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

Hello,


I'm able to generate TCP and UDP packets and able to capture them on wireshark on a connected PC. I notice that the Ethernet checkum is always 0. I'm not sure why it's not being computer. It does perform the internal TCP or UDP header checksum and generates a correct value.

How do I fix the Ethernet checksum?

Thanks,
Raj

  • I should mention I'm on the C6670 EVM board.

  • Rajan,

    You can find the checksum added files at: C:\ti\pdk_C6670_1_1_2_6\packages\ti\drv\pa\test
    You can refer the PAUnitTest and PAUnitTest2, which is having the test code.

    Are you using your own code or TI test code on the C6670 EVM?

  • I'm running my own code - which is based on some the TI Ethernet test samples. It's pretty simple at this point - just establishes a connection and starts sending packets out via the send or sendto command whether it's TCP or UDP.

    Do I need to explicitly add code to do the checksum calculation or is that something the PA should be doing automatically? Is there some PA configuration that I may have missed?

  • Rajan,

    I thought you are looking low level UDP/TCP checksum, so that I asked you to refer the PA test code.

    Did you take the reference code, which is based on helloworld or client projects from the NDK?

    I hope, you are using the UDP/TCP socket program to send the packet from the board. How you are validating the packets in the PC side(receiving the packets), did you using any software to receive the packets?

    If possible share your piece of code to check and provide technical suggestion.

  • The reference code is based on the helloworld project in the NDK. I am using the NDK commands to create sockets, connect, send, and recv data.

    I'm connecting my EVM to a laptop and using wireshark to inspect the packets. That's where I'm seeing the ethernet checksum be 0. I can work on getting you the code but it's basically this:

    - call "socket" to create a socket

    - call "connect: to open a connection (or attempt to connect)

    - send or sendto to send some default data.

    When I look at wireshar, I see the UDP packets that are ouput have checksum errors and when doing TCP, the connection request messages also have checksum errors.

  • Rajan,

    Go through the section "Timestamping UDP Datagram Payloads" at TI Network Developer's Kit(NDK) User's Guide

    Refer the TI Network Developer's Kit(NDK) API Reference Guide to find more detailed info,

  • Oh interesting - thanks for the posting. I didn't know i had to do that manually. How is what you sent different from Section 3.3 Transmit Checksum Generation Example in the PA document (SPRUGS4A)?

  • Rajan,

    You can find the test code for PA with checksum at: C:\ti\pdk_C6678_1_1_2_6\packages\ti\drv\pa\example