[En-Nut-Discussion] Proposed Change to NutOS TCP/IP libs to support GRPS/CDMA variable latency (avoid unnecessary TCP retransmission)

Brett Abbott Brett.Abbott at digital-telemetry.com
Wed Apr 13 22:17:10 CEST 2005


Hi

We've made the following change to the TCP retransmit timer calculation 
to account for the widely variable latency in GPRS/CDMA. 

For those holding open longish sessions and sending data in drips and 
drabs, you will find that the cellular networks will "virtually" suspend 
the link after short periods of inactivity.  After this suspension, 
there is often several seconds (as much as 8 seconds when the network is 
under load)  before new packets will get through, let alone carry a TCP 
ack back home.  The resulting retransmission storms can cost a pretty 
penny.  Once the first packet gets through after the wakeup, and the 
vitual data channel is awake, the latency drop away remarkably and it 
doesnt take long for the automatic latency calculation (NutTcpCalcRtt() 
to bring the Retransmission time back down to very small.

The change is shown below, which should only be used for slow and 
variable networks.  Pre NutOS 3.9.5, the retransmission timer was fixed 
and could be specified when creating the socket.  This method now only 
provides the starting value.

This is the sledgehammer option but works nicely where steady and cost 
effective is more important than speed.  A more elegant and automated 
solution would be welcomed.

Regards
Brett

// Changes to library: tcputil.c, void NutTcpCalcRtt(TCPSOCKET * sock)

// added RTTO_MIN such that the soonest a retrans may begin is longer 
than 200ms after the previous packet
// RTTO_MIN is new #define, value was 200
// #define RTTO_MIN now set to 5000 or 10000
// OLD VERSION:     sock->so_rtto = min (20000, max(200, (delta * 4 + 
sock->so_rtto * 8) / 10));
     sock->so_rtto = min (20000, max(RTTO_MIN, (delta * 4 + 
sock->so_rtto * 8) / 10));

-- 
-----------------------------------------------------------------
Brett Abbott, Managing Director, Digital Telemetry Limited
Email: Brett.Abbott at digital-telemetry.com
PO Box 24 036 Manners Street, Wellington, New Zealand
Phone +64 (4) 5666-860  Mobile +64 (21) 656-144
------------------- Commercial in confidence --------------------

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.egnite.de/pipermail/en-nut-discussion/attachments/20050414/72c625d4/attachment-0001.html>


More information about the En-Nut-Discussion mailing list