From owner-freebsd-net@FreeBSD.ORG Fri Jun 24 05:08:11 2005 Return-Path: X-Original-To: freebsd-net@freebsd.org Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8E51616A41C for ; Fri, 24 Jun 2005 05:08:11 +0000 (GMT) (envelope-from demizu@dd.iij4u.or.jp) Received: from r-dd.iij4u.or.jp (r-dd.iij4u.or.jp [210.130.0.70]) by mx1.FreeBSD.org (Postfix) with ESMTP id 32D8543D49 for ; Fri, 24 Jun 2005 05:08:10 +0000 (GMT) (envelope-from demizu@dd.iij4u.or.jp) Received: from localhost (h219.p049.iij4u.or.jp [210.130.49.219]) by r-dd.iij4u.or.jp (4U-MR/r-dd) id j5O585uG001196; Fri, 24 Jun 2005 14:08:07 +0900 (JST) Date: Fri, 24 Jun 2005 14:07:26 +0900 (JST) Message-Id: <20050624.140726.43393126.Noritoshi@Demizu.ORG> From: Noritoshi Demizu To: freebsd-net@freebsd.org X-Mailer: Mew version 4.1 on Emacs 21 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: A burst from NewReno when a partial ACK is received X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2005 05:08:11 -0000 I'm using FreeBSD current for my experiences. I observed bursts sent by NewReno when a partial ACK is received. I have two packet traces of such bursts. One of such bursts is analyzed at http://www.demizu.org/~noritosi/memo/2005/0623/ . I think tcp_newreno_partial_ack() in tcp_input.c rev 1.275 has a bug in calculating a new value of snd_cwnd at the tail of the function. Currently, snd_cwnd is re-calculated as following: L.3113: tp->snd_cwnd -= (th->th_ack - tp->snd_una - tp->t_maxseg); Since snd_cwnd is u_long, if snd_cwnd < SEG.ACK - SND.UNA - MSS, snd_cwnd becomes awfully huge and a burst of data can be sent. To fix this problem, I'd like to suggest the patch below. Thanks. Regards, Noritoshi Demizu Index: tcp_input.c =================================================================== RCS file: /home/cvsup/FreeBSD/ncvs/src/sys/netinet/tcp_input.c,v retrieving revision 1.275 diff -u -r1.275 tcp_input.c --- tcp_input.c 1 Jun 2005 12:03:18 -0000 1.275 +++ tcp_input.c 23 Jun 2005 06:20:28 -0000 @@ -3110,7 +3112,11 @@ * Partial window deflation. Relies on fact that tp->snd_una * not updated yet. */ - tp->snd_cwnd -= (th->th_ack - tp->snd_una - tp->t_maxseg); + if (tp->snd_cwnd > th->th_ack - tp->snd_una) + tp->snd_cwnd -= th->th_ack - tp->snd_una; + else + tp->snd_cwnd = 0; + tp->snd_cwnd += tp->t_maxseg; } /*