IPv4 : Internet Protocol Version 4 (Explained with Header)

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 network. It is discovered by DARPA and defined in RFC 760. In this article, we will discuss IPv4 in more detail.

introduction-to-ipv4-header
IPv4 Header

What is Internet Protocol version 4 (IPv4)?

As we discussed, it is the most widely used protocol in data communication. It is used in Network Layer of OSI Model. Actually, this protocol works on Best Effort Model, this means that it does not provide a guarantee of delivery of data. It is achieved by higher layer like TCP. Although IPv6 is another successful version of Internet Protocol is released by DARPA.

Header of IPv4

IPv4 header has 14 different fields in 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)
012345678910111213141516171819202122232425262728293031
VersionIHLDSCPECNTotal Length
IdentificationFlagsFragment Offset
Time To LiveProtocolHeader Checksum
Source IP Address
Destination IP Address
Options
Data

Version

Version is the first field of 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 filed, different types of services are defined. Voice over IP (VoIP), is an example which 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 an end to end notification of congestion without dropping and packet. This field is defined in RFC 3168.

Total Length

Total length field defines the total length of the entire IP Packet. This includes length of 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 maximum length, then the packet will be fragmented. Thus, the identification field is used to identify the fragmented packets.

Flags

Flags are a three-bit field which 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)

This field is used for loop avoidance at the network layer. This filed have 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, 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 purpose. 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 request for the 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

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 IHL field (already described) has a value greater than 5.

Summary

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

Leave a Reply

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