IPV4 packet format


IPv4 is the fourth version of the Internet Protocol (IP) and the first widely used protocol that forms the foundation of today’s internet technology. Each device and domain connected to the Internet is assigned a unique number called an IP address. The IPv4 address is a 32-bit number composed of four decimals. Between each Decimal separator is a number between 0 and 255. Example: 192.0.2.235
Nowadays, due to the relatively new nature of IPv6, IPv4 is still the foundation for most Internet operations, and many devices are configured with IPv4. In this situation, most devices cannot communicate using IPv6, resulting in many individuals, businesses, and others still needing IPv4. Next, we will introduce the packet format of IPv4.
IPv4 packet format

wps_doc_0

(1) The version field accounts for 4 bits, indicating the version of the IP protocol.
(2) IP Header Length, this field is used to describe the length of the IP header, as there are variable length optional parts in the IP header. This section occupies 4 bits, with a length unit of 4 bytes, which means that the value in this region=IP header length (in bytes)/length unit (4 bytes).
(3) Type of Service: 8 bits in length.
PPP: The first three digits define the priority of the package. The more important the value is, the more important the Big data is
000 (Routine) Normal
001 (Priority) priority, used for data business
010 (Immediate) immediate, for data business
011 (Flash) flash speed for voice transmission
100 (Flash Overrides) fast for video business
101 (critical) CRI/TIC/ECP critical for voice transmission
110 (Internet Control) Inter network control, used for network control, such as routing protocols
111 (Network Control) network control, used for network control
DTRCO: Last 5 digits
(1000) D delay: 0: min delay, 1: minimize delay as much as possible
(0100) T Throughput: 0: max throughput (maximum throughput), 1: Try to increase the traffic as much as possible
(0010) R reliability: 0: max throughput, 1: maximize reliability
(0001) M transmission cost: 0: min Monday cost (minimum path overhead), 1: minimize the cost as much as possible
(0000): normal (regular service).
(4) Total length of IP packet: 16 bits in length. The length of an IP packet calculated in bytes (including header and data), therefore the maximum length of an IP packet is 65 535 bytes. So, the size of the packet payload=Total IP packet length – IP header length.
(5) Identifier: 16 bits in length. This field is used in conjunction with the Flags and Fragment Offer fields to segment larger upper level packets. After the router splits a packet, all small packets that are split are marked with the same value, so that the destination device can distinguish which packet belongs to the split packet.
(6) Flags: 3 bits in length.
The first digit of this field is not used.
The second bit is the DF (Don’t Fragment) bit. When the DF bit is set to 1, it indicates that the router cannot segment the upper layer packet. If an upper layer packet cannot be forwarded without segmentation, the router will discard the upper layer packet and return an error message.
The third bit is the MF (More Fragments) bit. When the router segments an upper layer packet, it sets the MF bit to 1 in the header of the IP packet except for the last segment.
(7) Fragment Offset: A length of 13 bits, measured in units of 8 octets. Indicates the location of the IP packet in the component packet, which is used by the receiving end to assemble and restore the IP packet.
(8) Time to Live (TTL): The length is 8 bits, initially designed in seconds (s), but actually measured in hops. The recommended default value is 64. When IP packets are transmitted, a specific value is first assigned to this field. When an IP packet passes through each router along the way, each router along the way will reduce the TTL value of the IP packet by 1. If the TTL is reduced to 0, the IP packet will be discarded. This field can prevent IP packets from being continuously forwarded in the network due to routing loops.
(9) Protocol: 16 bits in length. Used for correctness detection of IP headers, but does not include the data section. Because each router needs to change the TTL value, the router will recalculate this value for each passing packet
(10) Header Checksum: 16 bits in length. Used for correctness detection of IP headers, but does not include the data section. Because each router needs to change the TTL value, the router will recalculate this value for each passing packet
(11) Source and Destination Addresses: Both addresses are 32 bits. Identifies the origin and destination address of this IP packet. Please note that unless NAT is used, these two addresses will not change throughout the entire transmission process.
(12) Options: This is a variable length field. This field is optional and mainly used for testing, and can be rewritten by the originating device as needed. The optional items include the following:

•Loose source routing: Provide a series of IP addresses for router interfaces. IP packets must be transmitted along these IP addresses, but it is allowed to skip multiple routers between two consecutive IP addresses.
•Strict source routing: Provide a series of IP addresses for router interfaces. IP packets must be transmitted along these IP addresses, and if the next hop is not in the IP address table, it indicates an error.
•Record route: Record the IP address of the router’s outbound interface when the IP packet leaves each router.
•Timestamps: Record the time when an IP packet leaves each router.
•Padding: Because the unit of the IP header length is 32 bits, the length of the IP header must be an integer multiple of 32 bits. Therefore, after the optional option, the IP protocol will fill in several zeros to achieve an integer multiple of 32 bits.
IPV4 data can often be applied to our company’s ONU network devices, and our related network hot selling products cover various types of ONU series products, including AC ONU/communication ONU/intelligent ONU/box ONU, etc. The above ONU series products can be used for network requirements in various scenarios. Welcome everyone to come and have a more detailed technical understanding of the product.

wps_doc_1

WhatsApp Online Chat !