From owner-freebsd-net@FreeBSD.ORG Mon Aug 11 12:16:51 2014 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 372C8F73 for ; Mon, 11 Aug 2014 12:16:51 +0000 (UTC) Received: from mail-wi0-f180.google.com (mail-wi0-f180.google.com [209.85.212.180]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C30DC2DC8 for ; Mon, 11 Aug 2014 12:16:50 +0000 (UTC) Received: by mail-wi0-f180.google.com with SMTP id n3so4084885wiv.1 for ; Mon, 11 Aug 2014 05:16:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:content-type; bh=8JT8gd9IXxo6HxMcVbI3moGNgmZO+SAgWvUxjdreIUY=; b=N50f3nsK6NbWqy0QI+b1tC6keNxpMkCOIa2ZJrsH5zNkXBRaI20zylRZYe074Rkh64 C8LRFyyg++sFZBy8I6TRMZSRAVaFioYMEqbJn6DD5ctr/SZku3dqq8IqMy8ScYSzSZRw zkEg7c49nLddVyGsbI2RR8Bok4fE35uAzCsi3cPoKmPcDkO8VLM9Gi80ILlJ+MVlPMUG /AsuzaQ0vPqkF/YofM/m6IpPYKZhCMXoVdbwBa+UBMimnYiieOlRMSkk/L6wXIuMHXoM Z+CCGDhCGVNPqjbqPFZeo/nrCuX5QgSzvonYZo0rI0SKk1LRlicPpVz4iGClR/CN3lJp 9HXQ== X-Gm-Message-State: ALoCoQms27bjVYjlYCnU/yE43bVF8Pt3k9zsG/WrfTpufGTyUIMcBKqeWD/IblIMcrpzooQLn34L X-Received: by 10.180.86.1 with SMTP id l1mr6531120wiz.62.1407759402799; Mon, 11 Aug 2014 05:16:42 -0700 (PDT) Received: from [10.0.0.164] (84.94.198.183.cable.012.net.il. [84.94.198.183]) by mx.google.com with ESMTPSA id kt3sm1146350wjb.37.2014.08.11.05.16.42 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 11 Aug 2014 05:16:42 -0700 (PDT) Message-ID: <53E8B424.2000904@cloudius-systems.com> Date: Mon, 11 Aug 2014 15:16:36 +0300 From: Vlad Zolotarov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.7.0 MIME-Version: 1.0 To: freebsd-net@freebsd.org Subject: TCP Rx window auto sizing relies on TCP timestamp option? Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.18 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Aug 2014 12:16:51 -0000 Hi, I have the most strange question about the TCP Rx window auto sizing implementation in a FreeBSD networking stack. When I looked at the FreeBSD code (hash 9abce0e567c9a5a0520cdd94d5c633c7baf9a184) I noticed that the mentioned above feature will not be "enabled" if there isn't a TCP timestamp option present in the current TCP session: See sys/netinet/tcp_input.c: line 1813 in tcp_do_segment() function: if (V_tcp_do_autorcvbuf && *to.to_tsecr* && <-------- this is what I'm talking about (so->so_rcv.sb_flags & SB_AUTOSIZE)) So, if i read the code correctly, if there isn't a TS option (negotiated and thus present in every received packet) the receive socket buffer won't grow thus preventing the growth of the Rx window. If that's the case this is very strange since TS option is not promised and even more - in many cases it won't be present. For example in Linux this feature is disabled by default (controlled by /proc/sys/net/ipv4/tcp_timestamps). This is how I actually noticed the problem the first place: I ran iperf test where Linux was an initiator and a transmitter (iperf -c) FreeBSD box was a receiver (iperf -s) and I noticed that the Rx window wasn't opening up because Linux box hasn't negotiated the TS option in the SYN. As a result, the throughput numbers were significantly lower compared to Linux-to-Linux setup (Linux uses a Dynamic Right-Sizing (DRS) algorithm http://public.lanl.gov/radiant/pubs.html#DRS, which doesn't rely on TS). Could anybody comment on this, pls.? Did I miss anything? Is it true that FreeBSD assumes that TS option is always present and if not how can I cause an Rx Window to open up when TS option hasn't been negotiated? thanks in advance, vlad