in reply to Re^5: changing tcp parameters when establishing connection
in thread changing tcp parameters when establishing connection

What you are describing is this:

  1. If your tcpip stack supports window scaling;
  2. And if it is enabled for your machine and your userid/group;
  3. And if you set the receive buffer size immediately after connect
  4. And if the remote host tcpip stack also supports window scaling;
  5. And if it is enabled;
  6. And if all the firewalls, gateway devices and bridges between the ends support window scaling; have it enabled and are set to monitor the scaling factors;
  7. And if the bandwidth-delay product between them indicates a benefit from increasing the buffer size;
  8. And if the application retrieve rate is sufficiently high to merit it;
  9. And if the stack-wide maximum scaling factor permits it;

Then setting the receive buffer size may, heuristically allow an application to influence the setting of the window size/scale factor product.

That's an awful lot of ifs & buts, to be claiming "an application can set the window size".


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
In the absence of evidence, opinion is indistinguishable from prejudice.
  • Comment on Re^6: changing tcp parameters when establishing connection

Replies are listed 'Best First'.
Re^7: changing tcp parameters when establishing connection
by Apero (Scribe) on Dec 03, 2015 at 21:12 UTC

    In the name of avoiding a reply-war, I'll make this (brief) comment my last in the thread. For the record, I never said "an application can set the window size". What I did say is that an application can:

    tune window-scaling per-socket

    ..and..

    impact the window scaling

    ..and..

    adjust this in the application level (where "this" is socket buffer sizes)

    from the application. Apologies if there was any confusion where someone thought I said you had direct application-level control over the window-scaling. The application can influence this, which is described not only in system manpages, but in RFC-1323, section 2.1. This has been my only point for a while, and it's not worth any more attention, I suspect.

      I never said "an application can set the window size"

      But the OP asked: "how can i change the tcp parameters (i.e. tcp window size, scaling"; and the answer is: he cannot.

      The application can influence this

      Great. You've outlined a mechanism for potentially effecting some indeterminate change in the window size/scale factor product. Now show how to do something useful with it.

      The primary benefit of adjusting those (that) parameter is to improve throughput by tailoring the effective buffer size to the bandwidth and latency of the link.

      To make the adjustment, you need to know:

      • The effective bandwidth;
      • The effective latency;
      • The application retrieve rate.

      But, none of these factors are available to application code. Not only is that information not available from the stack; even if it was, it would do you no good because the only parameter you can tune is the retrieve buffer size; and that has to be done before the connection is made; so you cannot even try to instrument these from within the application and adjust in light of your findings.


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
      In the absence of evidence, opinion is indistinguishable from prejudice.