TCP packet capture analysis of simulation wireshark

1) Virtual Machine Installation tcp / udp communications test tools, open TCP listening [9999] Port

2) Client Installation tcp / udp communications test tool, ip + port connected to the server

At this point the client and server to establish connections three-way handshake

TCP three-way handshake
first handshake: the client sends a SYN packet to the server and enter SYS_SEND state, waiting for the server to confirm
second handshake: server receives the client's SYN packet, send an ACK, while sending their own SYN packet, this when the server enters a state SYN_RECV
third handshake: the client receives the SYN + ACK sent by the server, enters the ESTABLISHED state, and the server sends an acknowledgment ACK SYN packet, the server receives ACK client after entering ESTABLISHED state
when the client and after the server into the ESTABLISHED state, between the client and server can start two-way data transfer.

 

3) the client and server communications
client sends 11111111, the server replies 222222

4) client disconnects
disconnect will be four times and waved.
The first wave: Close active and sends a FIN state enters FIN_WAIT1
second wave: closing the passive to the active closing FIN receiving party side and transmitting the ACK, this time off the passive state party enters CLASE_WAIT; has received the active close passive ACK side after closing, the state enters FIN_WAIT2
third wave: closing passive sends a FIN LAST_ACK state and enters
the fourth wave: active close passive shutdown has received and sends the FIN ACK transmission, this time into the active close side TIME_WAIT state, 2MSL time after closing the connection, the passive side closed off after receiving the active side of the ACK, the connection is closed.

 

 

 

Published 60 original articles · won praise 20 · views 4585

Guess you like

Origin blog.csdn.net/zhaikaiyun/article/details/104873552