This article is a mirror article of machine translation, please click here to jump to the original article.

View: 7873|Reply: 6

[Source] [Actual combat]. NET/C# uses UDP to send and accept data

[Copy link]
Posted on 2022-7-10 21:29:29 | | | |
On June 6, 2022, the IETF (Internet Engineering Task Force) officially released the RFC for HTTP/3, which is the third major version of the Hypertext Transfer Protocol (HTTP), HTTP/3 always runs on QUIC (not TCP for TCP/IP, QUIC replaces it), QUIC (Quick UDP Internet Connection) is a low-latency Internet transport layer protocol based on UDP developed by Google.

QUIC protocol HTTP/3 is officially released
https://www.itsvse.com/thread-10330-1-1.html

UDP protocol

The Internet protocol set supports a connectionless transport protocol called User Datagram Protocol (UDP). UDP provides a way for applications to send encapsulated IP packets without establishing a connection. RFC 768 describes UDP.

The transport layer of the Internet has two main protocols that complement each other. Connected is UDP, which does little special other than send packet functionality to applications and allow them to architect their own protocols at the required level. Connection-oriented is TCP, which does almost everything.

UDP is the abbreviation of User Datagram Protocol, the Chinese name is User Datagram Protocol, which is a connectionless transport layer protocol in the OSI (Open System Interconnection) reference model, providing transaction-oriented simple and unreliable information transmission services, IETF RFC 768 is the official specification of UDP. The protocol number of UDP in IP packets is 17.

The UDP protocol is used to process packets like the TCP protocol, and in the OSI model, both are located at the transport layer, above the IP protocol. UDP has the disadvantage of not providing packet packaging, assembly, and packet sorting, that is, when a packet is sent, it is impossible to know whether it arrives safely and completely. UDP is used to support web applications that need to transfer data between computers. Many client/server mode network applications, including network video conferencing systems, require the use of the UDP protocol. The UDP protocol has been used for many years since its inception, and although its initial luster has been overshadowed by some similar protocols, UDP is still a very practical and viable network transport layer protocol even today.

Many applications only support UDP, such as multimedia data streaming, without generating any additional data and not retransmitting packets even if they know they are corrupted. When emphasizing transmission performance over transmission integrity, such as audio and multimedia applications, UDP is the best choice. UDP is also a good option in cases where the data transfer time is so short that the previous connection process becomes the entire traffic body.

UDP is a connectionless transport layer protocol in the OSI reference model, which is mainly used in transmissions that do not require packet order to arrive, and the inspection and ordering of packet transmission order are completed by the application layer, providing transaction-oriented simple and unreliable information transmission services. The UDP protocol is basically the interface between the IP protocol and the parent protocol. The UDP protocol is applicable to multiple applications running on the same device.

UDP provides connectionless communication and does not guarantee the reliability of transmitted packets, making it suitable for transmitting a small amount of data at a time, and the reliability of UDP transmission is responsible for the application layer. Commonly used UDP port numbers are: 53 (DNS), 69 (TFTP), 161 (SNMP), and the UDP protocols include: TFTP, SNMP, NFS, DNS, and BOOTP.

UDP packets do not have reliability guarantees, sequence guarantees, and flow control fields, and are not reliable. However, because the UDP protocol has fewer control options, low latency and high data transmission efficiency during data transmission, it is suitable for applications that do not require high reliability, or applications that can ensure reliability, such as DNS, TFTP, SNMP, etc.

review

.net/c# UDP communication gadget [source code]
https://www.itsvse.com/thread-3538-1-1.html


First, the service turns on a UDP listener, the port is: 2017,After receiving a message from the client, add the word "reply" in front of the message and reply to the client, the code is as follows:



Deploy the server to the ECS, and then open the UDP client on the local computer and send a message to the server with the following client code:

(End)





Previous:Break Glass Temporary Authorized Access Credential
Next:C# 8.0 Syntax Features: New Operator System Index
 Landlord| Posted on 2022-7-10 21:39:46 |
Posted on 2022-7-10 23:47:35 |
Learn to learn
Posted on 2022-7-11 09:01:25 |
Learn something new.
Posted on 2022-7-11 10:32:16 |
Posted on 2022-9-7 15:31:09 |

Learn to learn
Posted on 2022-9-24 14:23:13 |
Prompt:Authors are banned or removed content is automatically blocked
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com