Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Aug 2014 21:41:21 +0300
From:      Vladislav Zolotarov <vladz@cloudius-systems.com>
To:        hiren panchasara <hiren.panchasara@gmail.com>
Cc:        freebsd-net@freebsd.org
Subject:   Re: TCP Rx window auto sizing relies on TCP timestamp option?
Message-ID:  <CAOYyTHYeFnoBx=CLjr2Wat_=%2BzwwXQA53bWiv5oOGuepXtAZug@mail.gmail.com>
In-Reply-To: <CALCpEUG5cChteYa0JAYcf9gg%2Bfkd0vGkzBJ7DMw97NYXitMfUw@mail.gmail.com>
References:  <53E8B424.2000904@cloudius-systems.com> <CALCpEUG5cChteYa0JAYcf9gg%2Bfkd0vGkzBJ7DMw97NYXitMfUw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Aug 11, 2014 8:40 PM, "hiren panchasara" <hiren.panchasara@gmail.com>
wrote:
>
> On Mon, Aug 11, 2014 at 5:16 AM, Vlad Zolotarov
> <vladz@cloudius-systems.com> wrote:
> > 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?
>
> In my limited understanding, we (FreeBSD) want to base Rx window size
> increase on accurate RTT which is not possible if TS option is not
> negotiated. And that's why this requirement.
>
> Do you know how does it work in Linux?

Linux uses an algorithm mentioned above for estimating the RTT and that
algorithm doesn't require a TS. They use a TS if it is present though.

>
> cheers,
> Hiren



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAOYyTHYeFnoBx=CLjr2Wat_=%2BzwwXQA53bWiv5oOGuepXtAZug>