I found in file "tcp_input.c-orig" located at location "usr/src/sys/netinet" at line number 511, "tp->request_r_scale" is incremented depending on condition. 16 bits are reserved for window and its value could be MAX 30 bits. In your if condition "TCP_MAXWIN << tp->request_r_scale < so->so_rcv.sb_hiwat", if I have "so->so_rcv.sb_hiwat" value to be 524286, then "tp->request_r_scale" is incremented four times but its value should be 3. Reason being, while shifting TCP_MAXWIN, 1st iteration 1111111111111111 < 1111111111111111110 [TRUE] increment once 2nd iteration 11111111111111110 < 1111111111111111110 [TRUE] increment again 3rd iteration 111111111111111100 < 1111111111111111110 [TRUE] increment once 4th iteration 1111111111111111000 < 1111111111111111110 [TRUE] increment again 5th iteration 11111111111111110000 < 1111111111111111110 [FALSE] The LSB are zeros, which should be one. Please tell me if I am wrong.
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.