User Datagram Protocol
Welcome back to the course on Computer Network and Internet Protocols. So, in the lastclass, we have discussed about the transmission control protocol at a TCP and the severalfeatures which are there in TCP.(Refer Slide Time: 00:29)So, in this class we will discuss about another transport layer protocol which is not thatmuch widely used as TCP, but still many of the applications use a start we call it as userdatagram protocol or UDP. Apart from UDP we will discuss another protocol which isrecently developed by Google and gradually getting popularity over the internet whichwe call as the QUIC and that QUIC it uses this UDP as the underlying transport layerprotocol.So, the basic difference between the TCP and UDP is that: UDP actually is a very simpleprotocol and it does not support the functionalities which are provided by TCP. So, as wehave seen that the TCP protocol it supports the connection establishment, reliable datadelivery, flow control congestion control or the packet delivery all these differentfeatures, but to implement this kind of features in TCP certainly the protocol has asignificant amount of overhead or the signaling overhead what we call it in thenetworking term.So, this signaling over head is something like this to make the protocol correct or tomake the operation of the protocol correct. You are sending some additional data to theinternet. So, for example, for the connection establishment and the connection release,you need to send or you need to have this three way handshaking mechanism which istime consuming.So, for every individual data packet if you think about multiple sort flows which areflowing in the network just like whenever you are doing web browsing during that timeif you are sending such multiple short flows that means, HTTP request responsemessages. And if every request response message is embedded in a TCP connection thenthat is a problematic. Because for this request response message, you require threemessages for connection establishment and three messages for connection closure, sothat is one of the over head.The second over head which comes from the flow control and the congestion controlalgorithm. So, if the protocol detects that there is a packet loss you need to retransmit it.And retransmit always block the flow of the existing data packet or the new data packets.On the other hand, if you look into the congestion control algorithm, the congestioncontrol algorithm to make the congestion control algorithm distributed and to supportmax min fairness. We make the protocol in such a way that you have to start from theslow start phase. That means, you need to start from a very low value of the congestionwindow and gradually increase that value to reach the capacity because you do not knowthat capacity.Now, if you think about a high speed link in that high speed link itself you are startingfrom a very low value of the congestion window and then applying the slow start toreach at the operating point. But with this, if you just think about your flows are veryshort like just like a HTTP request response message, by the time the TCP flow willreach to the operating point the connection will get closed because you have transferredyour request and response message for HTTP. And you will again start a new TCP withthis new set of congestion control algorithm or the new set of slow start mechanism.So, because of this protocol the TCP, it has this significant amount of overhead whichmakes the protocol very slow for practical deployment although it supports a goodamount of reliability and works perfectly or works correctly over a real network. But formany of the application, we do not tolerate or we are not able to tolerate or some time wedo not require this kind of additional services. What is more required is to send a datasomehow at the other end, and then just parse the data.So, one application is just like your DNS protocol or the domain name system protocol.So the DNS protocol for sending a DNS request and the DNS response, you do notrequire a TCP connection establishment, because that is going to be a significant overhead rather you just send a DNS simply the DNS message. And if the DNS message isnot responds, you will certainly have a timeout at the sender side you can again requestfor the domain name with the next message.So, for that we support this user datagram protocol or UDP protocol in the internet. So,this UDP just provide you the end-to-end packet delivery or in UDP we term it as thedatagram; so end-to-end in datagram delivery. So, it doesn’t provide any of the serviceslike this connection establishment, reliable data delivery, flow control and congestioncontrol, ordered packet delivery all these things in the network.(Refer Slide Time: 05:26)So, these are the broad features and the uses of TCP. So, the feature is that first of all it isa very simple protocol. It is or sometime we say that it is not at all a transport layerprotocol. It is just like a wrapper on top of the IP layer. So, whatever services is beingprovided by the IP layer, the same set of service is just forwarded to the application bybypassing the basic transport layer functionality. So, UDP works like a wrapper on top ofthe IP layer, the protocol is very fast, because you do not need to wait for the slow startphase. You do not need to wait for the connection establishment and the connectionclosure, and you do not have any flow control and the congestion control algorithm. Theprotocol itself is very fast and it worked nicely when the network has a low lossprobability.So, the use cases of UDP is to provide performance, you do not have any buffer like TCP.So, you can give or support a protocol with faster delivery whenever your link is good,or you do not bother about the packet loss. And it is the kind of short and sweet protocol.So, it does not have any overhead. And it is suitable for short message transfer just likethe domain name system.(Refer Slide Time: 06:49)So, as I have mentioned that UDP is connectionless and unreliable. So, you just send datapackets or datagrams one after another. If a datagram is being lost the server does nottake care of that or the packet get lost. So, you do not care about that. So, if theapplication cares about packet loss, the application will apply its own acknowledgementmechanism or its own procedure for handling or recovering from the loss. So, you justcreate a datagram and send it one after another. So, you do not have any connectionestablishment. You do not bother about whether the server is running or not. You simplysend a packet you do not have any reliability and no acknowledgement mechanism.(Refer Slide Time: 07:33)So, this is the structure of the UDP header. So, earlier we have looked into the structureof the TCP header. So, compared to the TCP header this UDP header is fairly simple youonly have four different fields the source port, the destination port, the length and thechecksum that is all and then you have that data. So, the source port and the destinationport at the server port, and the client port, the length of the packet which is required tofind out that how much data is there in your UDP datagram and a checksum field tocheck the correctness of the packet.So, although reliability is not implemented, but at the server side or the destination side,you want to find out whether the packet or the datagram that you have received whetherthat is a correct datagram or something got some some happened or something gotflipped. So, you want to find out that, so that is when we put the checksum field.Now, checksum calculation in TCP and UDP, so I have not mentioned that during thediscussion of TCP just kept it for the discussion here. So, this checksum calculation inTCP and UDP is a nice feature. So, how checksum is calculated or what is checksum, thedetails of checksum. We will discuss later on while we will look into various errorcorrection codes in the context of data link layer, but just to give you a brief idea thatchecksum is nothing but a function. So, you can think of checksum as a function if. So,inside that function you are providing the message and then you are getting certain value.So, whatever value you are getting, so this C this is the checksum that C you are puttinghere. Now, because the checksum is of fixed length, you can think of this function as ahash function. So, any hash function can be used as a checksum, but ideally these IPchecksum or internet checksum which we apply for network data transfer. It is not acomplicated hash function like our traditional cryptographic hash function, because wedo not require that one way property that much rather we are just concerned about to geta fixed size message digest out of the message. So that is why this internet checksumcomputation is fairly simple.And if you are again apply a cryptographic hash or a complicated hash function here, itwill take a significant amount of time to compute that corresponding checksum, so thatwe do not what. So, we simply use a simple method for doing the checksum. So, asimple method as the name suggests in internet the checksum is just like you divide theentire message into fixed size block, and then make ones complement addition tocompute the checksum, so that is the basic idea of internet checksum that we apply here.Now, in internet checksum, so the detailed procedure of internet checksum and examplewe’ll discuss later while we discuss about the error correcting code as I mentioned justbefore. But ultimately this checksum is giving you a fixed size code that is the C. Now,whenever you are receiving this message at the receiver end what you do whatever youare receiving with this received data, again you apply the same function to compute thechecksum. And find out that what is the checksum that has been transferred with themessage and the checksum that has been computed at the receiver side whether they aregetting matched or not. If they are getting matched, that means, whatever value has beentransferred from the sender side, you have received that for a particular value.Now, again remember that checksum is not to ensure packet integrity from the securityattacks or the external attacks. It is just to ensure packet integrity from the network faultor the system faults. So, whenever you are transferring the data because many of the timeyou are doing a digital to analog conversion or analog to digital conversion, thenencoding decoding a packet, you are applying the modulation technique at the physicallayer. So, it may happen because of the sampling error or the quantization error some bitideally or it was one but that got flipped to 0 during this analog digital conversion or themodulation and coding states or some zero bits got flipped to 1.So, just to detect those kinds of things we apply the checksum. It is not to not to ensurethat the packet is free or the packet has saved from some security attack based on thecryptography or network security point of view. So, because of that so whateverchecksum you are getting at the receiver side you compute the checksum value that hasbeen transferred with the packet if they matches, that means, the packet integrity got fizzup, there was no such error that has been introduced during signal processing. And youhave received the correct datagram that was sent by the sender. Now, while compute thechecksum in TCP and UDP; TCP and UDP takes certain things into consideration duringchecksum computation.(Refer Slide Time: 13:02)So, as we have said that checksum is nothing but a function in where you are taking amessage in as input and you are computing the checksum value. Now, in this message, soTCP or UDP, they put TCP or UDP header plus the data that you are sending plus apseudo header. So, this pseudo header is actually not transmitted with the packet, it isjust used for the computation of checksum. And once the checksum is computed thatpseudo header is getting dropped or that is that gets dropped.So, what is the content of the pseudo header, the content of the pseudo header is thesource IP, the destination IP, then the protocol field from the IP header. So, it actuallytakes certain fields from the IP header. So, all these frame fields are coming from the IPheader. And the fourth is the reserved bits. So, there are 8 reserved bits in IP. So, thosereserved bits from the IP header. So, all these fields comes from the IP header so thatway we consider the pseudo header in the computation of checksum. But remember thatthis pseudo header is not transmitted with the packet rather once you have computed thechecksum; then do just put the checksum and discard the pseudo header. At the receiverend, receiver will again construct the pseudo header and compute the checksum make amatch with the received checksum and drop that pseudo header.Now, the thing is that; what is the purpose of including the pseudo header in thechecksum computation; so this pseudo header is included in the checksum computationjust to do a double validation of the source IP, destination IP and a protocol field, and areserved value field. So, these fields are very important from the perspective oftransmission of a packet because these fields actually help you to identify the correctsource at the correct destination.
User Datagram Protocol- Part 2
So, although IP header includes its own checksum field,but this IP header changes the checksum at every individual layer, because if you lookinto the network diagram you have this source followed by multiple hops routers andthen finally, is your destination.Now, every router they apply the routing mechanism, they look into the IP header, theymay make they may change the IP header and then they again compute the checksum,the IP header checksum and put it at the part of the IP header. So that is why thechecksum which is there in the IP header they may get changed whenever you are goingfrom one layer three hop to another layer three hop. So, all these are the layer threedevices. So, whenever you are going from one layer three hop to another layer three hopthen the things may get changed. But at the same time we do a end-to-end validationwith this end-to-end protocols.So, this transport layer protocols are basically the end-to-end protocols. So, the UDPheader or the TCP header never gets changed at the lower layer of the protocol stack atthe internet layer of the protocol stack so that UDP header or the TCP header will neverget changed at the individual routers. So that is why we make a double check in the TCPheader or the UDP header by putting this pseudo header at the source IP, destination IP.All these fields that this intermediate router somehow there this fields has not gotchanged.Because, in the router if you later on will discuss the entire processing of the routers youwill see that whenever it receives an IP packet, it takes the IP header out, applies therouting mechanism then again adopt the IP header and send it to the outgoing link,because that IP layer processing is done at the router level. So, if there is certaininconsistency or certain faults inside the router that may introduce an error to the sourceIP or the destination IP field. So, we want to make sure through this integrity change atthe UDP header that no such error has been occurred during the transmission of thetransport layer segment or in TCP or the transport layer datagram at UDP. So, that is whyyou put the pseudo header as a part of the checksum computation.But as I have mentioned earlier again repeatedly I am mentioning that this pseudo headeris just used only for the computation of the checksum. And this pseudo header is nottransmitted during the transfer of the data, and that is just to check this end-to-endintegrity of the data transmission ok.(Refer Slide Time: 18:39)Now, there are multiple application that uses UDP as you have looked earlier, the DNSprotocol the domain name system protocol. It is simple request response message. So, werequire it faster than TCP. So, we apply UDP there. Then this BOOTP or DHCP, they arethe network configuration protocol. Again they are short messaging protocol which helpsfaster configuration of the device devices. TFTP, TBL, file transfer protocol it is a simplelightweight file transfer protocol to transfer small files. SNMP, the network managementprotocol or the simple network management protocol it is again a simple UDP protocolwhich is easily cut through congestion than TCP.So, in TCP, if there is a congestion, then TCP reduce the rate, but in case of UDP as itdoes not take care of the congestion, if the packet comes to the buffer. And if it is notdropped from that intermediate buffer, eventually it will get transmitted so that is why weuse this UDP in case of SNMP.Then the interesting protocol comes which is QUIC, QUIC, UDP internet connection thatwas developed by Google a couple of years back which is a advance of the transportprotocol. So, idea behind QUIC is to overcome many of the shortcomings which werethere in TCP, because of the slow start phase, the connection establishment for everyindividual flow. And in QUIC UDP provide a direct access to IP.So, with the help of UDP, what QUIC does, that it directly send a packet via IP, butwhatever additional facilities like flow control, congestion control, reliability, all thesethings are there, they are implemented as a part of application with a secure binding. Whenever you are moving to a different page, you need to create adifferent TCP connection.Now, for every TCP connection you require three way handshaking. So, just to send afew HTTP request response message, you require three connection at three wayhandshaking at the sender side and a three way handshaking during the connectiontermination as well. Now, QUIC actually solves this problem in this way. So, in case ofQUIC, during the initial handshaking, whenever you are connecting to the server for thefirst time during that time you have to do a detailed handshaking. But after that, you donot need to do that detailed handshaking rather you can directly use the previoushandshaking part the connection that has already been established to send further data.So, this works in this way. So, as I have mentioned that QUIC is an end-to-endencryption protocol because of that you require certain credential from the server. Now,initially that client does not have those kinds of credentials. So, the client sets a sends ainchoate CHLO, client CHLO. When the client says this inchoate client CHLO which isreceived by the server, and the server finds it out that the client CHLO does not has therequired security certificate, it sends a reject message. And with this reject message theserver sends the security credential to the client.Now, the client has the security credential. With this security credential, it sends acomplete client CHLO. Now, here the interesting thing is that because the client hasalready received this reject message from the server, the client actually knows that theserver is running, and the server is ready to accept packet. So, the client can start sendingencrypted request. Now, if the server wants to send the message from the server side tothe client side, that means the responses, the server sends a server CHLO initially. Afterthe server CHLO is sent, because the server has already received the client credentialfrom this client CHLO, it starts sending the encrypted responses from the server side. So,you actually require 1-RTT here.Now, once this connection has been established, then for the next ongoing connectionsbetween the same set of client server, you do not require this 1-RTT handshake ratheryou require a 0-RTT handshake. That means, you already have received the servercredentials, because you already have received the server credentials. You can start withthis complete client CHLO. And you know that the server is running because it hasalready received certain packets. So, you can start sending the encrypted request. And ifthe server wants to send data to the client, server start with a server CHLO and then theencrypted responses. This is not only one encrypted response, it can send multipleresponses or (Refer Time: 26:06) multiple requests simultaneously.Now, sometime it may happen that well during this time, it may happen that the servercredential has been changed.(Refer Slide Time: 26:15)If the server credential has been changed, when the server received this complete clientCHLO, the server sends reject message with the updated server credential. Now, withthis updated server credential, the client can reinitiate the connection and start sendingthe request. So, whenever the server credential gets changed, you require a 1-RTThandshake. And at the initial time you require a 1-RTT handshake; after in between youcan always use the 0-RTT handshake to transfer the packets ok.(Refer Slide Time: 26:49)Another interesting feature of QUIC is to support multi streaming. And it supportssomething called head of line blocking free protocol. I will come to that point of what ismean by head of line blocking in a couple of minutes. So, what happens in HTTP 1.1 thatyou can have multiple TCP streams one after another and to with this multiple TCPstreams you can send multiple with every TCP stream you can send multiple requestresponse messages in between the client and the server.But, because you are having these multiple TCP streams in parallel for every individualstream, you should have this connection establishment and every TCP stream will gothrough the slow start phase. So that is the overhead for HTTP 1.1, so that is why inHTTP 2 or sometime that was a earlier proposal from Google, they call that particularprotocol as SPDY. So, in that particular protocol, you can multiplex multiple streamstogether.So, here you are combining all these streams together and have a single TCP connectionbetween the server and a client. So, here all these streams are getting multiplexed to asingle stream. And this multiple stream is sent to the client. So, in this case you have aproblem called head of line blocking. What is that? Say the nature of the TCP is that if itreceives a single out of order packet, then it put that out of order packet in the buffer andstart sending duplicate acknowledgements. But if it does not receives in order packet,then it will not send the packet to the application.Now, here whenever you are combining multiple streams together what happens, even ifa single packet get lost, because of that single packet lost this entire TCP connection willget blocked and which will in turn block all the streams even if certain packets fromcertain streams are receiving at the buffer.(Refer Slide Time: 29:01)So, because you have a single connection, say assume red packet got lost. And this is thestream corresponds to the red packet. These are the streams corresponds to the bluepackets and the black packets. Even if you are receiving blue packets and the blackpackets, because you have a single TCP connection, the TCP connection will not sendthose packets to the corresponding stream.So, those streams will also get blocked. So, this is called the head of line blocking. Now,QUIC solves this head of line blocking problem by using UDP connection. So, UDPconnection does not have this problem of blocking due to reordering. So, UDP simplypasses the packet to the streams. And then the streams take cares of the QUIC protocolitself takes care of sending the packet to the individual streams. And it maintains thestream wise flow control and a congestion control algorithm.So, I am not going to the flow control and the congestion control algorithm of QUIC indetail. If you are interested you can look into the specific draft or the SIGCOMM (ReferTime: 29:53) 2017 paper. Another interesting feature in QUIC is that TCP uses thisduplicate acknowledgment, but QUIC does not use the duplicate acknowledgement.Even for a retransmission, it assigns a new sequence number to the packet. So, becausethe packets are basically transmitted over UDP, QUIC is not a stream oriented protocol;it does not use the byte sequence number rather it uses the packet sequence number forsimplicity. And for every packet, that means the original packet as well as theretransmitted packet, it puts a new sequence number, so that is why you do not have thisproblem of duplicate sequence number and blocking due to this duplicateacknowledgements.So, these are few of the features of QUIC and this protocol QUIC is gradually gettingpopularity in the internet, many of the services like YouTube or Google Drive which iscoming from Google. Google has already started a deployment of QUIC, and the currentversion of chromium based browsers, they have the implementation of QUIC. So, manyof the recent protocols have started using QUIC, recent applications are mostly all theapplications from Google they have started using QUIC. So, possibly QUIC is the futureprotocol which is going to replace the standard TCP based data delivery. And during thattime UDP is actually going to be more important compared to TCP. So that is possiblythe future of internet, so that is all about the transport layer protocol a different kind oftransport layer protocol.In the next couple of classes, we will do a practical thing. We look into this concept ofsocket programming and network programming. We will see that with the help of thesocket programming, how you can access a specific transport layer protocol and you canstart transmission of data. And you can write your own application by utilizing thisdifferent type of transport layer protocol. We will see certain demo of that. And then wewill move to the next layer of the protocol stack that is the internet layer or the networklayer of the protocol stack.Thank you all for attending this class. See you again.
Log in to save your progress and obtain a certificate in Alison’s free Advanced Diploma in Computer Networks and Internet Protocol online course
Sign up to save your progress and obtain a certificate in Alison’s free Advanced Diploma in Computer Networks and Internet Protocol online course
Please enter you email address and we will mail you a link to reset your password.