| Summary: | [tcp] TCP window scaling value calculated incorrectly? | ||
|---|---|---|---|
| Product: | Base System | Reporter: | Gaurav Goel <gaurav0287> |
| Component: | kern | Assignee: | Andre Oppermann <andre> |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | ||
| Priority: | Normal | ||
| Version: | 1.0-CURRENT | ||
| Hardware: | Any | ||
| OS: | Any | ||
|
Description
Gaurav Goel
2009-09-09 07:10:01 UTC
State Changed From-To: open->feedback To submitter: Firstly, tcp_input.c-orig is not a file distributed with FreeBSD. I suspect this is left over from a failed patch attempt to src/sys/netinet/tcp_input.c. Can you confirm that the problem exists in that file? Can you also please give the version number of the copy you are looking at, and the line numbers where the problem occurs? Thanks! Responsible Changed From-To: freebsd-bugs->gavin Track Dear Gavin, Version- Revision *1.192.2.1 *(check it on link " http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/netinet/tcp_usrreq.c") File- "src/sys/netinet/tcp_usrreq.c" Line No- 1101 Problem described as above Thanks, Gaurav Goel On Wed, Sep 9, 2009 at 6:13 PM, <gavin@freebsd.org> wrote: > Synopsis: TCP window scaling value > > State-Changed-From-To: open->feedback > State-Changed-By: gavin > State-Changed-When: Wed Sep 9 12:38:16 UTC 2009 > State-Changed-Why: > To submitter: Firstly, tcp_input.c-orig is not a file distributed with > FreeBSD. I suspect this is left over from a failed patch attempt to > src/sys/netinet/tcp_input.c. Can you confirm that the problem exists > in that file? Can you also please give the version number of the copy > you are looking at, and the line numbers where the problem occurs? > Thanks! > > > Responsible-Changed-From-To: freebsd-bugs->gavin > Responsible-Changed-By: gavin > Responsible-Changed-When: Wed Sep 9 12:38:16 UTC 2009 > Responsible-Changed-Why: > Track > > http://www.freebsd.org/cgi/query-pr.cgi?pr=138652 > -- Gaurav Goel Hello, I was having the older version. Now the same code segment is available in file "src/sys/netinet/tcp_usrreq.c" Thanks, Gaurav Goel On Wed, Sep 9, 2009 at 7:19 PM, Gaurav Goel <gaurav0287@gmail.com> wrote: > Dear Gavin, > > Version- Revision *1.192.2.1 *(check it on link " > http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/netinet/tcp_usrreq.c") > File- "src/sys/netinet/tcp_usrreq.c" > Line No- 1101 > > Problem described as above > > Thanks, > Gaurav Goel > -- Gaurav Goel State Changed From-To: feedback->open Over to maintainer(s) for investigation Responsible Changed From-To: gavin->freebsd-net Feedback was received, thanks! Dear Gavin,
Please find the fix for the problem:
*Replace*
* while (tp->request_r_scale < TCP_MAX_WINSHIFT &&
(TCP_MAXWIN << tp->request_r_scale) < sb_max)
tp->request_r_scale++;*
*With*
*unsigned int new_TCP_MAXWIN = TCP_MAXWIN;
while (tp->request_r_scale < TCP_MAX_WINSHIFT)
{
if(new_TCP_MAXWIN < sb_max)
tp->request_r_scale++;
else
break;**
** new_TCP_MAXWIN <<=1;**
** new_TCP_MAXWIN |=1;**
**}*
Please inform me if I am right/wrong.
Thanks,
Gaurav Goel
On Wed, Sep 9, 2009 at 7:59 PM, <gavin@freebsd.org> wrote:
> Old Synopsis: TCP window scaling value
> New Synopsis: TCP window scaling value calculated incorrectly?
>
> State-Changed-From-To: feedback->open
> State-Changed-By: gavin
> State-Changed-When: Wed Sep 9 14:24:24 UTC 2009
> State-Changed-Why:
> Over to maintainer(s) for investigation
>
>
> Responsible-Changed-From-To: gavin->freebsd-net
> Responsible-Changed-By: gavin
> Responsible-Changed-When: Wed Sep 9 14:24:24 UTC 2009
> Responsible-Changed-Why:
> Feedback was received, thanks!
>
> http://www.freebsd.org/cgi/query-pr.cgi?pr=138652
>
--
Gaurav Goel
Hi, May I know if someone is working on the bug. I have provided the solution too, but didn't get any response. Thanks, Gaurav Goel On Thu, Sep 10, 2009 at 7:00 PM, Gaurav Goel <gaurav0287@gmail.com> wrote: > Dear Gavin, > > Please find the fix for the problem: > > *Replace* > * while (tp->request_r_scale < TCP_MAX_WINSHIFT && > (TCP_MAXWIN << tp->request_r_scale) < sb_max) > tp->request_r_scale++;* > > *With* > *unsigned int new_TCP_MAXWIN = TCP_MAXWIN; > while (tp->request_r_scale < TCP_MAX_WINSHIFT) > { > if(new_TCP_MAXWIN < sb_max) > tp->request_r_scale++; > else > break;** > ** new_TCP_MAXWIN <<=1;** > ** new_TCP_MAXWIN |=1;** > **}* > > Please inform me if I am right/wrong. > > Thanks, > Gaurav Goel > > > On Wed, Sep 9, 2009 at 7:59 PM, <gavin@freebsd.org> wrote: > >> Old Synopsis: TCP window scaling value >> New Synopsis: TCP window scaling value calculated incorrectly? >> >> State-Changed-From-To: feedback->open >> State-Changed-By: gavin >> State-Changed-When: Wed Sep 9 14:24:24 UTC 2009 >> State-Changed-Why: >> Over to maintainer(s) for investigation >> >> >> Responsible-Changed-From-To: gavin->freebsd-net >> Responsible-Changed-By: gavin >> Responsible-Changed-When: Wed Sep 9 14:24:24 UTC 2009 >> Responsible-Changed-Why: >> Feedback was received, thanks! >> >> http://www.freebsd.org/cgi/query-pr.cgi?pr=138652 >> > > > > -- > Gaurav Goel > -- Gaurav Goel Responsible Changed From-To: freebsd-net->andre Take over. Gaurav The window scale computation as found in FreeBSD is indeed correct. The LSB have to be zero as the window is shiftet. The values of these bits are lost to the TCP window. We can't represent the LSB in the downshifted window field in the TCP header. -- Andre State Changed From-To: open->closed Not a bug but correct behavior. |