lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-users] Re: [lwip] dropping the TIME-WAIT state


From: Adam Dunkels
Subject: [lwip-users] Re: [lwip] dropping the TIME-WAIT state
Date: Thu, 09 Jan 2003 00:30:38 -0000

Hi!

On Wednesday 08 May 2002 12.44, address@hidden wrote:
> lwIP obeys the rfc TIME-WAIT spec, whereby a connection
> sits around waiting to acknowledge any remaining FIN packets.
>
> What is the significance of removing the TIME-WAIT state
> and immediately freeing the pcb struct using tcp_abort?

This is discussed in RFC1337, among others. Here is what RFC1337 says:

   (4)  TIME-WAIT state removes the hazard of old duplicates for "fast"
        or "long" connections, in which clock-driven ISN selection is
        unable to prevent overlap of the old and new sequence spaces.
        The TIME-WAIT delay allows all old duplicate segments time
        enough to die in the Internet before the connection is reopened.

There is also a paper discussing this by Faber, Touch and Yue called "The 
TIME-WAIT state in TCP and Its Effect on Busy Servers" that might be worth a 
read.

> I do this myself to conserve resources: if I have ten
> incomming web server connections per second, I don't want
> idle pcb structs taking up memory. IMO an http server
> should send its last packet and forget the connection.

In "vanilla" lwIP, the TIME-WAIT PCBs does not really comsume resources 
because there is a fixed amount of avaliable connections. If there are no 
free connections, the oldest TIME-WAIT connection is removed and reused. 

If you aren't using lwIP's memp manager and allow an unlimited amount of 
connections, TIME-WAIT connections will use memory, however. In that case, 
the best thing to do is probably to modify the TCP code so that it sets a 
limit on the amount of connections. This could be made by introducing a 
counter that is incremented by tcp_new() and decremented by tcp_abort() and 
tcp_pcb_remove().

> Alternatively, can the time spend in TIMED-WAIT be reduced?
>
> Can we not make this a few seconds instead of many minutes?
>
> What parameters must be modified to reduce it?
>
> What is the current timeout?

It is possible to modify the timeout by adjusting the TCP_MSL #define in 
tcp.h. A connection stays in TIME-WAIT for 2 * TCP_MSL.

/adam
-- 
Adam Dunkels <address@hidden>
http://www.sics.se/~adam

[This message was sent through the lwip discussion list.]




reply via email to

[Prev in Thread] Current Thread [Next in Thread]