当前位置:网站首页>UDP message structure and precautions
UDP message structure and precautions
2022-07-25 02:19:00 【Skinny monkey 117】
Catalog
The original situation of the network
The original situation of the network
The original situation of the network : Data in the network , Between routers , Jumping 、 Like a relay , To the target host , There are two problems :
1. Network transmission is unreliable
1) The data you sent , The other party does not guarantee to receive2) There is no guarantee that the other party will receive it strictly in the order in which it was sent
Because the road may be different , It is difficult to guarantee that the data will arrive in the order of departure .
2. The Internet is not secure
1) All the data you send , The routers along the way can be checked or modified ( hacking 、 Tampering )2) Others can fake the data you send
The transport layer UDP
User Datagram Protocol User message protocol
UDP Is a very simple transport layer protocol , It just fulfills the most basic responsibilities of the transport layer ( stay host to host Together with the case , Realization process to process).
The network layer itself is unreliable ,UDP I haven't done any treatment , therefore ,UDP It's not reliable .It's not reliable here , Not at all UDP What did you do , Just become unreliable , It is UDP You've done nothing at all? , Therefore, the unreliability of the network layer is directly expressed to the application layer , So from the perspective of application layer , We just said UDP It's not reliable .
UDP What has been done ( Mechanism )
UDP The head of the newspaper (header) What does it look like , The contents of these headers , It's all cooperation UDP The agreement fulfills its duties .
1. Responsibilities in the header of all network protocols :How to unpack ( How to put header and payload Separate )
byte[]data = {12345}
2. The problem of distribution , stay UDP in , The problem of distribution is actually process to process The problem of .
UDP Public praise of (UDP Characteristics ) From the perspective of application layer :
shortcoming : unreliable
advantage : There is no connection 、 Data oriented message 、 The cost is low ( cheap )
UDP Header structure
How can the recipient be based on header Unpack the data in . because header The length of is fixed ( Fixed length ), front 8 Bytes must be header, The rest must be payload.
UDP length : The length of the whole message .64kb16 position (bit) = 2 byte (byte) = 2^16-1=65535——>65535 / 1024 = 64kb
How to make it for distribution , Which process of the application layer should the data be handed over ?
Use the destination port . At the same time, it can support reply , Also bring the source port .
The checksum
UDP buffer
buffer
UDP No send buffer
UDP There's a receive buffer
Summary
边栏推荐
- Peripherals: interrupt system of keys and CPU
- Yunyuanyuan (VIII) | Devops in depth Devops
- [programmer interview classic] 01.09 string rotation
- Freedom and self action Hegel
- Cloud native platform, let edge applications play out!
- Several application scenarios of NAT
- Data management process model of science and technology planning project
- After six years of precipitation, new consumption has found a digital transformation paradigm
- [leetcode] 2. Add two numbers - go language problem solving
- Industrial control safety PLC firmware reverse III
猜你喜欢

Hcip - BGP - border gateway protocol

After six years of precipitation, new consumption has found a digital transformation paradigm

Detailed explanation of the principles and differences between static pages and dynamic pages

Several application scenarios of NAT

Use SAP ui5 application to consume create and delete operations of OData in business application studio

Using ODBC to consume SAP ABAP CDs view in Excel
![ASP. Net core 6 framework unveiling example demonstration [01]: initial programming experience](/img/26/18fd3106f887f503479f081e29dac3.jpg)
ASP. Net core 6 framework unveiling example demonstration [01]: initial programming experience
![[linear DP] Digital triangle](/img/8c/f7392733ef8e13b20c394da8b4c403.png)
[linear DP] Digital triangle

What are the important trends revealed by the release of "operator data viability index"?

Google launched another "man grabbing war" for core making, and Intel's 17 year veteran joined!
随机推荐
After six years of precipitation, new consumption has found a digital transformation paradigm
The importance of system to Philosophy Hegel
Web vulnerability
Example demonstration of "uncover the secrets of asp.net core 6 framework" [02]: application development based on routing, MVC and grpc
Simulation Implementation of [STL] string class
Automatically create partition tables by time and month in PostgreSQL
Academicians said: researchers should also support their families. They can only do short-term and fast research if they are not promoted
Chinese son-in-law OTA Ono became the first Asian president of the University of Michigan, with an annual salary of more than 6.5 million!
Android memory optimized disk cache
Talk about what's going on with C # backstage GC?
Focus on improving women's and children's sense of gain, happiness and security! In the next ten years, Guangzhou Women's and children's undertakings will make such efforts
Apk packaging process
Codeforces:d1. choosing carrots (easy version) [max min problem + control one side to make the other side as close as possible + thinking]
Origin and development of philosophy Hegel external historical form
Can PostgreSQL CDC only connect to the main database? Connection from the library reports an error logical decoden
An article explains unsupervised learning in images in detail
PostgreSQL views tables, table indexes, views, table structures, and parameter settings
Simulate the implementation of strstr
Completefuture parallel asynchronous return processing
Hbuilderx developed by uni app connects to night God simulator









