当前位置:网站首页>Network communication and tcp/ip protocol
Network communication and tcp/ip protocol
2022-07-28 06:40:00 【yfyh2021】
TCP/IP
tcp/ip Agreement is the abbreviation of agreement family
- IP Equivalent to a phone number , Address when addressing .
- TCP Connection oriented 、 Reliable Streaming Protocol . It's equivalent to our confirmation before calling 、 Confirmation at the end 、 Control process . For example, we call feed , Xiao Li . well , bye . Keep your voice up , I can't hear you .
- UDP Connectionless communication protocol . Just an unreliable connection .
TCP/IP Data terms in
● Data packets (packet) It's a versatile term
● message / news (message) The application layer passes to the transport layer (tcp) The data of
● Message segment (segment) TCP Information in the data stream , Message plus tcp Baotou (20 byte )
● The datagram (datagram) IP The unit of data in . Is to add ip Baotou (20 byte )
● frame (frame) Represents the unit of packets in the data link layer
In the subnet , The computer passes through mac Address address
New employees join the company network , He will pass ARP agreement ( Data link layer ) Broadcast , The company's DHCP The server will receive the broadcast according to the new employee's MAC Address assignment IP.
TCP Three handshakes connected
reflection :
- What messages are sent by the three handshakes
- What is the status of the client and server after three handshakes
The process
- The first handshake
a. Client initiates connection . The message sent by the client contains SYN The position of the sign is 1, There is also a random value field seq_no( For example 10000), At this point, the client state changes to SYN_SENT - The second handshake
a. The server sends a message .SYN Sign bit is 1,ACK Sign bit is 1, Random value field ack_no For the client seq_no It's worth adding 1,seq_no For the random value . At this time, the server status changes to SYN_REVD - The third handshake
a. The client sends a message .SYN Sign bit is 1,ack_no For the server message seq_no The value of the add 1. At this point, the client state changes to ESTABLEISHED.
b. The server receives the message from the client , The status changes to ESTABLEISHED.
TCP Four waves
The process :
- First wave , The client sends a close request .
- Second wave , The corresponding client of the server closes the request .
- Third wave , The server sends a shutdown request .
- Fourth wave , The client sends a close confirmation request .
- Compared with the three handshakes to establish the connection , Four waves can be the first request made by the server , Or the client sends the request first . And three handshakes , The client must be the first to send the request .
Why do you need to wave four times ?
TCP It's double full-time work ( That is, the client and server can send and receive requests at the same time ), So both sides need to confirm that the connection is closed .
边栏推荐
猜你喜欢
随机推荐
What are the open earphones? Four types of air conduction earphones with excellent sound quality are recommended
Valgrind tool
JSON笔记
Get the current directory in QT
Listener
浮点型数据在内存中如何存储
Listener
2022-05-24 SpEL使用
关于Shader KeyWord的整理
如何模拟实现strcpy库函数
Pyppeteer 被识别 绕过检测
Treasure plan TPC system development DAPP construction
OJ 1129 分数矩阵
开放式耳机推荐哪款最好、性价比最高的开放式耳机
中国剩余定理 个人理解
2021-11-10
量化交易机器人系统开发
刷题记录----链表
新的selenium
万字归纳总结并实现各大常用排序及性能对比








