[riot-notifications] [RIOT-OS/RIOT] gnrc_tcp: syn_rcvd pkt loss fix (#10946)

Simon Brummer notifications at github.com
Tue Feb 5 11:32:38 CET 2019


### Contribution description
This PR fixes #10945. Peter found a bug in gnrc_tcp() connection establishment procedure.

## Problem description
The Problem can be provoked by starting a RIOT Node with TCP in passive mode by calling gnrc_tcp_open_passive(). The function does not return until a connection was successfully established
or an error occurred. As soon as the RIOT Node received a SYN Packet, a SYN-ACK is added to the retransmission mechanism. By prohibiting the peer TCP to not send any response to the SYN-ACK,
gnrc_tcp() retransmits SYN+ACK infinitely and can never accept a new connection. 

>From my point of view this is a very critical issue because either packet-loss or a manipulated  Handshake can deadlock a RIOT Node. As a side note: This Problem is not mentioned in the TCP RFC
so there is no definite strategy to address this.

## Fix description
TCP uses by default a two minute timeout to evaluate if a connection is alive. If the retransmission mechanism is longer that two minutes not successful in transmitting packets a connection is viewed as lost.

This fix starts a timer as soon as the SYN Packet is received from the peer. This Timer is stopped as soon as the connection is established. If the timer times out after two minutes the retransmission queue is cleared and the TCB reverts back to the LISTEN state waiting for the next incoming SYN.

You can view, comment on, or merge this pull request online at:

  https://github.com/RIOT-OS/RIOT/pull/10946

-- Commit Summary --

  * gnrc_tcp: syn_rcvd pkt loss fix

-- File Changes --

    M sys/net/gnrc/transport_layer/tcp/gnrc_tcp.c (29)
    M sys/net/gnrc/transport_layer/tcp/gnrc_tcp_fsm.c (1)

-- Patch Links --

https://github.com/RIOT-OS/RIOT/pull/10946.patch
https://github.com/RIOT-OS/RIOT/pull/10946.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/10946
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190205/9e873bb1/attachment.html>


More information about the notifications mailing list