Tcp protocol: three handshakes and four waves.
Tcp Protocol (Transmission Control Protocol)
1. Connection-oriented, reliable process-to-process communication protocol
2. Tcp provides duplex service, that is, data can be transmitted in both directions at the same time.
3. Tcp message paragraph
An and tcp form a packet of several bytes
B, tcp message segments are encapsulated in ip Datagram
4. The first format serial number of the tcp message segment: the sender numbers each byte to facilitate the correct reorganization of the receiver.
Confirmation number: used to confirm the information of the sender
SYN: synchronizes the sequence number bit. Tcp needs to connect by setting this value to 1.
ACK: confirm the sequence number bit, which is used to confirm the data of the sender when the bit is 1
FIN: set this value to 1 when tcp needs to disconnect
2. Tcp connects the process of three-way handshake and grabs the bag with the bag grabbing tool.
1. The server sends the tcp message segment of FIN and ACK location 1 to the client.
2. The client returns the tcp message segment with ACK location 1 to the server.
3. The client sends the tcp message segment of FIN and ACK location 1 to the server.
4. The server returns the tcp message segment of ACK location 1 to the client in a semi-closed state when Tcp is disconnected: the client terminates sending data and still accepts data to prevent the data from being transmitted.