UDP
UDP
UDP
UDP widely known as User Datagram Protocol, an alternative to the Transmission Control Protocol (TCP) and, together with IP, is also referred to as UDP/IP. Like the Transmission Control Protocol, UDP uses theInternet Protocol to get a data unit (datagram) from one computer to another. But before jumping into the nuances of this simple protocol lets take a peek into the history of its development. Earlier during the development of the protocol suite, TCP protocol was used to handle functions now performed by IP and TCP.TCP was responsible for providing network-layer connectivity, connection establishment, flow control and reliability. But soon it was realized that the reliability functions introduced an overhead, as some applications needed the reliability functions, while some did not. Hence this overhead caused a loss of performance in many applications which did not depend on reliability functions offered by TCP. The solution came in the mode of UDP User Datagram Protocol. The Original protocol was separated into IP, TCP and UDP internetworking was handled IP, and the reliability features by TCP. UDP as discussed earlier is a simple protocol that resides in Transport Layer of the OSI model. UDP was defined in RFC 768, User Datagram Protocol, in 1980.
UDP is a Simple and lighter protocol specifically because it doesn't have all the complexities of a TCP. That is UDP does not support reliability or acknowledgements and hence uses a best effort delivery model. In short the only real objective of the protocol is to serve as an interface between networking application processes running at the higher layers, and the internetworking capabilities of IP.This Process identification in UDP is done by port number. All it does is take application layerdata passed to it, package it in a simplified message format, and send it to IP for transmission.
UDP Datagram
As UDP provides no guarantees to the upper layer protocol for message delivery hence it is also referred to as Unreliable Datagram Protocol. Any reliability issues for the information must be implemented and handled in upper layers.
Source port This field identifies the sending port when meaningful and should be assumed to be the port to reply to if needed. This field is optional, when not used it should be zero. Destination port This field identifies the destination port and is mandatory. Length A 16-bit field that specifies the length in bytes of the entire datagram: header and data in total.
The minimum length is 8 bytes since that is the length of the header. Checksum The 16-bit checksum field is used for error-checking of the header and data. This field is optional. Checksum is the 16-bit one's complement of the one's complement sum of a pseudo header of information from the IP header, the UDP header, and the data, padded with zero octets at the end (if necessary) to make a multiple of two octets. Data This field contains the actual data. PSEUDO Header mystery: UDP uses Pseudo header concept to define the checksum. The pseudo header contains. The IP Source Address field. The IP Destination Address field. The IP Protocol field. The UDP Length field. The total length of this "pseudo header" is 11 bytes. It is padded to 12 bytes with a byte of zeroes and then prepended to the real UDP message. The checksum is then calculated over the combination of both pseudo header and the real UDP message, and the value is placed into the Checksum field. Note: The pseudo header is used only for this computation and is discarded; it is not actually transmitted. The UDP software in the destination device creates the same pseudo header when calculating its checksum to compare to the one transmitted in the UDP header.
UDP Basic Operation, Ports, Functions and Implementations The basic operations involved for transmission using UDP can be defined in 3 simple steps:
1.Higher-Layer Data Transfer: An application sends a message to the UDP software. 2.UDP Message Encapsulation: The higher-layer message is encapsulated into the Data field of a UDP message. The headers of the UDP message are filled in, including the Source Port of the application that sent the data to UDP, and the Destination Port of the intended recipient. The checksum value is also calculated. 3.Transfer Message to IP: The UDP message is passed to IP for transmission. At the destination device this short procedure is reversed on reception. UDP functions can be underlined as follows: UDP does not provide guarantees that its messages will arrive and no acknowledgments to show that data was received. UDP does not establish connections before sending data. It just packages it. UDP does not ensure that data is received in the same order that they were sent. UDP does not detect lost messages and retransmit them as in TCP. UDP does not provide any mechanism to manage the flow of data between devices, and congestion handling. UDP provides optional checksum capability, which can allow detection of an error in transmission or the situation where a UDP message is delivered to the wrong destination. UDP is widely used and recommended for: Data Where Performance, Speed Is More Important that is when an application values timely delivery over reliable delivery Places where data exchanges are short and the order of reception of datagram does not matter Acknowledgement of delivery is not needed Applications that require multicast or broadcast transmissions, since these are not supported by TCP.