From owner-freebsd-net@freebsd.org Thu Sep 3 13:41:11 2015 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C2D89C9E09 for ; Thu, 3 Sep 2015 13:41:11 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id F0F35B59 for ; Thu, 3 Sep 2015 13:41:10 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from Julian-MBP3.local (ppp121-45-243-143.lns20.per4.internode.on.net [121.45.243.143]) (authenticated bits=0) by vps1.elischer.org (8.15.2/8.15.2) with ESMTPSA id t83Dex5b001309 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Thu, 3 Sep 2015 06:41:03 -0700 (PDT) (envelope-from julian@freebsd.org) Subject: Re: Value of congestion window (cwnd) when loss is detected To: freebsd-net@freebsd.org References: <20150903005405.GN68814@strugglingcoder.info> <55E82B59.6000202@freebsd.org> From: Julian Elischer Message-ID: <55E84DE5.6000008@freebsd.org> Date: Thu, 3 Sep 2015 21:40:53 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <55E82B59.6000202@freebsd.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Sep 2015 13:41:11 -0000 On 9/3/15 7:13 PM, Lawrence Stewart wrote: > On 09/03/15 10:54, hiren panchasara wrote: >> I am failing to understand the reason behind this behavior. >> >> What should the congestion window (snd_cwnd) be set to when we hit loss? >> It seems that we set it to 1 segment right now. >> https://svnweb.freebsd.org/base/head/sys/netinet/tcp_input.c?revision=286227&view=markup#l2531 >> >> I also see that in the simulations I did. Sender side pcap can be found >> at: https://people.freebsd.org/~hiren/pcaps/single_packet_loss.pcap >> >> Trying to send 50kb of data from freebsd 10.2 server to freebsd client. >> Initial cwnd is 10 so we blast out 10 packets but 1 packet gets dropped: >> seq 2897:4345. We get 3 dupacks and we retransmit it. But as soon as we >> detect this loss, we reduce cwnd to 1 segment. In fact, we could've used >> data in SACK to see how much we could send on the n/w, imo. >> >> 3rd dup ack (which triggered the retransmit) looks like this: >> IP 192.168.11.10.41674 > 192.168.10.10.http: Flags [.], ack 2897, win >> 12579, options [nop,nop,TS val 4236220288 ecr 3905376863,nop,nop,sack 1 >> {4345:10137}], length 0 >> >> And the retransmit: >> IP 192.168.10.10.http > 192.168.11.10.41674: Flags [.], seq 2897:4345, >> ack 172, win 12579, options [nop,nop,TS val 3905376894 ecr 4236220288], >> length 1448 >> >> At this point in time, sender knows that it has sent 23169 bytes (last >> packet server sent was seq 21721:23169) and received ack for 10137 >> bytes minus a missing packet = 8689 bytes. i.e. 6 packets. So, there is >> at least that much room on n/w at that point in time. We can go >> conservative and halve that. i.e. 3 packets. That is still better than >> going down to 1 packet. >> >> Is there something basic I am missing here? >> Any insights would be helpful. > You want to read up about window inflation during fast recovery in RFC > 5681 followed by 3782, and then consult Stevens vol 2 to understand how > variables are used for different purposes depending on connection state > and which code path was taken (something I greatly dislike and would > love to change one day). how about today? > > Cheers, > Lawrence > _______________________________________________ > freebsd-net@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" >