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.

How to configure UDP max send size?

I'm working on a legacy application built with NDK 1.93. I'd like to send UDP packets larger than 1472 bytes and have the NDK take care of fragmenting them for me. In the release notes for NDK 1.93 one of the highlights is "UDP send size limit is now configurable", and under defects fixed "SDSCM00015481 - change UDP output to allow send datagrams up to 64K". That sounds like what I want, how do I configure the upper size limit? Is it a configuration call into the stack before starting, or change a constant and rebuild the NDK, or what? Thanks!

   -- Carl

  • Hi,

    Thanks for your post.

    In general, there could be more probability for UDP application to drop multiple send/receive UDP packets. So, when using UDP and sending multiple packets at once:

    Please make sure you have plenty of packet buffers available and verify you do not have any scheduling issues and while UDP application drops when receiving multiple packets at once, make sure the packet threshold for UDP is high enough to hold all UDP data received in between calls to recv(). Kindly see CFGITEM_IP_SOCKUDPRXLIMIT in the NDK programmer's reference guide in the NDK release notes below and see section G.3.9 for OS / IP stack configuration item specifications

    For details on packet buffer pool, kindly refer section 5.3.1 in the NDK user guide which you can get it from the NDK release notes.

    There is a possibility that packets  can be dropped by the Ethernet device driver. Some device drivers have adjustable RX queue depths, while others do not. Refer to the source code of your Ethernet device driver for more details (device driver source code is provided in NDK Support Package for your hardware platform).

    Please see section 3.5.1 in the NDK user guide for troubleshooting common problems and check the option "Sending and Receiving UDP Datagrams over MTU size" for NDK configuration options.

    For NDK FAQ's, please check the below wiki:

    http://processors.wiki.ti.com/index.php/Network_Developers_Kit_FAQ

    http://processors.wiki.ti.com/index.php/Category:NDK

    Also you should download NDK Support Package NSP from - nsp_x_x_x_x\packages\ti\ndk\examples In this package have the "helloWorld" test project for UDP.

    http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/ndk/index.html

    The below code for UDP receive and sent for your reference only.

    /cfs-file/__key/communityserver-discussions-components-files/791/5187.0131.8168.udpsocket.c

    Thanks & regards,

    Sivaraj K

    -------------------------------------------------------------------------------------------------------

    Please click the Verify Answer button on this post if it answers your question.

    -------------------------------------------------------------------------------------------------------

  • Sivaraj,

    This is my first exposure to the NDK so I wasn't sure where to start, I appreciate you getting me pointed in the right direction. I will study up and let you know how it turns out. Thanks!

    -- Carl
  • Sivaraj,

    Your guidance was spot-on. One additional detail due the age of my ndk: needed to use setsocketopt() with SO_BROADCAST to get around the EACCES returned from sendto(). Everything is working like I wanted, thanks!

    -- Carl
  • Hi,

    Thanks for your update.

    Glad that it is working as you desired.

    Thanks & regards,
    Sivaraj K