A very easy to misunderstand TCP congestion control algorithm

Source: Internet
Author: User
Tags rfc

Body

A lot of people think that a good TCP congestion control algorithm will accelerate the connection, which is wrong. On the contrary, all congestion control algorithms are designed to allow TCP to pull back when greedy, most of the time. Congestion control is a reduction in the speed of data transmission.

I will be in this article for the recent chat with friends in the industry record. Summarize the few words.
The ultimate goal of TCP congestion control is not to speed up data transmission, so the understanding is selfish and superficial! Its end goal is to increase the bandwidth utilization indefinitely under the premise of fair occupancy bandwidth!


Assuming you are just focusing on a separate TCP connection itself, then you may never be able to design a better algorithm, but suppose you do not start with a separate connection, seemingly more ethereal, after all you can get and harness the only one connection!
Consider the design of a process scheduler, starting with 2.6.23. It is generally felt that the Linux scheduler ushered in a new phase, the CFS phase, in contrast. The O (1) Scheduler is just like a transition, and the previous O (n) scheduler is slightly 0 based. I was also concerned about the new scheduler for a while, just as I was focusing on TCP BBR this time ... So, let's take a look at where CFS is so good that it can occupy the top spot of the Linux default scheduler.


First we ask. Does CFS make the process run faster? Not also, a bit of experience is known. For high-throughput environments, the CFS makes the process run slower. Relatively superficial cognitive perspective, generally very easy to "good" and "fast" closely linked together, but in fact. Standing at a higher level. What you see will no longer be an independent process, but a whole process inside a machine!

Where is CFS?
From its name it can be seen that the advantage is "totally fair"!

It treats the symptoms caused by almost all of the unfair dispatch in the O (1) scheduler. For example, the problem of preemption and starvation between IO consumption type and interaction process, such as scheduling granularity problem. And so on all these problems, after introducing a dummy clock. Fairness has been measured in a very precise measure. These problems have finally been solved.

From start to finish, there is no independent process "accelerated execution speed"!
Finally, CFS allows the entire process to run as full as possible with CPU time, which increases CPU utilization. The whole process has no burrs and is very smooth.
----------------------------------------------------
, let's look at the advantages of smoothing instead of burrs, just looking directly at the eyes is so handsome! The Krauts are on fire again! Audi finally built the spherical tires ... "


----------------------------------------------------
Now back to TCP itself, BBR and the same year's CFS, aroused the attention of the people. I think I have drawn the idea of "how to design a good TCP congestion control algorithm".


Stand on the global internet and look down. You see all the TCP connections, not just the one or the other ones that are built on your machine.

This is the pattern, and your prejudice will naturally be eliminated. Shanghai naturally wants to compete with Beijing. But Beijing does not look so, no matter where good, it is Beijing's, is not it? How to make all TCP connections fair share all the Internet bandwidth is the root of TCP congestion control algorithm! Note Two key points, one. Be fair to share, and second, as full as possible of bandwidth.


This problem is a world problem, no process scheduler so simple!
The process Scheduler is acting on one CPU. Or, simply put, for a machine.

This machine is on your hands. You, the designer of the scheduler, are able to see everything that is happening in the current machine, all the inequities, all the waste that gives the designer a panoramic view, and you can force the resources of a process to give you a process. You can also kill overly greedy processes ... For TCP, there is no one can stand on the global Internet to look down on the man, TCP congestion control is completely distributed, each designer can only see that part of their machine connection.
However, the reason why TCP congestion control is so difficult is not what so-called distributed causes. In fact, distributed is not difficult, the difficulty is that TCP congestion control is always misunderstood. So, when designing algorithms. A little inattention will be the opposite. It was supposed to be to avoid congestion and actually add plugging.


Why is it misunderstood? In fact, Caesar has long said that people always see what they want to see.

There is also a layer of meaning in this sentence, people are happy to see their own local as a whole.

People can see the process of a whole machine at a glance. So the design of a good process scheduler is very easy, so the CFS appeared. But you can't see all the TCP connections. Everyone sees just their own TCP connection, so everyone can just assumption, I'm good. You. As for whether the algorithm is plugging, it may not be out of malice at all, but it is the short-sighted and the pattern of the low-rise.


A correct, and good TCP congestion control algorithm should take into account all the connections, assuming that TCP is not fast enough, it should be all TCP acceleration, which reflects the increase in bandwidth utilization. Assume that TCP is fast enough. No matter what connection is not faster, this is a manifestation of fairness.

It's very easy to change. Let's say you feel that driving down the road is fast, so if you're already on the freeway, please don't change lanes.
How simple the truth, but can still see the road lane overtaking, I may express a problem, is all the drivers are playing lane overtaking, assuming that these people to design the TCP congestion control algorithm, will be good where to go? Unfortunately, it is. The world's TCP unilateral acceleration play the most fire of the people, and this batch of Chinese good driver is the same group of people, no matter what resources, the only goal except Rob, or Rob.
In fact. I am not a moral preacher. Say what people for me, I for everyone's algorithm is a good algorithm, said as if I did it ...
I was scolded by two Masters to change the mistake. In fact, I have been possessed ...
Some time ago. I've changed a congestion algorithm. Give a master a comment, let's call the Master 1. It's worth showing off. This algorithm is very fast, even faster than the BBR, but was a bad loss of a meal, my algorithm, "competition is definitely the first", but "irresponsible" ... This is the algorithm that destroys the character. Later, I tried to let two or more of the same algorithm to perform the flow of data transmission, sure enough ... Some streams will instantly squeeze the remaining stream bandwidth to 0! Even foe are not divided, is simply a rogue algorithm Ah!

This algorithm is also burned after reading, completely unusable.
...
Assuming this doesn't count, then there's a master 2 who makes me feel like I don't know shit.
This master is abroad, and I sometimes poor, and can read Chinese but do not write Chinese, I am the opposite. I can read English but it's hard to write. So you can only communicate by email.

The topic is also congestion control. I just asked the question of "How to make TCP data send faster" because of quick success, the answer is very simple. Ignore congestion control and compensate for retransmission. Then I wrote a "congestion control algorithm that ignores congestion control." and provocative as a response. Then the message appeared fxxk vocabulary, and suck ... Said I did not understand the main principles, and urged me to resign my work home to study and think carefully.

I was almost crying.
...........
The guidance of the Master 2 before the Master 1. But Master 1 gave me directions and ways to do it in detail. In addition to my heartfelt thanks, I can do is to write some "attack TCP congestion Control algorithm" article to put people for me, I for everyone's Christian ideas to many other people.

Due to the respect of two masters and friends, I will not post the relevant code, the original message and the chat record. The concept of digestion and processing, from my direct origin here.


BBR at the end of this article, I have a little chat about what algorithm is the correct algorithm through the BBR algorithm.
BBR, like the CFS of the year, I've already said that. But BBR is still at a 0-based stage, at first, I think the problem is:
1. Convergence is too slow, that is, the window will not be slowed down immediately. But to be completed within a few RTT;
2. It is too late to detect upward. Question 1 is the remedy for this;
3. Preemption under the big BDP cache is debatable;
4.BBR relies on the SDN infrastructure ...
...

To see, such an initial understanding of the embodiment of my personal how deep technical skills. But then. By the master's guidance, I found. The biggest problem with the original BBR is that the new congestion control framework introduced by it is very easy to misuse, please see http://blog.csdn.net/dog250/article/details/54754784 for details.
Assuming a few three streams of people worse than me using the new framework to write algorithms, then the internet crashes just in the corner. Fortunately, it is. Even if the crash, is only the domestic internet collapse, in this field, the foreign moon is round, after all, people than we are more educated. Understand game theory. Even from the point of view of a selfish person. It's not something you can do that is not selfish.

It is worth noting that knowledge does not represent a culture. I always think that domestic universities are in fact technical schools, especially Huazhong University of Science and Technology. It was almost directed to the Giants such as Huawei and bat to train senior craftsmen.


        back to BBR. For the new frame brought by BBR, the most serious is, before someone to spell speed and re-transmission, there will be PRR down the window. This is not controlled by the algorithmic module. Now, just write a callback and completely bypass the window. Everybody's going to plug it up. The principle level of TCP design, the RFC seems to have also referred to the fairness of the high status. Because of the assumption that fairness is not the basic principle. Then the entire ring will not be closed. Bandwidth resources early evening, at this time blind AI non-MD process will make everyone want to move forward, and finally who can not get through, so one. The internet will be completely unusable! Based on this. All engage in "TCP unilateral acceleration" of individuals and manufacturers are doing loopholes in the bad, the starting point is wrong.

Of course. This type of vendor's starting point is often not the TCP level. It's a business level, which is understandable. After all, not an area, I have no right to ask too much, TCP is only a tool for them. It was really some day that the internet crashed. They'll still be using trucks to drive the data, and then the fast-track truck that's jammed with the hard drive will be just as much a tool as TCP.
----------------------
What's the right thing to do?
        first introduced a gentleman algorithm, namely Ledbat algorithm, can see http://www.rfc-base.org/txt/ Rfc-6817.txt, whose wiki is Https://zh.wikipedia.org/wiki/LEDBAT
Its thinking is actually a little funny in the eyes of those who "accelerate". It exists in order to fill the cubic of the bloat buffer when the gap, once there are other traffic caused the queue, Ledbat immediately teng place concessions. Such an algorithm is the "accelerator" should be the first time to abandon the algorithm, but it in iOS and Win10 in the way, Ledbat mainly used for software updates, such things can be silently in the background. Lower priority. So the invention of a backstage silence of the gentleman-type Ledbat algorithm. In fact, to improve the bandwidth utilization of fair bet AH. However, this algorithm will not compete with other traffic bandwidth, the slightest should not be high-priority traffic fairness, is not very handsome algorithm? Ledbat in the expression is, you go to the front block to go, I do not you important, I walk slowly can ...
        BBR is not a gentleman-style algorithm, it is to participate in fair competition, I do not take the initiative to bully people. But being bullied, I will not timid. So BBR added the probe more process on the ledbat. At the same time, unlike Ledbat's concession, BBR changed it to a softer drain less.


All of these are not recent, and before that, the Vegas algorithm represents a correct approach, it is finally not superior because the Vegas deployment has a premise, that is the same time all deployed to Vegas, but this is not possible. Only if there is Reno or cubic, Vegas's "right approach" will suffer.

The reality is this, the inferior currency drive good currency. Cubic is clearly the wrong algorithm, but because it can be used very low but very simple method quickly converge to the available bandwidth, so it has been recognized by the algorithm. All the people are silently enduring the bufferbloat, and this problem brings the additional queuing delay that greatly reduces the interactive TCP connection experience, at the same time seriously affecting the real-time protocol. For example, NTP or something.
Cubic is bound to block the road, after buffer was blocked. The data of the interactive application is queued, the delay is added, and the interactivity falls naturally.
The question I've been curious about is. Why Reno. The cubic of the flow of the AI after slow-start is called congestion avoidance, on the contrary, such blind way to the black window will inevitably lead to congestion, that is, congestion is unavoidable. Does this process tarnish the word "congestion avoidance", or is it just a definition? One of the following articles gives an answer, and now it's Saturday-7:30 A.M., it's time to get some sleep.

Written in the final order: "Last night into the city. Return tears full Fly "that is silly, oneself not sericulture is, why envy others wear silk."


Today is the weekend. And can get up in the middle of the night, this writing began at 5:30, finished in early 72, before this, I spent one hours to read the "rupee doughnut" 25 pages. One hours before that. I saw something about the road plan. Mostly on disturbing computers ... Now, I wanted to sleep, but I couldn't sleep. Just want to go to unstoppable. Just a pity the mountains are too small ... Since the return of Ganzi, the mountains in Shenzhen have become small mounds ... Practical point. To buy food. Cooking is the way to solve it. What do you do for dinner? Ha ha. Chongqing brings the old hot pot!

----I hope you can read this article.



A very easy to misunderstand TCP congestion control algorithm

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.