 To compare to compare the three different techniques for switching will I'll just try and summarize some things We know already using this diagram Remember if with switching is about the ways we deliver the data through a network We send it via a number of intermediate nodes or switches switching nodes to form a Path from source to destination where that path takes multiple links and There are different approaches that the telephone network type approach is called circuit switching Where we establish a circuit from source all the way through to destination via intermediate nodes Before we send any data and then we transmit our data as a signal carrying that data What these diagrams show for the three different switching cases for On the left is circuit switching. So if you don't recognize right it on there This one is circuit switching The middle one is virtual circuit packet switching and the right one is datagram packet switching. So three different approaches With circuit switching And all right more about these diagrams with these diagrams they show an example of the timing For the three approaches in a case where we have three links if you look at the bottom Node one node one wants to send data to node four in this example There's a link to node two three and four so three links four nodes involve sources one Destination is four the intermediate nodes at two and three So this illustrates the timing of Setting up the connection It takes some time and then the transmission of data takes some time So as a reminder with circuit switching what we do is when I want to send data to someone I First establish a circuit and that's shown at the top where I send a special signal from source one through to node Destination node four here. It's called a call request signal so We often talk about a telephone call Sometimes a connection a call request or a connection request. I send a signal to the first node along the path node two Sends it on to node three and then to the destination node four and that's when the Destination if they accept this request they send back a special signal saying call is accepted This is like you dial in someone's phone number and That sends a message to their phone their phone starts ringing when they pick up the call accept message is sent back What what that does is it sets up those intermediate nodes in preparation for the data transfer? so when node two receives the call request signal node two knows that If I see an accept come back that there's going to be data from node one to node four and what node two does is sets up the The circuit between the link from node one to two So I think there's a cable from node one to node two and there's a cable from node two to node three So this call request triggers node two to effectively connect them together So the next time when the data comes on one of those cables it will go through that connection and go out on the other cable Creating a circuit and it same happens at node three So in fact when the call accept comes back it reaches node three from node four that this indicates that everything's okay Four is happy to receive the data and it goes through node three to node two and back to node one And that's when the data can be sent So we illustrate here now node one transmits the data and In circuit switching think of it from a signal perspective We establish a circuit Whatever the data whether it's someone's voice whether it's a file But think of it from a signal we transmit the data and the signal propagates across the first link and Because the circuit set up it effectively goes through node two and Propagates across the second link through node three to the third link and reaches node four the result is We can now say that node one has a link all the way through to node four. There's no physical Link, it's made up of three different links But from the perspective of the signal transmission the signal just propagates from node one all the way through to node four and you see that Nodes two and three when the data is transmitted There's no delay inside those nodes. The signal just comes in travels through a Digital circuit and then comes out on the next link and Eventually so in this example it takes some time to transmit the data and then eventually because of propagation delay The data is received at node four. So let's say it was a large file transferred takes time to transmit and Propagate we get the data with can with circuit switching Once we've transferred the data once we're finished. We send back a response saying we're finished disconnect So this acknowledgement signal saying that the data's transfers finished Three and two can disconnect That is they remove everything regarding this connection. They don't If more data wants to come from node before they'll need to set up again So it's finished at this point one thing we often care about on this this picture illustrates Is the timing and which one takes more time to transfer the same amount of data? So let's explain how the packet switching works talk about the advantages and then look at the timing in this case With packet switching we take our data that we want to transfer and break it into smaller packets The reason is With circuit switching once we establish a circuit those links are reserved for that data transfer No one else can use that That's very wasteful if We reserve the link But we don't transmit data In this case, we're sending data But in another case we may send data not disconnect but then spend a time not sending data All that time not spending data. Maybe the computer at node one is got nothing to send all of that time Is wasting the links because they've been reserved for node one through to node four the idea with packet switching both of these approaches is that we Split the data into smaller chunks send them one at a time and If it gets when we have multiple users sending data If at a particular link we have Little data coming from one user one user's got nothing to send so they've got no packets coming in Then we'll be able to send packets from another user So with many users in the network some us some are sending a lot some are sending little and it changes over time Then on average what it works out if we design the network correctly is that for links Those links can carry the packets of different users at different times and be much more efficient With circuit switching we reserve that resource just for that pair of users with packet switching We can use that resource amongst multiple pairs of users and That works well when we have applications that generate data which vary a lot When you're you've got your mobile phone running There's always services in the background your instant messaging service Your updates are always sending packets, but not continuously Maybe they send some packets over a short period of time and then send nothing and then a little bit later Send some packets and then nothing If we had a circuit switch connection to send those packets It'd be very wasteful because what would happen is your mobile phone was set up a connection Have it running all day, but maybe only 10% of the time would it be sending packets? With packet switching you just send the packet when you need to send it an internal internally in the network if you're not sending packets the network can deliver someone else's packets and That's much more efficient We've got two different variations of packet switching Datagram packet switching this one on the right and the one in the middle is virtual circuit packet switching The name suggests We use packets and we have the advantage of being more efficient because we don't reserve the entire set of resources But we try and have the similar behavior to circuit switching virtual circuit It's cool in that we set up a connection then send our packets this is Has an advantage in that by setting up a connection you prepare the nodes in advance for receiving the data So We'll see in datagram packet switching. There's no connection set up at the top just send the data in datagram packet switching node 2 Doesn't know before it receives packet one that the data is coming It has no idea that there's data coming from node one until it receives the actual data But with virtual circuit packet switching Node 2 knows from the call request packet and call accept packet that in the future node one is going to send data to node 4 via node 2 That's a benefit in that node 2 can can prepare Okay, make sure it has some memory available. It can do more advanced things like give priority to users I want to make a voice call to someone using virtual circuit packet switching I set up a connection and when I set up the connection it tells nodes 2 and 3 Give priority to Steve's voice call and then someone else makes a virtual circuit packet switching connection and They don't pay as much as me to the network operator. So their packets get lower priority My packets get higher priority and I get better performance That's much easier with virtual circuit packet switching than with datagram packet switching So the concept of informing the intermediate nodes in advance can be a benefit in that case Other than that they both send packets In this simple example just three packets to contain the data But in a more complex example, it may be a large number or even very small number one packet and Importantly with the packets What happens we transmit a packet? Across the first link Node 2 will transmit that same packet across the second link only once it's received it in its entirety And you see that here. This is the transmission time for packet one It propagates packet one is fully received here So no two's got the packet. Maybe it does some checking error detection checks the destination address and then sends it on to node three So you see this delay here transmit packet one Then transmit it again and then transmit it again whereas with So nodes two and three are active in this case whereas in circuit switching Nodes two and three effectively do nothing other than let the signal go through to the the next link So nodes two and three do much more in this case and therefore they must receive and then send the packet and Therefore it takes more time What else can we say? from these pictures which So often we care about the timing how long it takes to transfer the data Before we get into that which one is the easiest which one looks the easiest From the nodes perspective This one is easy once we've set up a connection especially from node two and three. They do nothing effectively So once we set up a connection, this is easy Whereas datagram packet switching is easy because we don't set up a connection It's harder for the processing of the packets Yes for the data transfer But one advantage it has is that there's no concept of a connection just send the data The problem with setting up a connection is that the intermediate nodes need some Some memory and some capacity to to allocate for that so We need to tell node two and need node two needs to remember that there's going to be data from node one to node four Sounds easier a smaller amount of memory But now think when you have there are hundreds of thousands of voice calls or millions of packets per second going through particular devices Then the amount of memory needed for all of these connections can be significant So this one simple in terms of no connection But packet switching requires more Processing of the data at the intermediate nodes Whereas circuit switching doesn't here Circuit switching is no good for our applications. We use today It's very inefficient for variable For applications that send at a variable rate That don't constantly send but just send for a short amount and then send nothing So circuit switching is not used for most of our applications today. What else can we see? circuit switching is inefficient for data applications internet applications. It's good for performance Guaranteed performance, but that leads to inefficiencies packet switching requires some more processing of the intermediate nodes two and three But much better for applications with very varying sending rates like in most applications we use today and Still works well for voice and video calls for example Most networks built today Use packet switching we'll talk more about that at the end a bit more about the timing let's See we care about how long it takes to transfer the data Same picture. I'll just make some notes on it so you can see so from the user's perspective The user let's say at this point in time They press start whatever application they're using whether making a voice call transferring a file at this time They start the transfer and Then that triggers the call request signal the call accept then the data transfer begins here and At this point in time the data transfers finished Node 4 has received it and we're done. We often care about The time between the two red dots Okay, from when the user presses start Let's say you want to transfer a file from one node one to node four at this time until when the data is received We want to know how long that takes or when we compare the three approaches which one's best Sometimes we'll also compare. Okay, how long does it take to transfer the same amount of data? Ignoring the setup the between the two green dots now in the two Circuit switching approaches circuit switching and virtual circuit packet switching. There's also some message saying we're finished the data transfer That's needed. We can't avoid that But from the user's perspective often we don't care how long that takes That's needed in the network, but the user here has already received the data So it's not so important from the timing perspective So now let's compare the three from those two perspectives of total time plus the data transfer from the start Until when the last piece of data is received Which one takes the least time in this example datagram packet switching finishes first It takes the least time Is that always true? This is an example. Okay, so is that always true? Why not under what conditions in that not be true? Why does it take less time here? What are some of the reasons that it takes least time the less the least time in these three examples? It doesn't check if the packets can be received Sort of None of these work in all of these we haven't worried about whether the packet is Correct or not But yes, it doesn't it doesn't inform the destination that we're about to Transfer data and whether we're the destination ready receive data That is Don't think that this is an acknowledgement for reliability. This is maybe the acknowledgement. It's a bad name here This is saying I'm finished Okay, no more data. That's all But you see I think There's no connection setup Generally call this to set up a connection or set up a call. There's no initial exchange So we bypass that time that takes time to get a message there and get one back so Datagram packet switching never has that initial startup time How long is that initial startup time well that depends upon the propagation delays the number of links and so on but So that would depend So that's an advantage of datagram packet switching whenever you have data. Just send it. You don't have to wait for the initial setup and it Considered two extreme cases there. What if there's just one packet of data to send? Well, right here. We have three if there was one right we transmit one one and one we get it here Compare with virtual circuit packet switching with just one packet of data the process is send a packet to request Wait for the act or the call accept packet to get back and then send out one packet of real data So really there's across our network. There are three exchanges to get the one packet of real data We need to send the request get the accept and then send our real data So it really takes three times as much time as just sending the real data straight away So that's where it's very inefficient to set up a connection when you only have a small amount of data to send It's wasteful of time You might as well just send the data Be much faster if you have the other extreme a million packets here And I asked you to draw that keep drawing a million packets Then you know, I think you can imagine packet three four five and it'll keep going down with a large amount of data This initial request and accept time is going to be quite small compared to the total time So if you've got a large amount of data to transfer then setting up a connection is not a big problem It's okay because it's only a small part of the total time But if you've only got a small amount of data to transfer then setting up a connection is a large amount of the total time And therefore you may not want to wait that time. So that's one comparison there What about Between the two green dots here the time to trans transfer the user data with circuit switching versus the others packet switching that is between the green dots and If you look at between the green dots for the two switching techniques at the same So between packet switching and circuit switching which one takes less time For just the transfer of data this one is less the way that circuit switching works is that We don't packetize the data. We don't split it up. We just transmit it all at once Assuming we've got data to send of course Then we just transmit the data and we can think this is the transmission time And the data or the signal carrying the data propagates across those three links There's no processing in those two or three Whereas with packet switching we transmit one packet Then the second then the third Each packet usually has a header So there's some overhead there Maybe it's not shown in this diagram, but each packet has the data plus a header We need a header so that the nodes know where to send it a Header is not needed for the data in circuit switching because we know that the data is going to go through the node for So there's an extra overhead with headers plus Where some processing at intermediate nodes node to receives packet one It must wait until it's received in full and then send on the packet under node three So there's that time Waiting there So you see that packet switching just the data transfer part is always longer than circuit switching So which one takes the longest time? Well, it depends It depends on how much data to transfer the propagation delay the number of links and so on But in general if you've got a large amount of data then setting up a connection is okay But if you've only got a small amount of data then setting up a connection is is wasteful of time I think we'll stop our summary There's a couple of other things about packets, but stop our comparisons of three maybe in practice Where are they used? When you use networks Do you do you use any of these three? Where do where do you use networks every day? What two main networks do you do you use? the that that I word What's the I word that network that covers the international area? The internet you use the internet every day that's thinking the internet's a network actually a network of many networks It uses datagram packet switching So there's an example in the internet it's built upon the concept of datagram packet switching it doesn't set up a connection so some applications may set up a connection but in That's specific to applications, but for everything sent in the internet Then it's based upon datagram packet switching It's very simple There's no initial set up it works well doesn't matter if you're sending one byte of data or One million bytes of data. There's no overhead of setting up the connection and there's no No extra requirements of the processing or especially the memory of setting up the connection So it makes the nodes relatively simple So that's why one reason why the internet has become so successful compared to other technologies Which were around which use different approaches Does anyone use anyone here use circuit switching? telephone Your mobile phone even uses circuit switching You use your mobile phone for two purposes for making phone calls and for internet access in Fact for making phone calls on your mobile phone is still uses circuit switching So it connects to the the landline Telephone network using circuit switching, but when you send With internet access on your mobile phone It will use packet switching there Newer mobile phone technology so fourth generation or 4g technologies are switching to using packet switching Even for your voice calls, so everything is basically over the internet But I think the current technologies here are still using circuit switching for your voice calls But most networks are moving to packet based networks It works much better for a variety of applications That's I think enough summary of the three different approaches There are a few more words on this table that compares them You may have a look through but I think what we've said today and in the previous lecture is enough There's some things that we haven't covered here Which we will not go into Any questions on the three different switching techniques? Can we move on? We've got one slide that we want to cover which is about packet switching, but it is a nice Concept that is relevant for Networks, which not so much for links This slide we skipped over This is another aspect of how long it takes to transfer data with packet switching Just focusing on the data transfer part not the connection set up And this will try and illustrate the trade-offs involved with a packet size In general, how big should a packet be? What's the advantage of having a big or a small packet do we want big or small? medium Why would you not want a big packet? Right if you send big packets, then if you lose one you lose it all you have to retransmit a lot So that's a bad for big packets anything else. Why would you want small packets? Sorry, why would you not want small packets? So you say you don't want big packets because of retransmission. So let's make the packet one byte That's the smallest we can go What's the problem? It takes more time to transmit all the packets because I Have let's say what a packet contains a one byte of data each packet contains one byte of data versus a packet that contains a thousand bytes of data one byte small packet one thousand bytes big packet and I have a thousand bytes of data to send Which approach takes more time? Smaller packet because of The header okay, so the header and in practice the header is usually something We cannot control We can choose the size of the data, but we usually can't control the size of the header So the smaller the data inside each packet The the more header that we need to transmit for the same amount of total data so we'd like Large packets for that reason Okay, forgetting about errors for a moment So with just regarding headers we want large packets. We'll go through four different cases And I'll give you the numbers so we can make some a Little bit more realistic and we'll look at when we're sending packets across a network Another fact that comes into play You have on the slide the situation we have is What this this picture illustrates is we have a Scenario of node X as a link to node a Then to be then to why you see that on the slide down the bottom node X to a to be to why so we have an path with three links We want to send data from X to Y. Let's say the total data. We want to send Total original data is 1250 bytes and let's say the link data rate of all links is 8 megabits per second Every link is the same Why why do I choose these numbers? How long does it take to transmit? 1250 bytes someone can calculate transmission time at 8 megabits per second How long does it take to transmit one two five oh bytes? Data size divided by data rate. Tell me the answer in micro seconds micro times by a thousand if you have 1250 bytes times by 8 to give bits is 10,000 it turns out to be 1250 micro seconds So that's why I chose the data rate of 8 megabits per second just so that the data size and The data transmission time are the same number just for this example a data packet is made up of header plus original data Sometimes we call it payload But this is the original data so we can say a data packet contains header plus payload or header plus data Just another word is payload In this example, let's say the header is a hundred bytes. It's fixed. We can't change it What we're going to do is try four different scenarios with a different payload the first one will set it to be the payload of 250 bytes the second one will be half the size third one will be 250 bytes and The last 125 any questions everyone can calculate transmission time So we'll go through the four different cases That is we want to look at if we use different payload a different size packet Same size header, but a different amount of data in each packet The total amount of data we want to send is 1250 bytes so by changing the payload we'll get a different number of packets We want to see how that impacts upon the the total time to transfer Now for simplicity, we're going to ignore any processing and propagation delays. Okay, so propagation is zero Processing is zero We could do the same if we had them so The diagram on the left will go through first What it shows is the transmission of the data packet from X to A Across the first link and then from A to B here and the last part is from B to Y How many packets do we need to transmit? Not looking at the diagram, but looking at the total data and the payload size. How many data packets do we need? Hands up hands up for one Hands up for not one Everyone except one person is correct. Okay, it's one Total data is one thousand two hundred and fifty bytes In each data packet. I'm going to include a payload of one thousand two hundred and fifty bytes So we need just one packet okay In the second case we'll go through in a moment is total data is one thousand two hundred and fifty bytes But I'm only going to send six hundred and twenty five bytes Per packet therefore. I would need two packets. I need to transfer the total amount of data Same amount of data, but I'm going to do it in smaller chunks so I Think you will see in a moment But in the first example, we're going to need one packet in the second example two packets Total data one two five oh divided by two fifty. This would need five packets and this one will need ten packets Pkt sure for packet now. Let's look at the the transmission time in the first case Think we start at time zero At what time is the header transmitted? We start at zero. How long does it take to transmit the header? How big is the header in the setup how big was the header how many bytes 100 bytes good and how long will that take to transmit? 100 micro seconds you can calculate, but the way that I've chosen eight megabits per second The transmission time will be the same number of course a different unit the same number as the number of bytes Just to make it easier for you to calculate and Me so if we start at time zero The header would finish at time 100 But then we transmit the payload which takes what another 1250 So we'd finish here 1350 microseconds That is one data packet is 1350 bytes in length Transmitting at 8 megabits per second means it takes 1350 microseconds to transmit so this is from x to a the first link and When a receives that It can then transmit that same data packet on the B The aim is to get the data from x to y by a and B So as soon as we receive that we start transmitting that same data packet to be What time does B receive? again another 100 Another 100 plus one two five oh, it's another one thousand three hundred and fifty brings us to two thousand seven hundred It's the same size and Then when B receives it transmits to y and it receives it another one three five oh four zero five oh each data packet takes one thousand three hundred and fifty microseconds to transmit and We transmit from a sorry from x to a the first one When a's received it it transmits on to be when B's received it it transmits on to y and Then we're done. We care about this total time. We want to see which one's faster and why Let's try the second case where we have a smaller packet Half the size and we need to send of course two packets in this case Start at time zero Transmit the header finish seven two five That is 625 for the payload 100 for the header We've got the fixed-size header in all cases What happens next? What does this picture show us what's happening and? with Who transmits what next? Data to so focusing on the source node X X has two data packets to send and the way the X transmits it transmits data packet one and then packet two So that's what we see here data one being transmitted and then data two being transmitted When will data to arrive? Maybe if we this time well another 725 but What's also happening? Remember what this diagram shows in the first part is what X transmits to a Then in the second part is what a transmits to be They have separate links so while a Is receiving data packet to It's also transmitting data packet one on to be and because they're the same length It arrives at the same time here. We've got something happening in parallel here with with the two links in our network from a's perspective It's receiving data to on one link from one cable and on the other cable It's transmitting data one at the same time. That's what this diagram shows here Follow that on because each data packet takes 725 receive here What is it? receive data to by be at 2175 At the same time why receives data one and then a little bit later receives data to What is it? 2,900 which Which of the two is faster we see the second one is faster the first one took 4,050 microseconds the second one takes 2,900 why We've got smaller packets in the second case therefore more header being sent no errors We're ignoring errors. Why do we get better? I think most people can see it somewhere But describe it what? What's happening that saves us time? 2,900 versus 4,050 we've saved over a thousand microseconds sending the same amount of data But just sending it in smaller packets So here's smaller packets faster Why? What? What's happening? How do you describe what's happening? Consent packets in the network at the same time Something's happening in parallel think of we're receiving some and at the same time transmitting it's possible because We have separate links at this point in time X is transmitting one packet to a but at the same time a is transmitting the packet to be maybe back to the top that's like That we're sending x to a But at the same time a to b So that's happening in parallel and that saves us out saves us time in total So we're utilizing the network much better in this case We we're transmitting on two links at the same time Whereas in the first case at any one time. We're only using one link We're either using the first link or the second or the third This one we get to use two links at the same time Follow it through for the third case five packets, we're not right them all zero. This will be 350 Because 100 for the header 250 for the data So you just look at the number of packets in total one two three four five Then the time to transmit that last packet from a to b and Then from B to Y so total of seven transmissions not through the network, but in terms of happening over time It's the equivalent of seven transmission times What do you get? Seven times two three four oh Two three four oh what I say that I thought that was the answer seven times three fifty Two four five oh It's even better Why is it better? We get some cases where we can be using all three links at the same time. So in these periods The link from x to a is being utilized the link from a to b is being utilized for sending packet four And at the same time the link from B to Y is being utilized to send packet three So that's better because We can save total time Smaller packets smaller total time Try the fourth case 10 packets 100 bytes of header 125 bytes of data a total of two two five Transmit 10 packets Plus the time for the 10th to get to B and the time for the 10th to get to Y so a total of 12 transmissions 12 times 225 is 2700 which one's best number three and out of these four That best in that it takes less time Same amount of data delivered less time Why because Well in the first two We'll get better than those two because we utilize the links better We had enough packets to be able to be using all three links at the same time You can see that Look say it at this time period in this case. There's one One link being used here. There's two links being used here. There are three links all three links being used Here there's all three links being used. There's no more than three links that can be used at the same time What's wrong with number four? too much header Because the packets are so small Well, the header is almost as large as that the data, right? So we've got We've got packets that are too small means we transmit too much header to make up for the advantage of transmitting across all links so now Ignoring errors and other reasons packet size in a network here. We're seeing Larger packets to reduce headers But smaller packets to utilize the links better and in that leads to a trade-off or Finding an optimal solution The idea is that generally we want to use large packets to reduce the impact of headers Okay, large packets are good because then headers are less But we want small packets so that we can be transmitting them on all links at the same time In the first case with a large packet. We only had one packet to send So there was no chance to be sending that one packet or to send packets on The three links at the same time because they have to go one after the other How do you know how many links? You need to know something about the network. So this is just one example with three links So this is just showing a specific case of of the trade-offs if there are four links It'll be a different best size okay If if the header size was not 100 bytes, but 50 bytes and so on that would have to calculate But just showing the trade-off any questions on this issue of packet size on our in our network now so different Different technologies will often specify the maximum packet size allowed and People have designed and come up with the what they think is should be as the biggest size that gives a good trade-off between all the different factors of errors of buffer sizes of Using the links of keeping the header small There are different trade-offs to consider and if many protocols will say your packet cannot be larger than this size Can be smaller, but the maximum is usually given The headers we usually cannot control We can control how much data we may vary that but not the header