 Hello everyone, welcome to lecture on user datagram protocol. At the end of this session, students will be able to explain the format of a UDP packet and every field of it. Also, students will be able to identify the services provided by the UDP. Now before starting with the UDP, let's recall what is the position of UDP in the TCP-IP protocol suite. If you remember, it is present in the transport layer. Now user datagram protocol, it has some characteristics. First end to end means that the application can send or receive data to or from another application directly. Also UDP is a connectionless service provider means that application does not need to pre-establish a connection before sending data or need not to terminate a connection when the data send is finished. Next the application identification means that each application assigned with an integer number called protocol number means on every host there are n number of application is running at the same time and each application is identified by a number which is called as a port number. Service UDP provides unreliable datagram service unreliable means that the packets may be lost or delivered out of order at the receiver side as compared to TCP-IP, TCP is provided packets in order and it can be with the help of flow control or error control. No buffering before transmission means that when the data comes from the IP layer to UDP, it sends directly to the application without storing it or without holding the data in the buffer. Now that UDP is a same present protocol at transport level in addition to TCP. It supports network applications. It is placed directly above the internet protocol in the TCP-IP protocol suite. Main purpose is to outline the network traffic in the form of datagrams. Datagrams means it has first 8 bytes which is nothing but the header and remaining bytes are nothing but the data. If you see that it is a format shown over here that is UDP user datagram which is having first 8 bytes is a header byte and then remaining bytes are nothing but the data. Now let's see the each field which is present in the header one by one. So if you see the diagram it shows there are four fields. First is a source port number which is a 16 bits port number. Second field is a destination port number which is also 16 bits port number. Third one is a total length which is of 16 bits means that the total length of a UDP header plus data the field gives the total number of bytes present in the UDP header also and data. And the last field is the checksum which is of 16 bits. If it is 0 then there is no checksum required in the UDP and if it is 1 then it is a checksum over a pseudo header plus UDP data area. Now let's see UDP and TCP comparison. In the form of performance if you see TCP uses a window based flow control scheme whereas UDP does not have any flow control mechanism in it. Then TCP is a slow start algorithm reduces throughput UDP does not have any algorithm it directly takes the data from IP layer and it's transferred to the application. So there is no buffer in the UDP TCP has extra overhead per segment. If you remember in the TCP header there are more fields as compared to the UDP that is window size then checksum flow control. It has more overhead as compared to the UDP UDP sends small and insufficient datagrams. In the form of reliability if you see TCP provides reliable and in-order transfer of data whereas UDP provides unreliable services as we previously said, packet loss due to overflow and errors and out of order datagram delivery can happen in the UDP. Because there is no flow control and in-order sequence provision in that. Next is a multicast and broadcast it is only supported by the TCP. Data size UDP datagram limited to 64 kbps. Now let's see the services provided by the UDP in the form of multiplexing and demultiplexing. At the sender side multiplexing of UDP datagrams is done means that there are n number of applications running on the sender side and it is identify each application is identify the port number assigned to that particular application or process. So every process has data to send. So UDP multiplexing done with the it takes data from each application and multiplex together and sends to the receiver side to appropriate application program. A single sequence of UDP datagram is passed to the application layer for the transmission purpose. At the receiver side the demultiplexing of datagram is done. A single sequence of UDP datagram is received from the IP layer and UDP datagram received is passed to the appropriate application by using the port number. So these are the some well known port number used in UDP. If you see the port number 7 is having a protocol of ECO and it used to ECOs a received datagram back to the sender means datagram received from which sender the receiver sends one ECO to that sender that the datagram is received. Similarly there are some different port numbers are there. The only used one is 13 that is a protocol is a datetime which returns the date and time. Now let's see one example. The following is a dump of a UDP header in hexadecimal format that is CB8400D001C001C. Now think that what is the source port number, what is the destination port number, what is the total length of the user datagram, what is the length of the data and is the packet directed from a client to server or vice versa and what is the client process. So you have to answer these questions from above hexadecimal number. Now the solution for this is that the source port number is a first four hexadecimal digits because if you remember UDP data header having a first field is a source port number which is of 16 bits so first four digits are nothing but the source port number. So CB84 is a source port number then destination port number is a second four hexadecimal digits that is 00D or it in digit form is 13 the third four hexadecimal digits are 001C defines the length of the whole UDP packet as 28 bytes. So now you are having a total length of the UDP packet that is 28 bytes so you know the fixed size of UDP header is 8 bytes so length of the data is defined as a 28 minus 8 that gives 20 bytes. Since the destination port number is a 13 which is a well known as we seen in the previous table the packet is from the client to server and the client process is the day time you can check it from the previous table. So these are the references thank you.