1

RFC 2460, Internet Protocol, Version 6 (IPv6) Specification, Section 8.1 Upper-Layer Checksums, states the UDP checksum is mandatory and any IPv6 receivers must discard UDP packets containing a zero checksum, whereas it is optional for IPv4.

Who drops it and at what level?

Does the hardware discard it or does some layer in the stack discard it?

  • Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you can provide your own answer and accept it. – Ron Maupin Aug 7 '17 at 16:30
1

Ethernet has its own checksum, and it has nothing to to with IP, TCP, or UDP. Neither TCP not IPv6 have anything to do with the UDP checksum. UDP on the source will create the checksum, and UDP on the destination will verify the checksum.

I think you don't really understand the network stack layers.

Layer-2 protocols, e.g. ethernet, Wi-Fi, etc., may use a checksum. In general, layer-2 protocols will drop any layer-2 frame with a bad checksum anywhere along the layer-2 path. For instance, a switch will discard an ethernet frame with a bad checksum. Layer-2 protocols don't care which layer-3 or layer-4 protocols are carried in their frames, nor are they aware of any layer-3 or layer-4 checksums.

In layer-3, IPv4 has a header checksum that layer-3 devices, e.g. routers or hosts, will inspect to verify the integrity of the IPv4 header, discarding any layer-3 packets with a bad header checksum. IPv6 has done away with the IPv4 header checksum. Layer-3 protocols do not care which layer-2 protocol carries their layer-3 packets, nor which layer-4 protocols they carry. Neither are they aware of any layer-2 or layer-4 checksums.

Layer-4 protocols, e.g. TCP, UDP, etc. may have a checksum. In IPv4, the UDP checksum was optional, but it is mandatory with IPv6. A layer-4 protocol will inspect it own checksum, and it will discard any datagrams with bad layer-4 checksums. Layer-4 protocols are unaware of any layer-2 or layer-3 checksums.

| improve this answer | |
  • Sorry that my question was poorly written. What does a MAC chip do in a network card? Is the TCP/IP stack a software middleware or is it implemented via some pieces of HW (e.g. MAC chip) along the way? – user_ABCD Dec 21 '16 at 19:52
  • The hardware is layer-1, and it doesn't really care about layer-2/3/4 protocols. The protocols above layer-1 are built into the OS (software). Anything above layer-4 is up to the application. A MAC address, for protocols that use MAC addresses (not all layer-2 protocols use MAC addresses, and there are 48-bit or 64-bit MAC addresses, depending on the layer-2 protocol), will default to the BIA in the interface, but that can usually be changed in software. A MAC address is a layer-2 address, just like an IP address is a layer-3 address, and a port is a layer-4 address. – Ron Maupin Dec 21 '16 at 19:57
0

Does the hardware discard it or does some layer in the stack discard it?

It depends.

Traditionally the NIC would only concern itself with Ethernet level stuff. So it would verify the "frame check sequence" and check the destination MAC address, but higher level checksums would be left to the OS.

However modern NICs often have the option to at least partilly handle higher levels of the protocol stack to reduce load on the main CPU.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.