Transport Layer: Reliability
Welcome back to the course on Computer Networks and Internet Protocol. So, in the lastclasses you have looked various services in transport layer of the protocol stack, and wehave looked into in details the connection establishment and the connection terminationprocedure. So, today we look into the second services which is the flow control and thereliability in transport layer.(Refer Slide Time: 00:40)So, the flow control and reliability ensures that whenever you have established certainend to end connection between the two remote host, so on top of that connection, nowyou need to send a sequence of data.So, in transport layer in TCP kind of protocol you send it in the form of sequence ofbytes. On the other hand in certain version of transport protocols, the data is transmittedin the form of sequence of packets or sequence of segments. So, in this end to endconnection which is being established on the two end of the devices, the two end devices,here our objective is the first objective is that the sender should not send more datacompare to what the receiver can receive.So, this particular methodology or this particular philosophy, we call it as a flow controlalgorithm. So, the flow control algorithm ensures that the sender is always aware aboutwhat a receiver can receive or how much data the receiver can receive. And, accordinglythe sender adjusted its rate of transmission, such that it does not overshoot the rate atwhich the receiver can receive. At the same time, as we have discussed earlier that thelower layer of the protocol stack is kind of unreliable.So, whenever the network layer forwards packets or forwards data to an remote host, thenetwork layer does not ensure that there is a kind of guaranty or assurance that your datawill be delivered at the other end. So, it makes a best try to deliver your data based onyour destination address and finding out the intermediate hops through which the packetneed to be delivered. But on the other hand, this network layer it does not bother aboutthat how much data need to be pushed to the network or how much data need to betransferred.And as a result what happens in a packet switching network that I described in the lastclass, that the intermediate buffers, at the intermediate network devices that at therouters, they may get filled up and you may experience a buffer over flow from thoseintermediate routers. And because of that whenever you are delivering a data through thisnetwork layer using the IP delivery method, there is always a possibility that aconsiderable number of data frames or data segments, they are getting dropped from thefrom the network layer.Now, the task of the transport layer is to consider that to find out or to sense whethercertain data has been transferred correctly at the other end or not and if it is nottransferred at the other end correctly, then apply this reliability mechanism to ensure thatevery message which is send by the application layer that is getting delivered at the otherend eventually.So, the broad idea is that you sense the channel, you sense the media to find out whetherthe data is being transmitted correctly or not, if the data is not being transmittedcorrectly, that means, the other end is not able to receive the data. If you are able to findit out, then retransmit the data to make sure that eventually the data is received by theother end receiver.Now, in a typical transport layer this flow control and reliability are implementedtogether. So, we look into the different mechanism through which we implement the flowcontrol and the reliability algorithms over the transport layer of a TCP/IP protocol stack.So, let us proceed with the detailed mechanism of that one.(Refer Slide Time: 04:25)So, this is the broad idea of ensuring reliability. So, as I have mentioned that yournetwork layer provides you an unreliable channel. So, the network layer does notguarantee that the packet that it is trying to deliver at the other end it will be eventuallytransmitted. So, there is always a possibility of buffer overflow from the intermediaterouters because of which there is a possibility of data loss.Now, we are we are having some hypothetical function or hypothetical method which isthrough which we are making a interaction among different layers to make youunderstand about the entire procedure. Now if you just think about from the applicationperspective, the application always wants or the application always try to have anmethodology through which you will be able to ensure reliability.So, that means, the application always wants that if a sender is or a sending process issending certain message or certain data, that data will be eventually received by thereceiver. So, the receiver will receive all the messages. So, you can just think of anapplication like a file transfer. So, the entire large file is divided into multiple chunks andthen the sender process sending the data bits for that file.Now, at the receiver end you need to ensure that all the data that is send by the senderthat is received eventually otherwise you will not be able to reconstruct the entire file.So, that is why from the application perspective, reliability is at most importance formany of the application. But as I have mentioned earlier that they are exist a certaingroup of applications where reliability are is not that much important; rather deliveringthe data or delivering the messages more important within a predefined time or duration.And in that cases we use UDP type of protocols where reliability is not a concern orreliability is not used. But for the application, for the set of applications when reliabilityis a concern, during that time the application always expects that the data or the messagethat is transferred from the application, they will be eventually received at the receiverside.Now, the application here expects a reliable channel. So, the question comes that yournetwork layer is unreliable. So, on these unreliable channels, how can you express orhow can you write a methodology to ensure reliability. So, the idea is there that at thetransport layer, you have this reliable data transfer protocol at the sender side and thereceiver side.So, this sending sending process at the network layer it is unreliable send “udt_send()”,that express a unreliable way of sending the data. On top of that you are implementingthis reliability mechanism which is ensuring that reliable data send on top of thetransport layer.So, whenever you are making a interfacing between the network layer at the transportlayer, there you have this unreliable data send and at the interface of transport layer andthe application layer, you have the interface of reliable data send.Now, at the other end it receives the data in a reliable way because of this reliable datasend mechanism which is there and this reliable data transfer protocol at the receiverside, eventually it will receive the message and it will deliver the data to the applicationlayer.So, that way the application layer will always expect a reliable delivery of the messages.And here we will see that in the transport layer, how can you implement this twomechanism at the sender side, and at the receiver side which will help you to ensurereliability in the system.So, let us look into this process in details. So, as I as I discussed earlier during thediscussion of a different layer of the TCP/IP protocol stack, that certain services areimplemented in multiple layers of the protocol stack. So, this flow control and errorcontrol these are the two mechanism which are implemented both at the transport layerand the data link layer. So, the question comes that, why do we need to implement flowcontrol at the transport layer as well as the data link layer.So, if you if you just ask the question in this way that let us assume that I have my flowcontrol algorithm in the data link layer which is being implemented, do I need to havethe flow control algorithm at the transport layer itself?(Refer Slide Time: 09:05)So, let us look into one example where you have this flow control algorithm at the datalink layer. So, the data link layer ensures this hop by hop flow control algorithm. So, aswe have learnt already that your data link layer protocol, it ensures the hop by hopprinciples, the hop by hop transmission of data where as the transport layer, it ensures thecomplete end to end delivery of the data. Now whenever we are saying that the flowcontrol algorithm is implemented at the data link layer, it is like that this hop by hop flowcontrols are implemented.So, if you think about this as the intermediate routers R1, R2 and R3 and this is thesource and this is the final destination. So, these flow control algorithm at the data linklayer, it ensures that you have flow control mechanism between S and R R1 between R1and R2 between R2 and R3 and between R3 and the D.Now so, this hop by hop flow control algorithms are there. Now the question comes if Ihave this hop by hop flow control algorithm, do I still need to have a flow controlalgorithm at the transport layer? Now just think of a scenario that well this link from S toR1, it is 10 mbps; the link from R1 to R2, it is 5 mbps; the links from R2 to R3, it is 3mbps and the link from R3 to this D this is 1 mbps.Now, what happens here that whenever you are implementing this hop by hop flowcontrol at the data link layer, then from S to R1, the S finds out that well I can send thedata at a rate of 10 mbps. So, it sends the data at a rate of 10 mbps. But then R1 finds outthat it will not be able to send the data to R2 at a rate of 10 mbps, although it is receivingthe data at a rate of 10 mbps, but it requires 5 mbps of transmission. Similarly R2 it findsout that it will not be able to send data at a rate of 5 mbps; rather it need to sends the dataat 3 mbps and finally, from R3 to D it can only send the data at a rate of 1 mbps.Now, if S does not know that this entire, so if you look into the effective rate of thisentire end to end path. So, this effective rate of this entire end to end path will be equal to1 mbps. Now if S does not get this information, S will try to push the data at a rate of 10mbps and what will happen that R1 will not be able to deliver the data to R2 and so on.So, that way that additional data which is coming to R1; so, R1 is receiving the data at arate of 10 mbps, but it is only able to deliver the data at a rate of 5 mbps. So, that as aresult this additional data that it is receiving, it will get on filling up the buffer spacewhich is available at R1 and eventually what will happen, that eventually we willexperience the data loss from the buffer due to buffer over flow.So, there will be a huge amount of data loss because source is transmitting data at a rateof 10 mbps, but the receiver the other end, receiver is only able to receive data at a rateof 1 mbps. And as a result this 9 mbps of data that will get accumulated over the differentlayers of buffers at different intermediate routers; and after some time it will experience adrop of data from those intermediate buffers, and this the reason that we are not able toimplement. If we implement this flow control algorithm only at the data link layer forhop by hop flow control, it is not sufficient. We have to implement it at the transportlayer.Now, let us look into the other way around - like you have this end to end flow controlalgorithm and in that case, still we still we require that this flow control algorithm at datalink layer or not. Now in transport layer, what happens that you are only ensuring the endto end data delivery or end to end flow control algorithm?(Refer Slide Time: 13:03)So, you have one router with which your source is getting connected. Then you have thisintermediate network, then another router and then your destination which is there. Andyou are only ensuring the flow control among these two end host and just think about theearlier example that you are sending data at a rate of 1 mbps.Now, you just think of two intermediate routers here in the network. Now this router hasmultiple incoming ports. So, it is just like a road network that you are getting data frommultiple parts all together. So, you are getting data from this link, you are getting datafrom this link, you are getting data from this link and so on.So, that way it may happen that which link is pushing data at a rate of 1 mbps, but thisindividual links may push data at a rate of 2 mbps and say this link is pushing data at arate of 5 mbps. But this out going link it only has a speed of say 3 mbps. In that casebecause this multiple incoming link are getting converged in a intermediate router, it mayhappen that the total incoming rate which is being there from multiple others incominglinks that is exiting the total out going capacity that the router has. And because of thatthis end to end flow control algorithm, it may perform poorly in this kind of scenario. So,that is why to make it control to have a control, you need hop by hop flow controlmechanism in the network. But here you will see by applying this hop by hop flowcontrol algorithm in the network. So, what your task would be? Your task would be toreduce the incoming rate at every individual hop such that intermediate routers isexperience less congestion, less amount of congestion.So, by doing that you are effectively improving the performance of the system, butremember that by even after implementing the hop by hop flow control, it may not bepossible to possible to ensure complete reliability that a complete elimination of dataloss. Because you are receiving data from multiple hops and every, where there is a kindof estimation going on that what should be the ideal rate at which the one ensure send thedata at the other end, and this is the estimation takes some time. So, before the systemsmoves to the convergence there is always a possibility of having a significant amount ofdata loss.So, you will not be able to completely eliminate the data loss by applying this hop byhop flow control mechanism, but certainly you can improve the performance. And that isthe reason we say that flow control mechanism, the error control we will discuss later on.
Transport Layer: Reliability - Part 2
The flow control and this error control mechanism at the transport layer; they areessential whereas the flow control and the error control mechanism and the data linklayer they improve the performance of your protocol.Now, let us look into different type of flow control algorithms and before going to that,why do we require this different kind of end to end protocols in the network. So, for thatI suggest all of you to read through this particular paper which was which was publishedby Saltzer Reed and Clark. So, it is a fundamental paper in Computer Networking thattalks about that, why do you require this kind of end to end protocols in the internetwhen there is this hop by hop protocols already existing. So, I suggest all of you to readthis particular paper to get more details about the principles which you are adopted in theTCP/IP protocol stack to implement this kind of end to end protocols over the internet.(Refer Slide Time: 17:02)Now, let us look into this flow control algorithm. So, the simplest flow control algorithmthat we have, we call it as a stop and wait flow control algorithm. So, the stop and waitflow control algorithm in a error free channel works as follows. The protocol is prettysimple - that you send a frame or you send a packet and then, you wait for itsacknowledgement.So, once the receiver receives this frame, it sends back an acknowledgement and thesender it waits for the acknowledgement before sending the next frame or the nextpacket. So, once you are receiving this acknowledgement, then you only send the nextframe. So, that way every frame has an acknowledgement associated with it and onlywhen you receive the acknowledgement you transmit the next frame.Now, if it is a error free channel it is always guaranteed that eventually the receiver willreceive the frame and it will be able to send you back the acknowledgement and thesender will eventually receive the acknowledgement, because it is an error free channeland there is no loss. So, once you are receiving the acknowledgement, you are sure thatthe receiver has received this particular frame and so, you transmit the next frame.So, that is the broad idea of this stop and wait protocol. So, you stop after sendingtransmission, start sending the next frame, after sending one frame then, wait for theacknowledgement; one you have received the wait, then you send the next frame.(Refer Slide Time: 18:21)Now, let us look into this flow control algorithm in a noisy channel, the same Stop andWait protocol. So, here we use the concept of sequence numbers to individually identifyeach frame and the corresponding acknowledgement. So, every frame is associated withone sequence number. So, if you look into this example, this frame 0 is associated with asequence number. So, this 0 is the sequence number for this frame and then, we aregetting an acknowledgment. So, this acknowledgement mechanism it is sendingacknowledgement 1; it is sending acknowledgement 1 means that B has correctlyreceived frame 0 and then it is expecting for frame 1.So, then you send the frame 1. So, once you have B has receive frame 1, then it sendsacknowledge 0; that means, B has received frame 1 and it is waiting for theacknowledgement 0. So, that way in a noisy channel, the first reason is the first principleis that you separate out every frame with by using the a corresponding sequence numberwhich will be uniquely identify every frame in the channel.Now, because it is a noisy channel, there is a possibility of having a frame loss becausethis frame is being lost from the network. So, if there is a frame loss, so we will not sendback any acknowledgement. So, you wait for a timeout value. So, A will wait for atimeout value and once this timeout expires, then A will returns with the frame.Now, one interesting question here is that what can be the maximum size of the sequencenumber in stop and wait? So, in stop and wait you can see that at one instance of time,only one frame can be outstanding in the network. So, whenever you have send frame 0,unless you are getting the acknowledgement from that frame; you will not send the nextframe. So, that is why 2 bit sequence number will be sufficient and because of this reasonyou can see from this diagram that, every frame is associated with one sequence numberand the sequence numbers are 0’s and 1’s. So, repeated 0’s and 1’s so; that means,whenever you have send frame 0, unless you are getting this acknowledgement with theexpected frame 1; you will not send frame 1.So, you can always be sure by looking at the acknowledgement that which for whichframe this acknowledgement corresponds to. If you are getting an acknowledgement 1;that means, you have correctly received frame 0 and you are expecting from for frame 1.So, that is the reason that we use 2 bit sequence number for a this flow control algorithmusing stop and wait and this kind of algorithm where we are utilizing the concept ofsequence number and applying flow control algorithm in case of a noisy channel, andyou can see that by applying this flow control algorithm in a noisy channel, we are alsoensuring reliability in the system.So, we are also ensuring that the receiver receives all the frames correctly. So, if there areif a timeout occurs then you retransmit that frame again. So, that this frame 0 eventuallyreceives by the receiver B. So, that way you are also ensuring reliability in the systemand this flow control and reliability algorithm all together, we call it as a automaticrepeat request or ARQ algorithms.So, now onwards we look into these ARQ algorithms in details, the different versions orthe different variance of ARQ algorithms.(Refer Slide Time: 21:41)Well, so this is a kind of sender side implementation of this stop and wait ARQ algorithmin the form of a state transition diagram.So, here the thing is that this you can think of the initial state. So, the initial state talksabout that you wait for call 0 from above; that means, you are waiting for frame 0initially. So, the event which is there it is in the sender side. So, you are from theapplication layer you are sending a reliable data delivery. Now once this things happens.So, at the transport layer side, you are making a call to reliable data delivery to send withthis data.Now, how it ensures the reliable data delivery? So, you need to map this rdt to thecorresponding udt call because if you remember that earlier, we have seen that at thenetwork layer the calls are unreliable calls like this udt calls. So, for that what you aredoing that you are appending one sequence number with this packet you are providingthe data and some checks some checksum, we will discuss later on to ensure the errorfree transmission of the data. Then you are sending the data over unreliable channel andstarting the timer.Now, whenever you are waiting for the acknowledgement 0, you are moving to the statethat you have sent the packet 0. So, you are waiting for the correspondingacknowledgement. So, here once you are receiving a packet and if you are finding outthat the packet is corrupted and in that case, you are in the same loop, you again wait foran acknowledgement. If a timeout occurs, then again you send the packet, you retransmitthe packet through this udt send mechanism. You retransmit the packet and start the timeragain. And then once you are receiving the acknowledgement, then you move to thisstate, that wait for call one because you have received that acknowledgement, now youwant to send the next frame that is frame 1. So, in that case you have received the packetfrom the upper layer and once you have received that packet and that packet is not acorrupted packet and it is the acknowledgement corresponds to frame 0. So, you aremoving to this state. Once you are in this state in that case, you are waiting for receivingthe packet from the upper layer. So, once you have received the packet from the upperlayer, then you make this send call with the data with this frame 0 and the same processgets repeated that you append this sequence number; sequence number 1 along with thedata and the corresponding checksum and then send the packet through the unreliablechannel. And you move for waiting for that corresponding acknowledgement. And thesame process gets repeated, that if you are receiving the data and the packet is corrupted,you are in this loop. If a timeout occurs, then you transmit the packet again and start thetimer again and then whenever you are receiving the acknowledgement; that means, youare receiving a non corrupted packet and you have received the acknowledgementcorresponds to frame 1; then you stop the timer and wait for this frame 0.So, that way you send this frames one after another frame 0’s and frame 1’s, one afteranother and you move through this state transition diagram to send the packets one afteranother. And ensure proper flow control along with the reliability in the system.(Refer Slide Time: 25:19)Well so, let us look into the problems which are associated with stop and wait type offlow control or ARQ algorithm. In stop and wait ARQ, first of all every packet needs towait for the acknowledgement of the previous packet. So, until you are receiving theacknowledgement for the previous packet, you will not be able to send the next packet.Now, for if you think about bidirectional connections, for bidirectional connection, youcan use two instances of stop and wait. One instances of stop and wait will ensure oneinstances of stop and wait will ensure transferring of data from A to B and anotherinstances of stop and wait will ensure transferring data from B to A, but this will againresult in a significant waste of network resources that for both the side you have to waitfor the acknowledgement.So, one possible solution to solve this particular problem is that you can piggyback dataand acknowledgement from both the direction. But even if you are piggybacking dataand acknowledgement for the both the directions, so piggybacking here means thatwhenever you are sending a data frame, along with the data frame, you also adds up theacknowledgement.So, this data is say this is going for sequence one and along with the data with sequenceone you send the acknowledgement for the previous one which is coming from B to A.So, it is like that say this is B and this is A. From B to A you are sending one data packet;for B to A whenever you are sending a data packet say A has earlier send a packet to B.You are sending the acknowledgement along with whenever you are sending the datapacket to A.So, although this piggybacking mechanism is more efficient compared to compared tothis using these two instances of stop and wait, but still it is wasting a huge amount ofresource because for all packets you need to wait for the acknowledgement.So, you will not be able to parallely transmit the packets in the network. So, to solve thisproblem we use a class of flow control algorithms which we call as the sliding windowprotocol. So, sliding window protocols are a pipe line protocol where you can sendmultiple frames or multiple packets altogether without waiting for the correspondingacknowledgement. So, you can send multiple frames and all the frames can go in apipelined way.(Refer Slide Time: 27:49)So, a broad idea of this sliding window protocol is something like this. If you look intothe stop and wait protocol, so the stop and wait protocol you are sending only one datapacket. So, only one data packet can be outstanding in the network.So, once this data packet is received by this receiver, then this receivers send back theACK and once you are receiving that ACK at the sender, then only you will be able tosend the next data packet. In case of my pipeline protocol or the sliding windowprotocol, what we do that we can send a sequence of packets and parallely we canreceive the sequence of acknowledgement.So, that way we will be able to use this pipeline concept over the network where youcould be able to send a sequence of packets all together and parallely you can receive asequence of acknowledgement. So, that way, you will be able to utilize the networkresource more efficiently because nowadays, now with this particular approach of slidingwindow protocol, you will be ensuring that more number of packets can be pushed to thenetwork if the network has that much of capacity. And parallely we will be able toreceive the acknowledgement and you will be able to adjust your transmission rateaccordingly so that you can receive the packets correctly at the other end.So, this is the broad idea of the sliding window protocol. And in the next class we lookinto this sliding window protocols in details.So thank you all for attending the class.
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.