[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200131150544.26333-1-sjpark@amazon.com>
Date: Fri, 31 Jan 2020 16:05:44 +0100
From: <sjpark@...zon.com>
To: David Laight <David.Laight@...LAB.COM>
CC: "'sjpark@...zon.com'" <sjpark@...zon.com>,
"edumazet@...gle.com" <edumazet@...gle.com>,
"davem@...emloft.net" <davem@...emloft.net>,
"shuah@...nel.org" <shuah@...nel.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kselftest@...r.kernel.org" <linux-kselftest@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"sj38.park@...il.com" <sj38.park@...il.com>,
"aams@...zon.com" <aams@...zon.com>,
SeongJae Park <sjpark@...zon.de>
Subject: Re: RE: [PATCH 0/3] Fix reconnection latency caused by FIN/ACK handling race
On Fri, 31 Jan 2020 14:00:27 +0000 David Laight <David.Laight@...LAB.COM> wrote:
> From: sjpark@...zon.com
> > Sent: 31 January 2020 12:24
> ...
> > The acks in lines 6 and 8 are the acks. If the line 8 packet is
> > processed before the line 6 packet, it will be just ignored as it is not
> > a expected packet, and the later process of the line 6 packet will
> > change the status of Process A to FIN_WAIT_2, but as it has already
> > handled line 8 packet, it will not go to TIME_WAIT and thus will not
> > send the line 10 packet to Process B. Thus, Process B will left in
> > CLOSE_WAIT status, as below.
> >
> > 00 (Process A) (Process B)
> > 01 ESTABLISHED ESTABLISHED
> > 02 close()
> > 03 FIN_WAIT_1
> > 04 ---FIN-->
> > 05 CLOSE_WAIT
> > 06 (<--ACK---)
> > 07 (<--FIN/ACK---)
> > 08 (fired in right order)
> > 09 <--FIN/ACK---
> > 10 <--ACK---
> > 11 (processed in reverse order)
> > 12 FIN_WAIT_2
>
> Why doesn't A treat the FIN/ACK (09) as valid (as if
> the ACK had got lost) and then ignore the ACK (10) because
> it refers to a closed socket?
Because the TCP protocol (RFC 793) doesn't have such speculation. TCP is
stateful protocol. Thus, packets arrived in unexpected state are not required
to be respected, AFAIU.
>
> I presume that B sends two ACKs (06 and 07) because it can
> sit in an intermediate state and the first ACK stops the FIN
> being resent?
I think there is no such presume in the protocol, either.
>
> I've implemented lots of protocols in my time, but not TCP.
If you find anything I'm misunderstanding, please don't hesitate to yell at me.
Hope the previous discussion[1] regarding this issue to be helpful.
Thanks,
SeongJae Park
[1] https://lore.kernel.org/bpf/20200129171403.3926-1-sjpark@amazon.com/
>
> David
>
> -
> Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
> Registration No: 1397386 (Wales)
Powered by blists - more mailing lists