当前位置:网站首页>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
边栏推荐
- Wechat applet canvas draws a simple asymptotic color of the dashboard
- [AI vision · quick review of robot papers today, issue 28] wed, 1 Dec 2021
- Variables, constants, operators
- The art of concurrent programming (3): an in-depth understanding of the principle of synchronized
- AI CC 2019 installation tutorial under win10 (super detailed - small white version)
- Common net HP UNIX system FTP server listfiles returns null solution.
- CRF based medical entity recognition baseline
- Identificateur, mot - clé, type de données
- 标识符、关键字、数据类型
- (valid for personal testing) compilation guide of paddedetection on Jetson
猜你喜欢
PyMOL usage
The art of concurrent programming (6): explain the principle of reentrantlock in detail
Design and implementation of redis (4): what is the event driver of redis
AI CC 2019 installation tutorial under win10 (super detailed - small white version)
Mechanical design knowledge point planning
知乎有问题,谁来解答?
标识符、关键字、数据类型
变量、常量、运算符
ROS series (4): ROS communication mechanism series (4): topic communication practice
创下国产手机在海外市场销量最高纪录的小米,重新关注国内市场
随机推荐
[AI vision · quick review of robot papers today, issue 29] Mon, 14 Feb 2022
According to the category information and coordinate information of the XML file, the category area corresponding to the image is pulled out and stored in the folder.
How to introduce opencv into cmake project
SQL topic exercise summary
Retrieval question answering system baseline
The art of concurrent programming (6): explain the principle of reentrantlock in detail
Install PaddlePaddle on ARM
硬核拆芯片
Common net HP UNIX system FTP server listfiles returns null solution.
ROS series (4): ROS communication mechanism series (4): topic communication practice
ROS series (IV): ROS communication mechanism series (1): topic communication
Design and implementation of redis (6): how redis achieves high availability
Identifier and type conversion
you need to be root to perform this command
[AI vision · quick review of NLP natural language processing papers today, issue 29] Mon, 14 Feb 2022
Use the thread factory to set the thread name in the thread pool
变量、常量、运算符
VS Studio 修改C語言scanf等報錯
Installation and configuration of MinGW under win10
Definition format of array