How relevant is "Automatic TCP Window Tuning" in Networking Applications ?

Discussion in 'C++' started by sherkhan, Feb 2, 2007.

  1. sherkhan

    sherkhan Guest

    Hello Everyone.

    I have come across this article (http://dast.nlanr.net/Projects/
    Autobuf_v1.0/autotcp.html) called "Automatic TCP window tuning". After
    my first newbie file transfer I wrote and found that it was just
    extremely slow over net, compared to http or ftp. I have been thinking
    of reasons. After reading the article I modified the server and
    clients.. in the following way..

    server...
    /*setting socket Opttions to windows size to 780K.. 780 * 1024
    */
    int window_size = 2000 * 1024;
    mySocket = socket(AF_INET, SOCK_STREAM, 0);
    setsockopt(mySocket, SOL_SOCKET, SO_SNDBUF,
    (char *) &window_size, sizeof(window_size));
    setsockopt(mySocket, SOL_SOCKET, SO_RCVBUF,
    (char *) &window_size, sizeof(window_size));

    on client...

    /*set Socket Option.. 1000 * 1024*/
    int window_size = 780 * 1024;
    s = socket(AF_INET, SOCK_STREAM, 0);
    setsockopt(s, SOL_SOCKET, SO_SNDBUF,
    (char *) &window_size, sizeof(window_size));
    setsockopt(s, SOL_SOCKET, SO_RCVBUF,
    (char *) &window_size, sizeof(window_size));
    /*End Of set Socket Option*/

    with this I got a better transfer rate.. I mean 10 times faster. :)
    its even better in LAN. I got 1 GB transfered in 200 secs. faster than
    it took to create the file.

    Now I have a question, do Apache (HTTP server) and FTP servers employ
    such a TCP window tunning. Is it hard coded ( I mean is there a
    optimum value known ?) for all types of networks ?
    since even when I download a file through HTTP its nearly the same
    speed, as I achieved by increasing the TCP window.

    cheers.
    sherkhan, Feb 2, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jim
    Replies:
    1
    Views:
    423
    Dino Chiesa [Microsoft]
    Oct 15, 2003
  2. =?Utf-8?B?RGFuaWVs?=

    Search for relevant control

    =?Utf-8?B?RGFuaWVs?=, Sep 4, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    329
    Mark Rae
    Sep 4, 2005
  3. clintonG
    Replies:
    3
    Views:
    10,238
    mrbongo
    Jun 15, 2007
  4. Pingo
    Replies:
    2
    Views:
    326
    Thomas G. Marshall
    Sep 18, 2004
  5. Kottiyath
    Replies:
    4
    Views:
    319
    Bryan Olson
    Dec 23, 2008
Loading...

Share This Page