Understanding IP Header

--> IP Address operates at Layer 3 of OSI reference model and Layer 2 of TCP/IP model.

--> IP uses Packets to carry the information throughout the network.

--> IP  is a connectionless protocol which does not require any acknowledgment from the destination after it has been sent.



1) Version  

--> This is the first field in IPv4 Protocol header.

--> The size of this field is of 4 bits.

--> The Version field indicates the current IP version being used(IPv4 or IPv6).


2) Internal Header Length 

--> Indicates the size of the IP header.

--> The minimum length of the IP header is 20 bytes and maximum length of 60 bytes.

3) Service Type or Type of Service 

--> This field is of 8 bits which are used in Quality of Service.

--> The first three bits of this field are known as precedence bits and are not used currently.

--> The next 4 bits define the type of service and the last bit is left unused.

-->  Devices use TOS filed to set various options, such as low delay, high throughput, or high reliability.


4) Packet Length 

--> Indicates the size of the packet including IP header.

--> The maximum size of the packet is 65,535 bytes because of the Packet Length field is 16 bits.

--> The minimum size of the packet is 20 bytes.

--> Router performs fragmentation if the size of the packet is more than 65,535 bytes.

5) Identification

--> This field is required when reassembling of IP Packets required.

--> This value is incremented every-time an IP datagram is sent from source to the destination.

--> These fields are used to fragment and reassemble packets.

--> This field is necessary to combine individual IP packets back into a single datagram.

6) Flag

--> The size of this field comprises of three bits.

-->  Devices only uses the last two bits of this field as first bit kept reserved.

-->  The second bit of this field is known as  ‘Don’t Fragment’ bit. If the value of this field is set to 1 then the IP Packet is never fragmented or divided into fragments.

--> The third bit of this field is known as the ‘More Fragment’ bit.If the value of this field is set to 1 then it represents fragmented IP packet and more fragmented IP packets need to come after this.

--> In case of the last fragment of an IP packet, ‘More Fragment’ bit is not set signifying that this is the last fragment of a particular IP datagram.

7)  Fragmented offset 

--> In case of fragmented IP datagrams, this field contains the offset from the start of IP datagram.

--> So again, this field is used in reassembly of fragmented IP datagrams.

8) Time to live

-->  This field represents the number of layer 3 devices or Routers that the IP datagram will go through before being dropped.

--> When the IP Packet arrives at a router, the router decrements the TTL field by one.

--> When the TTL field becomes zero, the router drops the packet by sending an ICMP Time Exceeded message to the sender.

--> The traceroute application uses these ICMP Time Exceeded messages to print the routers used by packets to go from the source to the destination.

9) Protocol

--> The Protocol field defines which application the data is from or which application the data.

--> This field does not identify the application but identifies a protocol that sits above the IP layer that is used for application identification.

--> For example, protocol number 1 = ICMP, 6 = TCP, 17 = UDP.

10) Header checksum 

--> Header Checksum contains the value that is calculated based on the data of the IP header.

--> This field is used to determine if any errors have been introduced during the process of sending the IP Packet from source to destination.

--> If the checksum value is same at both sender and receiver then the IP Packet was not corrupted else its assumed that IP Packet was received corrupted.

--> Basically this field is used to check the integrity of an IP Packet.

11) Source IP Address 

--> This field is of 32 bits used to define Sender IP Address.

12) Destination IP Address

--> This field is of 32 bits used to define Receiver IP Address.


--> This field is of 32 bits used to define Sender IP Address.

13) Options and padding

--> This field varies in length from 0 to a multiple of 32 bits. 

--> If the option values are not a multiple of 32 bits, 0s are added or padded to ensure that this field contains a multiple of 32 bits.

--> The options field is not often used. Note that the value in the IHL field must include enough extra 32-bit words to hold all the options.

Reference : Cisco & WikiPedia

Md.Kareemoddin

CCIE # 54759

0 Comments