Solve traditional TCP defects: 1. The window is too small and the maximum is 65535. TCP uses the option function, and its header has reserved items for extension and other purposes. The window expansion option adds an additional 16 bits to indicate the window size. The window consists of the 16 bits of the header and the 16 bits of the option. However, they are represented not by addition, but by the power of the shift window,
Solve traditional TCP defects: 1. The window is too small and the maximum is 65535. TCP uses the option function, and its header has reserved items for extension and other purposes. The window expansion option adds an additional 16 bits to indicate the window size. The window consists of the 16 bits of the header and the 16 bits of the option. However, they are represented not by addition, but by the power of the shift window,
Solve traditional TCP defects:
1. The window is too small. The maximum value is 65535.
TCP uses the option function, and its header has reserved items for extension and other purposes. The window expansion option adds an additional 16 bits to indicate the window size. The window value consists of the 16 bits of the header and the 16 bits of the option.
However, they are expressed not by addition, but by the power of the shift window value,That is to say, if the value of the shifted window is 10, the maximum value of the window is 65535*210., This value is relatively large, enough to indicate the size of the window.
2. packet loss, which is identified as network congestion
In high-speed networks, this assumption is not true. If we generally think that packet loss is caused by congestion, thus reducing the speed by half, this is a great waste of network resources. Congestion determination requires two consecutive groups to be lost.
As a result, there is a series of congestion control methods such as HSTCP and BI-TCP.
HSTCP
High-Speed TCP is a new congestion control algorithm based on the AIMD criterion proposed by Floyd.The network with high speed and high latency can improve the network throughput more effectively.. It avoids algorithm addition and parameter reduction by modifying standard TCP congestion.Rapid growth and slow decrease of WindowsBut it has serious RTT unfairness.
The window increase and decrease methods proposed by HSTCP first look at the two formulas in congestion control:
Cwnd = cwnd + a (cwnd)/cwnd ............................ (1)
Cwnd = (1-b (cwnd) * cwnd ............................ (2)
Formula (1) is the window growth mode when congestion is avoided, formula (2) is the window descent mode after packet loss occurs, where a and B are two functions, and cwnd is its independent variable, in standard TCP, a (cwnd) = 1, B (cwnd) = 0.5, that is, the addition increases and the multiplication decreases.
To achieve TCP Friendliness, HSTCP adopts the same a and B as standard TCP in a low window, that is, in a non-BDP network environment, that is, to ensure the friendliness between the two. When BDP is large, that is, w is large (the critical value set by HSTCP is 38), new a and B are adopted to meet the high throughput requirements:
You can see RFC3649 for more information about the increasing and decreasing parameters of TCP windows in different network environments.
BIC-TCP
HSTCP, which achieves high throughput by simply modifying the standard TCP growth mode. The method is simple, but the disadvantage is that it has serious RTT unfairness. fairness means that the network resources occupied by Multiple Streams sharing the same network bottleneck are equal.
BIC-TCP was proposed by the Network Research Laboratory of North Carolina Lina State University. This algorithm was recently used as the default TCP congestion algorithm in Linux kernel. (the default algorithm before using cubic in linux)
The essence of BIC-TCP:
The BIC-TCP initiators have found an essence of TCP congestion window adjustment: that is, to find a sending window most suitable for the current network, in order to find this window value, the method adopted by TCP is to add 1 per RTT (congestion avoidance segment), which increases slowly, drops by half when packet loss occurs, and then increases slowly. BIC-TCP creators see through the essence of things, in fact this is a search process, and the TCP search method is similar to traverse the search method one by one, you can think that this value is in1 and a relatively large number (large_window)Between, since you need to search for the best value in this range, it is obvious that the best method is the binary search idea.
BIC-TCP is based on the binary idea: When packet loss occurs, it indicates that the optimal window value should be smaller than this value, so BIC sets cwnd as max_win, set the value after the multiplication is reduced to min_win, and then BIC starts to execute the binary idea between the two-each time jump to the midpoint of max_win and min_win.
Specific implementation of other problems, such as to prevent the jitter of transmission, so the BIC-TCP selected two additional reference values Smax and Smin. The specific implementation of BIC-TCP can refer to the kernel code/net/ipv4/tcp_bictcp.c
CUBIC
The disadvantage of BIC-TCP: First of all, the preemptible is strong, it is equivalent to restarting a slow start algorithm in the probe phase, and TCP in the stable window is always linear growth, the slow start process will not be executed again. Secondly, the BIC-TCP window control stage increases the algorithm implementation and performance analysis complexity.
The Design of CUBIC simplifies the BIC-TCP window adjustment algorithm, CUBIC uses a CUBIC function to replace the growth curve of BIC-TCP. Let's take a look at the specific details: When a congestion event occurs, Wmax sets the window value for which congestion occurs. Then, the window is reduced by multiplication, and the multiplication factor is set to Beta, after exiting from the rapid recovery phase and entering the congestion avoidance phase, the growth of the CUBIC window begins to follow the "Concave" growth curve. This process continues until the window grows to Wmax again, then, the function is transferred to the "convex" growth stage. The growth of this method can keep the window close to Wmax, so as to achieve high network bandwidth utilization and Protocol stability.
Given the better performance of CUBIC than BIC-TCP, after Linux2.6.18, CUBIC replaced the BIC-TCP, kernel code please refer to/net/ipv4/tcp_Cubic.c.
There are more than n tcp congestion optimization algorithms, such
Fast TCP: developed from the idea of TCP vegas, it uses network delay for congestion determination.
ECN: Explicit Congestion Notification. The idea of this algorithm is to use vro. When a vro detects congestion, it marks the congestion in the TCP or IP address header of the connection, allowing the terminal to handle the congestion by itself.
UDT: UDT is an open source reliable transmission protocol based on UDP. However, the congestion algorithm in UDT has nothing to do with UDP or TCP. UDT uses a bandwidth estimation algorithm. The congestion algorithm at the sending end is to use a function to infinitely approximate the bandwidth value in the congestion window. This idea is very good for transmission stability. Because it is an infinite approximation, it will never exceed the bandwidth value, instead of increasing the window continuously after the balance state like TCP, the balance state can be maintained for a long time.
It is easy to complete a available version of TCP. To achieve a high-performance version, you need to consider more.
Different Environments: Lan, heterogeneous network, satellite network, and so on. Each network has different requirements.
Different applications: There are applications that keep sending small packets (the length of the sent packet is smaller than that of MSS), applications that keep sending large packets, and applications that send and receive data simultaneously on both sides.
Transmission Efficiency, fairness, and stability
Reference; http://www.cnblogs.com/fll/archive/2011/11/15/2250437.html