当前位置:网站首页>Interview focus - TCP protocol of transport layer
Interview focus - TCP protocol of transport layer
2022-07-25 23:42:00 【Skinny monkey 117】
Catalog
TCP The mechanism provided ( Ensure reliability )
Wireshark Caught tools , demonstration TCP Three handshakes
Three handshake state transitions
You can view the TCP Connection ( understand )
1. Know the receiving ability of the object
2. Get the receiving ability of the other party
3. Control the sending volume —— Sliding window mechanism
The reason for byte stream orientation
Sticky packet problem caused by byte stream
TCP Concept
TCP:Transmission Control Protocol
The goal is :process to process Process to process
Ensure reliability , But not to ensure safety
What is reliability ?
1. TCP I will do my best , As far as possible Send data to the other party ; But there is no guarantee 100% You can send it to the other party .2. TCP When the data is not sent to the other party , Give the application layer a Error notification .
Application layer sends data , Or send it to the other party , Or you will know that the data is lost .3. TCP It can guarantee the receiver ( application layer ) Strictly follow the data at the time of sending Sequential reception .
4. TCP Protect data from unintentional damage (UDP This is also done ).
5. TCP Maintain the network quality as much as possible .
TCP The mechanism provided ( Ensure reliability )
About number
TCP Segment The two roles of
About retransmission
Packet loss occurred , How to retransmit ?
Fast retransmission
When a message segment is lost , The sender will always receive 1001 In this way ACK, It's like reminding the sender " I think
What I want is 1001" equally ;
If the sending host receives the same message three times in a row "1001" Such a response , The corresponding data will be 1001 -
2000 To resend ;
At this time, the receiver receives 1001 after , Return again ACK Namely 7001 了 ( because 2001 - 7000) The receiver
In fact, I have received it before , It is placed in the receive buffer of the receiving operating system kernel ;
This mechanism is called " High speed retransmission control "( Also called " Fast retransmission ").
Timeout time
TCP Of Header
TCP The buffer
TCP The connection of
TCP Connect (Connection) The concept of , And connection management
( A connected life = Creation at the beginning + For official use + The destruction )
Three handshakes
syn ack Sign a
Three complete handshakes
Wireshark Caught tools , demonstration TCP Three handshakes
4 Bit head length (header length)
Because the first may contain optional content , therefore TCP The length of the header is uncertain , If the header does not contain any optional fields, the length is 20 byte ,4 The maximum value that can be represented by the bit header length field is 1111, Turn into 10 Into the system for 15,15*4= 60, So the maximum length of the header is 60 byte . The head length is also called data offset , Because the header length actually indicates the starting offset of the data area in the message segment .
Three handshake state transitions
Summary of three handshakes
Four wave phase
Sign a :(FIN) Final/Finish
Active wave side : The party who actively disconnects
Passive wave side : Passively disconnected party
Simultaneous closure : Both sides take the initiative to wave their hands
The active waving party must be the active connecting party ? no !( Those who take the initiative to break up are not necessarily the people who took the initiative to pursue at that time )
Four wave state changes
![]()
CLOSE_WAIT state
TIME_WAIT state
Why keep ?
Examples of why to keep
A lot of TIME_WAIT What happened
Summary of four waves
TCP Exception in
Situation 1
Situation two
Situation three
Situation four
OS Is it hardware or software ?
OS It's software .
Software is a program , It's data + The instruction is to run in CPU On command , And the data to be processed by these instructions .
Mechanism to solve dead links
You can view the TCP Connection ( understand )
flow control
flow control
1. You need to know the receiving ability of the other party , It is better to perceive in real time .
2. Get the receiving ability of the other party -> Send traffic
3. What mechanism is used to control the sending volume
1. Know the receiving ability of the object
2. Get the receiving ability of the other party
3. Control the sending volume —— Sliding window mechanism
Highlight the situation 2
Highlight the situation 2
Sliding window mechanism
Congestion control
The reason for byte stream orientation
Sticky packet problem caused by byte stream
TCP Summary
UDP And TCP contrast
边栏推荐
- What is the difference between hot deployment and hot loading?
- WebMvcConfigurationSupport
- TS union type
- 2022 Niuke multi School Game 2
- 意向不到的Dubug妙招
- Optimize the browsing experience of yandere/konachan site with user scripts
- Qpprogressbar for QT style (QSS) application
- Swap, move, forward, exchange of utility component learning
- Implementation of date class
- 1913. Maximum product difference between two number pairs - no sorting required
猜你喜欢

生成随机数random学习之uniform_int_distribution,uniform_real_distribution

ratio学习之ratio_add,ratio_subtract,ratio_multiply,ratio_divide的使用

Qt风格(QSS)应用之QProgressBar

How does JS judge whether the current date is within a certain range

Learning exploration-3d rotation card

Write a select drop-down list

S4/HANA MM & SD EDI基于NAST的集成配置(ORDERS, ORDRSP, DESADV, INVOIC)
![[JUC] concurrent keyword volatile](/img/80/2f1b33f1e8c87fd4f8806eafb83139.png)
[JUC] concurrent keyword volatile

Matchmaker's words

Leetcode 0135. distribute candy
随机推荐
Strategy mode_
[code case] blog page design (with complete source code)
[Muduo] thread package
Good news under the epidemic
@Import
2022牛客多校第二场
Qpprogressbar for QT style (QSS) application
From which dimensions can we judge the quality of code? How to have the ability to write high-quality code?
疫情之下的好消息
Anti shake and throttling
TS basic data type
[JUC] concurrent keyword volatile
Grain Academy p98 trample pit e.globalexceptionhandler: null
谷粒学苑P98踩坑 e.GlobalExceptionHandler : null
图的遍历-DFS,BFS(代码详解)
智牛股--09
Recursion of function (use recursion to find the factorial of 1-N) (use recursion to find Fibonacci sequence) (use recursion to traverse data)
Which securities company should a novice choose to open an account? Is it safe?
ES6 syntax (difference between let, const, VaR, deconstruction assignment, arrow function, residual parameters, extension method of array)
生成随机数random学习之uniform_int_distribution,uniform_real_distribution

















































Mechanism to solve dead links 








Highlight the situation 2 











