Transport Layer Primitives
Welcome back to all of you in this course on Computer Network and Internet Protocols.So, till now at the transport layer we have to looked into different kind of serviceprimitives.(Refer Slide Time: 00:25)So, going from there, now we will look into that how you can combine all this servicetogether and develop an complete end to end transport layer protocol. So, we look intothis combination of multiple service together here and then we’ll go to the details of theTCP protocol in details.(Refer Slide Time: 00:45)So, as we have discussed earlier like at the transport layer whenever you are interfacingit with the application layer with specific application service. So, the transport layer it isproviding you the end to end connectivity. So now when the transport layer is providingyou the end to end connectivity, it may happen in a hypothetical scenario that there aresay one single machine which is trying to communicate with another machine.(Refer Slide Time: 01:14)So, this is one desktop D1 this is another desktop D2 we have communicate over theinternet. So, this is my internet cloud and there are other machines which are availablethere say D3 and D4. Now on this machine and a single machine there can be multipleapplication which can be running all together say this is A1, this is A2, here you arerunning again 1 application A1 other application A2 here you are running say 3applications A1, A2, A3 here you are running 1 applications say A 4.So, that way on a single machine because we are utilizing this kind of multi-taskingenvironment, they are can be multiple such applications which are running all together.Now it may happen that in a transport protocol that application at D1, so application atD1 wants to make communicate with application 2 at D3. So these two application needto communicate with each other. So, at the network protocol stack what you have to do?You have to first uniquely identify this machines that D1 and D3 want to communicateand that is not sufficient at the same time you need to ensure that the application 1 at D1wants to communicate with application 2 over D3.So, A1 over D1 wants to communicate with A2 over D3. So these communication pathneed to be established. So, the question comes that how will you uniquely identify amachine, and then how will you uniquely identify an application running on top of amachine. So, to look into that, we use 2 different addresses here, so we have the networklayer on top of the network layer, we have the transport layer and on top of the transportlayer, I have the application layer and as we discussed earlier, that this part it isimplemented as a part of your operating system. And then the transport layer they aresending these end to end segments. So, the packets are going via the network layer, butwe are considering transport layer pipe a logical pipe between these 2 transport layerentity.(Refer Slide Time: 03:45)Now, to identify these transport layer entity we use this port number, so the port numberuniquely maps this transport entity to a particular application. So, the example that weare talking about that application 1 on D1 wants to talk with application 2 at D3. So,these individual applications they are identified over the network with the help of thisport number. Similarly individual machines at the network that are identified by the IPaddress, so we bind the IP address with this network layer and we bind the port numberwith the transport layer.So, this transport layer header, it uses this source port number and the destination portnumber that will look into when you look into the details of the TCP protocol and a UDPprotocol, that at the transport layer header you have to provide the source port numberand a destination port number. So, this source port number and a destination port numberwill uniquely identify the application, which is trying to send the data or which is tryingto receive the data. So, that is the usefulness of the port number.(Refer Slide Time: 04:58)Then on top of this transport layer we logically define a pipe, so this is again a logicalpipe and you want to implement all the services transport layer services on top of thislogical pipe. So, it is just like in the telephone call you are making a hello, so wheneveryou are making a hello you want make sure that the other person is correctly receivingyour message and whenever you are saying something that hi how are you. wait for someamount of time if you are getting the respond that hello I am well, so you are happy thatthe other end has saved your message.If you have said that hello how are you and you are waiting for some 2 minutes and noresponse is coming, then again you will say that hello are you hearing, so those are theprotocols those are the kind of logical channels which you are establish establishing.Now all your messages like whenever you are saying: hello, how are you - this messageis embedded to a signal, and then transferred over the physical wire which is there toconnect your telephone network.So, the same way things happens in the data network, whenever sending data from thetransport layer, the transport layer is assuring end to end that you are able to send thedata correctly at the other end of the system and the other end of the system is receivingthe data correctly, because as we are looked into that the lower layer of the protocol stackstarting from the network layer and the below they are unreliable, so packet may getdropped from there. So, because packet may get dropped from there, at the transportlayer actually sense that whether the packet is getting dropped from there and if packet isgetting dropped, it is identified with the help of that sequence number, if the packet isgetting dropped then you retransmit the packet over the same pipe.So, unique pipe here between 2 transport layer entity, it is identified with the help of thisIP address, which is the network layer address. So, at the network layer I have this IPaddress and here I have the port number. So, I have this source IP, I have source port, Ihave destination IP, I have destination port, which is uniquely identified this pipe, butremember another point that we have discussed earlier like if a system is getting crashed,and it is restarting you have to also have an initial sequence number and to avoid thedelayed duplicate, you need to ensure that that sequence number initial sequence numberwhich you are generating, it is not using any sequence number of the forbidden regionfrom the previous connection, which is utilizing the same source IP, source port.destination IP. destination port pair. So, that is why this initial sequence number, saysource sequence number and this destination sequence number, they also become part ofuniquely identifying this logical pipe.So, in TCP or in transport layer protocol, TCP kind of transport layer protocol weidentify this logical pipe with the help of this 6 tuples, the source IP, the source port, thesource initial sequence number, the destination IP, the destination port and a destinationinitial sequence number.(Refer Slide Time: 08:18)OK. Now, let us look in to some hypothetical primitive to enable user to write a transportlayer application. So, the thing is that if you again remember that at the operating systemlevel, I have the implementation of the transport layer and then the network layer andthen the lower layer of the protocol stack and this part is implemented in your insideyour operating system and in the userspace you can write your own application. Now ifyour application say if you are building a chat application and in that chat application ifyou want to send data over the network then your application need to directly interface ordirectly interact with the transport layer.Now whenever you are saying that you need to directly interact with the transport layer,your operating system should provide certain primitives through which you will be ableto make your transport layer active and then send the data to your transport layer. Afterthat, everything will be taken care of by the transport layer and other lower layers of theprotocol stack. But from the application layer you should ask for the specific service thatyou want from the transport layer.Now to get those service let us first try to design a hypothetical transport layer protocol,by utilizing the various services that we have learnt till now and after that we look in tothe TCP protocol in details. So, that way understanding TCP will be much easier for you.So, to look in to this hypothetical protocol we are thinking of a client server thisapplication. So, I have a server, that server is ready to accept the connection, then I havea client, the client can send certain messages to the server. For the time being, just thinkof a hypothetical protocol where the client will send the server as a message like helloserver and the server will listen that message and reply back to a client that I am fine. So,to do that what the server has to do the server has to first to be in the listen state, what isthis listen state? The server here it is waiting for an incoming connection because, seewhenever you want to connect to something if the machine is not in the listen state, youwill not be able to initiate a connection, you will not be able to randomly initiate aconnection with any of the machine in the world, the machine need to be ready to acceptthe connection. So, whenever you say that is the server is in the listen state, what we areensuring? We are ensuring that the server is ready to listen some message. So, initiallythe server is in the listen state then we have the connect states, so in the connect statefrom the client you are sending so the server and this is the client.(Refer Slide Time: 11:00)So, the server is in the listen state, now from the client side, you are making a connectcall. Whenever you are making a connect call, then you are actually asking the transportlayer to initiate a end to end connection, so the transport layer will initiate a connection.So, if it is a 3 way hand shaking that we have learnt earlier, it will used the 3 way handshaking for initiating the connection. Then once this connection is established, then youcan call the send function from your application program to send the data, send the datato the corresponding server.Now once the server gets this data, so server need to accept the data from the transportlayer. So, if you remember earlier the diagram like the data will come and the data willkeep on waiting on the receiver buffer at the transport layer. And from the applicationyou have to make certain function call to get the data from that transport layer buffer. So,for that we have this receive call, so the server will make a receive call to receive thedata from the transport layer buffer. Now that way, you can send that hello message andthe server can say I am fine, server can again make a send call to send server can againmake a send call to send for the data and that way this call can go on. So, once this datatransfer is complete, then you send the disconnect message or disconnect function call todisconnect this particular connection.Now here the interesting point is this connect and the disconnect call. So, in a transportlayer if you want to get the transport layer services along with connection establishedstate. So, what you have to ensure that whenever you are making a send call or thereceive call, you are there in the connect state. That means, before you have made a sendcall and a receive call, you need to ensure that well the system has already establishedthe connection.(Refer Slide Time: 13:17)So that means to initiate a connection what you have to do, you have to write the code inthis way that if connected, I am just writing some pseudo code, then send; else wait. Sothat is at the sender side okay? Similarly at the receiver side it will be if connected, thenmake a receive call; else wait for the connection. Now in this case you can see that wellevery time you want to make a call to the send or receive, you have to check that thesystem is in the connected state. So, if only the system is in the connected state then onlywe will be able to make a call to this send or receive function.
Transport Layer Primitives- Part 2
So, that way that way, this particular primitive is important because, what we say that thetransport layer needs to remember the state of the pipe, the pipe logical pipe that we havedefined earlier, so that appropriate actions can be taken. So, if you are making a send callbefore initiating the connection, so that call is not a valid call. So, we need a statefulprotocol for a transport layer, so what is mean by a stateful protocol? That with everyconnection, you will remember that what was the state of that particular pipe throughwhich you are going to send the data.(Refer Slide Time: 14:56)So, first you have to initiate a connection. So the system is in the connect state, theexample that I have given you, that the client is in the connect state, the server is in thelisten state, you have sent a connection request and got an connection acknowledgement,both are in the established state. Established state means the connection has establishedthen you can send the data, make a send call to send the data, the server can make areceive call to receive the data even if after that the some server wants to send the dataserver can make a send call and the client can make a receive call. And once this is done,then you can make a disconnect call to disconnect this particular request. So, thisestablished is the state that the server and the client need to remember before making thesend call and the received call.(Refer Slide Time: 15:50)So, this entire thing we can represent in the form of a state transition diagram. So, this isan important concept with the concept of this transport layer, where if you want tomaintain transport layer services you need to maintain this state of your pipe, logical pipethat you are defining on top of the transport layer. So, this state transition diagram willtell you that on reception of which message, how you are moving from one state toanother state. So, let us look in to this example in details, so initially you are in the idlestate, now in the idle state so you make a connect call.So, once you have connect call, so this solid line is the client side and this dotted line isthe server side. So, you have make a connect call, so once you have make the connectcalls, that time this is you have made a active establishment, active establishment meansyou have initiated the connection; similarly the server it has received the connectionrequest segment. So, once the server has received the connection request segment it is inthe passive establishment state; that means, it has got a connection request message theyneed execute the connection primitive; that means, if it is a 3 way hand shaking itexecute that 3 way hand shaking, otherwise it send the acknowledgement and it moves tothe established state.Similarly the client when it gets the connection accepted segment it received thisconnection established segment, accepted segment and it moves to the established stateand in this established state, you can start transmitting the data whenever you are in theestablished state.Now to come out of the establish state, you have disconnect the things, then again if theclient initiate the disconnection message, so connect connect the client execute thedisconnect primitive; after the client execute disconnect primitive the client has executedit. So, it is the active disconnection after that similarly at the server side the server, if itreceive the disconnection request segment. So, it moves to the passive disconnectionthen once it execute the disconnect primitives, send the acknowledgement, the servermoves to the idle state; similarly when the client receive this disconnection request fromthe server that gives an acknowledgement to its request, it moves to the idle state.So, that way so this client by executing this connection primitive, it moves to theestablished state, the server moves to the established state and you execute thedisconnect primitive and move to the idle state back again. And here you can see that thisstate transitions are initiated by sending some messages or receiving some messages andwhenever you are in a proper state then only you are allowed to do further task. Forexample, whenever you are at the established state then only you are able to execute thesend and a receive call, otherwise you are not allowed to do that.(Refer Slide Time: 19:08)Well, so this is the server side and this is the client side that we have discussed.(Refer Slide Time: 19:16)So, in the context of transport layer till now I have use this terms segment, packet, frameinterchangeably everything to point that a network packet which is going over the link,but technically we make a differentiation between the segment, the frame and thepackets. So, in general at the transport layer whatever you are getting, so that is called asegment.So, at the segment is the concept at the transport layer. Now after getting a segment at thetransport layer, you add up the segment header at the transport layer and pass it to thelower layer that is the network layer. So, this entire thing that you are passing to thenetwork layer, that becomes the network layer payload and in the network layer thatconcept we call it as a packet.So, packet the term packet is normally used to denote the primitive at the network layer,with that you adopt the packet header and send this entire thing to the data link layer. Inthe data link layer, this entire thing that you are receiving from the network layer that istermed as a frame, so this is the frame payload. At the data link layer, you add up theframe header with the frame payload and send it to the physical layer for physicaltransmission.So, the segment it is used at the transport layer, so in the transport layer the dataprimitive we call it as a segment, at the network layer, the data primitive we term it as apacket or in the contest of UDP we call it as a data gram and then at the data link layerwe call it as a frame. So, till now you have used the term interchangeably, because thisterminologies has not been defined to you, but now onwards we’ll use this terminologywhenever we are there at a particular layer of the protocol stack. In the context of flowcontrol, I have used the term frame and segment interchangeably because as we haveseen that this concept of flow control is there at the transport layer as well as at the datalink layer. So, the flow controls are executed on top of segment as well as it is executedon top of frames, so we should not have any confusion there; but for the other primitivestry to utilize this proper term which is there.(Refer Slide Time: 21:33)OK. Now, let us look in to this entire transport layer process flow by combining all theservice primitives that we have learned. So, initially you need to have this connectionestablishment. So this connection establishment it initiate a connection by selecting theinitial sequence number. And whenever you are selecting the initial sequence number,you need to ensure that this initial sequence number do not fall within the forbiddenregion of the previous connection between the same source IP, source port, destinationIP, destination port pair. And that is why we include the sequence number as a part ofidentifying these end to end type, which we normally call as socket in the terms of Unix,later on will look how we do the programming on top of a socket.So, this same logical pipe is termed as a socket, so we defined uniquely identify aconnection uniquely identify a socket with the 6 tuples, the source IP, source port, sourceinitial sequence number, destination IP, destination port and destination initial sequencenumber.(Refer Slide Time: 22:39)Then comes the flow control and reliability, once you have set up these initial sequencenumber then that initial sequence number will be used further to ensure the flow controland reliability with the help of your ARQ protocols. So, this ARQ protocols see itensures the flow control and reliability, so the sender will not send data at a rate higherthan the receiver rate; as well as in the congestion control prospective we have seen thatthe sender rate should be minimum of the network supported rate. That means, thecongestion rate and the receiver rate. Then the sequence numbers, they are used touniquely identify each byte for a byte sequence number or if you designing a protocolwith the packet sequence number with fix size packets, then this, this sequence numberwill denote uniquely identify a packet and loss in the communication part it is handledthrough retransmission in the flow based flow based control mechanism in the basedflow control mechanism. So, you make a retransmission to retransmit the packet overthat same connection, then we have the congestion control the congestion controlalgorithm it reduces the transmission rate once congestion is detected.So, we have seen that the sender rate I am writing it has srate is minimum of the networkrate and your receiver rate. So, this receiver rate is something that is advertised by thereceiver with every individual acknowledgement and this network rate the idea is thatyou apply this a AIMD protocol additive increase multiplicative decrease protocol toensured both efficiency and free on a simultaneously. And with this help of the AIMDprotocol what you do in case of congestion control, you gradually increase the rate andyou see that this rate will gets saturate when it will reach at the receiver rate. So, ideallylet me try to draw a proper diagram so that the things become easier for you tounderstand.(Refer Slide Time: 24:45)So, initially you increase that so I am I am here with respect to time, I am plotting thesender rate for congestion control algorithm. So, initially which increase the sender rate,so once so my formula is that sender rate is equal to minimum of network rate andreceiver rate. So, initially you start network rate with a very low rate say some 1 kbps.And gradually try to increase it, so whenever you are increasing it the minimum isbecoming the network rate after that when the network rate will exceed the receiver rate,it will get saturated here, so this is my receiver advertised rate.So, after that once you are experience a packet loss, you are experiencing a packet losshere, so once you are experiencing a packet loss, you apply this AIMD concept additiveincrease multiplicative decrease concept to drop the rate again and start this procedureagain gradually increase the network rate ok. At this point if the receiver advertise somedifferent rate it will get saturated here, after that if the network again advertise that wellit can support higher rate again you start increasing it based on the network rate it willget saturated here, based on the receiver rate and then it increases again and some time ifthere is a congestion detection with the help of a loss with the detection of a packet loss,you again drop the rate.So, that way the sender rate gradually increases in a transport layer and it helps you tofind out to handle the congestion as well as the flow control simultaneously. So, here wecan see that this is the flow control algorithm and the congestion control algorithms arecoupled together.(Refer Slide Time: 27:04)So, this congestion control it reduces the transmission rate once congestion is detectedand as you have seen that it improves the performance for end to end data delivery. So,dynamically based on this rate, you start sending the data, other end to receive the datasend back the acknowledgement and accordingly will process it and once you want toclose the connection the data transmission is over. Then you execute this connectionclosure primitive, that close the connection when the data transmission is complete. Andas we have seen earlier that although asynchronous closure is good, but asynchronousclosure is not possible to implement in a distributed system with unreliable channel. Sowe go with synchronous closure with timeout.So, that is all about the basic service primitives of transport layer, in the next classonwards we’ll start looking in to the transmission control protocol or the TCP protocol indetails which is widely used in the network. So, around 80 percent of the traffic over theglobal internet it uses this TCP protocols; so will look into the TCP protocol in detailswhich is a widely accepted transport layer protocol.Thank you all for attending this 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.