IP header checksum is calculated over IP header only as the data that generally follows the IP header (like ICMP, TCP etc) have their own checksums. At the destination side, the checksum is again calculated and crosschecked with the existing checksum value in header to see if the data packet is OK or not. At the source side, the checksum is calculated and set in header as a field. This is the reason the checksum field is added to the header.
This is because while traveling on network a data packet can become corrupt and there has to be a way at the receiving end to know that data is corrupted or not. Through integrity, we mean a check on whether the data received is error free or not. Well, in this article we will have a brief discussion on the concept of checksum and then we will go into details of how checksum is calculated.Ī check sum is basically a value that is computed from data packet to check its integrity. Have you ever given a thought about things like what exactly is checksum, why is it used and how it is calculated.
If you have ever tried to understand the TCP/IP protocols then you would have definitely stumbled upon the checksum field that is the part of protocol headers like TCP, IP etc.