Re: TIME_WAIT connections

From: Andi Kleen (ak@suse.de)
Date: Wed Jun 21 2000 - 17:02:54 EST


On Wed, Jun 21, 2000 at 03:10:01PM -0600, Warren Young wrote:
> Alan Cox wrote:
> >
> > > Machine is web serwer with reather big traffic. Why there is
> > > so much connections in TIME_WAIT state ?
> >
> > Its quite normal. A tiny fragment of a TCP session has to remain for 2 minutes
> > after use at least at one end of a TCP connection to avoid corruption[1].
>
> "2 mintues" may be how the Linux kernel does it, but it's not the way
> TCP says it should be done.

Linux kernel uses 60 seconds.

>
> TIME_WAIT should last for 2*MSL (maximum segment lifetime). I know it's
> hard to calculate MSL, and if you make up a hard-coded value it has to
> be long enough for the slowest connections. It could be that FreeBSD
> 4.0 does do this calculation. If we can calculate semi-accurate MSLs
> for each connection, TIME_WAIT states would be minimized.

s/hard/impossible/.
The route can change every time.

>
> Even over a slow Internet link, the MSL can't be much longer than 10
> seconds or so. By then a segment has either been TTL'd out, or is
> lost. I don't buy "MSL == 1 minute" at all.

30s MSL is probably not even conservative enough; if the packet loops
a few times over satellite or slow wire less connections (with own
buffering) that could be easily reached.

Note that when you have PAWS you can avoid TIME-WAIT, it is only needed
to cache the timestamp per host then. Linux 2.4 optionally implements this
trick.

-Andi

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Jun 23 2000 - 21:00:22 EST