USER DATAGRAM PROTOCOL

The User Datagram Protocol gives application programs direct access to a datagram delivery service, like the delivery service that IP provides. This allows applications to exchange messages over the network with a minimum of protocol overhead.UDP is an unreliable, connectionless datagram protocol. (As noted before, "unreliable" merely means that there are no techniques in the protocol for verifying that the data reached the other end of the network correctly.) Within your computer, UDP will deliver data correctly. UDP relies on the upper layer protocol for both error correction and reliable service. The protocol is transaction oriented and delivery and duplicate protection are not guaranteed. The major uses of this protocol are DNS and TFTP.

UDP has a small header and for all intents and purposes it adds Port addressing to the IP header. The IP header routes datagrams to the correct host on the network. UDP routes the datagram to the correct application.
UDP Header
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
Source Port (16 bits)
Destination Port (16 bits)
Length (16 bits)
Checksum (16 bits)
Data

  • User Interface :-A user interface should allow
    1. the creation of new receive ports,
    2. receive operations on the receive ports that return the data octets and an indication of source port and source address,
    3. an operation  that allows  a datagram  to be sent,  specifying the data, source and destination ports and addresses to be sent.

  • IP Interface :- The UDP module  must be able to determine  the  source  and  destination internet addresses and the protocol field from the internet header.  One possible  UDP/IP  interface  would return  the whole  internet  datagram including all of the internet header in response to a receive operation. Such an interface would also allow the UDP to pass a full internet datagram complete with header to the IP to send. The IP would verify certain fields for consistency and compute the internet header checksum.
  • Why do applications programmers choose UDP as a data transport service? There are a number of good reasons. If the amount of data being transmitted is small, the overhead of creating connections and ensuring reliable delivery may be greater than the work of
    retransmitting the entire data set. In this case, UDP is the most efficient choice for a Transport Layer protocol. Applications that fit a "query-response" model are also excellent candidates for using UDP. The response can be used as a positive acknowledgment to the query. If a response isn't received within a certain time period, the application just sends another query. Still other applications
    provide their own techniques for reliable data delivery, and don't require that service from the transport layer protocol. Imposing
    another layer of acknowledgment on any of these types of applications is inefficient.

    for details refer RFC 768