Each IP datagram starts with an IP header. The TCP/IP software of the source computer constructs this header, and the destination computer's TCP/IP software leverages the information processing data encapsulated in the IP header. The IP header contains a large amount of information, including the source IP address, destination IP address, datagram length, IP version number, and special instructions to the router.
Version
This 4-bit field represents the IP version being used. IPV4 the corresponding binary is 0100.
IHL (Internet Header Length)
This 4-bit field represents the length of the IP header in 32-bit words. The minimum length of the IP header is 5 32-bit characters, and the corresponding binary represents 0101.
Type of Service
The source IP can specify special routing information. Some routers ignore this lot's information, but with the advent of quality of service (QoS) technology, this field gets more attention. The primary purpose of this 8-bit field is to prioritize the datagrams waiting to be passed through the router, and most IP implementations now fill the field with 0.
Total Length
This 16-bit field represents the length of the IP datagram, in bytes, which contains the IP header and the data payload.
Identification
This 16-bit field is a numeric value that is sequentially larger and is assigned to a message sent from the source IP. When the message passed to the IP layer is too large to fit into a datagram, IP splits the message into multiple datagrams and assigns the same identification number to the datagram sort. The receiving end uses these values to reorganize the original message.
Flags
This field indicates the likelihood of fragmentation. The 1th bit is unused and its value should be 0. The 2nd bit, called DF (Don ' t Fragment), indicates whether to allow fragmentation, 0 for allow, and 1 for disallowed. The 3rd bit is MF (more fragments), which indicates whether there are still segments in transit, and a setting of 0 indicates that no more segments need to be sent or that the datagram is not fragmented at all.
Fragment Offset
This 13-bit field is a numeric value that is assigned to each successive segment. The IP of the destination device uses this value to reassemble the segment in the correct order.
Time to Live (TTL)
This field indicates the time (in seconds) or the number of router hops that the datagram can hold before it is discarded. Each router checks the field and subtracts at least 1, or the number of seconds the datagram is delayed in the router. When the value of this field is 0 o'clock, the datagram is discarded.
Protocol
This 8-bit field represents the protocol that receives the data payload, such as a datagram with a protocol ID of 6 (Bits 00000110) that is passed to the TCP module. The following are some common protocol identity values.
Agreement name |
Protocol Identification |
Icmp |
1 |
Tcp |
6 |
Udp |
17 |
Header Checksum
This field contains a 16-bit checksum and is used only to verify the validity of the header itself. Each router that goes through the datagram will recalculate this value because the value of the TTL field is changing.
Source IP Address
This 32-bit field contains the source IP address of the datagram.
Destination IP Address
This 32-bit field contains the destination IP address of the datagram. The destination IP verifies the correctness of the transmission based on this value.
IP Options
This field supports a number of optional header settings, primarily for testing, debugging, and security purposes. These options include strict source routing (the datagram must go through a specified route), an internet timestamp (time stamp logging via the US router), and security restrictions.
Padding
The length of the IP option field is not fixed. The Fill field can provide some extra 0 to ensure that the length of the entire header is a full multiple of 32 bits (the header length must be an integer multiple of the 32-bit word, because the Ihll field represents the length of the header in 32-bit words).
IP Data Payload
This field is used to hold data that is passed to TCP or UDP (in the Transport Layer), ICMP, or IGMP. The data block is variable in length and can contain thousands of bytes.
NETWORKING-IPV4 Message Format