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. Advertisements

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:
    590
    Dino Chiesa [Microsoft]
    Oct 15, 2003
  2. John Davis
    Replies:
    0
    Views:
    953
    John Davis
    Aug 21, 2003
  3. Wolfgang
    Replies:
    5
    Views:
    1,757
    Tris Orendorff
    Feb 19, 2004
  4. praba kar
    Replies:
    2
    Views:
    1,067
    Paul Rubin
    May 4, 2005
  5. Kottiyath
    Replies:
    4
    Views:
    405
    Bryan Olson
    Dec 23, 2008
  6. Rob Raad
    Replies:
    1
    Views:
    571
    diamondwxp
    Oct 10, 2003
  7. Anil
    Replies:
    1
    Views:
    773
    Jean-Luc David [MS-MVP]
    Jul 31, 2004
  8. John Davis
    Replies:
    0
    Views:
    509
    John Davis
    Aug 21, 2003
Loading...