当前位置:网站首页>Demo of UDP communication applied to various environments
Demo of UDP communication applied to various environments
2022-07-24 05:59:00 【Joey Boye o (* ^ ^ ^ *) o】
List of articles
`
One 、Ubuntu Compile... In environment Demo Code instance
pure C udp Unicast receive and send instances Demo link
udp Multicast Demo Multicast receive and send instance links
Two 、 be based on visual studio 2013 In the environment udp agreement Demo C++
udp unicast Demo vs Links in the environment
udp Multicast Demo vs Links in the environment
summary
UDP yes User Datagram Protocol For short , Chinese name is user datagram protocol , yes OSI(Open System Interconnection, Open system interconnection ) A connectionless transport layer protocol in the reference model , Provide simple and unreliable transaction oriented information transfer services ,IETF RFC 768 [1] yes UDP The formal norms of .UDP stay IP The protocol number of the message is 17.
UDP Deal with the TCP The protocol is also used to process packets , stay OSI In the model , Both are located at the transport layer , be in IP The next level of agreement .UDP Packet Grouping is not provided 、 The disadvantages of assembling and not being able to sort packets , in other words , When the message is sent , It's impossible to know whether it arrived safely and completely .UDP Used to support network applications that need to transfer data between computers . Including the network video conference system, many customers / Server mode network applications need to use UDP agreement .UDP The protocol has been used for many years since it came out , Although its original glory has been covered by some similar agreements , But even today UDP It is still a very practical and feasible network transport layer protocol .
Many applications only support UDP, Such as : Multimedia data stream , No additional data will be generated , Don't resend even if you know that there are broken packets . When transmission performance is emphasized instead of transmission integrity , Such as : Audio and multimedia applications ,UDP Is the best choice . In data transmission time is very short , So that the previous connection process becomes the main body of the whole traffic ,UDP It's also a good choice . [3]
Content
UDP yes OSI A connectionless transport layer protocol in the reference model , It is mainly used in the transmission which does not require the packet to arrive in sequence , The checking and sorting of packet transmission order is completed by the application layer [4] , Provide simple and unreliable transaction oriented information transfer services .UDP The agreement is basically IP The interface between protocol and upper protocol .UDP The protocol is applicable to multiple applications running on the same device .
UDP Provides connectionless communication , And there is no reliability guarantee for the transmission of data packets , Suitable for transmitting a small amount of data at a time ,UDP The application layer is responsible for the reliability of the transmission . frequently-used UDP The port number has :53(DNS)、69(TFTP)、161(SNMP), Use UDP The agreement includes :TFTP、SNMP、NFS、DNS、BOOTP.
UDP The message has no reliability guarantee 、 Sequence guarantee and flow control fields, etc , Poor reliability . But because of UDP Protocol has fewer control options , Small delay in data transmission 、 High data transmission efficiency , Suitable for applications with low reliability requirements , Or applications that can guarantee reliability , Such as DNS、TFTP、SNMP etc. .
function
In order to identify multiple destination addresses on a given host , At the same time, multiple applications are allowed to work on the same host and can send and receive data packets independently , Design User Datagram Protocol UDP.
UDP Use the underlying internet protocol to transmit messages , Same as IP Provide unreliable connectionless packet transmission services . It does not provide message arrival confirmation 、 Sort 、 And flow control .
UDP Helper Can achieve the specified UDP Relay and forwarding of port broadcast message , About to specify UDP The broadcast message of the port is converted into unicast message and sent to the specified server , Act as a relay .
The main features
UDP It's a connectionless protocol , No connection between source and terminal is established before data transmission , When it wants to transfer, it simply grabs the data from the application , And throw it on the Internet as soon as possible . At the sending end ,UDP The speed of data transmission is only affected by the speed of data generated by the application 、 The capacity of the computer and the limitation of the transmission bandwidth ; At the receiving end ,UDP Put each message segment in the queue , The application reads one message segment at a time from the queue .
Because the transmission data does not establish a connection , So there is no need to maintain the connection state , Including sending and receiving status, etc , Therefore, a server can transmit the same message to multiple clients at the same time .
UDP The title of the packet is very short , Only 8 Bytes , be relative to TCP Of 20 In terms of a byte packet UDP The extra cost is small .
Throughput is not regulated by congestion control algorithm , Only affected by the rate of data generated by the application 、 Transmission bandwidth 、 Source and terminal host performance limitations .
UDP It's message oriented . The sender's UDP Message delivered to the application , After adding the header, deliver it down to IP layer . Neither split , It doesn't merge , But keep the boundaries of these messages , therefore , The application needs to select the appropriate message size .
although UDP It's an unreliable agreement , But it's an ideal protocol for distributing information . for example , Report the stock market on the screen 、 Display aviation information, etc .UDP Also used in routing information protocols RIP(Routing Information Protocol) Modify the routing table in . In these applications , If a message is lost , In a few seconds, another new message will replace it .UDP Widely used in multimedia applications .
Protocol comparison
UDP and TCP The main difference between the two protocols is how to achieve reliable transmission of information .TCP The protocol includes a special delivery guarantee mechanism , When the data receiver receives the message from the sender , A confirmation message is automatically sent to the sender ; The sender will continue to transmit other information only after receiving the confirmation message , Otherwise, it will wait until the confirmation message is received . And TCP Different ,UDP The protocol does not provide a guarantee mechanism for data transmission . If a packet is lost during the transmission from the sender to the receiver , The protocol itself does not make any detection or prompt . therefore , Usually people put UDP Protocol is called unreliable transport protocol .
TCP It's a connection oriented transport control protocol , and UDP Provides connectionless datagram service ;TCP With high reliability , Ensure the correctness of the transmitted data , There is no loss or disorder ;UDP Do not establish a connection before transferring data , Do not check and modify datagrams , There's no need to wait for a response , So there will be packet loss 、 repeat 、 Disorder , Applications need to be responsible for all aspects of transmission reliability ;UDP With better real-time , Work efficiency is higher TCP Protocol high ;UDP Segment structure ratio TCP The segment structure is simple , Therefore, the network overhead is also small .TCP The protocol can ensure that the receiving end receives the byte stream sent by the sending end without error , Provide reliable communication services for applications . Communication systems that require high reliability often use TCP To transmit data .
Applicable occasions
In the choice UDP As a transport protocol, we must be careful . In a very unsatisfactory network quality environment ,UDP Protocol packet loss will be more serious . But because of UDP Characteristics of : It is not a connection protocol , Therefore, the consumption of resources is small , The advantage of fast processing speed , So usually audio 、 Video and ordinary data are used in transmission UDP More , Because even if they occasionally lose one or two packets , It will not have a great impact on the received results . For example, we chat with QQ It is used UDP agreement . [7]
The practical application
In the field of field measurement and control , For distributed controllers 、 Monitor, etc , Its application environment is relatively harsh , In this way, different requirements are put forward for the data to be transmitted , Such as real-time 、 Anti interference 、 Safety and so on . Based on this , In field communication , If an application wants to transmit a set of data to another node in the network , May by UDP The process adds the header to the data and sends it to IP process ,UDP The protocol eliminates the process of establishing and removing connections , The retransmission inspection mechanism is cancelled , It can achieve high communication rate .
边栏推荐
- 信号与系统:希尔伯特变换
- js星星打分效果
- Deepsort summary
- ++cnt1[s1.charAt(i) - ‘a‘];
- day-7 jvm完结
- Could not load library cudnn_cnn_infer64_8.dll. Error code 126Please make sure cudnn_cnn_infer64_8.
- STM32 DSP library MDK vc5\vc6 compilation error: 256, (const float64_t *) twiddlecoeff64_ 256, armBitRevIndexTableF64_ 256,
- 用指针访问二维数组
- 绘制轮廓 cv2.findContours函数及参数解释
- day1-jvm+leetcode
猜你喜欢

Machine learning (Zhou Zhihua) Chapter 3 Notes on learning linear models
![[MYCAT] MYCAT configuration file](/img/53/63a633d3ae917e3754f9f7f5c6567f.png)
[MYCAT] MYCAT configuration file

用指针访问二维数组

Qt新建工程简介

Jupyter notebook选择conda环境

《统计学习方法(第2版)》李航 第15章 奇异值分解 SVD 思维导图笔记 及 课后习题答案(步骤详细)SVD 矩阵奇异值 十五章

Positional argument after keyword argument

Could not load library cudnn_ cnn_ infer64_ 8.dll. Error code 126Please make sure cudnn_ cnn_ infer64_ eight

删除分类网络预训练权重的的head部分的权重以及修改权重名称

列表写入txt直接去除中间的逗号
随机推荐
String methods and instances
[activiti] process example
Typora installation package in November 2021, the last free version of the installation package to download v13.6.1
Loss after cosine annealing decay of learning rate
Machine learning (zhouzhihua) Chapter 1 Introduction notes learning experience
Openwrt quick configuration Samba
《统计学习方法(第2版)》李航 第十三章 无监督学习概论 思维导图笔记
解决ModularNotFoundError: No module named “cv2.aruco“
The problem that the user name and password are automatically filled in when Google / Firefox manages the background new account
Xshell远程访问工具
Iotp2pgate two IOT devices point-to-point communication fast implementation scheme
Machine learning (Zhou Zhihua) Chapter 3 Notes on learning linear models
AD1256
LSTM神经网络
JS star scoring effect
Points for attention in adding spp module to the network
《统计学习方法(第2版)》李航 第16章 主成分分析 PCA 思维导图笔记 及 课后习题答案(步骤详细)PCA 矩阵奇异值 第十六章
【深度学习】手把手教你写“手写数字识别神经网络“,不使用任何框架,纯Numpy
传统的k-means实现
Raspberry pie is of great use. Use the campus network to build a campus local website