Bug 15095 - TCP's advertised window is not scaled immediately upon discovering use of Window scale option
Summary: TCP's advertised window is not scaled immediately upon discovering use of Win...
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 3.3-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-net (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 1999-11-26 03:20 UTC by aron
Modified: 2016-12-22 18:28 UTC (History)
2 users (show)

See Also:


Attachments
file.diff (596 bytes, patch)
1999-11-26 03:20 UTC, aron
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description aron 1999-11-26 03:20:00 UTC
The FreeBSD implementation does not scale the advertised window
immediately when it discovers that window scaling is being used. The result
is that irrespective of advertised window, in the first round-trip after
connection establishment, a FreeBSD TCP sender cannot send more data than
the unscaled value of advertised window.

One can argue that this is not important given that TCP does slow-start in
the first round-trip. Well, people are looking at rate-based pacing where
you don't have to do slow-start. Also the above is important in LANs where
FreeBSD doesn't use slow-start. In my case, I'm emulating a WAN to see
the benefits of rate-based pacing and so is extremely important.

Fix: The following patch applied to /sys/netinet/tcp_input.c fixes the problem:
How-To-Repeat: Try running a TCP transfer over an emulated (or an actual) WAN. Make
sure that slow-start is turned off (it is if FreeBSD thinks its operating 
on a LAN - i.e the other host has the same subnet address). Also ensure
that RFC1323 is being used (i.e. Window scaling is in effect) and the
flow control window is big enough on the TCP receiver. Use tcpdump to
check the number of packets sent in the first round-trip - these will
correspond to the unscaled value of the advertised window.

A simpler method to repeat the problem is to instrument the kernel
to print out the value of the variable tp->snd_wnd when TCP starts
sending data. You'll see that it corresponds to the unscaled value of
the flow control (or advertised) window.
Comment 1 Poul-Henning Kamp freebsd_committer freebsd_triage 2001-06-06 22:06:02 UTC
Responsible Changed
From-To: freebsd-bugs->jlemon

over to a true TCP geek...
Comment 2 Bruce M Simpson freebsd_committer freebsd_triage 2004-06-22 16:42:10 UTC
Responsible Changed
From-To: jlemon->freebsd-net

Throw this one over to the -net list.
Comment 3 Andre Oppermann freebsd_committer freebsd_triage 2004-08-24 20:43:24 UTC
Responsible Changed
From-To: freebsd-net->andre

Take over.
Comment 4 Andre Oppermann freebsd_committer freebsd_triage 2006-02-18 21:01:20 UTC
State Changed
From-To: open->analyzed

A bit late but here we go: 
http://people.freebsd.org/~andre/tcp_sndwnd-20060218.diff 

Many things changed since the PR so this not based on the 
submitted patch at all.
Comment 5 K. Macy freebsd_committer freebsd_triage 2007-11-16 08:37:38 UTC
Responsible Changed
From-To: andre->silby


Please follow up or assign to me.
Comment 6 Mark Linimon freebsd_committer freebsd_triage 2015-11-12 01:25:53 UTC
Reassign to the wild with permission of assignee.

To submitter: is this PR still relevant?
Comment 7 Hiren Panchasara freebsd_committer freebsd_triage 2016-12-22 18:28:45 UTC
r156125 by andre@