Introduction
Imagine sending a quick message to a friend without waiting for a reply or confirmation. This is the problem UDP solves by providing a simple way to send data quickly over a network without extra checks.
Imagine sending a postcard through the mail. The postcard has a return address, a destination address, a note about the size of the message, a stamp to check if it’s valid, and the message itself written on it.
┌───────────────┬───────────────┬───────────────┬───────────────┐ │ Source Port │ Destination │ Length │ Checksum │ │ (16 bits) │ Port (16 bits)│ (16 bits) │ (16 bits) │ ├───────────────────────────────────────────────────────────────┤ │ Data (variable length) │ └───────────────────────────────────────────────────────────────┘