Link to home
Start Free TrialLog in
Avatar of h_mohsenian
h_mohsenian

asked on

Congestion Window Size ( How to measure it by application )

The number of frames that the sender is allowed to send before it must wait for an ACK is referred to as the SEND WINDOW. ( or congestion window size ).

Congestion Control algorithms such as AIMD ( Additive Increase Multiplicative Decrease ) or other algorithms in TCP Reno , Tahoe ,... versions adjust this window size.

Now assume that we have two end host computers ( win WINDOWS OS ) connected to INTERNET. now we run two applications in these computers and connect them by a WIN SOCKET. Is it possible to measure ( and know ) the window size during message transmission between two computers ? ( I mean in any time my Application can show me the WINDOW SIZE that is used to its TCP Connection Trasmissiom Control ). and more is it possible to adjust this window size directly by the application ( insteed of TCP algorithms )

best regard. Thanks

Avatar of _nn_
_nn_

Well, I did a bit of research and here's what I came up with (which isn't much, sorry) :

There are well-known ways to "tune" the MS TCP/IP stack by modifying entries of the registry (just for reference, the relevant KB URLs)
http://support.microsoft.com/default.aspx?scid=kb;EN-US;314053
http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/q120/6/42.asp&NoWebContent=1
http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/q158/4/74.asp&NoWebContent=1
but you clearly stated that you wanted dynamic operations on an already opened socket.

Browsing the APIs, I haven't found anything which would cut the mustard. The best shot is possibly the PVD_CONFIG option, but this structure is opaque (undocumented) and I recall reading somewhere (sorry, I lost the URL) that the MS implementation doesn't return anything useful in there anyway...

An option could be to try to use a third-party stack which would provide the functionality you're looking for. Following URL may eventually help you :
http://directory.google.com/Top/Computers/Internet/Protocols/Transmission_Protocols/TCP/Implementations/
(The Mentat one looked interesting...)

This said, I'm not an uber-expert of Windows Sockets, I made that short digging just because I found the topic very interesting, and I may have missed something. Hopefully some Expert will have a better answer... In any case, I'd like to hear about your advancing around this issue, if you don't mind. In other words, please keep us updated :)
Avatar of h_mohsenian

ASKER

Ok, thanks for your cooperation :-) , but what about my main question which is to KNOW this SEND window size ? Did you find any thing related to it ? if you could find please tell me, Thanks
I haven't found a way to get the information out of an opened socket. Again, maybe someone else more knowledgeable would know. Perhaps there could be something in some SNMP agent, but I don't hope much here and didn't bother verifying...

At this stage, assuming I'd be facing the same problem, I would start thinking about a separate thread in my application and sniffing my own traffic. http://winpcap.polito.it/ and http://www.ethereal.com are good pointers I think.
Avatar of bbao
hi h_mohsenian, how is your problem? sovled or not? if you need further help, please let me know. cheers, bbao
ASKER CERTIFIED SOLUTION
Avatar of bbao
bbao
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
PAQed - no points refunded (of 500)

modulo
Community Support Moderator
hi modulo, it seems that you dont think the above official solution in my last comment is the answer? ;)

> now we run two applications in these computers and connect them by a WIN SOCKET. Is it possible to measure ( and know ) the window size during message transmission between two computers? ( I mean in any time my Application can show me the WINDOW SIZE that is used to its TCP Connection Trasmissiom Control ).

yes. it is possible. by access attribute TcpWindowSize (uint16) of class Win32_NetworkAdapterConfiguration of WMI Win32, you can learn the window size.

> and more is it possible to adjust this window size directly by the application ( insteed of TCP algorithms )

yes, it is also possible. by calling SetTcpWindowSize static method in class Win32_NetworkAdapterConfiguration, you can adjuest the window size.

so, personally, i think my comments should be accepted as the answer, dont you think so? :)

regards,
bbao
Hi,

bbao, thank you very much for your consideration.

1) About the question: It is a very old question. In fact, after I could not find the answer of what I asked, I modified my target to handle my need. At the present time, unfortunately I am not in an appropriate position to test the answer.

2) I just read what you wrote, it seems that it can be a good answer. (as I said, I did not test it). NOW I AM HERE TO ACCEPT YOUR ANSWER. but it seems the clean up process, ignored the question and I can not select one answer as the ACCEPTED ANSWER. if "modulo" can changed the situation I will be able to accept the answer, if not, sorry to "bbao" and once again thanks for his/her comments.

regards,
Hamed
hi h_mohsenian and modulo,

thanks for your feedback, consideration and effort.

as for the reason of i claiming for the accepted answer, i do expect that every PAQ has a right answer, even it is PAQed during cleanup stage, this will make EE much valuable to the people who search EE's KB for answers. so everyone may benefit more from EE, including myself. :)

cheers,
bbao