Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Nov 2016 21:20:20 +0100
From:      Michael Tuexen <tuexen@freebsd.org>
To:        freebsd-transport@freebsd.org
Subject:   Loss recovery at tail
Message-ID:  <3A9A8225-A296-408F-BEC5-3E9CEFB65AF0@freebsd.org>

next in thread | raw e-mail | index | archive | help

--Apple-Mail=_77C21147-D552-44F3-9DE4-709B3D89FE87
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=us-ascii

Dear all,

in the last telco we discussed the behaviour when that last N packets =
are dropped.
It was mentioned that multiple retransmission timers where used to =
recover.

I wrote a packetdrill script which
* Get the cwnd to 30 segments
* Sends 30 segments, which all get lost
* Observe how the 30 dropped segments are retransmitted.

It uses only a single timeout as one would expect.
So this script does NOT reproduce the problem, but I'm attaching it such =
that
you can see how the stack behaves.
Tested with FreeBSD head r308802.

If you have more details, please let me know.

Best regards
Michael


--Apple-Mail=_77C21147-D552-44F3-9DE4-709B3D89FE87
Content-Disposition: attachment;
	filename=tail_loss.pkt
Content-Type: application/octet-stream;
	x-unix-mode=0644;
	name="tail_loss.pkt"
Content-Transfer-Encoding: 7bit

//
// Copyright (c) 2016 Michael Tuexen
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
//    notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
//    notice, this list of conditions and the following disclaimer in the
//    documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
// SUCH DAMAGE.
//

--ip_version=ipv4
--tolerance_usecs=50000

// Emulating an RTT of 10ms and a peer's delayed ack timer of 100ms.

 0.00 `sysctl -w net.inet.tcp.hostcache.purgenow=1`
+0.00 `sysctl -w net.inet.tcp.initcwnd_segments=10`
+0.00 `sysctl -w net.inet.tcp.rfc3465=1`
+0.00 `sysctl net.inet.tcp.abc_l_var=2`
// Create a TCP endpoint in the ESTABLISHED state.
+0.00 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3
+0.00 fcntl(3, F_GETFL) = 0x02 (flags O_RDWR)
+0.00 fcntl(3, F_SETFL, O_RDWR | O_NONBLOCK) = 0
+0.00 getsockopt(3, SOL_SOCKET, SO_RCVBUF, [65536], [4]) = 0
+0.00 connect(3, ..., ...) = -1 EINPROGRESS (Operation now in progress)
+0.00 > S  0:0(0) win 65535 <mss 1460,nop,wscale 6,sackOK,TS val 100 ecr 0>
+0.01 < S. 0:0(0) ack 1 win 65535 <mss 1000>
+0.00 >  . 1:1(0) ack 1 win 65535
+0.00 %{ assert tcpi_snd_cwnd == 10000 }%
// Verify that there are no errors pending at the socket layer.
+0.01 getsockopt(3, SOL_SOCKET, SO_ERROR, [0], [4]) = 0
// Now it is in the ESTABLISHED state.
+0.00 %{ assert tcpi_snd_cwnd == 10000 }%
+0.00 write(3, ..., 20000) = 20000
+0.00 >  . 1:1001(1000) ack 1 win 65535
+0.00 >  . 1001:2001(1000) ack 1 win 65535
+0.00 >  . 2001:3001(1000) ack 1 win 65535
+0.00 >  . 3001:4001(1000) ack 1 win 65535
+0.00 >  . 4001:5001(1000) ack 1 win 65535
+0.00 >  . 5001:6001(1000) ack 1 win 65535
+0.00 >  . 6001:7001(1000) ack 1 win 65535
+0.00 >  . 7001:8001(1000) ack 1 win 65535
+0.00 >  . 8001:9001(1000) ack 1 win 65535
+0.00 >  . 9001:10001(1000) ack 1 win 65535
+0.01 <  . 1:1(0) ack 1001 win 65535
+0.00 %{ assert tcpi_snd_cwnd == 11000 }%
+0.00 >  . 10001:11001(1000) ack 1 win 65535
+0.00 >  . 11001:12001(1000) ack 1 win 65535
+0.00 <  . 1:1(0) ack 3001 win 65535
+0.00 %{ assert tcpi_snd_cwnd == 13000 }%
+0.00 >  . 12001:13001(1000) ack 1 win 65535
+0.00 >  . 13001:14001(1000) ack 1 win 65535
+0.00 >  . 14001:15001(1000) ack 1 win 65535
+0.00 >  . 15001:16001(1000) ack 1 win 65535
+0.00 <  . 1:1(0) ack 5001 win 65535
+0.00 %{ assert tcpi_snd_cwnd == 15000 }%
+0.00 >  . 16001:17001(1000) ack 1 win 65535
+0.00 >  . 17001:18001(1000) ack 1 win 65535
+0.00 >  . 18001:19001(1000) ack 1 win 65535
+0.00 > P. 19001:20001(1000) ack 1 win 65535
+0.00 <  . 1:1(0) ack 7001 win 65535
+0.00 %{ assert tcpi_snd_cwnd == 17000 }%
+0.00 <  . 1:1(0) ack 9001 win 65535
+0.00 %{ assert tcpi_snd_cwnd == 19000 }%
+0.00 <  . 1:1(0) ack 11001 win 65535
+0.00 %{ assert tcpi_snd_cwnd == 21000 }%
+0.00 <  . 1:1(0) ack 13001 win 65535
+0.00 %{ assert tcpi_snd_cwnd == 23000 }%
+0.00 <  . 1:1(0) ack 15001 win 65535
+0.00 %{ assert tcpi_snd_cwnd == 25000 }%
+0.00 <  . 1:1(0) ack 17001 win 65535
+0.00 %{ assert tcpi_snd_cwnd == 27000 }%
+0.00 <  . 1:1(0) ack 19001 win 65535
+0.00 %{ assert tcpi_snd_cwnd == 29000 }%
+0.10 <  . 1:1(0) ack 20001 win 65535
+0.00 %{ assert tcpi_snd_cwnd == 30000 }%
+0.10 write(3, ..., 30000) = 30000
+0.00 >  . 20001:21001(1000) ack 1 win 65535
+0.00 >  . 21001:22001(1000) ack 1 win 65535
+0.00 >  . 22001:23001(1000) ack 1 win 65535
+0.00 >  . 23001:24001(1000) ack 1 win 65535
+0.00 >  . 24001:25001(1000) ack 1 win 65535
+0.00 >  . 25001:26001(1000) ack 1 win 65535
+0.00 >  . 26001:27001(1000) ack 1 win 65535
+0.00 >  . 27001:28001(1000) ack 1 win 65535
+0.00 >  . 28001:29001(1000) ack 1 win 65535
+0.00 >  . 29001:30001(1000) ack 1 win 65535
+0.00 >  . 30001:31001(1000) ack 1 win 65535
+0.00 >  . 31001:32001(1000) ack 1 win 65535
+0.00 >  . 32001:33001(1000) ack 1 win 65535
+0.00 >  . 33001:34001(1000) ack 1 win 65535
+0.00 >  . 34001:35001(1000) ack 1 win 65535
+0.00 >  . 35001:36001(1000) ack 1 win 65535
+0.00 >  . 36001:37001(1000) ack 1 win 65535
+0.00 >  . 37001:38001(1000) ack 1 win 65535
+0.00 >  . 38001:39001(1000) ack 1 win 65535
+0.00 >  . 39001:40001(1000) ack 1 win 65535
+0.00 >  . 40001:41001(1000) ack 1 win 65535
+0.00 >  . 41001:42001(1000) ack 1 win 65535
+0.00 >  . 42001:43001(1000) ack 1 win 65535
+0.00 >  . 43001:44001(1000) ack 1 win 65535
+0.00 >  . 44001:45001(1000) ack 1 win 65535
+0.00 >  . 45001:46001(1000) ack 1 win 65535
+0.00 >  . 46001:47001(1000) ack 1 win 65535
+0.00 >  . 47001:48001(1000) ack 1 win 65535
+0.00 >  . 48001:49001(1000) ack 1 win 65535
+0.00 > P. 49001:50001(1000) ack 1 win 65535
+0.00 %{ assert tcpi_snd_cwnd == 30000 }%
*     >  . 20001:21001(1000) ack 1 win 65535
+0.00 %{ assert tcpi_snd_cwnd == 1000 and tcpi_snd_ssthresh == 15000}%
+0.11 <  . 1:1(0) ack 21001 win 65535
+0.00 %{ assert tcpi_snd_cwnd == 2000 and tcpi_snd_ssthresh == 15000}%
+0.00 >  . 21001:22001(1000) ack 1 win 65535
+0.00 >  . 22001:23001(1000) ack 1 win 65535
+0.01 <  . 1:1(0) ack 23001 win 65535
+0.00 %{ assert tcpi_snd_cwnd == 3000 and tcpi_snd_ssthresh == 15000}%
+0.00 >  . 23001:24001(1000) ack 1 win 65535
+0.00 >  . 24001:25001(1000) ack 1 win 65535
+0.00 >  . 25001:26001(1000) ack 1 win 65535
+0.01 <  . 1:1(0) ack 25001 win 65535
+0.00 %{ assert tcpi_snd_cwnd == 4000 and tcpi_snd_ssthresh == 15000}%
+0.00 >  . 26001:27001(1000) ack 1 win 65535
+0.00 >  . 27001:28001(1000) ack 1 win 65535
+0.00 >  . 28001:29001(1000) ack 1 win 65535
+0.01 <  . 1:1(0) ack 27001 win 65535
+0.00 %{ assert tcpi_snd_cwnd == 5000 and tcpi_snd_ssthresh == 15000}%
+0.00 >  . 29001:30001(1000) ack 1 win 65535
+0.00 >  . 30001:31001(1000) ack 1 win 65535
+0.00 >  . 31001:32001(1000) ack 1 win 65535
+0.00 <  . 1:1(0) ack 29001 win 65535
+0.00 %{ assert tcpi_snd_cwnd == 6000 and tcpi_snd_ssthresh == 15000}%
+0.00 >  . 32001:33001(1000) ack 1 win 65535
+0.00 >  . 33001:34001(1000) ack 1 win 65535
+0.00 >  . 34001:35001(1000) ack 1 win 65535
+0.01 <  . 1:1(0) ack 31001 win 65535
+0.00 %{ assert tcpi_snd_cwnd == 7000 and tcpi_snd_ssthresh == 15000}%
+0.00 >  . 35001:36001(1000) ack 1 win 65535
+0.00 >  . 36001:37001(1000) ack 1 win 65535
+0.00 >  . 37001:38001(1000) ack 1 win 65535
+0.00 <  . 1:1(0) ack 33001 win 65535
+0.00 %{ assert tcpi_snd_cwnd == 8000 and tcpi_snd_ssthresh == 15000}%
+0.00 >  . 38001:39001(1000) ack 1 win 65535
+0.00 >  . 39001:40001(1000) ack 1 win 65535
+0.00 >  . 40001:41001(1000) ack 1 win 65535
+0.00 <  . 1:1(0) ack 35001 win 65535
+0.00 %{ assert tcpi_snd_cwnd == 9000 and tcpi_snd_ssthresh == 15000}%
+0.00 >  . 41001:42001(1000) ack 1 win 65535
+0.00 >  . 42001:43001(1000) ack 1 win 65535
+0.00 >  . 43001:44001(1000) ack 1 win 65535
+0.01 <  . 1:1(0) ack 37001 win 65535
+0.00 %{ assert tcpi_snd_cwnd == 10000 and tcpi_snd_ssthresh == 15000}%
+0.00 >  . 44001:45001(1000) ack 1 win 65535
+0.00 >  . 45001:46001(1000) ack 1 win 65535
+0.00 >  . 46001:47001(1000) ack 1 win 65535
+0.00 <  . 1:1(0) ack 39001 win 65535
+0.00 %{ assert tcpi_snd_cwnd == 11000 and tcpi_snd_ssthresh == 15000}%
+0.00 >  . 47001:48001(1000) ack 1 win 65535
+0.00 >  . 48001:49001(1000) ack 1 win 65535
+0.00 > P. 49001:50001(1000) ack 1 win 65535
+0.00 <  . 1:1(0) ack 41001 win 65535
+0.00 %{ assert tcpi_snd_cwnd == 13000 and tcpi_snd_ssthresh == 15000}%
+0.00 <  . 1:1(0) ack 43001 win 65535
+0.00 %{ assert tcpi_snd_cwnd == 15000 and tcpi_snd_ssthresh == 15000}%
+0.00 <  . 1:1(0) ack 45001 win 65535
+0.00 %{ assert tcpi_snd_cwnd == 17000 and tcpi_snd_ssthresh == 15000}%
+0.00 <  . 1:1(0) ack 47001 win 65535
+0.00 %{ assert tcpi_snd_cwnd == 17000 and tcpi_snd_ssthresh == 15000}%
+0.00 <  . 1:1(0) ack 49001 win 65535
+0.00 %{ assert tcpi_snd_cwnd == 17000 and tcpi_snd_ssthresh == 15000}%
+0.10 <  . 1:1(0) ack 50001 win 65535
+0.00 %{ assert tcpi_snd_cwnd == 17000 and tcpi_snd_ssthresh == 15000}%

// Tear it down.
+0.00 close(3) = 0
+0.00 > F. 50001:50001(0) ack 1 win 65535
+0.10 < F. 1:1(0) ack 50002 win 65535
+0.00 >  . 50002:50002(0) ack 2 win 65534

--Apple-Mail=_77C21147-D552-44F3-9DE4-709B3D89FE87--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3A9A8225-A296-408F-BEC5-3E9CEFB65AF0>