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 aggregation in UDP

Other Parts Discussed in Thread: CC3100, CC3200

Hi,

We are using CC3100.

It is running in AP mode as TCP server.

We are disabling the packet aggregation using the below API as mentioned in the TRM(section 6.8)

/* Packet aggregation disabled*/
uint8_t RxAggrEnable = 0;
retVal = sl_NetCfgSet(SL_SET_HOST_RX_AGGR, 0, sizeof(RxAggrEnable), (uint8_t *) &RxAggrEnable);

Even after using this API, it concatenate more than one packet into the buffer.

The API is returning as success.

How can we resolve this issue?

Thanks,

Likhitha

  • Hi,

    I think this parameter is relate to UDP protocol not TCP. In documentation is write that packet aggregation is also applicable to sl_Recv() but from natural behaviours of TCP protocol it not make sense.

    Using network sniffer (e.g.: https://www.wireshark.org/) check how looks packets from your other side. I think you will see that data are aggregated at other side during sending.

    Jan
  • It was a typo.

    I am using UDP server

    In wireshark I could observe that packers are not aggregated.

    When it comes to sl_recvfrom the packets are getting aggregated

  • Hi,

    Hmm... please try search on from (topic SL_SET_HOST_RX_AGGR). I remember that here was similar topic that some users reported that this API is not working. I don't know if there was any conclusion.

    Jan
  • Hi,
    TI team,i am stuck with the issue .
    Please help us to resolve the issue.
    Thanks,
    Lihitha
  • Hello Anna,

    It may be misleading. Let me explain.

    The main reason for this feature, and it is applicable for UDP as well as for TCP, is to increase throughput.

    It is relevant only for SPI interface with CC3100.

    When you want to get data of length X from the device, and this feature is enabled, it would return only when all X bytes are received (the loop for recvfrom() is done in the device, not in host side). When this feature is disabled, it would return with whatever length it has. So if 2 packets already received, both would be concatenated and transferred to the host.

    Regards,

    Shlomi

  • Hi Shlomi,

    Thanks for your reply.
    With referring to section 6.8 Packet Aggregation of CC3100/CC3200 SimpleLink™ Wi-Fi® Interneton-a-Chip User's Guide
    When using UDP socket (sl_RecvFrom) this[means aggregation enabled] might be a problematic feature, since UDP is a connectionless data socket, a server socket can receive data from multiple client, thus aggregating these packets might be a wrong implementation.
    The packet aggregation feature can be disabled upon using sl_NetCfgSet() API.
    u8 RxAggrEnable = 0;
    sl_NetCfgSet(SL_SET_HOST_RX_AGGR, 0, sizeof(RxAggrEnable), (_u8 *) &RxAggrEnable);

    So please suggest a method to avoid the concatenation to the CC3100 SPI interface.It means CC3100 shouldn't send a concatenated packet to the host side microcontroller.

    Thanks,
    Likhitha
  • Hello Anna,

    As I described, it is not supported for this generation.

    Whether you only have a single client in which you want to make distinction between the packets or having several clients and you want to distinct between the packets, the only way currently is to introduce a well known piece of data in the content (add metadata to the packet).

    If you think of it, since UDP is unreliable in its nature, you might want to do it anyway, for example if the packets order is important and you want to be able to reorder it on the application layer.

    Regards,

    Shlomi

  • Hi Shlomi,
    Frankly your reply came as a shocker to us. We would expect the BSD sockets implementation for UDP sockets to respect the packet boundaries so that standard applications using UDP will not require any changes to work in the system. Quoting from en.wikipedia.org/.../User_Datagram_Protocol :

    "Packets have definite boundaries which are honored upon receipt, meaning a read operation at the receiver socket will yield an entire message as it was originally sent."

    Honouring packet boundaries is a minimum requirement for UDP sockets and we have developed our hardware using CC3100 based on your user manual stating that packet aggregation can be disabled using the following API call:

    sl_NetCfgSet(SL_SET_HOST_RX_AGGR, 0, sizeof(RxAggrEnable), (_u8 *) &RxAggrEnable);

    We find that the API call returns success, but packet aggregation continues to happen.

    Is it possible to fix this in the CC3100 software and provide us an update that can be uploaded to CC3100?

    On the other hand, can you provide the source code of CC3100 for us to fix the issue, build and update?

    Expecting your reply at the earliest.

    Thanks,
    Likhitha
  • Hello Likhitha,

    I double checked it in the code and I revert my answer. It should work.

    Please describe the use case. If I understand correctly, you are transmitting UDP packets to SimpleLink server (from different clients or the same client?) and call sl_RecvFrom(). With what length are you calling it? what is the size of your packets? Do you see more than one packet upon sl_RecvFrom()?

    Also, please remember that this feature is not persistent, i.e. you need to set it after each reset. Is it possible that you did not set it after reset?

    Regards,

    Shlomi

  • Hello,

    Any update on the post?

    Regards,
    Shlomi