8. Packet Formats
NETBLT packets are divided into three categories, all of which share a common packet header. First, there are those packets that travel only from data sender to receiver; these contain the high-acknowledged-sequence-numbers which the receiver uses for control message transmission reliability. These packets are the NULL-ACK, DATA, and LDATA packets. Second, there is a packet that travels only from receiver to sender. This is the CONTROL packet; each CONTROL packet can contain an arbitrary number of control messages (GO, OK, or RESEND), each with its own sequence number. Finally, there are those packets which either have special ways of insuring reliability, or are not reliably transmitted. These are the OPEN, RESPONSE, REFUSED, QUIT, QUITACK, DONE, KEEPALIVE, and ABORT packets. Of these, all save the DONE packet can be sent by both sending and receiving NETBLTs.
All packets are "longword-aligned", i.e. all packets are a multiple of 4 bytes in length and all 4-byte fields start on a longword boundary. All arbitrary-length string fields are terminated with at least one null byte, with extra null bytes added at the end to create a field that is a multiple of 4 bytes long.
Packet Formats for NETBLT
OPEN (type 0) and RESPONSE (type 1):
1 2 3
1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2
+---------------+---------------+---------------+---------------+
| Checksum | Version | Type |
+---------------+---------------+---------------+---------------+
| Length | Local Port |
+---------------+---------------+---------------+---------------+
| Foreign Port | Longword Alignment Padding |
+---------------+---------------+---------------+---------------+
| Connection Unique ID |
+---------------+---------------+---------------+---------------+
| Buffer Size |
+---------------+---------------+---------------+---------------+
| Transfer Size |
+---------------+---------------+---------------+---------------+
| DATA packet size | Burst Size |
+---------------+---------------+---------------+---------------+
| Burst Rate | Death Timer Value |
+---------------+---------------+---------------+---------------+
| Reserved (MBZ) |C|M| Maximum # Outstanding Buffers |
+---------------+---------------+---------------+---------------+
| Client String ...
+---------------+---------------+---------------
Longword Alignment Padding |
---------------+-------------------------------+
Checksum: packet checksum (algorithm is described in the section "Connection Setup")
Version: the NETBLT protocol version number
Type: the NETBLT packet type number (OPEN = 0, RESPONSE = 1, etc.)
Length: the total length (NETBLT header plus data, if present) of the NETBLT packet in bytes
Local Port: the local NETBLT's 16-bit port number
Foreign Port: the foreign NETBLT's 16-bit port number
Connection UID: the 32 bit connection UID specified in the section "Connection Setup".
Buffer size: the size in bytes of each NETBLT buffer (save the last)
Transfer size: (optional) the size in bytes of the transfer.
This is for client information only; the receiving NETBLT should NOT make use of it.
Data packet size: length of each DATA packet in bytes
Burst Size: Number of DATA packets in a burst
Burst Rate: Transmit time in milliseconds of a single burst
Death timer: Packet sender's death timer value in seconds
"M": the transfer mode (0 = READ, 1 = WRITE)
"C": the DATA packet data checksum flag (0 = do not checksum DATA packet data, 1 = do)
Maximum Outstanding Buffers: maximum number of buffers that can be transferred before waiting for an OK message from the receiving NETBLT.
Client string: an arbitrary, null-terminated, longword-aligned string for use by NETBLT clients.
KEEPALIVE (type 2), QUITACK (type 4), and DONE (type 11)
1 2 3
1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2
+---------------+---------------+---------------+---------------+
| Checksum | Version | Type |
+---------------+---------------+---------------+---------------+
| Length | Local Port |
+---------------+---------------+---------------+---------------+
| Foreign Port | Longword Alignment Padding |
+---------------+---------------+---------------+---------------+
QUIT (type 3), ABORT (type 5), and REFUSED (type 10)
1 2 3
1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2
+---------------+---------------+---------------+---------------+
| Checksum | Version | Type |
+---------------+---------------+---------------+---------------+
| Length | Local Port |
+---------------+---------------+---------------+---------------+
| Foreign Port | Longword Alignment Padding |
+---------------+---------------+---------------+---------------+
| Reason for QUIT/ABORT/REFUSE...
+---------------+---------------+---------------
Longword Alignment Padding |
---------------+-------------------------------+
DATA (type 6) and LDATA (type 7):
1 2 3
1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2
+---------------+---------------+---------------+---------------+
| Checksum | Version | Type |
+---------------+---------------+---------------+---------------+
| Length | Local Port |
+---------------+---------------+---------------+---------------+
| Foreign Port | Longword Alignment Padding |
+---------------+---------------+---------------+---------------+
| Buffer Number |
+---------------+---------------+---------------+---------------+
| High Consecutive Seq Num Rcvd | Packet Number |
+---------------+---------------+---------------+---------------+
| Data Area Checksum Value | Reserved (MBZ) |L|
+---------------+---------------+---------------+---------------+
Buffer number: a 32 bit unique number assigned to every buffer. Numbers are monotonically increasing.
High Consecutive Sequence Number Received: Highest control message sequence number below which all sequence numbers received are consecutive.
Packet number: monotonically increasing DATA packet identifier
Data Area Checksum Value: Checksum of the DATA packet's data. Algorithm used is the same as that used to compute checksums of other NETBLT packets.
"L" is a flag set when the buffer that this DATA packet belongs to is the last buffer in the transfer.
NULL-ACK (type 8)
1 2 3
1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2
+---------------+---------------+---------------+---------------+
| Checksum | Version | Type |
+---------------+---------------+---------------+---------------+
| Length | Local Port |
+---------------+---------------+---------------+---------------+
| Foreign Port | Longword Alignment Padding |
+---------------+---------------+---------------+---------------+
| High Consecutive Seq Num Rcvd | New Burst Size |
+---------------+---------------+---------------+---------------+
| New Burst Rate | Longword Alignment Padding |
+---------------+---------------+---------------+---------------+
High Consecutive Sequence Number Received: same as in DATA/LDATA packet
New Burst Size: Burst size as negotiated from value given by receiving NETBLT in OK message
New burst rate: Burst rate as negotiated from value given by receiving NETBLT in OK message. Value is in milliseconds.
CONTROL (type 9):
1 2 3
1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2
+---------------+---------------+---------------+---------------+
| Checksum | Version | Type |
+---------------+---------------+---------------+---------------+
| Length | Local Port |
+---------------+---------------+---------------+---------------+
| Foreign Port | Longword Alignment Padding |
+---------------+---------------+---------------+---------------+
Followed by any number of messages, each of which is longword aligned, with the following formats:
GO message (type 0):
1 2 3
1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2
+---------------+---------------+---------------+---------------+
| Type | Word Padding | Sequence Number |
+---------------+---------------+---------------+---------------+
| Buffer Number |
+---------------+---------------+---------------+---------------+
Type: message type (GO = 0, OK = 1, RESEND = 2)
Sequence number: A 16 bit unique message number. Sequence numbers must be monotonically increasing, starting from 1.
Buffer number: as in DATA/LDATA packet
OK message (type 1):
1 2 3
1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2
+---------------+---------------+---------------+---------------+
| Type | Word Padding | Sequence Number |
+---------------+---------------+---------------+---------------+
| Buffer Number |
+---------------+---------------+---------------+---------------+
| New Offered Burst Size | New Offered Burst Rate |
+---------------+---------------+---------------+---------------+
| Current control timer value | Longword Alignment Padding |
+---------------+---------------+---------------+---------------+
New offered burst size: burst size for subsequent buffer transfers, possibly based on performance information for previous buffer transfers.
New offered burst rate: burst rate for subsequent buffer transfers, possibly based on performance information for previous buffer transfers. Rate is in milliseconds.
Current control timer value: Receiving NETBLT's control timer value in milliseconds.
RESEND Message (type 2):
1 2 3
1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2
+---------------+---------------+---------------+---------------+
| Type | Word Padding | Sequence Number |
+---------------+---------------+---------------+---------------+
| Buffer Number |
+---------------+---------------+---------------+---------------+
| Number of Missing Packets | Longword Alignment Padding |
+---------------+---------------+---------------+---------------+
| Packet Number (2 bytes) ...
+---------------+---------------+----------
| Padding (if necessary) |
-----------+---------------+---------------+
Packet number: the 16 bit data packet identifier found in each DATA packet.
NOTES:
<1> When the buffer size is large, the variances in the round trip delays of many packets may cancel each other out; this means the variance value need not be very big. This expectation will be explored in further testing.