Unexpected TCP connection resets on nRF9160

We are using modem firmware 1.3.5 on nRF9160.

When packet loss is high, we sometimes see connection resets (NRF_ECONNRESET) reported by the modem that don't seem to be explainable by the packets the server has sent.

I have documented such a case in the attached files and will explain it here. On the client side, NRF_MODEM_LIB_TRACE_LEVEL_IP_ONLY was used.

The nRF91 opens a TCP connection to a server and tries to send data:

client ->   SYN   -> server
client <- SYN,ACK <- server
client -> ACK LOST
client -> PSH,ACK LOST
client -> PSH,ACK LOST (retransmission)
client <- SYN,ACK <- server (retransmission)
client -> ACK LOST (duplicate)

At this point, the nRF91 aborts the nrf_poll function with POLLERR. Querying the SO_ERROR using nrf_getsockopt yields 104 (NRF_ECONNRESET).

Is this expected behaviour? As far as I know, ECONNRESET should indicate that the server has sent a RST packet, which was not the case here. Not that in the logs, you can see the server sending a RST packet, but that is much later.

Server packet trace:

Client (nRF91) packet trace (note that the timestamps are wrong):

trace.bin0882.server.pcapng6330.log.txtclient.pcapng

Related