Change congestion control algorithms per connection

tcp congestion control algorithm
tcp congestion algorithm
tcp congestion control - ppt
tcp congestion control tutorialspoint
tcp congestion control dd-wrt
udp congestion control
fast retransmit and fast recovery
congestion avoidance and control

The command 'sysctl' in linux as of now changes the congestion control algorithm globally for the entire system. But congestion control, where the TCP window size and other similar parameters are varied, are normally done per TCP connection. So my question is:

  • Does there exist a way where I can change the congestion control algorithm being used per TCP connection?

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

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

This is how it is implemented (PerfSocket.cpp, line 93) :

    if ( isCongestionControl( inSettings ) ) {
    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));
    fprintf( stderr, "The -Z option is not available on this operating system\n");

Where mCongestion is a string containing the name of the algorithm to use

TCP congestion control, Transmission Control Protocol (TCP) uses a network congestion-avoidance algorithm that For each connection, TCP maintains a congestion window, limiting the total Once the CWND reaches ssthresh, TCP changes to congestion avoidance algorithm where each new ACK increases the CWND by MSS / CWND. From an Android app, can you change the TCP congestion control algorithm? Are there functions in the Android API to get and set the TCP congestion control algorithm? In Linux, you can read or write

It seems this is possible via get/setsockopt. The only documentation i found is:

[PDF] Virtualized Congestion Control, congestion control algorithm while allowing each guest to keep using its private the guest memory essentially enables it to replace the whole networking stack, but at Likewise, by breaking a TCP connection into several. Abstract This paper describes six methods for controlling congestion for TCP connections. The first four, Slow Start algorithm , Tri-S , DUAL , and TCP Vegas treat the network as a black box, in that the only way to detect congestion is through packet loss and changes in round trip time, or throughput.

In newer versions of Linux it is possible to set the congestion control for a specific destination using ip route ... congctl .

If anyone are familiar with this approach, please edit this post.

[PDF] Fifty Shades of Congestion Control: A Performance and , delay-based and hybrid types of congestion control algorithms, we reveal that fairness and to prevent packet loss, but they add delay to every packet passing If a TCP connection sends less data than the bottleneck link bandwidth To adapt to changing network conditions, BBR periodically probes for  TCP congestion control is a fundamental part of this protocol and over the years has undergone a process of constant improvement through the generation of different versions, such as TCP Tahoe, Reno, Vegas, and so on. The case of the TCP CUBIC version, which has been the default congestion control applied by Linux/Unix systems.

Linux has pluggable congestion algorithms which can change the algorithm used on the fly but this is a system wide setting not per connection.

RFC 5681 - TCP Congestion Control, This document specifies four TCP [RFC793] congestion control algorithms: To implement these algorithms, two variables are added to the TCP per-connection state. Further, the TCP sender MUST NOT change cwnd to reflect these two  condition for TCP congestion control to be stable. • Because the simple CC mechanism involves timeouts that cause retransmissions, it is important that hosts have an accurate timeout mechanism. • Timeouts set as a function of average RTT and standard deviation of RTT. • However, TCP hosts only sample round-trip time

[PDF] Chapter 5 – Modeling Congestion Control Algorithms, speed of network links increases toward 10s and 100s of gigabits per second (​Gbps). A typical TCP flow evolves through three phases: connection, transfer and close. Congestion Control Mechanisms in this Study Change the Congestion  Congestion Control Algorithms • Congestion - the situation in which too many packets are present in the subnet. 7. Causes of Congestion • Congestion occurs when a router receives data faster than it can send it – Insufficient bandwidth – Slow hosts – Data simultaneously arriving from multiple lines destined for the same outgoing line.

[PDF] Chapter 6 – Comparing Congestion Control Regimes in a , how each congestion control regime responds to various conditions and then connected access routers connect sites to the topology at higher speeds than normal Factors x4 (propagation delay) and x6 (buffer-sizing algorithm) also alter. RFC 5681 TCP Congestion Control September 2009 FLIGHT SIZE: The amount of data that has been sent but not yet cumulatively acknowledged. DUPLICATE ACKNOWLEDGMENT: An acknowledgment is considered a "duplicate" in the following algorithms when (a) the receiver of the ACK has outstanding data, (b) the incoming acknowledgment carries no data, (c) the SYN and FIN bits are both off, (d) the

tcp: TCP protocol - Linux Man Pages (7), After that a new socket for each incoming connection can be accepted using accept(2). More congestion-control algorithms may be available as modules, but not Force BIC TCP to more quickly respond to changes in congestion window. New congestion control algorithms are needed for multipath transport protocols such as Multipath TCP, as single path algorithms have a series of issues in the multipath context. One of the prominent problems is that running existing algorithms such as TCP New Reno independently on each path would give the multipath flow more than its fair share

  • Yeah, I'm aware of that. "$ sudo modprobe tcp_<congestion_algorithm>" will add the specified algorithm as an entry in /proc/sys/net/ipv4/tcp_available_congestion_control. But my question is about connection-specific settings.
  • Well thats not per connection, that would be slow to look up for each connection.
  • The default setting is in /proc/.../tcp_congestion_control. The algorithms selectable via setsockopt are in tcp_available_congestion_control. There's another file which contains all the algorithms installed in the kernel. However mixing different congestion control algorithms on the same device will usually result in one stealing most of the bandwidth (reno almost always loses out)