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.

CC3200-LAUNCHXL: TCP packet loss

Part Number: CC3200-LAUNCHXL
Other Parts Discussed in Thread: CC3200, UNIFLASH

I received the CC3200 LAUNCHXL board then tried the tcp_socket example in the CC3200 SDK. I connect CC3200 and my computer to my wireless router. Then configured CC3200 as TCP client and made it connect to the TCP server on my computer. CC3200 then started sending TCP packets to the TCP server. I added a delay of about 0.4 second between every packet and changed the packet length to 140. Then I used Wireshark to monitor the received TCP packet on my computer. I noticed Wireshark showed that there are TCP packet loss/retransmission frequently. I also replaced my wireless router with another TP-Link enterprise level wireless router and there were still TCP packet loss/retransmission observed.

I also tried connecting my computer to the wireless router with the Ethernet cable directly. But still observed packet loss. 

I also tried using 2 computers connected to my wireless router and use TCP debug tool to transmit TCP packets between the 2 computers. There was almost no packet loss. Seems the wireless router works fine.

Just wonder have you encountered similar issue before? What the root cause for that?

  • Hello,

    TCP packet loss can happen on a TCP connection over WiFi.

    The main question is: did you get the data you sent from the TCO client in your TCP server?

    The entire mechanism of TCP involves moving RX window and retransmissions. Until the other side gets the packets in order, it does not move the window,

    So i expect that the other side gets the information correctly and in order.

    Can you confirm?

    Regards,

    Shlomi

  • Hi Shlomi,

    Yes, the PC side did receive the data. The problem is that the retransmissions takes time.

    In my test, TCP client side sends the packet every 100ms. From the Wireshark capture, I can see when the packet out of order/retransmission happens, sometimes it takes about 2 seconds to re-send the packet. In some time-critical application, such delay could cause problem.

    Thanks
  • Hi,

    Though TCP packet retransmission is not desirable on well functional local network (WiFi), it can happens and your application need deal with this. But if packet timing is important for you, you should select UDP protocol not TCP. Above UDP protocol you can build your own retransmission mechanism. For time critical applications is TCP not right choice.

    I am not sure if TCP retransmission timeout is hard-coded in CC32xx to some fix value or dynamical calculated from round-trip time, but 2 sec retransmission timeout sounds reasonable for most application. But I think your question should be - how often you see retransmissions? And when you seen "re-transmissions" between two computers in real live, it sounds very suspicious. This can signalise that your wireless connection is not that good.

    Finally my suggestions what you can try. Try set power policy to always on by API: sl_WlanPolicySet(SL_POLICY_PM, SL_ALWAYS_ON_POLICY, NULL,0). This option improve network performance of CC3200.

    BTW... do you use latest ServicePack and SDK?


    Jan

  • Hi Jan,

    Thanks for the reply.

    I agree that for the time critical application, maybe UDP is a better option. I will try UDP for my application.

    I tested using 2 computers transmitting TCP packets through wireless, and there was almost NO packet loss. Seems the wireless router/connection is ok.

    I am using the CC3200 SDK 1.3.0. This is the latest version, right?

    I tried changing the power policy as you suggested. It did improved the TCP transmission dramatically!

    Thanks,
    Owen
  • Hi Owen,

    Do you have uploaded latest version of Service Pack inside device?

    Jan
  • Hi Jan,

    I installed the SDK 1.3.0, imported the tcp_socket example projects (with other lib projects, driverlib, oslib, simplelink ...) to CCS and used CCS debug to load tcp_socket image to the board and did the test.

    Would you let me know how to upload the service pack to the device? 

    Thanks,

    Owen

  • Hi Owen,

    Service Pack for CC3200 can be obtained from TI websites ( www.ti.com/.../CC3200SDK ). Service pack contains fixes for internal firmware for network processor. It is mandatory to be uploaded Service Pack inside device (serial flash). This can be done using Uniflash software (version 3.4).

    Though uploading SP into your device maybe not fix this particular issue, usage of CC32xx without latest Service Pack is not recommended.

    Jan
  • Thank you Jan.

    Just installed Uniflash. Will upload the service pack to the device.

    Thanks,
    Owen