udp.docx

Upload: mit-thakore

Post on 04-Jun-2018

217 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/14/2019 UDP.docx

    1/7

    UDP Short Note

    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 the Internet Protocol to get a data unit (datagram) from one computer to another. Butbefore jumping into the nuances of this simple protocol lets take a peek into the history of itsdevelopment.

    Earlier during the development of the protocol suite , TCP protocol was used to handle functions nowperformed by IP and TCP.TCP was responsible for providing network-layer connectivity, connectionestablishment, flow control and reliability. But soon it was realized that the reliability functionsintroduced 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 onreliability functions offered by TCP.

    The solution came in the mode of UDP User Datagram Protocol. The Original protocol wasseparated 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. UDPwas defined in RFC 768, User Datagram Protocol, in 1980.

  • 8/14/2019 UDP.docx

    2/7

    UDP is a Simple and lighter protocol specifically because it doesn't have all the complexities of aTCP. That is UDP does not support reliability or acknowledgements and hence uses a best effortdelivery model. In short the only real objective of the protocol is to serve as an interface betweennetworking application processes running at the higher layers, and the internetworking capabilities ofIP.This Process identification in UDP is done by port number. All it does is take applicationlayer data 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 alsoreferred to as Unreliable Datagram Protocol. Any reliability issues for the information must beimplemented and handled in upper layers.

    As shown in Fig. The UDP header consists of only 4 fields.

    Source port

    This field identifies the sending port when meaningful and should be assumed to be the port toreply 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.

  • 8/14/2019 UDP.docx

    3/7

    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 isoptional.

    Checksum is the 16-bit one's complement of the one's complement sum of a pseudo header ofinformation 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 zeroesand then prepended to the real UDP message. The checksum is then calculated over thecombination of both pseudo header and the real UDP message, and the value is placed into theChecksum field.

    Note: The pseudo header is used only for this computation and is discarded; it is not actuallytransmitted. The UDP software in the destination device creates the same pseudo header whencalculating 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:

  • 8/14/2019 UDP.docx

    4/7

    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 ofa UDP message. The headers of the UDP message are filled in, including the Source Port of theapplication 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 toshow 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, andcongestion handling.

    UDP provides optional checksum capability, which can allow detection of an error intransmission 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 byTCP.

  • 8/14/2019 UDP.docx

    5/7

    UDP Ports Defined

    As you know every computer or device on the Internet must have a unique number assigned to itcalled the IP address. This IP address is used to recognize your particular computer on the

    Internet. When information is sent over the Internet to that computer it accepts that information by using TCP or UDP ports.

    TCP and UDP protocol port numbers are designed to distinguish multiple applications runningon a device from one another. Since many network applications may be running on the samemachine, computers need something to make sure the correct application on the destinationcomputer gets the data packets from the source machine, and vice versa. This is accomplishedthrough the use of the TCP or UDP port numbers. In the TCP and UDP header, there are SourcePort and Destination Port fields which are used to indicate the message sending process ID andreceiving process ID.

    Let's take an example to study it further, When a program on your computer sends or receivesdata over the Internet it sends that data to an ip address and a specific port on the remotecomputer, and receives the data on a usually random port on its own computer. If it uses the TCP

    protocol to send and receive the data then it will connect and bind itself to a TCP port. If it usesthe UDP protocol to send and receive data, it will use a UDP port. Note that once an application

    binds itself to a particular port, that port can not be used by any other application.

    Some popular examples where UDP is used are:

    Multimedia applications like streaming video , VOIP

    In multicast environment

    If an application needs to multicast or broadcast data, it must use UDP, because TCP is onlysupported for unicast communication between two devices.

    Domain Name System (DNS)

    Simple network management protocol (SNMP)

    Dynamic Host Configuration Protocol (DHCP)

    Routing Information Protocol (RIP)

    In short though functionally UDP is less complex, simpler and unreliable than TCP its advantagelies in its Speed and Simplicity. Despite its age, UDP continues to be used in mainstreamapplication like video conferencing , streaming video, multicast applications and still remains a

    prominent protocol in use.

  • 8/14/2019 UDP.docx

    6/7

  • 8/14/2019 UDP.docx

    7/7