Protocols working at the transport layer

What are the agreements?

TCP[Transmission Control Protocol]
UDP[User Datagram Protocol]

What is the difference between them?

TCP UDP
Connection-oriented Connectionless
reliable Unreliable
low efficiency efficient
Two-way transmission One-way transmission

What is connection-oriented

Refers to the establishment of a connection between the two parties before communication

What is connectionless

Means that both parties do not need to establish a communication line in advance, but send each packet with a destination address to the network line, and the system independently selects the route for transmission

TCP segment

Source port number : port number of the sending process
target port number : port number of the receiving process
number : for the correct recombinant recipient
acknowledgment number : the message sender to confirm
the header length : TCP header length
window size : Acceptable local data segment Number
validation sum : error control
control bit :
URG[emergency bit]: emergency pointer valid bit, used with emergency pointer
ACK[acknowledgment bit]: when ACK is 1, the confirmation sequence number field is valid, when it is 0, it is invalid
PSH [emergency bit]: When the flag bit is 1, the receiver is required to send the data segment to the application layer as soon as possible.
RST [Reset bit]: When the RST value is 1, the TCP connection is notified to re-establish the TCP connection.
SYN [Sync bit]: Synchronization sequence number Bit, when TCP needs to establish a connection, set this value to 1
FIN[Disconnect bit]: When TCP completes data transmission and needs to disconnect, the party that proposes to disconnect will set this value to 1

UDP segment

Source port number (16) Destination port number (16)
UDP length (16) UDP checksum (16)

UDP length : point out the total length of UDP, add data
checksum to the header : error check

TCP three-way handshake


In order to punish Adam and Eve, God separated them. Although they could not see each other, their voices could convey that Adam was afraid that Eve was hungry and wanted to throw an apple to Eve. Adam threw an apple to Eve; when Eve received After arriving at Adam’s apple, he informs Adam that he has received it; after Adam knows that Eve has received it, he throws it again

Four disconnects of TCP


At this time Eve was very full, and she told Adam not to lose apples; Adam stopped collecting apples when he heard that, and told Eve that he knew; Eve got Adam's reply and told Adam to let him take a rest

Guess you like

Origin blog.csdn.net/qq_42427971/article/details/112003400