From owner-freebsd-net@FreeBSD.ORG Sun Apr 5 21:50:07 2009 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E4411065670 for ; Sun, 5 Apr 2009 21:50:07 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.cksoft.de (mail.cksoft.de [195.88.108.3]) by mx1.freebsd.org (Postfix) with ESMTP id 084C98FC1C for ; Sun, 5 Apr 2009 21:50:06 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id A09CD41C6FC; Sun, 5 Apr 2009 23:50:05 +0200 (CEST) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([195.88.108.3]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id vVdtwUB0c+OZ; Sun, 5 Apr 2009 23:50:05 +0200 (CEST) Received: by mail.cksoft.de (Postfix, from userid 66) id 3FFE941C6F2; Sun, 5 Apr 2009 23:50:05 +0200 (CEST) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 8844D4448E6; Sun, 5 Apr 2009 21:49:50 +0000 (UTC) Date: Sun, 5 Apr 2009 21:49:50 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: sthaug@nethelp.no In-Reply-To: <20090405.231044.74688369.sthaug@nethelp.no> Message-ID: <20090405214757.E15361@maildrop.int.zabbadoz.net> References: <20090405.231044.74688369.sthaug@nethelp.no> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-net@freebsd.org Subject: Re: IPv6 window scaling factor always 1 on initial SYN 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: Sun, 05 Apr 2009 21:50:07 -0000 On Sun, 5 Apr 2009, sthaug@nethelp.no wrote: > On 7-STABLE, with kern.ipc.maxsockbuf=2621440, both sides set a window > scaling factor of 6 (i.e. SYN wscale 6, SYN-ACK wscale 6) using IPv4. > > With the same value of kern.ipc.maxsockbuf, using IPv6, the side which > sends the initial SYN sets a window scaling factor of only 1, while > the other side sets a scaling factor of 6 in the SYN-ACK. This will > obviously limit throughput in many cases. > > In both cases net.inet.tcp.rfc1323=1. > > Anybody know why IPv6 behaves differently here? > > tcpdump example: > > 22:20:37.282415 IP 193.75.4.50.53981 > 193.75.110.66.5555: S 1580765626:1580765626(0) win 65535 > 22:20:37.282442 IP 193.75.110.66.5555 > 193.75.4.50.53981: S 1408884711:1408884711(0) ack 1580765627 win 65535 > > 22:21:49.749586 IP6 2001:8c0:9a00:1::2.53983 > 2001:8c0:8500:1::2.5555: S 565631163:565631163(0) win 65535 > 22:21:49.749633 IP6 2001:8c0:8500:1::2.5555 > 2001:8c0:9a00:1::2.53983: S 627173961:627173961(0) ack 565631164 win 65535 request_r_scale < TCP_MAX_WINSHIFT && 1112 (TCP_MAXWIN << tp->request_r_scale) < sb_max) ^^^^^^^^^^^ 1113 tp->request_r_scale++; and tcp6_connect 1174 /* Compute window scaling to request. */ 1175 while (tp->request_r_scale < TCP_MAX_WINSHIFT && 1176 (TCP_MAXWIN << tp->request_r_scale) < so->so_rcv.sb_hiwat) ^^^^^^^^^^^ 1177 tp->request_r_scale++; I'll have to check why they are un-equal... /bz -- Bjoern A. Zeeb The greatest risk is not taking one.