Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TCP三次握手和四次挥手 #20

Open
GGXXMM opened this issue Aug 10, 2019 · 0 comments
Open

TCP三次握手和四次挥手 #20

GGXXMM opened this issue Aug 10, 2019 · 0 comments
Labels

Comments

@GGXXMM
Copy link
Owner

GGXXMM commented Aug 10, 2019

TCP三次握手

image
1、客户端——发送带有SYN标志的数据包——服务端,此时客户端进入SYN-SENT同步已发送状态(一次握手)
2、服务端——发送带有SYN/ACK标志的数据包——客户端,此时服务端进入SYN-RECV同步收到状态(二次握手)
3、客户端——发送带有ACK标志的数据包,确认建立连接,发送数据——服务端,此时客户端服务端进入ESTABLISHED TCP连接成功状态(三次握手)

TCP四次挥手

image
1、客户端——发送一个FIN,用来关闭客户端到服务器的数据传送
2、服务端——收到这个FIN后,发送一个ACK,确认序号为收到的需要加1。和SYN一样,一个FIN将占用一个序号。
3、服务端——等所有数据发送完毕后,关闭与客户端的连接,发送一个FIN给客户端
4、客户端——发送ACK报文确认,服务端收到后立即进入CLOSE状态,断开连接。

@GGXXMM GGXXMM added the 网络 label Dec 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant