当前位置:网站首页>TCP interview
TCP interview
2022-06-26 11:13:00 【Unable to type 314】
TCP interview
Preposition
tcp The following brain map is not a big problem in dealing with the interview
Brain map in hand , Don't panic

wireshark Grab the bag
Use wireshark Grab the bag and remember tcp Three handshakes , Four waves
1.springboot Get ready
@RestController
public class HelloController {
@GetMapping("/")
public String hello() {
return "";
}
}
Start project
2.cmd perform curl command
curl localhost:8080
3. Observe wireshark The change of

Relevant interview questions
Why? TCP When you connect, it's 3 Time ?2 Can't you do it again ?
Because we need to consider the problem of packet loss when connecting , If you just shake hands 2 Time , In the second handshake, if the confirmation message segment sent by the server to the client is lost , At this time, the server is ready to send and receive data ( It can be understood that the server has successfully connected ) According to the , But the client has not received the confirmation message from the server , So the client doesn't know if the server is ready ( The client is not connected successfully ), In this case, the client will not send data to the server , It also ignores the data sent by the server .
If it's three handshakes , Even if there is a packet loss, there will be no problem , For example, if you shake hands for the third time, the client sends a confirmation ack Message lost , The server has not received the confirmation within a period of time ack The message will enter again
Line second handshake , That is, the server will resend SYN Message segment , After receiving the retransmitted message segment, the client will send a confirmation to the server again ack message .
Why? TCP When you connect, it's 3 Time , When it was closed, it was 4 Time ?
Because it can only be disconnected when the client and server have no data to send TCP. And the client sends out FIN Message can only ensure that the client has no data sent , The server does not know whether the data is sent to the client . And the server receives the client's FIN After the message can only reply to the client a confirmation message to tell the client that the server has received your FIN Message , But my server still has some data to send out , After these data are sent, the server can send it to the client FIN message ( Therefore, it is not possible to combine the confirmation message with the
FIN The message is sent to the client , It's here one more time ).
TCP and UDP difference
It is not allowed to combine the confirmation message with the
FIN The message is sent to the client , It's here one more time ).
TCP and UDP difference

边栏推荐
猜你喜欢
随机推荐
Work report (3)
ACK攻击是什么意思?ACK攻击怎么防御?
[deep learning theory] (7) long and short term memory network LSTM
02 linked list of redis data structure
修改calico网络模式为host-gw
哈希表的前置知识---二叉搜索树
Group by is used in laravel to group and query the quantity
杜比全景音效简介
机器学习LDA——实验报告
APICloud 实现文档下载和预览功能
4、 Stacks and queues
Build document editor based on slate
2021 Q3-Q4 Kotlin Multiplatform 使用现状 | 调查报告
Wangeditor uploading local video modification
Machine learning SVM - Experimental Report
FastRCNN
介绍一下实现建模中可能用到的时间序列预测之线性二次移动平均,Excel的简单操作
dd命令测试华为鲲鹏&宏衫固态存储磁盘读写速度
MySQL 30 military regulations
工作汇报(3)









