Header Checksum Field in IPv4 Header

For Complete YouTube Video: Click Here

We will try to understand Header Checksum Field in IPv4 Header in this class.

We have already discussed the Time to Live TTL field in the IPv4 header in our previous class.

Header Checksum Field in IPv4 Header

How to calculate the header checksum?

Divide the IP header into 16-bit words, sum each of them up, and finally do one’s complement of the sum. Then the value generated out of this operation would be the checksum. 

We will consider a header and group the header bits as the 16-bit group to understand this.

The grouping of the bits of the header checksum is done as shown below.

STEP 1: Grouping the header bits

Header Checksum Field in IPv4 Header
Header Checksum Field in IPv4 Header

STEP 2: Summing up each group

Header Checksum Field in IPv4 Header 1
Header Checksum Field in IPv4 Header 1

STEP 3: One’s Compliment of the Final Sum

Header Checksum Field in IPv4 Header 2
Header Checksum Field in IPv4

The final result is placed in the header checksum field and send to the receiver.

How the checksum is verified at the receiver?

After receiving the packet the header checksum value is removed and replaced with all zeros.

Now the same procedure is repeated and compared with the value sent by the sender.

If both the values are same then the packet is forwarded to the upper layer else discarded.