TCP connection struggling

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Félix_T
Level 5
Level 5
10 sign-ins First comment on blog 50 replies posted

I have a TCP socket opened against our server. We usually transmit up to 40KB/s (although faster would be better). When transmitting, often times, I will either run into a scenario where the tcp send reports that the connection is closed or just an error. I'm not sure what is going on. We are using NetX as the network stack.

Also, when looking at wireshark, I do not see a RST sent by the server. The last thing I see is always the server sending an ACK. I've tried disabling low power, throttling down the transfer rate, changing the MTU size, changing the device's ACK retry timeout. 

0 Likes
1 Solution
Phanindra_I
Moderator
Moderator
Moderator
250 sign-ins 10 likes given 25 likes received

You can enable logs in "wiced_defaults.h" file i.e. uncomment the defines in "Network stack prints" and "RTOS prints" to get more info and to isolate the issue.

Thanks

View solution in original post

0 Likes
4 Replies
Félix_T
Level 5
Level 5
10 sign-ins First comment on blog 50 replies posted

Adding on to this: If I set the ACK timeout to the standard 100 ticks in NetX, doubling timeout each time with a max of 4 retries, eventually my system backs up due to waiting for a really long ACK retry. If I set it to 10 ticks, then I just get socket disconnects and have to reestablish the link. When this happens, the last thing I see on wire shark is an ACK from the server with 0 size payload. This means that the device is no longer receiving packets for some reason.

0 Likes
Phanindra_I
Moderator
Moderator
Moderator
250 sign-ins 10 likes given 25 likes received

Hello @Félix_T 

Are you working on WICED? If so what version of it? what chip is being used? 

If WICED, do you see this issue on a standard CE like the snip.tcp_client? And regarding the throughput issue have you carried out any iPerf tests to verify the throughput numbers?

Thanks

0 Likes

Wiced is 6.4.0.61 and the chip is an STM32L4+ attached to the CYW43012 (packaged in an AW-AH306). The snip.tcp_client opens the socket, sends a packet and closes the socket, so it's not a good analog. I am trying to send lots of data, in bursts to a socket, while keeping the socket open. The first issue is that calling tcp_send is not very fast. The second issue is that after a period of time, could be seconds, could be minutes, the tcp_send stalls waiting for an ACK from the server, and retries to send out a packet. In wireshark, the last thing I see is an ACK from the server, and I don't see the attempted re-transmits from the device.

0 Likes
Phanindra_I
Moderator
Moderator
Moderator
250 sign-ins 10 likes given 25 likes received

You can enable logs in "wiced_defaults.h" file i.e. uncomment the defines in "Network stack prints" and "RTOS prints" to get more info and to isolate the issue.

Thanks

0 Likes