0xnhl

UDP

/ Update
2 min read

UDP (User Datagram Protocol) is a lightweight, connectionless transport protocol in networking. It prioritizes speed and low latency over reliability. By skipping connection establishment and delivery guarantees, UDP is ideal for time-sensitive applications where occasional data loss is acceptable.

Advantages of UDPDisadvantages of UDP
UDP is much faster than TCP.UDP doesn’t care if the data is received.
UDP leaves the application layer (user software) to decide if there is any control over how quickly packets are sent.It is quite flexible to software developers in this sense.
UDP does not reserve a continuous connection on a device as TCP does.This means that unstable connections result in a terrible experience for the user.

UDP Packet#

UDP packets are much simpler than TCP packets and have fewer headers. However, both protocols share some standard headers, which are what is annotated in the table below:

HeaderDescription
Time to Live (TTL)This field sets an expiry timer for the packet, so it doesn’t clog up your network if it never manages to reach a host or escape!
Source AddressThe IP address of the device that the packet is being sent from, so that data knows where to return to.
Destination AddressThe device’s IP address the packet is being sent to so that data knows where to travel next.
Source PortThis value is the port that is opened by the sender to send the UDP packet from. This value is randomly chosen (out of the ports from 0-65535 that aren’t already in use at the time).
Destination PortThis value is the port number that an application or service is running on the remote host (the one receiving the data); for example, a webserver running on port 80. Unlike the source port, this value is not chosen at random.
DataThis header is where data, i.e. bytes of a file that is being transmitted, is stored.

UDP is stateless. No acknowledgement is sent during a connection.
/attachments/Networking-UDP-78805a22


UDP
https://nahil.xyz/vault/networking/network-protocols/udp/
Author Nahil Rasheed
Published at May 22, 2026
Disclaimer This content is provided strictly for educational purposes only.