Headers, fields, and bit widths
A packet diagram lays out a network packet: header fields, their names, and how many bits each field occupies. Use it when the width and the order of fields are the point.
A sequence diagram is the neighbor for who sends which message over time. It does not show bit layouts. Stay here when the reader must see the header, not the conversation.
Packet layout or message sequence
Choose a packet diagram for a header format. Choose a sequence diagram for an exchange such as handshake or request and response. Choose a block diagram when the boxes are devices with named ports, not fields in a frame.
Make the widths add up
1. State the width of every field
Put the bit count next to the name in the prompt. If the draft omits a width, fill it before you trust the picture.
2. Check the sum
Add the widths. If they do not match the header size you intended, fix the field that drifted.
3. Keep one packet per diagram
A second message in the same prompt becomes a second diagram. The sequence of those messages belongs on a sequence diagram.
How to phrase the prompt
Name the protocol, then list fields from first bit to last with each width. Call out reserved bits and flags. Give a total width if you know it. Skip IP addresses from a real capture.
Packet draft questions
- Can I paste a hex dump?
- You can describe the fields the dump taught you. The diagram wants names and widths, not a raw capture line.
- The field order is reversed. What should I do?
- Say first bit on the left and restate the order in the prompt. Then confirm the draft follows that order.
- How do I show a variable-length field?
- Name it and say it is variable, with the field that stores its length beside it. Do not invent a fixed width the format does not have.