TCP CONGESTION ALGORITHMS:
The data transmission protocol used by many Internet applications is known as TCP, the later uses congestion control algorithms. The main objective of a TCP algorithm is to refrain from sending more data than the network is capable of imparting, that is, to avoid causing network congestion. Different algorithms respond unlikely to network loads, but they are all based on the same concept of avoiding network congestion.
Things to heed for in TCP algorithms include :
– Download/Upload speeds – The higher the rate, the better
– Latency – The lower the number, the better
step 1: you need to see what modules you have installed.
ls -la /lib/modules/$(uname -r)/kernel/net/ipv4
You should get a list of modules like this :
step 2. You can see what your kernel has configured by greping your config file for TCP_CONG ie
grep TCP_CONG /boot/config-$(uname -r)
Limits unknown packets being received. Limits the congestion window, and reset itself to a slow-start state.
Basically the same as Tahoe, but if 3 of the same packets are received, it will halve the window, instead of reducing it to one. It changes the slow start threshold equal to that of the congestion window.
One of the smoothest TCP algorithms(next to cubic), it increases the timeout delay for packets, which allows more to be received, but at a higher rate. It also has set timeouts, which helps with speed because it’s constantly being refreshed.
Penalizes connections that use satellite radio. Not usually used with phones.
One of the best, most recommended TCP options available. Less aggressive, works according to the event. Used in Linux.
A newer version of Reno, and another commonly used one. It controls parameters better, helping out streaming and overall quality of browsing the internet. One of the most fair algorithms out there, and is one of the most efficient algorithms to date.
Low Priority (LP):
A distributed algorithm whose goal is to utilize only the excess network bandwidth as compared to the “fair share” of bandwidth as targeted by TCP. The key mechanisms unique to TCP-LP congestion control are the use of one-way packet delays for early congestion indications and a TCP-transparent congestion avoidance policy.
Binary Increase Congestion control (BIC): BIC is optimized for high speed networks with high latency: so-called “long fat networks”. It has a unique congestion window (cwnd) algorithm. This algorithm tries to find the maximum where to keep the window at for a long period of time, by using a binary search algorithm.
HTCP is designed for high-speed, long distance networks that increases aggressiveness as the time since the previous loss increases. It is thought to be a more efficient TCP algorithm than BIC and HSTCP.
Veno is closely related to Vegas, it is a combination of Vegas and Reno in order to enhance TCP performance over Wireless networks.
CAIA-Delay Gradient (CDG) is a new hybrid congestion control algorithm which reacts to both packet loss and queuing delay. It attempts to operate as a delay-based algorithm where possible, but detects loss-based TCP traffic and will switch if required. CDG performs similarly to NewReno and Cubic, but is better at latency.
$ cat /proc/sys/net/ipv4/tcp_congestion_control
So, to change system-wide default you only have to write a name of congestion control algorithm to the same file. For example, to change it to reno you would do it this way:
# echo reno > /proc/sys/net/ipv4/tcp_congestion_control
# cat /proc/sys/net/ipv4/tcp_congestion_control
Note that, to change the value, you have to be the root user. As the root you can specify any available congestion algorithm you wish
comparing CUBIC, VEGAS and RENO
To compare the following variants we are going to do a downloading test with wget.
Before you can use wget, you need to install it.
- Most (if not all) Linux distros come with wget by default. So Linux users don’t have to do anything!
- if no simply do : sudo apt-get install wget
Once you’ve installed wget, you can start using it immediately from the command line. Let’s download some files.
Download a Single File
Let’s start with something simple. Copy the URL for a file you’d like to download in your browser.
Now head back to the Terminal and type
wget followed by the pasted URL. The file will download, and you’ll see progress in real time as it does.
Comparing from the results above (the same file has been downloaded using the three different variants) a conclusion can be derived. RENO is the best Tcp_algorithm that i can use as the downloading speed is more efficient compared to the others.
note: Real world usage would show little difference when comparing between algorithms, so everyone’s experience will vary!