This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Ethernet checksum insertion - UDP

I have modified enet_uip that comes with Tivaware 2.1.1.71 for the DK-TM4c129x board.  I open a TCP port 44818 and send a couple TCP datagrams.  The IPv4 and TCP checksum is inserted correctly.  I then send a UDP datagram port  2222 and the IPv4 checksum is inserted correctly but the UDP checksum that is inserted is wrong.  

Inserted in the message for UDP checksum is 0x627A.  Correct is 0x6280. I'm monitoring transmissions with Wireshark.  Any body have suggestions for what might be wrong to cause the UDP checksum to be off but the other ones to be correct?

  • Hello Gregory,

    This is very strange. Without the checksum being correct the DHCP would also not work on the UDP packet. Did you check uIP documentation on the web to see if there is any known issue in uIP?

    Regards
    Amit
  • I have solved my issue. The IPv4 protocol has a total length field but the checksum for IPv4 doesn't include data so even with an incorrect length the IPv4 section can be valid. Part of the UDP checksum is a pseudo header populated with fields from the IPv4 fields, including the length from the IPv4. Once the length in IPv4 and the length in UDP matched the checksum populated by the Tiva hardware is correct.