TCP/IP study notes 6-tcp fast open principle

background

TCP/IPProtocols are the foundation of the current Internet era. All network products, or development languages, and development frameworks are based on tcp/ipprotocols. Therefore, learning well tcp/ipwill be of great help to individuals in the Internet industry in the future.

But this is a basic theoretical course, just like the course of operating system, after learning it may not have much impact on you, and it will not let you immediately have the skills to put into work. But precisely because this is a basic theory course, all Internet technologies are based on it. So if you understand the tcp/ipagreement, it will have a positive effect on your future development or troubleshooting problems at work.

tcp fast open-TFO

tcpQuick open ( tcp fast open) for short TFO. TFOIt is tcpan extension that simplifies the handshake process to increase C-Sthe opening speed. The principle is to use SYN Cookierealization.

The specific details are as follows: The
TFOfirst round 3of handshake

  1. C sends a SYNrequest to S , S receives
  2. S does not reply immediately SYN + ACK, but S gets one through calculation SYN Cookie, puts this Cookiein tcpthe Fast Openoptions of the message , and then sends it to C
  3. C Cookiewill be cached after getting it. The next step is to complete the three-way handshake normally

3This is the case for the first round of handshake, but the subsequent process is different! !

TFOBack 3handshake

  1. C is sent to S Cookie、SYN、HTTP请求. (Yes, just send so much)
  2. S verifies Cookiewhether C is legal, and returns normally if it is legal SYN + ACK. Otherwise, please request the data directly
  3. S sends C HTTP响应. ( This step is the focus of optimization )
  4. C still needs to reply SACK

note:

  • The third and fourth steps can be executed simultaneously
  • Focus on optimization in the first and third steps. The first step is sent HTTP请求, and the third step can directly reply to the data. This saves a lot of time compared to before optimization. In the past, it was necessary to complete 3the handshake before sending HTTP请求.

TFOAdvantage
TFO Advantage is not in the first round of 3handshakes, but in the back of the handshake, the S get C's Cookieand verified by, they can return directly HTTP响应, taking advantage of 1a RTT(Round Trip Time)time for data transfer in advance. Although there is not much improvement in a round trip, the more data is sent, the greater the advantage.

to sum up

This is tcp/ipthe sixth part of the series, which mainly introduces the tforealization principle in detail . There will be more in-depth and more usage scene explanations later, this series of articles will be very long.
Let's start the next article.

Guess you like

Origin blog.csdn.net/Free_time_/article/details/107443654