AnsweredAssumed Answered

K60 ethernet checksums

Question asked by David Sherman on Nov 6, 2017
Latest reply on Dec 14, 2017 by David Sherman

I've managed to get the K60 working under FreeRTOS TCP stack using the K60 tower board and TWR-SER module, but I'm running into problems with checksums.  I have the hardware configured with the hardware accelerator functions turned on, and FreeRTOS TCP is configured to have the hardware provide the checksums.  I've modified the FreeRTOS routines to ensure the checksum fields for the IP header and protocol headers are zeroed out.  So far, ping (ICMP) works, but TCP is getting erroneous IP header checksums according to Wireshark.

 

I see in the K60 documentation (K60P144M100SF2V2RM, page 1216) that it says:

 

"for ICMP, the checksum is calculated  over the complete ICMP datagram, in other words, without the IP header"

"for TCP and UDP the checksums contain the header and data sections and values from the IP header, which can be seen as a pseudo-header that is not actually present in the data stream"

 

What exactly does that mean?  I make sure the IP header checksum is zero, and that the TCP protocol header checksum is zero, but somehow the IP header checksum comes out incorrect when it is transmitted.  I suspect the reason ICMP is transmitted successfully but TCP shows a checksum error is related to this difference between the two, but I don't understand what this distinction means or what needs to be done to correct it.

Outcomes