InetDaemon
The guy  "geeks" call for tech support..

User Datagram Protocol (UDP)

User Datagram protocol is an unreliable, connectionless protocol. It does not check for errors, or even to see if the transmitted data was received. However, because it does not provide these services, it has lower overhead and is thus faster than TCP. UDP will provide better throughput on a reliable network.

Domain Name Service, Trivial File Transfer Protocol and Simple Network Management Protocol all use UDP.

UDP DATAGRAM FORMAT

A UDP datagram is encapsulated withn an IP datagram and therefore is prefixed with IP information.

    0      7 8     15 16    23 24    31
   +--------+--------+--------+--------+
   |     Source      |   Destination   |
   |      Port       |      Port       |
   +--------+--------+--------+--------+
   |                 |                 |
   |     Length      |    Checksum     |
   +--------+--------+--------+--------+
   |
   |          data octets ...
   +---------------- ...
   

UDP DATAGRAM FIELDS

Source Port
The source port is the virtual port number assigned by the local computer when it transmits data to a remote machine. This is typically a number above 1023 and is the next highest number not already in use. This field is not always used, but when it is, it should indicate the port number the remote machine should use when sending any replies back to the source.
Destination Port
The Destination port is usually a 'well known port number' such as 69 for trivial file transfer protocol, or 53 for DNS. These port numbers allow the remote machine to recognize a request for a particular type of service. When used with a source port, this allows a remote machine to recognize a data connection.
Length
Length is specified as a number of octets, and since it's a 16-bit value, it provides for a datagram of up to 65,535 bytes, including the header and data.
Checksum
A checksum is calculated using the the 16-bit one's complement of the one's complement sum of data pulled from the IP header, the UDP header, and some of the data. This data is padded with zeroes so that it is a multiple of two octets before the checksum algorithm is run.

The purpose of UDP is to break up a stream of data into datagrams, add a source and destination port information, a length and a checksum. It is the receiving application's responsibility to detect and recover lost or damaged packets, as UDP doesn't take care of this.

You can think of UDP as riding "inside" IP. The networking layer protocol IP handles packet ordering, segmentation and re-assembly, as well as the routing between the source and destination.

 

 


index >>

YOUR DONATIONS SUPPORT THE CONSTRUCTION OR COMPLETION OF TUTORIALS THROUGHOUT THIS SITE

Comments and Suggestions | FAQ's | About InetDaemon.Com | About InetDaemon | Acceptable Use Policy | Privacy Policy
© 1996 - 2008 InetDaemon, InetDaemon Enterprises

This is a 'WHYFF' (We Help You For Free) site. One Person maintains this site in his spare time.
InetDaemon is an IT expert, not an English professor. Grammar and spelling errors are to be expected.

Standard disclaimer: The statements, views and opinions presented on this web page are those of the author and are not endorsed by, nor do they necessarily reflect, the opinions of the author's present and/or former employers or any other organization the author may be associated with. We do not warranty or guarantee the correctness of the information provided or its fitness for any purpose.