TCP issue

Martin Kocian kocian at slac.stanford.edu
Tue Sep 13 22:43:34 UTC 2011


Hi,

I discovered an issue with TCP where RTEMS hangs when after an idle 
period it tries to send a small message followed by a large message.
Looking at tcp_output.c I think I understand what's going on:
When TCP is idle for awhile the congestion window gets reset to t_maxseg.
Then the first message I send is smaller than t_maxseg so it is sent out 
in a single packet. The receiver (Linux) only sends an ACK on every other 
packet so no ACK comes back which means the RTEMS congestion window stays 
at t_maxseg.
Now we send a message that is larger than t_maxseg. Len (the number of 
bytes to be sent) gets set to congestion window size (t_maxseg) minus 
the length of the first (unacknowledged) message.
The conditions in the code to actually send the next packet are:
- len = t_maxseg 
- This is the last part in a send and idle or NODELAY set 
- Time-out
- We have more then 1/2 the maximum send window's worth of data
- Retransmitting

All of the conditions are false so the send hangs until the Linux side 
times out and sends the ACK.
This looks like a bug to me but I'm no TCP expert so any confirmation or
suggestion on how to fix this would be greatly appreciated.

Thank you,

Martin





More information about the users mailing list