I've asked this one on comp.os.ms-windows.programmer.tools.winsock
before but could not find much help. So I try again here.
What I'd like to do is to increase the TCP window size for certain
connection by using setsockopt(). After much struggle I found that
I can use (SOL_SOCKET, SO_RVCBUF) or (IPPROTO_TCP, SO_RCVBUF)
options to do this, but only if the specified buffer size is less than
64 kB; if it exceeds this value, everything seems to work fine
(setsockopt() succeeds, and in the case of (SOL_SOCKET, SO_RVCBUF),
getsockopt() reports the specified buffer size, at least on Win2k/WinXP),
but the window size falls back to its standard value of ~8 kB.
Unfortunately, the above mentioned 64 kB are not enough (the connections
in questions are via a satellite link). I need something in the range of 350
kB.
How can I persuade Windows (both NT and 9x) to increase the windows
size above 64 kB (using 1323 enhancements)?
I know that I can adjust some registry settings, but then the increased
window size will apply to all connections, not only those that need it,
and this increased window size creates problems of its own.
The relevant options under
HKLM\CurrentControlSet\Services\TcpIp\Parameters
are Tcp1323Opts = 3, GlobalMaxTcpWindowSize = 1000000, and SackOpts = 1,
TcpWindowSize is not set.
I did not change anything below HKLM\CurrentControlSet\Services\AFD.
TIA
Tobias
Tobias <tob...@nospam.org> wrote in message
news:3c726378$0$29260$9b62...@news.freenet.de...
Thanks for your reply. I've already known these two articles. My problem is
that
I don't want to set the window size globally with the TcpWindowSize value,
yet if I use setsockopt() I can increase the window size only up to 2^16-1
Bytes,
even though I enabled the scaling windows option (and timestamps) by setting
Tcp1323Opts to 3 (under Services\TcpIP\Parameters; I did not configure
individual parameters). Once using a buffer of >= 64 kB in setsockopt(),
Win2k falls back to the standard ~ 16kB (or somtimes ~ 8 kB). I verified
this
with tcpdump, and also the throughput reaches only ~ 25 kB over the
satellite link
(instead if 200 kB with a window of 2^16 -1 Bytes).
So what is wrong?
Tobias
Tobias <tob...@nospam.org> wrote in message
news:3c734c9f$0$29258$9b62...@news.freenet.de...
no problem :-)
> but as Q199947 for NT it's impossible and stands that 64 K is max window
> size for NT.
Well, that's a pity, bit fortunately not my problem :). I only want to use
1323
on Win98/ME and NT 5.x.
> Q239705 for Win9x stands that's with Vtcp.386 it's do possible to read
> correctly Tcp1323Opts registry data
> but TcpWindowSize not in the list so it's the same as NT .
> As for W2K I didn't understand If you do set global as you wrote
> > even though I enabled the scaling windows option (and timestamps) by
setting
> > Tcp1323Opts to 3 (under Services\TcpIP\Parameters;
> is it work ( BTW you wrote about tcpdump , but it'd UNIX sniffer , maybe
you
> mean Windump , just interested ) ?
No and yes. No, it does not work, i.e., Win2k does not use TCP window
scaling
when I increase the buffer with setsockopt() above 64 kB (but it does work
if I
set TcpWindowSize; but once again: I only want to increase the window size
for connections that need it, i.e., connections over a satellite link);
on Win2k a value of 64 kB or more for the buffer in setsockopt() have
no effect at all (they don't even increase the TCP window to 64 kB, the
maximum
without 1323).
And yes, it's Windump, of course.
> And other question about numbers
> > (instead if 200 kB with a window of 2^16 -1 Bytes
> it's have to by 64 K , not 200 K ?
> How you can see with a sniffer a TcpWindowSize , it's global buffer size
> for send/receive , but sniffer shows individual
> frames ( packets ) with max of 1460 MSS ( in ethernet ) ?
> More questions then answer :)
> Arkady
The current size of the window is included in the header of every TCP packet
that is sent to the peer and just informs the peer how much data it can send
without the overflowing receiver's buffers. Just let Windump analyse the
header
and it will tell you what the window in each packet is. And it shows me a
maximum window of 2^16 - 1 Bytes and no window scaling.
Tobias
this is line from my WinDump :
10:56:30.237959 ARKADY-NT.1025 > 140.1.50.1.139: P 134:258(124) ack 40 win
8448 (DF)
do you mean 8448 in your situation is 64 K ?
But his is window field ( forth word of TCP header ( indexed from 1 ) ,
right WORD of it )
It cannot be more than 64 K because it take 16 bits in all ?
So is it really more that 64 K in the case of W2K
Excuse me my laziness to go to W2K ( I so stick to NT ) and change the
registry :)
TIA
Arkady
Tobias <tob...@nospam.org> wrote in message
news:3c73a0a4$0$12295$9b62...@news.freenet.de...
Next portion of questions :)
Some details to previous my message , as I see from Q224829 they use option
scale because this window size really cannot exceed 64K or Windump show it
like 64K*scale factor in this case ?
TIA
Arkady
arkadyf <ark...@hotmail.com> wrote in message
news:ud#UFphuBHA.2688@tkmsftngp07...
> Hi , Tobias !
> Oh , I see I need to ask more
>
> this is line from my WinDump :
> 10:56:30.237959 ARKADY-NT.1025 > 140.1.50.1.139: P 134:258(124) ack 40 win
> 8448 (DF)
>
> do you mean 8448 in your situation is 64 K ?
Yes, if I use setsockopt( sock, SOL_SOCKET, SO_RCVBUF, (1 << 16) - 1,
sizeof( int ) ).
> But his is window field ( forth word of TCP header ( indexed from 1 ) ,
> right WORD of it )
> It cannot be more than 64 K because it take 16 bits in all ?
Exactly. To increase the window size the two peers can agree during the
standard three-way TCP handshake that this field does NOT mean the window
but instead a negotiated multiple of this, e.g., twice as much. This is
called
window scaling (please refer to RFC 1323 for this, they can explain this
much
better than I :-)
> So is it really more that 64 K in the case of W2K
No, it is not larger, but if you set the TcpWindowSize value to something
above 64 kB, Win2k uses window scaling and so this window size field
in the TCP header means, say, twice as much as specified.
> Excuse me my laziness to go to W2K ( I so stick to NT ) and change the
> registry :)
> TIA
> Arkady
and later:
> Sorry forgot to add about your problems , but Q263088 state exactly this
,
> that you cannot in W2K use socket configuration but
> only global setting of TCPWindowSize and Q239705 that it's impossible
for
> 9x :(
I think you got something wrong here. If you set TcpWindowSize directly
under
HKLM\System\CurrentControlSet\Services\TcpIP\Parameters, Win2k uses this
window size for ALL connections (with window scaling if necessary).
You can also set TcpWindowSize under
HKLM\System\CurrentControlSet\Services\TcpIP\Parameters\Adapters\<some
interface>
and then Win2k will use this value as the window size for all connections on
this
interface, but Q263088 says that this does not work when this value exceeds
64 kB
because of a bug in the code that parses this calue. There's no such problem
if you use HKLM\System\CurrentControlSet\Services\TcpIP\Parameters instead.
> Next portion of questions :)
> Some details to previous my message , as I see from Q224829 they use
option
> scale because this window size really cannot exceed 64K or Windump show
it
> like 64K*scale factor in this case ?
> TIA
> Arkady
Windump analyzes only one packet at a time and does not keep track of
connections.
The scaling factor is negotiated during connection establishment, and
Windump
does not keep this information. If you want to know whether a particular TCP
connection
uses window scaling and what the real window is, you have to look at the
options
negotiated during connection establishment. Look out for option 3 in all TCP
packets
with the SYN flag set.
Tobias
Tobias <tob...@nospam.org> wrote in message
news:3c74971a$0$29268$9b62...@news.freenet.de...
Hi guys an thanx for this interesting thread.
I've a similar problem I think.
I need to tuned tcpwinsize in win98SE registry but the key I use doesn't
works. I see it when I sniff the network. I use DefaultRcvWindow (see
below), a string with a value of 65330 and w98 always uses the default
value of 6*MSS (8340 for me).
So if one of you make it works, I'll be very very gratefull to knox how
cause I try without success since a week.
Thanx
Gilles
Win 98 registry key :
HKLM\System\CurrentControlSet\Services\VxD\MSTCP
DefaultRcvWindow
Data Type: DWORD
For Windows 98, the Data Type is a String value.
gilles <gba...@ifrance.com> wrote in message
news:a5ivua$1447$1...@norfair.nerim.net...
> Hi guys an thanx for this interesting thread.
> I've a similar problem I think.
> I need to tuned tcpwinsize in win98SE registry but the key I use doesn't
> works. I see it when I sniff the network. I use DefaultRcvWindow (see
> below), a string with a value of 65330 and w98 always uses the default
> value of 6*MSS (8340 for me).
>
> So if one of you make it works, I'll be very very gratefull to knox how
> cause I try without success since a week.
>
> Thanx
> Gilles
>
> Win 98 registry key :
> HKLM\System\CurrentControlSet\Services\VxD\MSTCP
> DefaultRcvWindow
> Data Type: DWORD
> For Windows 98, the Data Type is a String value.
Hi Gilles,
we had the same problem. If I remember correctly, Win98SE,
as it comes out of the box, does not read the DefaultRcvWindow
value correctly. The following patch should solve your problem:
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q236926
(even though this article does not mention DefaultRcvWindow; just
give it a try).
Hope this helps
Tobias
Tobias <tob...@nospam.org> wrote in message
news:3c970440$0$158$9b62...@news.freenet.de...