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.

RTOS/TDA2SX: How to set MTU size below 1500 on SysBIOS?

Part Number: TDA2SX
Other Parts Discussed in Thread: SYSBIOS

Tool/software: TI-RTOS

Hello all,

We would like to set the MTU size of the network packets to be lower than 1500.

Currently, among other packets, we have jambo packets (7K, 32K) and if they fail, retransmission with 1500 (non-jambo) MTU is tried.

How can we disable jambo packets, and set MTU size to be lower than 1500?

We are working on VisionSDK 2.12.01.00 , SysBIOS on TDA2x.

Thanks in advance,

Milena

  • Hello Milena,

    In the default configuration, the jumbo packets are disabled in VSDK. Have you enabled them explicitly?
    Also can you please comment more about your application and fail scenario? I am not sure if reducing MTU would help to avoid frame retransmissions.
  • Hello Prasad,

    We have not explicitly enabled jumbo packets.

    We are streaming video data and transferring some commands (small packets) from point A to point B. When A and B are directly connected via LAN cable, everything works fine. But in final scenario, other network topology is between these two points (also LAN cable from TDA2x). Through this network only MTU 1400 and smaller can pass through.

    So, retransmission is not the main issue.

    Our priority is to have smaller MTU, while avoiding retransmission is nice to have feature, but not required.

    Thanks,

    Milena

  • Milena,

    If I understand correctly, issue is with network topology between A to B and not with TDA application, right?

    You can change MTU size for ethernet in VSDK bios using NDK using below
    Change file ti_components/networking/nsp_x_xx_xx_xx/packages\ti\nsp\drv\ndk2nsp

    //#define ETH_FRAME_SIZE (ETH_MAX_PAYLOAD + VLAN_TAG_SIZE)
    #define ETH_FRAME_SIZE 1400U
  • Hi Prasad,

    Changing MTU size works. Most of the packets are now below MTU.

    I am wondering what kind of packets are still present from the TDA2x, since we have not enabled jumbo packets.

    Attached are the saved capture, in pcap-ng format. You can open it via Wireshark.

    Capture is saved with the old MTU.

    Thanks,
    Milena
  • Milena,

    These are not jumbo packets. Most of modern PC NICs has TCP/UDP offload engines which process layer 3 in NIC. So wireshark sees it as single packet.
    Mostly packet would be just 1500 bytes.

    en.wikipedia.org/.../TCP_offload_engine

    You can disable this feature and try again to see packet sizes. Check how to disable TSO/LSO in your NIC.
  • Thanks Prasad.

    One more question:

    We would like to set TCP window, but have not found anything under that name for TDA2x.

    When we send video stream using TCP over network tunnel with bigger latency, on the Rx side we sometimes have chopped video (video goes real-time, the video latency starts to increase, then video freezes for few frames, and then continues in real time).

    This happens when we stream video from one TDA2x to another TDA2x over network tunnel.

    When we do streaming from one Linux PC to another PC over the same tunnel, this does not happen. 

    Our colleagues suggested that this might be the oscillating behavior of TCP, and probably it could be solved by increasing TCP window.

    Regards,

    Milena

  • Milena,

    You can change different buffer sizes and windows sizes in vision_sdk\links_fw\src\rtos\bios_app_common\tda2xx\cfg\NDK_config.cfg.

    Please look below to change sizes. 

    Tcp.transmitBufSize = 64*1024;
    Tcp.receiveBufSize = 64*1024;
    Tcp.receiveBufLimit = 64*1024;
    Udp.receiveBufSize = 64*1024;

    For more details check in 

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

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

  • Hi Prasad,

    Our values for these buffers are set to 256*1024, but the network measurements show that it is 64kB..

    Does TCP implementation support window scaling? If yes, how to switch it on?

    Regards,

    Milena

  • Milena,

    256x1024 is maximum window size for NDK sockets. For individual sockets you need to set windows size using socket options.

    sendbuff = 128K;
    res = setsockopt(sockfd, SOL_SOCKET, SO_SNDBUF, &sendbuff, sizeof(sendbuff));

     https://stackoverflow.com/questions/14381303/increasing-tcp-window-size

  • Hi, Prasad!

    There are two terms: "TCP transmit buffer size" and "TCP window size", that do not mean the same, so it is not certain that we have understood each other.

    If we use the "setsockopt" function like this:

    sendbuff = 128K;
    res = setsockopt(sockfd, SOL_SOCKET, SO_SNDBUF, &sendbuff, sizeof(sendbuff));

    we will modify the transmit buffer size corresponding to a single socket, that is by default set to 256*1024 (correct me if I am not right).

    We are interested in enabling TCP window scaling option. Within the TCP header, there is a 16-bit field, called Window Size (bits 112 to 127), that is used for storing the size of the TCP window, i.e. the number of transmitted bytes after which the transmitting side expects an ACK message from the receiving side. Enabled the window scaling option, the Window Size field comprises 32 bits (instead of 16), both on the TX and RX side. Within the TCP header, the 16-bit field width is retained, but there is an additional field, called Window Scale Option (WSopt), used to reconstruct the initial 32-bit value from the 16-bit value.

    Ref: tools.ietf.org/.../rfc1323
    Section 2: TCP WINDOW SCALE OPTION


    How could we enable the window scaling option within the Vision SDK 02.12.01.00 and set a custom TCP window size (global/socket-wise)?

    Does the TCP window size value depend on the transmit buffer size?


    Best regards,

    Marko
  • Hi Milena,

    Milena Milosevic said:

    Our values for these buffers are set to 256*1024, but the network measurements show that it is 64kB..

    Does TCP implementation support window scaling? If yes, how to switch it on?

    Unfortunately, the NDK does not support window scaling.

    You might try editing the code of the stack to increase the value of the following macro (in ti/ndk/stack/tcp/tcp.h). This macro is limiting the window size to 64K:

    #define TCP_MAXWIN              65535   /* max window size */

    Note that changing the above value has not been tested - if you choose to do this, please do so at your own risk.

    Steve

  • Hi Marko,

    The NDK is open source and fully rebuild-able. If you wish to add this feature, you are free to modify the code in order to implement the specifications of that RFC.

    Marko Gostovic said:
    Does the TCP window size value depend on the transmit buffer size?

    Assuming that the TX buffer size is greater than the window size, no.

    The window size is governed by the receiving end of the TCP connection. The receiver tells the sender the window size (i.e. it tells the sender how much unacknowledged data it is allowed to send.)

    Steve

  • Hi, Steven!

    Thaks for your reply, although I forgot to mention that I am working with Milena Milosevic in the same environment.

    Since it is now clear that the window scaling is not provided within the available NDK, I have another question.

    I have considered the document on the location: VISION_SDK_02_12_01_00/vision_sdk/docs/Architecture/VisionSDK_SW_Architecture_Overview.pdf and I have found out that the NDK mentioned above is not run on the A15 core in the case Linux is used. I have also found out that the window scaling is provided by Linux.

    Is it certain that it would be possible to enable window scalinig if we used Linux on the A15 core instead of SysBIOS?

    Best regards,

    Marko

  • Hi Marko,

    I actually don't know the answer to that, but my colleague might. I've contacted him but it looks like he's out of the office until Monday, so the response to this question may be delayed until then. Thanks for your patience.

    Steve

  • Hello Marko,

    In VSDK Linux, if you use A15 for networking, it uses Linux network stack. If that stack supports scaling (and most probably it would be), you can enable window scaling,

    In fact it would be very easy to enable (and set many other options) in case of Linux using ethtool.

    Please start new e2e thread in case you need any help in enabling options in linux.