Why is the checksum calculated in the IPV4 packet against the IP header and not the entire packet, for example, tcp / udp transport protocols?

Why does the IPV4 packet compute the checksum against the IP header and not data such as tcp / udp transport protocols?

+6
source share
3 answers

This is a matter of speed: Internet backbone routers route millions of packets per second and calculate the checksum over the entire content, which will drastically slow down packet processing.

The IPv6 specification removes even the header checksum so that routers can route packets even faster. (This is just one of many steps IPv6 has taken to reduce the number of temporary routers that each packet should check. All of this adds up.) Dropping corrupted packets is now completely placed on the end nodes.

+9
source

There are two good reasons for this.

First, all higher level protocols that encapsulate data in an IPv4 datagram have a checksum field that spans the entire packet. Therefore, the checksum for the IPv4 datagram does not need to verify the encapsulated data.

Secondly, the IPv4 packet header changes with each router visited, but there is no data. Thus, the checksum includes only the part that has changed. If data was included, each router must recalculate the checksum for the entire packet, which means an increase in processing time.

source: data transfer and networking by Behrouz A. Forouzan

+2
source

IPv4 provides only the correct address, so it calculates the checksum using only the address and not using data, ensuring reliable data transfer, and not setting the network level.

+1
source

Source: https://habr.com/ru/post/908006/


All Articles