Discussion about this post

User's avatar
Ben Erickson's avatar

I appreciate you taking the time and effort to answer a question I've had for a long time, but it still does not answer for me the question of why higher-level protocols use a Checksum field in their headers vs using a trailer. I also found a few possible inaccuracies if you wouldn't mind addressing them.

The most important discussion/question: Say protocol designers had designed the IPv4 header such that the Header Checksum field was a trailer at the end of the IPv4 header instead of in the header. Also, let's assume that the designers of TCP had implemented the TCP Checksum field as a trailer at the end of the TCP Payload instead of in the header. In the former case, a router could then calculate the IPv4 Header checksum byte-by-byte as the frame is received/processed (simultaneously with the frame CRC calculation) without buffering the entire IPv4 Header first. Likewise, in both cases the receiving end-host's NIC could handover IPv4 packet to the kernel who in-turn could calculate both the IPv4 header checksum AND the TCP Checksum byte-by-byte until the trailer is received without buffering the entire segment. This seems to me to be the more optimal solution, so why didn't this happen?

The article states the following reasons why higher-level protocols don't need trailers:

1. Length Information is Already Present: This is true, but certain L2 technologies have Length information (such as 802.3 LLC Ethernet), so it doesn't strike me as a very good reason. Ethernet II has a Length/EtherType field in the header which is predominantly used as EtherType and not Length FWIW.

2. Protected by Lower Layers: I'm not sure what this has to do with Trailers vs. Checksum in the Header. TCP has a checksum field in its header and does not assume it is protected by lower layers.

3. End-to-End Principle: Again, I'm not sure what this has to do with Trailers vs. Checksum in the Header. TCP could still provided E2E protection with a trailer.

This leaves me with only one possible answer that feels hand-wavey: It's easier to both comprehend and implement the Checksum in headers, so designers went that route. Trailers are more complex for "reasons". I hope I'm wrong in this though.

Possible Inaccuracies?:

1. You state the following "Data link layer: Detects transmission errors via CRC in trailers; typically requests retransmission". I am not aware of Ethernet requesting retransmissions, I assume you're referring to other data link technologies?

2. You state the following "Network headers persist end-to-end". This is incorrect in one small instance: the TTL field is updated at every hop hence why the IPv4 Header checksum is recalculated at every hop. The IPv6 Header eliminated the the header checksum field for the reasons you discuss in your article (the assumption that the data link checksum detection is sufficient which is fine).

3. You state the following "Ethernet: Uses a preamble sequence and relies on the length field". Ethernet II (the dominant version of Ethernet unless I am mistaken) almost always does not use its length field. Instead the length field is shared with the EtherType field and it is this latter function (EtherType specifying the high-level protocol such as IPv4/IPv6) that is used. Slightly off-topic, but for the Ethernet II frame is the SFD+Preamble therefore used to delineate between both the start AND the end of an Ethernet II frame?

Expand full comment

No posts