sequenceDiagram
participant Client
participant Server
Client ->> Server:SYN
note right of Client:发送SYN请求
Server -->> Client:SYN-ACK
note right of Server:回复SYN-ACK
Client ->> Server:ACK
note right of Client:确认SYN-ACK
note over Client,Server:TCP连接已建立
Client -->> Server:数据传输
note right of Client:发送数据
Server -->> Client:数据传输
note right of Server:接收数据
Client -->> Server:FIN
note right of Client:发送FIN请求
Server -->> Client:ACK
note right of Server:确认FIN请求
Server -->> Client:FIN
note right of Server:发送FIN请求
Client -->> Server:ACK
note right of Client:确认FIN请求
note over Client,Server:TCP连接已关闭
Mermaid绘制TCP协议创建和关闭连接
于 2023-11-23 22:11:46 首次发布