1. Structure of UDP message
This is found in major textbooks
In fact, we should look at it this way for better understanding, from top to bottom, left to right
Source port number: sender address
Destination port number: receiver address
UDP length: UDP header + UDP payload, 2 bytes = 64KB (fixed), this is the maximum content that UDP can accept
Checksum: Check whether the data has errors
2. UDP characteristics
1. No connection:
You can communicate until the other party's port, no need to specifically establish a connection
2. Full duplex
Able to send data and receive data returned by the sender at the same time
3. Unreliable
Data is easily lost without any warning, and there is no mechanism to protect data integrity.
4. Datagram-oriented
Forward the entire data packet without splitting the data packet.