IPv4 Header
IPv4 Header
IPv4 Header
Service Type-
In this interpretation, the first 3 bits are called precedence bits. The next 4 bits are
called type of service (TOS) bits, and the last bit is not used.
The precedence defines the priority of the datagram in issues such as congestion.
TOS bits is a 4-bit subfield with each bit having a special meaning. Although a bit
can be either 0 or 1, one and only one of the bits can have the value of 1 in each
datagram.
Differentiated Services-
In this interpretation, the first 6 bits make up the codepoint subfield, and the last 2 bits are
not used.
When the 3 rightmost bits are Os, the 3 leftmost bits are interpreted the same as the
precedence bits in the service type interpretation. In other words, it is compatible with the
old interpretation.
When the 3 rightmost bits are not all Os, the 6 bits define 64 services.
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
Identification-
Identification is a 16 bit field.
It is used for the identification of the fragments of an original IP datagram.
When an IP datagram is fragmented,
- Each fragmented datagram is assigned the same identification number.
-This number is useful during the re assembly of fragmented datagrams.
-It helps to identify to which IP datagram, the fragmented datagram belongs to.
Flag-
It is a 3 bit field .
First bit is 0 , second bit is DF bit and third is MF bit.
DF Bit-
DF bit stands for Do Not Fragment bit.
Its value may be 0 or 1.
When DF bit is set to 0,
It grants the permission to the intermediate devices to fragment the datagram if required.
When DF bit is set to 1,
It indicates the intermediate devices not to fragment the IP datagram at any cost.
If network requires the datagram to be fragmented to travel further but settings does not
allow its fragmentation, then it is discarded.
An error message is sent to the sender saying that the datagram has been discarded due
to its settings.
MF Bit-
MF bit stands for More Fragments bit.
Its value may be 0 or 1.
When MF bit is set to 0,
It indicates to the receiver that the current datagram is either the last fragment in the
set or
that it is the only fragment.
When MF bit is set to 1,
It indicates to the receiver that the current datagram is a fragment of some larger
datagram.
More fragments are following.
MF bit is set to 1 on all the fragments except the last one.
Fragment Offset-
If the value of TTL becomes zero before reaching the destination, then datagram
is discarded.
Protocol-
Protocol is a 8 bit field.
When datagram reaches at the router, it’s buffer is already full.
In such a case,{
Router does not discard the datagram directly.
Before discarding, router checks the next level protocol number mentioned in its IP
header.
If the datagram belongs to TCP, then it tries to make room for the datagram in its buffer.
It creates a room by eliminating one of the datagrams having lower priority.
This is because it knows that TCP is a reliable protocol and if it discards the datagram,
then it will be sent again by the sender.
The order in which router eliminate the datagrams from its buffer is-
Header Checksum-
Header checksum is a 16 bit field.
It contains the checksum value of the entire header.
The checksum value is used for error checking of the header.
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.
Source IP Address-
Destination IP Address-
A record route option is used to record the IP Address of the routers through which
the datagram passes on its way.
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.
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.
THANK YOU
09