[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CADVnQyk9xevY0kA9Sm9S9MOBNvcuiY+7YGBtGuoue+r+eizyOA@mail.gmail.com>
Date: Fri, 31 Jan 2020 10:10:03 -0500
From: Neal Cardwell <ncardwell@...gle.com>
To: sjpark@...zon.com
Cc: Eric Dumazet <edumazet@...gle.com>,
David Miller <davem@...emloft.net>, shuah@...nel.org,
Netdev <netdev@...r.kernel.org>, linux-kselftest@...r.kernel.org,
LKML <linux-kernel@...r.kernel.org>, sj38.park@...il.com,
aams@...zon.com, SeongJae Park <sjpark@...zon.de>,
Yuchung Cheng <ycheng@...gle.com>
Subject: Re: [PATCH 2/3] tcp: Reduce SYN resend delay if a suspicous ACK is received
On Fri, Jan 31, 2020 at 7:25 AM <sjpark@...zon.com> wrote:
>
> From: SeongJae Park <sjpark@...zon.de>
>
> When closing a connection, the two acks that required to change closing
> socket's status to FIN_WAIT_2 and then TIME_WAIT could be processed in
> reverse order. This is possible in RSS disabled environments such as a
> connection inside a host.
>
> For example, expected state transitions and required packets for the
> disconnection will be similar to below flow.
>
> 00 (Process A) (Process B)
> 01 ESTABLISHED ESTABLISHED
> 02 close()
> 03 FIN_WAIT_1
> 04 ---FIN-->
> 05 CLOSE_WAIT
> 06 <--ACK---
> 07 FIN_WAIT_2
> 08 <--FIN/ACK---
> 09 TIME_WAIT
> 10 ---ACK-->
> 11 LAST_ACK
> 12 CLOSED CLOSED
AFAICT this sequence is not quite what would happen, and that it would
be different starting in line 8, and would unfold as follows:
08 close()
09 LAST_ACK
10 <--FIN/ACK---
11 TIME_WAIT
12 ---ACK-->
13 CLOSED CLOSED
> 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,
AFAICT that is where the bug starts.
AFAICT, from first principles, when process A receives the FIN/ACK it
should move to TIME_WAIT even if it has not received a preceding ACK.
That's because ACKs are cumulative. So receiving a later cumulative
ACK conveys all the information in the previous ACKs.
Also, consider the de facto standard state transition diagram from
"TCP/IP Illustrated, Volume 2: The Implementation", by Wright and
Stevens, e.g.:
https://courses.cs.washington.edu/courses/cse461/19sp/lectures/TCPIP_State_Transition_Diagram.pdf
This first-principles analysis agrees with the Wright/Stevens diagram,
which says that a connection in FIN_WAIT_1 that receives a FIN/ACK
should move to TIME_WAIT.
This seems like a faster and more robust solution than installing
special timers.
Thoughts?
neal
Powered by blists - more mailing lists