Add TCP congestion control variant to Linux Ubuntu & comparing.

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

STEPS TO CHANGE VARIANTS :

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 :

modules

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)

config.png

Descriptions:


Tahoe:
Limits unknown packets being received. Limits the congestion window, and reset itself to a slow-start state.

Reno:
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.

Vegas:
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.

Hybla:
Penalizes connections that use satellite radio. Not usually used with phones.

Cubic:
One of the best, most recommended TCP options available. Less aggressive, works according to the event. Used in Linux.

Westwood/Westwood+:
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.

Scalable:
Scalable calls for congestion window to be halved for each packet lost. Effectively, this process keeps halving the throughput until packet loss stops. Once the packet loss subsides, slow start kicks in to ramp the speed back up.
Hamilton TCP (HTCP):
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:
Veno is closely related to Vegas, it is a combination of Vegas and Reno in order to enhance TCP performance over Wireless networks.

Illinois:
Illinois is designed for high-speed, long-distance networks. A sender side modification to the standard TCP congestion control algorithm, it achieves a higher average throughput than the standard TCP and allocates the network resource fairly as the standard TCP.
 
High speed (HSTCP):
High Speed TCP (HSTCP) is a new congestion control algorithm protocol for TCP. Standard TCP performs poorly in networks with a large bandwidth delay product. It is unable to fully utilize available bandwidth. HSTCP makes minor modifications to standard TCP’s congestion control mechanism to overcome this limitation.
 
Yeah-TCP:
A high speed TCP congestion control algorithm which uses a mixed loss/delay approach to calculate congestion windows. Its purpose is to target high efficiency, fairness, and minimizing link loss while keeping network elements load as low as possible.
CDG

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.


 
Step 3. since default, system wide, congestion control algorithm is Cubic. You can check that by inspecting the content of the file /proc/sys/net/ipv4/tcp_congestion_control:

$ cat /proc/sys/net/ipv4/tcp_congestion_control
cubic

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
reno

change to reno.png

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.

Using CUBIC cubic

Using VEGASVEGAS.png

Using RENO

reno

CONCLUSION:

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!

 credits to : http://androidmodguide.blogspot.com/p/tcp-algorithms.html
Advertisements

One thought on “Add TCP congestion control variant to Linux Ubuntu & comparing.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s