MAC frame format:
field | value |
---|---|
Destination address | 6 bytes |
source address | 6 bytes |
Types of | 2 bytes, indicating what protocol is used by the upper layer. Example: 0x0800 means using IP protocol |
data | for the upper IP layer |
IP packet format:
field | value |
---|---|
Version | 4 bits, IP protocol version |
header length | 4 bits, the unit is 4 bytes, it is also the most commonly used; the maximum length is 60 bytes |
Differentiated Services | 8 bits for better service |
total length | 16 bits, the length of the sum of the header and data, in bytes. |
logo | 16 bits, the same value of the identification field enables each fragmented datagram to be correctly reassembled into the original datagram at the end |
logo | 3 bits, currently only two are meaningful. The lowest bit MF, MF=1, indicates the following datagram with "fragmentation". MF=0 indicates that this is the last of several datagram fragments. The middle DF (Don't Fragment), "cannot be fragmented". Fragmentation is only allowed when DF=0 |
slice offset | 13 bits, the relative position of a fragment in the original packet after the longer packet is fragmented |
survival time | The lifetime of a datagram in the network |
protocol | 8 bits, what protocol is used for the data carried |
header checksum | 16 bits, check the header of the datagram |
source address | 32nd place |
Destination address | 32nd place |
optional fields | |
filling | |
data part |
TCP packet format:
field | value |
---|---|
source port | 2 bytes |
destination port | 2 bytes |
serial number | 4 bytes, each byte in a stream of bytes transmitted in a TCP connection is sequentially numbered. The sequence number field value in the header refers to the sequence number of the first byte of the data sent in this segment |
Confirmation Number | 4 bytes, the sequence number of the first data byte expected to receive the next segment of the other party |
data offset | 4 bits, how far the data start of the TCP segment is from the start of the TCP segment |
Reserve | 6 bits, reserved, currently should be 0 |
URG | URG=1 urgent pointer is valid |
ACK | ACK = 1 acknowledgement field is valid |
PA | The receiver receives the message with PSH=1 and delivers it to the receiving application process as soon as possible |
RST | RST=1 There is an error in the TCP connection, the connection must be released and the transport connection must be re-established |
SYN | Used to synchronize sequence numbers when establishing a connection. When SYN=1 and ACK=0, it indicates that this is a connection request message. If the other party agrees to establish a connection, SYN=1 and ACK=1 are used in the response message. |
END | FIN=1 release the connection |
window | 2 bytes, the receive window of the party sending this segment |
checksum | 2 bytes, the inspection range includes the header and the data. |
emergency pointer | 2字节,紧急数据的字节数。即使窗口为零也可以发送紧急数据 |
选项 | |
填充 |
UDP报文格式:
字段 | 值 |
---|---|
源端口 | 2 字节 |
目的端口 | 2 字节 |
长度 | |
校验和 |
HTTP格式:
字段 | 说明 |
---|---|
GET | GET方法要求服务器将URL定位的资源放在响应报文的数据部分,回送给client。 |
HOST | 请求的主机名,允许多个域名同处于一个IP地址,即虚拟主机 |
user-agent | 产生请求的浏览器类型 |