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.

IP fragmentation/reassembly using NDK

Hi,

I am using NDK in C6670 EVM board for validating the IP fragmentation/reassembly functionality of NDK so that I can use the same while running my LTE stack on C6670.

When I pump network packets of size 1600 bytes/1700 bytes etc which is greater than the MTU size (1518 bytes) from a Linux PC to C6670 board, the packets are fragmented by network stack in Linux PC. 

In the C6670 board, I receive the reassembled packets of size 1600/1700 which I orignally sent from the Linux PC.

I am running the helloWorld example program on Core 0 of C6670.

My questions are:

1. What is the maximum data size for which IP reassembly is supported in NDK stack? (Because I could see packets of size 1900 Bytes are not received by udp receiver daemon of the example.

2. Whether this max reassembly size is configurable?

3. The udp echo daemon of the example program sends back the received packet back to network. When the received packet size is greater than MTU i.e. (1472+headers = 1518), the sendto() function fails. Apparently fragmentation is not working. How to enable IP fragmentation for packets sent via NDK stack?

Thanks & Regards,

- Gopi

  • Hi All,

    Can anyone please help me to understand the above said behavior NDK?

    With Regards,

    - Gopi

  • You need Jumbo packet support in NDK.

    1. Modified the code according to the instructions "Sending and Receiving UDP Datagrams over MTU Size" in the SPRU523H.pdf;

    2. Enable _INCLUDE_JUMBOFRAME_SUPPORT and rebuild the NDK lib.

    Regards, Eric

  • Hi Eric,

    I hope Jumbo packets are data packets whose size is very high compared to the conventional MTU size of 1518 bytes; And sending and receiving Jumbo packets means sending the packet as a single frame (without splitting) into network and receiving huge frame from network.

    But what I am looking for is, say I have a data of size 2000 bytes and I want to send it to network.  I do not want tosend that 2000 byte as a single frame but rather two frames. 

    Considering UDP socket, first frame will carry (1472 + header) bytes and second frame will carry 528+header bytes. 

    For this, fragmentation of data should happen in the network stack (in our case, within NDK) and when such fragments are received from network, it should get reassembled by NDK and returned as a single data packet to the application.

    How to enable this in NDK?  

    (Please correct me, if my understanding is wrong at any point).

    Thanks & Regards,

    - Gopi

  • Hi Eric,

    I did not enable Jumbo frames. 

    But from the document, SPRU523H.pdf, "Sending and Receiving UDP Datagrams over MTU Size", I added the below line in the hello World example program.

    rc = 8192;
    //Max re-assembly size
    CfgAddEntry( hCfg, CFGTAG_IP, CFGITEM_IP_IPREASMMAXSIZE,
    CFG_ADDMODE_UNIQUE, sizeof(uint), (UINT8 *)&rc, 0 );

    before invoking the "NC_NetStart()"

    Now I am able to see IP fragmentation is happening for packet of size upto 3000 bytes, while sending from NDK to outside network.  

    also reassembly size has increased from 1900 bytes to 3000 bytes for the received packets.

    1. But my question is, when I set the Max reassembly size as 8k, why reassembly and fragmentation happens only upto 3000 bytes?

    2. Another interesting observation. My CPU load under no traffic condition has come down to 4% from 32% after adding the above line.  Please refer to my query in the below link:

    http://e2e.ti.com/support/dsp/c6000_multi-core_dsps/f/439/t/308031.aspx

    How are they inter-linked?

    With Regards,

    - Gopi

  • Hi Eric,

    Any input on this?

    With Regards,

    - Gopi