分组格式
NETBLT 分组分为三类,它们共用一个通用的分组头部。第一类是仅从发送方流向接收方的分组,这些分组包含接收方用于保证可靠性的控制消息序列号,它们是 NULL-ACK、DATA 和 LDATA 分组。第二类是仅从接收方流向发送方的分组,即 CONTROL 分组;每个 CONTROL 分组可以包含任意数量的控制消息(GO、OK 或 RESEND),每条消息有各自的序列号。最后一类是那些具有特殊可靠性保证方式、或者不做可靠传输的分组,它们是 QUIT、QUITACK、DONE、KEEPALIVE 和 ABORT 分组。其中,除 DONE 分组外,其余都可以由发送端和接收端 NETBLT 发送。
分组类型编号:
OPEN: 0
RESPONSE: 1
KEEPALIVE: 2
DONE: 3
QUIT: 4
QUITACK: 5
ABORT: 6
DATA: 7
LDATA: 8
NULL-ACK: 9
CONTROL: 10
标准头部:
local port: 2 bytes
foreign port: 2 bytes
checksum: 2 bytes
version number: 1 byte
packet type: 1 byte
packet length: 2 bytes
OPEN 和 RESPONSE 分组:
connection unique ID: 4 bytes
standard buffer size: 4 bytes
transfer size: 4 bytes
DATA packet data segment size: 2 bytes
burst size: 2 bytes
burst rate: 2 bytes
death timeout value in seconds: 2 bytes
transfer mode (1 = SEND, 0 = RECEIVE): 1 byte
maximum number of concurrent buffers: 1 byte
checksum entire DATA packet / checksum
DATA packet data only (1/0): 1 byte
client-specific data: arbitrary
DONE、QUITACK、KEEPALIVE:
standard header only
ABORT、QUIT:
reason: arbitrary bytes
CONTROL 分组格式:
CONTROL 分组由类型为 CONTROL 的标准 NETBLT 头部以及其后任意数量的控制消息组成,控制消息的格式如下:
控制消息编号:
GO: 0
OK: 1
RESEND: 2
OK 消息:
message type (OK): 1 byte
buffer number: 4 bytes
sequence number: 2 bytes
new burst size: 2 bytes
new burst interval: 2 bytes
GO 消息:
message type (GO): 1 byte
buffer number: 4 bytes
sequence number: 2 bytes
RESEND 消息:
message type (RESEND): 1 byte
buffer number: 4 bytes
sequence number: 2 bytes
number of missing packets: 2 bytes
packet numbers...: n * 2 bytes
DATA、LDATA 分组格式:
buffer number: 4 bytes
highest consecutive sequence number received: 2 bytes
packet number within buffer: 2 bytes
data: arbitrary bytes
NULL-ACK 分组格式:
highest consecutive sequence number received: 2 bytes
acknowledged new burst size: 2 bytes
acknowledged new burst interval: 2 bytes