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 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 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 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 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 total length of IP header. Minimum value for this field is 5 words (20 bytes) and 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), 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

Total length filed defines the total length of entire IP Packet. This includes length of IP Header + IP Payload. The minimum size of this field is 20 bytes and 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, 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 entire IP Packet.

Time to Live (TTL)

This filed is used for loop avoidance at 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 decrements with 1. The minimum value of TTL is 1. After that, it drops the packet. Thus, it helps in loop avoidance at network layer.

Protocol

At network layer, data packet is always send or received from different protocols. Protocol field is used to identify that 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, router immediately discard that packet and request for new one.

Source Address

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

Destination Address

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

Option

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

Summary

IPv4 is the 4th version of Internet Protocol. It is widely used protocol in data communication. 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 *