# TCP WS option. - TCP-IP

This is a discussion on TCP WS option. - TCP-IP ; I am trying to understand TCP WS option and i have the following question: 1. How can a receiver advertise less the 2^14 bits window when TCP WS option is used. Assume a HOST A advertises WS factor of 14 ...

1. ## TCP WS option.

I am trying to understand TCP WS option and i have the following
question:

1. How can a receiver advertise less the 2^14 bits window when TCP WS
option is used.
Assume a HOST A advertises WS factor of 14 in its syn packet and hand
shake is complete. During the process of receiving data sent from the
peer, HOST A now has window less than 2^14 bits. While sending ACK,
before putting the window value in the TCP header, HOST A will do the
right shift window value by 14 bits and the resulting value will be
assigened to header field. By right shifting 14bits effective window
value will be zero, since window itself is less than 2^14 bits.

Is my understing correct ? if yes, will cause any problem?

Thanks,

2. ## Re: TCP WS option.

wrote in message
>I am trying to understand TCP WS option and i have the following
> question:
>
> 1. How can a receiver advertise less the 2^14 bits window when TCP WS
> option is used.
> Assume a HOST A advertises WS factor of 14 in its syn packet and hand
> shake is complete. During the process of receiving data sent from the
> peer, HOST A now has window less than 2^14 bits. While sending ACK,
> before putting the window value in the TCP header, HOST A will do the
> right shift window value by 14 bits and the resulting value will be
> assigened to header field. By right shifting 14bits effective window
> value will be zero, since window itself is less than 2^14 bits.
>
> Is my understing correct ? if yes, will cause any problem?
>
> Thanks,

This might help :

3. ## Re: TCP WS option.

>> 1. How can a receiver advertise less the 2^14 bits window when TCP WS
>> option is used.
>> Assume a HOST A advertises WS factor of 14 in its syn packet and hand
>> shake is complete. During the process of receiving data sent from the
>> peer, HOST A now has window less than 2^14 bits. While sending ACK,
>> before putting the window value in the TCP header, HOST A will do the
>> right shift window value by 14 bits and the resulting value will be
>> assigened to header field. By right shifting 14bits effective window
>> value will be zero, since window itself is less than 2^14 bits.

If the advertized window is 1000, and the WS factor is 14,
then the advertizing window is 1000*2^14 or 16384000000

You "lose" the ability to precisely specify small windows. Or rather
the system rounds up to the nearest 2^14 value:
0 0
1 16384
2 32768
1000 16384000000
etc.

--
Posted via a free Usenet account from http://www.teranews.com

4. ## Re: TCP WS option.

"eager" wrote in message
news:mtrfj.2425\$EA5.1952@pd7urf2no...
>
>
> This might help :
>

>
>

Maybe a bit too "eager"? Your link seems unrelated to the question of
window scaling.

5. ## Re: TCP WS option.

"Michael K. O'Neill" wrote in message
news:jcCfj.82345\$Um6.879@newssvr12.news.prodigy.ne t...
>
> "eager" wrote in message
> news:mtrfj.2425\$EA5.1952@pd7urf2no...
>>
>>
>> This might help :
>>

>>
>>

>
> Maybe a bit too "eager"? Your link seems unrelated to the question of
> window scaling.
>
>

WS is widely known as web services...

6. ## Re: TCP WS option.

"eager" writes:

> WS is widely known as web services...

But when the OP first said

"I am trying to understand TCP WS option"

And then talks about windows, then "web services" makes no sense in
this content.

--
Posted via a free Usenet account from http://www.teranews.com

7. ## Re: TCP WS option.

"Bruce Barnett" wrote in message
news:yek3atafnuo.fsf@mail.grymoire.com...
> "eager" writes:
>
>> WS is widely known as web services...

>
> But when the OP first said
>
> "I am trying to understand TCP WS option"
>
> And then talks about windows, then "web services" makes no sense in
> this content.
>
> --
> Posted via a free Usenet account from http://www.teranews.com
>

agreed

8. ## Re: TCP WS option.

Bruce Barnett writes:

> If the advertized window is 1000, and the WS factor is 14,
> then the advertizing window is 1000*2^14 or 16384000000

Oops. I meant 1000*2^14 or 16384000

In further discussion with Manesh, we discussed the case when the
window scale was set to 14, and the application's buffer was set to
8K.

Now this could be a configuration error, or it might happen if the
system default is WS=14, but an application, unaware of RFC1323,
specifically sets the buffer to 8K - which is common in old programs.

It is therefore theoretically possible that the application can never
advertise available memory, because the smallest amount it can
advertise is 16K. It would be "stalled."

It seems to me that the OS should check for this condition, and only
set a window scale factor that matches the buffer allocated. In other
words, only use the window scale feature if the buffer is > 64K.

If the buffer is 1GB, then set the window scale to 14.
512MB, then WS=13,
128K, WS=2, etc.

This makes sense. But I'm not sure what real world implementations do.
Does anyone know if this is the typical approach?

--
Posted via a free Usenet account from http://www.teranews.com

9. ## Re: TCP WS option.

In article ,
Bruce Barnett wrote:

> It seems to me that the OS should check for this condition, and only
> set a window scale factor that matches the buffer allocated. In other
> words, only use the window scale feature if the buffer is > 64K.
>
> If the buffer is 1GB, then set the window scale to 14.
> 512MB, then WS=13,
> 128K, WS=2, etc.
>
> This makes sense. But I'm not sure what real world implementations do.
> Does anyone know if this is the typical approach?

I think it is. Basically, WS is generally only used to the extent it's
needed.

The other thing I think some systems do is round up the actual buffer
space allocated from what the application requests. I.e. if the
application asks for an 8KB buffer, it's actually saying "I need AT
LEAST 8KB". If the OS/stack designer feels they can afford it, they can
make the buffer bigger, and then use an appropriate WS factor.

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***