|
|
UDP provides connectionless datagram communication between applications on networked hosts. As the sender does not know which processes are active on the destination host at any given moment, UDP uses a destination protocol port number (a positive integer) to specify the type of service that is required from the remote host. A protocol port receives and holds messages in queues until an application is ready to retrieve them.
UDP provides connectionless, unreliable message delivery in a similar manner to IP. It offers no assurance that datagrams will be delivered nor does it protect against duplication. Applications that require reliable delivery of datagrams must implement their own reliability checks when using UDP. The receiving application can use the source and destination port numbers and checksum in the UDP header to verify that a message has been delivered correctly. Applications that require reliable delivery of streams of data should use TCP.
The format of a UDP header is illustrated in ``UDP header format''.

UDP header format
A UDP header contains the following fields: