当前位置:网站首页>UDP protocol and TCP protocol
UDP protocol and TCP protocol
2022-04-23 03:49:00 【Xiao Ming learns programming~】
Catalog
udp Characteristics of the agreement
UDP Possible problems and solutions of transmission
TCP Characteristics of the agreement
TCP Possible problems and solutions of transmission
udp Characteristics of the agreement
(1) There is no connection
UDP The communication parties do not need to communicate before data occurs , The client only needs to know the name of the server IP Address and port number can send data
(2) Transmission is unreliable
There is no guarantee that the data is reliable and reaches the opposite end in an orderly manner .
(3) For datagram
udp For the application layer and transport layer, the whole data is delivered when the data is submitted .
UDP Possible problems and solutions of transmission
(1) The reason for this problem :udp The length of the datagram is 65535 byte , But if the data to be transmitted is greater than 65535 byte Then problems will be encountered in the transmission process .
(2) Solution steps : Design application layer protocol ( Custom protocol fields ) Field
a、 Data belonging to the same application layer is cut into different blocks , because udp Transmission is not reliable , So add the same... To different data modules id.
b、udp The transmission does not arrive at the opposite end in an orderly way , Add an offset to the header , The offset is used to describe the position of block data in the whole application layer packet .
c、 Add the length of block data to the header data .
TCP Characteristics of the agreement
(1) Connection oriented
TCP Before sending data, both parties need to establish a connection , To send data
(2) Reliable transmission
TCP Ensure that the data reaches the opposite end reliably and orderly during transmission .
(3) Byte stream oriented
a、 There is no obvious boundary between the transmitted data
b、 For the receiver, when data can be received , That can receive any byte of data .
TCP Possible problems and solutions of transmission
(1) The cause of the problem :TCP The protocol is byte stream oriented , It will cause packet sticking problem during transmission , Difficult to distinguish data length .
(2) resolvent : Application layer self customization protocol , Custom protocol adds header ( Data length ) And separator
a、[ Fixed length header ] + Data and information
b、[ Fixed length Baotou ] + Data and information + Separator
c、[ Variable length header ] + data + Separator
版权声明
本文为[Xiao Ming learns programming~]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230345047838.html
边栏推荐
- Overview of knowledge map (II)
- mui. Plusready does not take effect
- Summary of knowledge map (3)
- 創下國產手機在海外市場銷量最高紀錄的小米,重新關注國內市場
- Raspberry pie 3B logs into the wired end of Ruijie campus network through mentohust, creates WiFi (open hotspot) for other devices, and realizes self startup at the same time
- ROS series (III): introduction to ROS architecture
- ROS series (IV): ROS communication mechanism series (3): parameter server
- [latex] formula group
- you need to be root to perform this command
- AI CC 2019 installation tutorial under win10 (super detailed - small white version)
猜你喜欢
Identifier, keyword, data type
Idea debug debugging tutorial
Concepts of objects and classes
Variables, constants, operators
The art of concurrent programming (6): explain the principle of reentrantlock in detail
Solve the technical problems in seq2seq + attention machine translation
Process seven state transition diagram
Openvino only supports Intel CPUs of generation 6 and above
硬核拆芯片
Detailed explanation on the use of annotation tool via (VGg image annotator) in mask RCNN
随机推荐
Alphafpld upgrade alphafold multimer
Second kill all interval related problems
Numpy's broadcasting mechanism (with examples)
What to pay attention to when writing the first code
Why is it necessary to divide the variance by 255^2 when adding Gaussian noise using the imnoise function of MATLAB
Common exceptions
ERROR: Could not find a version that satisfies the requirement win32gui
Wechat payment iframe sub page has no response
【李宏毅2022 机器学习春】hw6_GAN(不懂..)
Leetcode 617 merge binary tree
[AI vision · quick review of NLP natural language processing papers today, issue 29] Mon, 14 Feb 2022
Create virtual machine
什么是软件验收测试,第三方软件检测机构进行验收测试有什么好处?
使用大华设备开发行AI人流量统计出现时间不正确的原因分析
Detailed explanation on the use of annotation tool via (VGg image annotator) in mask RCNN
7-1 introduction to finance
[AI vision · quick review of today's sound acoustic papers issue 1] Thu, 14 APR 2022
Use the thread factory to set the thread name in the thread pool
Vscode delete uninstall residue
The whole process of connecting the newly created unbutu system virtual machine with xshell and xftp