[En-Nut-Discussion] TCP state machine

Krzysztof Sawicki krzysztof.sawicki at mobile.put.edu.pl
Mon Apr 28 11:52:36 CEST 2014


I've got such situation: device with NutOs and GPRS/3G modem. I try to 
establish TCP connection from my PC (PC is client, device with NutOs is 
server). The link is slow, thus SYN packet is sent twice. NutOS's 
response for first SYN is SYN+ACK (this is correct), for second SYN - 
RST. And then session crashes and needs to be established again. Is this 
NutOS's behaviour correct?

I did some tests with another OSes and realized that the best option is 
to ignore duplicated SYNs, as in the following patch:

Index: net/tcpsm.c
===================================================================
--- net/tcpsm.c	(revision 5673)
+++ net/tcpsm.c	(working copy)
@@ -1106,10 +1106,10 @@
      }

      /*
-     * Reject SYNs.
+     * Silently discard duplicate SYN
       */
      if (flags & TH_SYN) {
-        NutTcpReject(nb);
+    	NutNetBufFree(nb);
          return;
      }


-- 
Krzysztof Sawicki
Mobile Systems Research Labs, Poznan University of Technology


More information about the En-Nut-Discussion mailing list