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 is discovered by DARPA and defined in RFC 760.
Table of Contents
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
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.
|Internet Protocol version 4 (IPv4)|
|Time To Live||Protocol||Header Checksum|
|Source IP Address|
|Destination IP Address|
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)
This field has 4 bits, which defined 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.
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.
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 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 is used to identify the original position of the fragment in the entire IP Packet.
Time to Live (TTL)
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.
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.
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 the new one.
Source Address is a 32-bit address in which the IP address of the sender (or source) of the packet is placed.
The Destination Address is a 32-bit address in which the IP address of the receiver (or destination) of the packet is placed.
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.
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. Its works on the Network Layer of the OSI Model.