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.

Attempt to send UDP packets of size 32k per sendto. (EVM6678L)

Hi,

I'm trying to send data across the ethernet cable at a rate of 5MB/s or higher. I have 2 ethernet cards on my PC and i have tried sending UDP data from one card to the other and it works. With this i was able to achieve a rate of about 6.2MB/s. I used a struct with a char array as follows:

struct myStruct{
  int num;
  char data[32768];
}

But when i moved the code into CCS and tried sending the UDP messages from my EVM6678 board to my PC, nothing is received on my PC side. I understand there's this MTU which limits the maximum packet size to 1500bytes.

Is there anyway i can solve this? By either increasing the MTU or some other settings elsewhere which i'm unaware of?

Thank you so much for your time.

  • Jonathan Lin,

    I don't think NDK allows sending UDP packets larger than the default MTU size (~1500 bytes).
    In addition that, the NIMU driver do not have support for JUMBO packets. This is not implemented yet.
    It is filed IR SDOCM00079559 already. You have to modify the code to support larger packets.

    Please have a look in the below E2E thread for how to increase the UDP packets,
    http://e2e.ti.com/support/dsp/c6000_multi-core_dsps/f/639/t/283509
    http://e2e.ti.com/support/dsp/c6000_multi-core_dsps/f/639/p/335873/1172455#1172455

    The NIMU driver has some hard coded definitions that block jumbo packet support,
    http://e2e.ti.com/support/dsp/c6000_multi-core_dsps/f/639/p/276002/994658.aspx#994658
    http://e2e.ti.com/support/dsp/c6000_multi-core_dsps/f/639/p/150134/635637.aspx#635637

  • Hi Pubesh,

    I see i have to edit the NIMU driver as well, i'll try it out, thanks. But from the document, i see that Jumbo support for C6678 (packet sizes 1.5kb-9kb), does that mean even with jumbo packet the maximum size per packet i can send out at is only 9kb?

    Is there any other way i can increase my UDP transfer rate other than increasing my per packet size? Because i've tried and the only way i can achieve transferring at more than 5MB/s is using a packet size of 32kb. Although i tested it using my 2 ethernet cards on my PC, but 9kb is alot lesser than 32kb, so i don't see how i can achieve 5MB/s. Could there be some settings somewhere or any other method i could implement to increase the transfer rate?

    Thanks.
  • Jonathan Lin,
    The NDK core stack can support Jumbo frames (packet sizes larger than 1500 bytes) . But the Jumbo PBM implementation is similar to the PBM implementation, except that it can handle larger block sizes than the ones in PBM and ranges between 3K and 10K bytes by default.
    Find the more details at the NDK user(SPRU523H) and API reference guide(SPRU524H).

  • Hi Pubesh,

    I've read the 2 NDK documents SPRU523H and 524H, and there's this section which says "Sending and Receiving UDP Packets over MTU size", i've tried the solution but it still doesnt work.

    I also tried the following step by step guide you provided. I attempted to send a 2KB packet but still it doesn't work. I then tried using the hello world project demo as stated in the guide, open wireshark, and run the Hello World program. I see the correct messages being displayed in CCS, stating the network is up and the ip address is 192.168.2.100. But when i tried to ping the IP address i couldn't ping it.

    Edit: Okay, it worked! Thanks!

  • Hi Pubesh,

    I'm now able to send UDP packets of up to 10k bytes, it's great, but i can't seem to go beyond 10k bytes. I've followed the PDF which you provided, step by step, enabling Jumbo Packet and setting the socket option etc. Currently the maximum size i am able to ping the board from my PC using the command prompt is 10194bytes, pinging at 10195bytes will result in a timeout. I've set the MTU on my PC at 15,000, and on wireshark, i see the ping request of 10195 bytes(not including header) data but no reply messages.

    As instructed, i set the page size to 65500, and the number of page was 16 and i didn't change it. There's this ".far:NDK_MMBUFFER", does it need to be included in the script sectMap? If so how do i add it? I'm not too sure about the 'align' part at the end of the sectMap.

    The pdf didn't ask me to change the PBM buffer so i leave it as it is?
    PBM Buffer
    Number of frames: 192
    Frame buffer size: 1536

    Is this a limitation of the board or my PC? Or is it some kind of setting which i may be missing out on?

    Edit: And so after making all the changes, what is the MTU for my board now? Is it 65500? I've also noticed that the document instructed me to change a value in NIMU to 10k, so i thought that could have caused my limitation, but i changed it to 40k and still the same.

  • Hi Pubesh,
    I need some help in clarifying some doubts. Firstly, based on the PDF you shared, in one of the instructions i was told to modifying the 'package.bld' in the stack folder, in which the line "pbm/jumbo_pbm.c" is to be included. Following that, a single modification to NIMU also had to be done "hPkt = PBM_alloc(10236)". My question is, i've looked through the c file 'jumbo_pbm.c', and if i were to use jumbo packets, shouldn't i be using "hPkt = jumbo_mmAlloc(10236)" instead? Since PBM(Packet Buffer Manager) allows me to set the packet buffer size, and only jumbo packet supports 3kb-10kb, why aren't we using "jumbo_mmAlloc()"?

    Secondly, i've tried using both 'PBM_alloc()' and 'jumbo_mmAlloc()', and i set the size to 20472, in the hope of sending 12k packet. None of the 2 seems to work.

    I followed the PDF you shared step by step, i've increased the MTU on my PC to 15k, i've tried using 'jumbo_mmAllow()' instead, but still it doesn't work. Could you assist me and guide me along to solve this? Thanks.
  • Jonathan,
    I do not have option other that jumbo supported for 10K bytes. And also shared the details like NDK user/reference API guide. You can search to find more info in the E2E forum with the relevant keyword.

    In additon that, refer the below wiki will be useful.

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

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

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