IPv4 packet header field

Source: Internet
Author: User

 

IP source address IP Destination Address TTL service type (ToS) protocol segment offset IPv4 header keyword segment :. The destination IP address field contains a 32-bit binary value, representing the network layer address of the destination host of the data packet. The IP Source Address field contains a 32-bit binary value, representing the network layer address of the data packet source host. TTL is an 8-bit binary value, indicating the remaining "Lifetime" of the data packet ". Each packet is processed by a router (that is, each hop), and the TTL value is reduced by at least one. When the value changes to zero, the router discards the data packet and deletes it from the network data traffic. This mechanism prevents data that cannot reach its destination from being forwarded indefinitely between routers in the routing loop. If you allow the route loop to continue, the network will be blocked by data packets that will never reach the destination. Reducing the TTL value at each hop ensures that the value is eventually zero and the packet whose TTL field expires is discarded. The 8-bit binary value indicates the data load type transmitted by the data packet. The Network Layer transmits data to the corresponding upper layer protocol based on the protocol field. Typical values include: 01 ICMP06 TCP17 the UDP Service Type field contains an eight-bit binary value to determine the priority of each data packet. With this value, you can use the Quality of Service (QoS) mechanism for high-priority data packets (such as data packets that transmit telephone voice data. The router that processes data packets can be configured to determine the first data packet to be forwarded based on the service type value. As mentioned above, the slice offset must be sharded when a router forwards data packets from one medium to another medium with a smaller MTU. In case of sharding, IPv4 packets use the segment offset field and MF flag in the IP header to reconstruct the packets when arriving at the target host. The part offset field is used to identify the placement order of the Data piece of the data packet during reconstruction. More flags more flags (MF) flags are a single bit in the flags field. They are used together with the slice offset for data packet sharding and reconstruction. If more flags are set, this is not the last data segment of the data packet. When the receiver host receives a packet with MF = 1, it checks the part offset to understand the position of the Data piece in the re-built data packet. When the receiver host receives a frame with a value of MF = 0 and a non-zero part offset, the data segment is placed as the last part of the reconstructed data packet. The part information of unsharded data packets is all zero (MF = 0, slice offset = 0 ). The non-fragment flag and the non-fragment (DF) flag are a single bit in the flag field, indicating that data packet fragment is not allowed. If a flag is set for not sharding, this packet is not allowed to be sharded. If the router must shard the data packet before it can be sent down to the data link layer, but the DF bit is set to 1, the router will discard the data packet. Other fields in the IPv4 header place the mouse pointer on each field in the graph to view its purpose. Version-contains the IP version number (4) header length (IHL)-specifies the size of the packet header. Packet Length-in bytes, this field provides the size of the entire packet, including the header and data. ID-this field is used to uniquely identify the data segment of the original IP data packet. Header checksum-the checksum field is used to perform error verification on the packet header. Option-some fields have been prepared separately for other services in the IPv4 header, but these fields are rarely used.

The figure below shows a complete IP packet with a typical header field value. Version = 4; IP version. IHL = 5; header size in the unit of 32 characters (4 bytes. This header is 5*4 = 20 bytes, which is the minimum valid size. Total length = 472; the size of data packets (headers and data) is 472 bytes. Id = 111; identifier of the original data packet (this value is required if the data packet is sliced later ). Flag = 0; indicates that data packets can be sharded as needed. Slice offset = 0; indicates that the data packet is not sharded currently (no offset ). Survival time = 123; indicates the Layer 1 processing time allowed before the packet is discarded, in seconds (the device will at least subtract 1 for each packet header ). Protocol = 6; indicates that the data transmitted by this data packet is a TCP Data Segment.

This article is from the "popular world" blog

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.