IPv4 : Internet Protocol Version 4 (Explained with Header)

introduction-to-ipv4-header

In this article, we will discuss IPv4 in detail. IPv4 stands for Internet Protocol version 4. It is the 4th version of Internet Protocol and widely used protocol in communication over different types of networks. It was discovered by DARPA and defined in RFC 760.

introduction-to-ipv4-header

What is Internet Protocol version 4 (IPv4)?

IPv4 is the most widely used protocol in data communication. It is used in the Network Layer of the OSI Model. IPv4 works on the best-effort model, which means that it does not provide a guarantee of delivery of data. It is achieved by a higher layer like TCP. Although IPv6 is another successful version of Internet Protocol released by DARPA.

Header of IPv4 – Internet Procol version 4

The IPv4 header has 14 different fields of which 13 fields are required. Below, is the table of IPv4 Header. We will discuss all the given fields one by one.

S.No.OSI ModelTCP/IP Model
1.OSI Stands for Open System Interconnection.TCP/IP stands for Transmission Control Protocol / Internet Protocol.
2.7 Different Layers.4 Different Layers.
3.It is developed by ISO (International Standard Organisation)It is developed by DoD (Department of Defense).
4.Conceptual ModelUsed in actual data transmission between different computers.
5.It is a not Tangible model.It is a Tangible Model.

Version

Version is the first field of the IPv4 Header. It is a 4-bit field which is always equal to 4 for IPv4.

Internet Header Length (IHL) of IPv4 Header

This field has 4 bits, which define the total length of the IP header. The minimum value for this field is 5 words (20 bytes) and the maximum value of this field is 20 words (60 bytes).

Differentiated Services Code Point (DSCP)

Differentiated Services Code Point (DSCP), originally defined as Types of Services. In this field, different types of services are defined. Voice over IP (VoIP), is an example that used this field. This field specifies DiffServ which is defined in RFC 2474.

Explicit Congestion Notification (ECN)

Explicit Congestion Notification (ECN), the field is used to determine the congestion in between the route. It allows end-to-end notification of congestion without dropping and packet. This field is defined in RFC 3168.

Total Length of IPv4 Header

The total length field defines the total length of the entire IP Packet. This includes the length of the IP Header + IP Payload. The minimum size of this field is 20 bytes and the maximum size is 65,535 bytes.

Identification

During the data transmission, if an IP packet has more than the maximum length, then the packet will be fragmented. Thus, the identification field is used to identify the fragmented packets.

Flags in IPv4

Flags are a three-bit field that is used to identify or control fragmented packets. They are:

  • Bit 0: Reserved
  • Bit 1: Don’t Fragment (DF)
  • Bit 2: More Fragments (MF)

Fragment Offset

Fragment Offset is used to identify the original position of the fragment in the entire IP Packet.

Time to Live (TTL) Value used in IPv4 Header

This field is used for loop avoidance at the network layer. This field has a pre-defined value (for Windows Operating System 128, for Linux-based Operating System 64). Each time, when a data packet crosses any layer 3 devices (i.e. Router), this value is decremented with 1. The minimum value of TTL is 1. After that, it drops the packet. Thus, it helps in loop avoidance at the network layer.

Protocol

At the network layer, the data packet is always sent or received from different protocols. The protocol field is used to identify those protocols. For example, the protocol number of ICMP is 1, TCP is 6, UDP is 17, OSPF is 88 and EIGRP is 89.

Header Checksum

This field is used for error checking and error correction purposes. Whenever an IP packet comes to network layer devices (i.e. Router), it calculates the header checksum of that packet. If the checksum seems invalid, the router immediately discards that packet and requests for a new one.

Source Address

Source Address is a 32-bit address in which the IP address of the sender (or source) of the packet is placed.

Destination Address

The Destination Address is a 32-bit address in which the IP address of the receiver (or destination) of the packet is placed.

Option

It is an optional field and it is not often used. It is only used when the IHL field (already described) has a value greater than 5.

Summary

IPv4 is the 4th version of the Internet Protocol. It is a widely used protocol in data communication. The header of IPv4 is 32-bit long and contains 14 different fields. It works on the Network Layer of the OSI Model.

Did you find this article helpful! Please share it on social media platforms and shows us some love.

You May Also Like

About the Author: Vikash Kaushik

Leave a Reply

Your email address will not be published. Required fields are marked *

Share via
Copy link