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.

Packet Timestamps etc in NDK 2.0

spru523g.pdf "TMS320C6000 Network Developer's Kit (NDK) Software User's Guide" section 3.4.2 Controlling Debug Messages "Timestamping UDP Datagram Payloads"  describes how to generate UDP payload timestamps for TX and RX.

(1) The RX side refers to adding a callback to the EtherConfig, which itself is called from within the function code of NC_NetStart in netctrl.c. At the present time NC_NetStart passes a NULL parameter for this callback. I'm assuming that I would need to recompile the NDK with a different API for NC_NetStart that allows the address of the callback to be passed in? How do I recompile the NDK?

(2) Is SO_TIMESTAMP in socket.h redundant? The TX timestamp method (above) describes the use of the SO_TXTIMESTAMP socket option. It appears that SO_TIMESTAMP is not used by the NDK?

  • Answer to Q1: The above mentioned timestamp feature (callback for time-stamping all Ethernet packets) has been deprecated by NIMU in NDK 2.0. Time stamping feature using sockets SO_TXTIMESTAMP in stack is the only way to time stamp a UDP packet being transmitted by stack. I don’t believe we have anything for Rx time stamping in stack. You can easily implement this in the ethernet driver’s NIMU layer “EmacPktService” function to track all packets received by driver and being handed over to stack. Again if the contents of packet have been modified here by driver for updating timestamp, the application is responsible for updating the timestamp before handing over the packet to stack using “NIMUReceivePacket” function.

    Answer to Q2: 

    No. This option is not redundant. This option when set on a UDP socket with a valid Timestamp callback function will be called by the stack’s Link Layer whenever a packet is sent out using the socket. This callback is called by stack just before handing the packet over to the Ethernet driver to put it on wire. Source Code Reference: The timestamp callback function for UDP sockets is called from “LLITxIpPacket” function of “NDK_INSTALL_DIR\packages\ti\ndk\src\stack\lli\lliout.c”.