From owner-freebsd-net@FreeBSD.ORG Tue Jan 11 01:37:52 2005 Return-Path: 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 C695B16A4CE for ; Tue, 11 Jan 2005 01:37:52 +0000 (GMT) Received: from rproxy.gmail.com (rproxy.gmail.com [64.233.170.195]) by mx1.FreeBSD.org (Postfix) with ESMTP id 360E143D49 for ; Tue, 11 Jan 2005 01:37:52 +0000 (GMT) (envelope-from grayas@gmail.com) Received: by rproxy.gmail.com with SMTP id z35so40964rne for ; Mon, 10 Jan 2005 17:37:51 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type:content-transfer-encoding; b=N+qEoV/VgJviQW02Oie2+iJIDfo0wExU+UlDBPTh8v0YjvlXO3NNrZZ3Yekc+Vo0nQJOmO6ysbkHp7RRjpKoD9VX0YnF1Z5lmShMLfwRGxmficRXWFjeCpJV4/M6l8Lp1qyKA11G13gSqi3COLm1vg0ZsjNA1q7BDCX/zmJ75Os= Received: by 10.38.82.44 with SMTP id f44mr85544rnb; Mon, 10 Jan 2005 17:37:51 -0800 (PST) Received: by 10.38.96.13 with HTTP; Mon, 10 Jan 2005 17:37:51 -0800 (PST) Message-ID: <9c9fb1860501101737268508be@mail.gmail.com> Date: Mon, 10 Jan 2005 17:37:51 -0800 From: Girish Rayas To: freebsd-net@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Bug in TCP window update? X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Girish Rayas List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Jan 2005 01:37:52 -0000 In tcp_input.c, window is updated when below condition is true, if ((thflags & TH_ACK) && (SEQ_LT(tp->snd_wl1, th->th_seq) || (tp->snd_wl1 == th->th_seq && (SEQ_LT(tp->snd_wl2, th->th_ack) || (tp->snd_wl2 == th->th_ack && tiwin > tp->snd_wnd))))) This check is to prevent old segments from affecting the send window. But, left trim logic that was executed earlier in tcp_input.c sets the th->th_seq to tp->rcv_nxt for old segments. In many scenarios this effectively causes snd_wl1 < th_seq and results in incorrect window update by old segments. Using actual sequence number of received segment in the above if statement will fix the problem. Any comments?