0% found this document useful (0 votes)
13 views

IPv4 Header format

IPv4 addresses consist of a network part, a host part, and an optional subnet number, which together identify devices on a network. The IPv4 datagram header includes fields such as version, header length, type of service, total length, and source/destination IP addresses, among others. Checksum is an error detection method used to ensure data integrity during transmission, where the sender generates a checksum and the receiver verifies it to confirm the data is error-free.

Uploaded by

Diksha Lokhande
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

IPv4 Header format

IPv4 addresses consist of a network part, a host part, and an optional subnet number, which together identify devices on a network. The IPv4 datagram header includes fields such as version, header length, type of service, total length, and source/destination IP addresses, among others. Checksum is an error detection method used to ensure data integrity during transmission, where the sender generates a checksum and the receiver verifies it to confirm the data is error-free.

Uploaded by

Diksha Lokhande
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

IPv4:

Parts of IPv4
Ipv4 addresses consist of three parts:

• Network part: the network part indicates the distinctive variety that’s
appointed to the network. The network part conjointly identifies the category of
the network that’s assigned.

• Host part: the host part uniquely identifies the machine on your network. This
part of the ipv4 address is assigned to every host. For each host on the network,
the network part is the same, however, the host half must vary.

• Subnet number: this is the non-obligatory part of ipv4. Local networks that
have massive numbers of hosts are divided into subnets and subnet numbers are
appointed to that.

IPv4 Datagram Header


• VERSION:
Version of the IP protocol (4 bits), which is 4 for IPv4
• HLEN:
IP header length (4 bits), which is the number of 32 bit words in the header.
The minimum value for this field is 5 and the maximum is 15.
• Type of service:
Low Delay, High Throughput, Reliability (8 bits)
• Total Length:
Length of header + Data (16 bits), which has a minimum value 20 bytes and
the maximum is 65,535 bytes.
• Identification:
Unique Packet Id for identifying the group of fragments of a single IP
datagram (16 bits)
• Flags:
3 flags of 1 bit each: reserved bit (must be zero), do not fragment flag, more
fragments flag (same order)
• Fragment Offset:
Represents the number of Data Bytes ahead of the particular fragment in the
particular Datagram. Specified in terms of number of 8 bytes, which has the
maximum value of 65,528 bytes.
• Time to live:
Datagram’s lifetime (8 bits), It prevents the datagram to loop through the
network by restricting the number of Hops taken by a Packet before delivering
to the Destination.
• Protocol:
Name of the protocol to which the data is to be passed (8 bits)
• Header Checksum:
16 bits header checksum for checking errors in the datagram header
• Source IP address:
32 bits IP address of the sender
• Destination IP address:
32 bits IP address of the receiver
• Option:
Optional information such as source route, record route. Used by the Network
administrator to check whether a path is working or not.
CHECKSUM

• Checksum is the error detection method used by upper layer protocols and is
considered to be more reliable than LRC, VRC and CRC. This method
makes the use of Checksum Generator on Sender side and Checksum
Checker on Receiver side.

• At the Sender side, the data is divided into equal subunits of n bit length by
the checksum generator. This bit is generally of 16-bit length.

• These subunits are then added together using one’s complement method.
This sum is of n bits.

• The resultant bit is then complemented.

• This complemented sum which is called checksum is appended to the end of


original data unit and is then transmitted to receiver.

• The Receiver after receiving data + checksum passes it to checksum checker.


Checksum checker divides this data unit into various subunits of equal
length and adds all these subunits.

• These subunits also contain checksum as one of the subunits. The resultant
bit is then complemented.

• If the complemented result is zero, it means the data is error-free.

• If the result is non-zero it means the data contains an error and Receiver
rejects it.

Example – If the data unit to be transmitted is 10101001 00111001, the


following procedure is used at Sender site and Receiver site.

Sender Site:

10101001 subunit 1
00111001 subunit 2
11100010 sum (using 1s complement)
00011101 checksum (complement of sum)
• Data transmitted to Receiver is:

• Receiver Site:

10101001 subunit 1
00111001 subunit 2
00011101 checksum 11111111
sum
00000000 sum's complement

Result is zero, it means no error.

You might also like