当前位置:网站首页>Interview focus - TCP protocol of transport layer
Interview focus - TCP protocol of transport layer
2022-07-27 15:43: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
边栏推荐
- [daily question 1] 558. Intersection of quadtrees
- JS uses extension operators (...) to simplify code and simplify array merging
- 使用双星号代替Math.pow()
- Spark 3.0 adaptive execution code implementation and data skew optimization
- npm install错误 unable to access
- Leetcode 74. search two-dimensional matrix bisection /medium
- 后台返回来的是这种数据,是什么格式啊
- Multi table query_ Exercise 1 & Exercise 2 & Exercise 3
- Extended log4j supports the automatic deletion of log files according to time division and expired files
- Hyperlink parsing in MD: parsing `this$ Set() `, ` $` should be preceded by a space or escape character`\`
猜你喜欢
随机推荐
【剑指offer】面试题55 - Ⅰ/Ⅱ:二叉树的深度/平衡二叉树
【剑指offer】面试题49:丑数
[正则表达式] 匹配分组
Network equipment hard core technology insider router 19 dpdk (IV)
$router.back(-1)
C语言:动态内存函数
[0 basic operations research] [super detail] column generation
【剑指offer】面试题41:数据流中的中位数——大、小堆实现
低代码是开发的未来吗?浅谈低代码平台
QT (XIII) qchart drawing line chart
网络层的IP协议
Network equipment hard core technology insider router 20 dpdk (V)
后台返回来的是这种数据,是什么格式啊
学习Parquet文件格式
Leetcode 341. flattened nested list iterator DFS, stack / medium
兆骑科创创业大赛策划承办机构,双创平台,项目落地对接
STL value string learning
语音直播系统——提升云存储安全性的必要手段
Use deconstruction to exchange the values of two variables
Fluent -- layout principle and constraints

















































Mechanism to solve dead links 








Highlight the situation 2 





















