in reply to Re^2: changing tcp parameters when establishing connection
in thread changing tcp parameters when establishing connection
This depends very much on your OS defaults and any distro-level or admin-level tuning. The actual definition of buffer window and receive size are frequently set to the maximum possible size by implementations, but you can adjust this in the application level. I merely said this has an impact on the TCP-window size, per the manpage reference I gave earlier.
Remember, the stock Linux or BSD kernel defaults can be adjusted by kernel maintainers (changing official upstream options,) by an admin who uses knobs like sysctl tuning to adjust defaults, or by applications that have some say over userland tooling (such as the socket-level options we're discussing here.) I can't tell you exactly what impact your change to the SO_RECVBUF size will have since I do not know the defaults on your current system. Use the above resources to find out, or learn more about them. Remember, sometimes you get a bit "dirty" learning how all the layers in an modern system interact. Test and see what the impact is for you.
Finally, note that the definitive reference for Window Scaling is RFC-1323. Specifically, section 2.1 talks about the need for buffer sizes large enough to make window-scaling effective. This is probably why the API documentation for tcp on various platforms frequently mentions this fact. It's quite possible your kernel/sysctl/userland is already using the "largest possible" buffers, in which case the behavior your noted may be quite correct. This may not be the case on someone else's OS, distro, or configuration.
FYI, your code is a bit hard to read; use <code> tags to increase readability by printing the code as you wrote it (markup docs are helpful too.)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: changing tcp parameters when establishing connection
by BrowserUk (Patriarch) on Dec 03, 2015 at 17:18 UTC | |
by Apero (Scribe) on Dec 03, 2015 at 18:40 UTC | |
by BrowserUk (Patriarch) on Dec 03, 2015 at 21:04 UTC | |
by Apero (Scribe) on Dec 03, 2015 at 21:12 UTC | |
by BrowserUk (Patriarch) on Dec 04, 2015 at 00:36 UTC |