"Reprinted from" http://blog.csdn.net/hjffly/article/details/7959889
IP header
Version: L3 protocol version number, IPV4 or IPV6
Header Length: 4 bytes in units
Protocol: L4 protocol type
The TTL time-to-live field sets the maximum number of routers that datagrams can pass through. Once it passes through a router that handles it, its value is reduced by 1. When the value of the field is 0 o'clock, the datagram is discarded and an ICMP packet is sent to notify the source host.
The source port number, the destination port number, is used to find the sending and receiving end application processes.
32-bit serial number: Used to identify the data stream sent from the TCP originator to the TCP receiver, representing the first data byte in this segment.
The confirmation number contains the sequence number of the next package that is expected to be received at the end of the send acknowledgement, and the confirmation number field is valid only if the ACK flag is 1 o'clock.
Once a connection is set up, the ACK flag is always set to 1.
16-bit window size: The maximum value is 2^16-1 (MTU: Maximum transmission unit, Ethernet maximum Transmission unit is 1518 bytes, but Ethernet can transmit an IP packet up to 65535 bytes (2^16-1), the link layer will shard it).
4-bit header length: 32bit, including option fields.
TCP provides full duplex service for the application layer, which means that each end of the connection must maintain the serial number and confirmation number of the transmitted data in each direction.
URG: Emergency pointer valid
ACK: Confirmation number is valid
PSH: The receiver should give this segment to the application layer as soon as possible
RST: Rebuilding the connection
SYN: The synchronous sequence number is used to initiate a connection
FIN: The originator completes the Send task
UDP header
16-bit UDP length: Contains head and data parts
16-bit UDP inspection and: Overwriting UDP headers and UDP data
Both the UDP datagram and the TCP segment contain a 12-byte pseudo-header, which is set for the purpose of calculating the test and the pseudo-header contains some of the fields in the IP header.
TCP has a timeout retransmission mechanism, and UDP does not.
"Reprint" IP header, TCP header, UDP header