1.TCP and UDP protocol

TCP/IP Transport layer protocol of protocol family

* TCP(Transmission Control Protocol)
* transport protocol
* UDP(User Datagram Protocol)
* User datagram protocol
2.TCP protocol

* TCP Is connection oriented , Reliable process to process communication protocol
* TCP Provide full duplex service , That is, data can be transmitted in both directions at the same time
* TCP Message segment
* TCP Grouping several bytes into a group , Call message segment (segment)
* TCP Message segments are encapsulated in IP In datagram

  illustrate : Connection oriented network protocol , It means that a connection must be established before communication between the communication parties , Like making a phone call , Both parties need to establish a connection before calling

Wireless connection network protocol , It means that the communication parties do not need to establish a communication line in advance , Instead, each packet with a destination address is sent to the network line , The system independently selects the route for transmission , such as QQ Send message

3.TCP Message segment

* Serial number : The sender numbers each byte , Facilitate the correct reorganization of the receiving end
* Confirmation number : Information used to confirm the sender
* Window size : Used to describe the number of locally acceptable data segments , Window size is variable
* SKY: Synchronous sequence number ,TCP Set this value to 1
* ACK: Confirm sequence number , When the value is 1 Hour , Data used to confirm the sender
* FIN: When TCP When disconnected, set this position to 1

4.TCP Three handshakes and four waves

4.1 Three handshakes


* computer A To the computer B Send connection request
* computer B Received to A Send confirmation message and connection request
* computer A Received to B Send confirmation message
4.2 Four waves

*   computer A To the computer B Send disconnect request and confirmation
* computer B towards A Send confirmation message ( computer A After receiving the information , Disconnect and B Connection for , but B Not disconnected A Connection for , So it is semi closed )
* Then the computer B towards A Send disconnect request and confirmation
* computer A towards B Send confirmation message
4.3TCP Semi closed state

 TCP a party ( Usually client ) Can terminate sending data , But data can still be received , Called semi closed state . The specific description is as follows (1) Client send FIN Message segment , Half closed the connection , Server send ACK Message segment acceptance half closed ,(2) Server continues sending data , The client only sends ACK confirm , No more data sent .(3) When the server has sent all the data , Just send FIN Message segment , Customer resend ACK Message segment , This closes TCP connect .

Here are some TCP Common port numbers and corresponding functions

©2019-2020 Toolsou All rights reserved,
C++ of string of compare usage Python Study notes ( one )evo Tool usage problems ——Degenerate covariance rank, Umeyama alignment is not possibleRISC-V_GD32VF103-TIMER0 timer interrupt java Array subscript variable _Java Basic grammar : array be based on stm32 Control four-wheel trolley motor drive ( one ) be based on redis Design of liking function Software engineering career planning mysql Query random data by conditions _MySQL Random query of several qualified records centos7 install RabbitMq