background
TCP/IP
Protocols are the foundation of the current Internet era. All network products, or development languages, and development frameworks are based on tcp/ip
protocols. Therefore, learning well tcp/ip
will 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/ip
agreement, it will have a positive effect on your future development or troubleshooting problems at work.
tcp fast open-TFO
tcp
Quick open ( tcp fast open
) for short TFO
. TFO
It is tcp
an extension that simplifies the handshake process to increase C-S
the opening speed. The principle is to use SYN Cookie
realization.
The specific details are as follows: The
TFO
first round 3
of handshake
- C sends a
SYN
request to S , S receives - S does not reply immediately
SYN + ACK
, but S gets one through calculationSYN Cookie
, puts thisCookie
intcp
theFast Open
options of the message , and then sends it to C - C
Cookie
will be cached after getting it. The next step is to complete the three-way handshake normally
3
This is the case for the first round of handshake, but the subsequent process is different! !
TFO
Back 3
handshake
- C is sent to S
Cookie、SYN、HTTP请求
. (Yes, just send so much) - S verifies
Cookie
whether C is legal, and returns normally if it is legalSYN + ACK
. Otherwise, please request the data directly - S sends C
HTTP响应
. ( This step is the focus of optimization ) - C still needs to reply S
ACK
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 complete3
the handshake before sendingHTTP请求
.
TFO
Advantage
TFO
Advantage is not in the first round of 3
handshakes, but in the back of the handshake, the S get C's Cookie
and verified by, they can return directly HTTP响应
, taking advantage of 1
a 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/ip
the sixth part of the series, which mainly introduces the tfo
realization 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.