Internet Protocol Version 4
Internet Protocol Version 4
Internet Protocol Version 4
IPv4 short for Internet Protocol Version 4 is the fourth version of the Internet Protocol (IP).
IP is responsible to deliver data packets from the source host to the destination host.
This delivery is solely based on the IP Addresses in the packet headers.
IPv4 is the first major version of IP.
IPv4 is a connectionless protocol for use on packet-switched networks.
IPv4 Header-
The following diagram represents the IPv4 header-
1. Version-
Version is a 4 bit field that indicates the IP version used.
The most popularly used IP versions are version-4 (IPv4) and version-6 (IPv6).
Only IPv4 uses the above header.
So, this field always contains the decimal value 4.
2. Header Length-
Header length is a 4 bit field that contains the length of the IP header.
It helps in knowing from where the actual data begins.
Minimum And Maximum Header Length-
3. Type Of Service-
Type of service is a 8 bit field that is used for Quality of Service (QoS).
The datagram is marked for giving a certain treatment using this field.
4. Total Length-
Total length is a 16 bit field that contains the total length of the datagram (in bytes).
Minimum total length of datagram = 20 bytes (20 bytes header + 0 bytes data)
Maximum total length of datagram = Maximum value of 16 bit word = 65535 bytes
5. Identification-
Identification is a 16 bit field.
It is used for the identification of the fragments of an original IP datagram.
6. DF Bit-
7. MF Bit-
8. Fragment Offset-
9. Time To Live-
If the value of TTL becomes zero before reaching the destination, then datagram is discarded.
10. Protocol-
At each hop,
The header checksum is compared with the value contained in this field.
If header checksum is found to be mismatched, then the datagram is discarded.
Router updates the checksum field whenever it modifies the datagram header.
1. Record Route-
A record route option is used to record the IP Address of the routers through which the datagram
passes on its way.
When record route option is set in the options field, IP Address of the router gets recorded in the
Options field.
The maximum number of IPv4 router addresses that can be recorded in the Record Route
option field of an IPv4 header is 9.
2. Source Routing-
A source routing option is used to specify the route that the datagram must take to reach the
destination.
This option is generally used to check whether a certain path is working fine or not.
Source routing may be loose or strict.
3. Padding-
Addition of dummy data to fill up unused space in the transmission unit and make it conform to the
standard size is called as padding.
Options field is used for padding.