最近在看udt协议的一些知识,先把包结构放上来
UDT包结构
总体结构:
0 1 2 3
0 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
Packet Header(包头)
|
Data/Control Information Field(数据包/控制包 信息)
|
数据包包头结构:
0 1 2 3
0 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
0 | Sequence Number
|
ff |o | Message Number
|
Time Stamp
|
Destination Socket ID
|
bit 0:
0: Data Packet(0:数据包)
1: Control Packet(1:控制包)
bit ff:
11: solo message packet(11:单一的消息包)
10: first packet of a message(10:一份消息的第一个包)
01: last packet of a message(00:一份消息的最后一个包)
bit o:
0: in order delivery not required(0:没有要求按正常序号传递)
1: in order delivery required(1:要求按正常序号传递)
控制包包头结构:
0 1 2 3
0 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
1 | Type | Reserved
|
Additional Info
|
Time Stamp
|
Destination Socket ID
|
bit 0:
0: Data Packet(0:数据包)
1: Control Packet(1:控制包)
bit 1~15:
0: Protocol Connection Handshake
Add. Info: Undefined
Control Info: Handshake information (see CHandShake)
1: Keep-alive
Add. Info: Undefined
Control Info: None
2: Acknowledgement (ACK)
Add. Info: The ACK sequence number
Control Info: The sequence number to which (but not include) all the previous packets have beed received
Optional: RTT
RTT Variance
advertised flow window size (number of packets)
estimated bandwidth (number of packets per second)
3: Negative Acknowledgement (NAK)
Add. Info: Undefined
Control Info: Loss list (see loss list coding below)
4: Congestion Warning
Add. Info: Undefined
Control Info: None
5: Shutdown
Add. Info: Undefined
Control Info: None
6: Acknowledgement of Acknowledement (ACK-square)
Add. Info: The ACK sequence number
Control Info: None
7: Message Drop Request
Add. Info: Message ID
Control Info: first sequence number of the message
last seqeunce number of the message
65535: Explained by bits 16 - 31
bit 16 - 31:
This space is used for future expansion or user defined control packets.
posted on 2008-11-26 10:52
水 阅读(2964)
评论(0) 编辑 收藏 引用 所属分类:
udt分析