Structure of a IPv4 Packet


Each protocol has a packet header, and this header is actually defined the rules for communication, thus the figure one is the figure of IPv4 packet header, and following is the detail of the IP packets fields.
Version: 4 bits
The Version field specifies the version of the internet header. As in the case is version 4.
IHL (Header Length): 4 bits
IHL stands for Internet Header Length; this is the length of the internet header and consists of 32 bit words, and this point to the establishment of the data. The lowest value for an accurate header is 5.
Type of Service: 8 bits
The Type of Service offers of the quality of service preferred. Type Of Service is utilize for particular IP packet information which may be inspect by routers by the interface who receive the packet. Initially, three bits was introduced named as IP Precedence that had a use as,
•000 (0) - Routine
•001 (1) - Priority
•010 (2) - Immediate
•011 (3) - Flash
•100 (4) - Flash Override
•101 (5) - Critical
•110 (6) - Internetwork Control
•111 (7) - Network Control
The 4th bit was set to "0" and the left over 4 bits are on hand for utilizing now a days for as following.
Minimise delay
Maximise throughput
Maximize reliability
Minimize monetary costs
Total Length: 16 bits
This is the length of the datagram, calculated in octets, including internet header and data. The minimum length of any IP datagram is 20 bytes and the maximum is 65,535
Identification: 16 bits
A recognize value allocate by the sender to assist in assembling the fragments of a datagram. It basically identify a packet’s fragments for example packet with identification of 1 has 20 fragments, so each fragment can be reassemble on the base of this identification.
Flags: 3 bits
Used primarily for the fragmentation.
Bit 0: reserved, must be zero
Bit 1: (DF) 0 = May Fragment, 1 = Don't Fragment.
Bit 2: (MF) 0 = Last Fragment, 1 = More Fragments.
Fragment Offset: 13 bits
This field specifies where in the IP datagram this fragment fit in. The fragment offset is determined in units of 8 bytes (64 bits). The first fragment has offset zero
Time to Live (TTL): 8 bits
This field specifies the highest time the datagram is permitted to stay in the internet system. If this field contains the value zero, then the datagram must be destroyed. The time is calculated in units of seconds, since every device that route an IP datagram must reduce the TTL by minimum one, even if it route the IP datagram in less than one second.
Protocol: 8 bits
This field specifies the next layer protocol, or it tells the IP which is the layer four protocols.
Header Checksum: 16 bits
A checksum is always computed on the header only. The checksum field is use for error-checking.
Source IP Address: 32 bits
This is the IP address of the machine which is sending the data out. It is usually represented by 4 octets of decimal value separated by decimals e.g 192.168.1.4
Destination IP Address: 32 bits
This is the IP address of the machine to which the datagram is being routed for delivery. It is normally symbolize by 4 octets of decimal value separated by decimals for example 192.168.1.10
IP Options
This field is for testing, debugging and security.
Padding
If datagram is not confined with the minimum length requirement of 20 byte then there is padding added sometimes just to make sure that the datagram is confined with the standard minimum total length requirement.

No comments: