Front-end interview skills collection No. 17 blog post - high-frequency test points (TCP knowledge points)

This is a record 前端面试的话术集锦第十七篇博文——高频考点(TCP知识点)and I will keep updating this blog post. ❗❗❗

First, let’s answer TCPthe relevant part of this frequently asked interview question, and then study this protocol in detail.

1. What is the difference between UDP and TCP?


TCPBasically, it's UDPthe other way around. To establish a connection or disconnect it, a handshake is required first. In the process of transmitting data, various algorithms are used to ensure the reliability of the data. Of course, the problem it brings is that it is UDPnot so efficient in comparison.

2. Head


From this picture we can see that the head is much more complicated TCPthan the head.UDP

Insert image description here

For TCPthe header, the following fields are very important

  1. Sequence number, this sequence number ensures that TCPthe transmitted messages are all in order, and the peer can splice the messages in sequence through the sequence number.

  2. Acknowledgement Number, this sequence number indicates the number of the next byte that the data receiving end expects to receive, and also indicates that the data with the previous sequence number has been received.

  3. Window Size, window size, indicating how many bytes of data can be received, used for flow control

  4. identifier

    • URG=1

Guess you like

Origin blog.csdn.net/lvoelife/article/details/132740945