Change connection congestion control algorithms

The linux sysctl command now modifies the congestion control algorithm globally for the entire system. But congestion control, when the TCP window size and other similar parameters are different, is usually performed for each TCP connection. So my question is:

  • Is there a way I can change the congestion control algorithm used for a TCP connection?

Or am I missing something trivial here? If so, what is it?

+3
source share
3 answers

This is done in iperf using the -Z option - patch.

Here's how it is implemented (PerfSocket.cpp, line 93):

    if ( isCongestionControl( inSettings ) ) {
#ifdef TCP_CONGESTION
    Socklen_t len = strlen( inSettings->mCongestion ) + 1;
    int rc = setsockopt( inSettings->mSock, IPPROTO_TCP, TCP_CONGESTION,
                 inSettings->mCongestion, len);
    if (rc == SOCKET_ERROR ) {
        fprintf(stderr, "Attempt to set '%s' congestion control failed: %s\n",
            inSettings->mCongestion, strerror(errno));
        exit(1);
    }
#else
    fprintf( stderr, "The -Z option is not available on this operating system\n");
#endif

mCongestion - ,

+2

Linux has compatible overload algorithms that can change the algorithm used on the fly, but this is not a system setting for every connection.

-1
source

Source: https://habr.com/ru/post/1785370/


All Articles