Subject: [tcpm] TCP implementations in Windows8 and Ubuntu violate standard?

From: Frits Vaandrager <[email-masked]>
Date: Wed, 07 May 2014 15:11:04 +0200

In my group at the Radboud University Nijmegen, the Netherlands, we do 
research on automata learning. We develop algorithms that allow us to 
learn state diagrams of black box systems by providing inputs and 
observing outputs.

Together with my students Paul Fiterau and Ramon Janssen, we just 
completed a paper in which we describe how we learned models of small 
fragments of TCP for Windows8 and Ubuntu 13.10 implementations: 
http://www.mbsd.cs.ru.nl/publications/papers/fvaan/TCP/.

Based on these results, we conclude that both Ubuntu 13.10 and Windows8 
do not conform to the
TCP standard. On page 37 RFC793 says:

3.  If the connection is in a synchronized state (ESTABLISHED,
     FIN-WAIT-1, FIN-WAIT-2, CLOSE-WAIT, CLOSING, LAST-ACK, TIME-WAIT),
     any unacceptable segment (out of window sequence number or
     unacceptible acknowledgment number) must elicit only an empty
     acknowledgment segment containing the current send-sequence number
     and an acknowledgment indicating the next sequence number expected
     to be received, and the connection remains in the same state.

We discovered that when an Ubuntu server is in CLOSE_WAIT state and the client sends an ACK or a FIN+ACK with a valid seq number but an invalid ack number, the server
sometimes does not return any message. In Windows 8 the required acknowledgment segment is never sent.

We would be very interested to hear your opinion on these findings.
Is this indeed a violation of the standard? Is this a known issue?

Thanks!

Frits Vaandrager

---

From: Hagen Paul Pfeifer <[email-masked]>
Date: Thu, 8 May 2014 09:48:23 +0200

The scenario that you spotted MAY violate 793, but it has no real practical
relevance. I.e. compared to 793 I see no performance or other negative
impact where the behavior is counterproductive. Except it differs from 793.

2) why the Linux implementation differs should be asked in netdev.
Sometimes standards are not fully implemented because of performance &
security considerations or simple bugs

Anyway: good catch!

Hagen

---

From: Joe Touch <[email-masked]>
Date: Thu, 08 May 2014 18:31:17 -0700

On 5/7/2014 6:11 AM, Frits Vaandrager wrote:
> We discovered that when an Ubuntu server is in CLOSE_WAIT state and
> the client sends an ACK or a FIN+ACK with a valid seq number but an
> invalid ack number, the server sometimes does not return any message.
> In Windows 8 the required acknowledgment segment is never sent.
>

It seems so (we'd have to check in detail). I don't recall anyone 
raising it before.

The key question is why this requirement was given. It seems like it's 
intended to help the sender of the unacceptable segment to determine 
that it had outstanding data to resend, or that it had exceeded the 
receiver's window.

The behavior you saw might cause connections to not recover properly, to 
either retransmit data it already had or to drop connections that could 
have been recovered after a loss or receiver change (e.g., if the 
receive window were made smaller during a connection).

The "practical" relevance depends on how often you expect this to occur, 
and whether the current behavior is acceptable vs. full recovery.

Joe