 Really, what we've covered so far is technologies related to the physical layer and the data link layer. So physical layer, how to get our data as signals across a link and the data link layer, how to support and make sure that that data across the link is delivered correctly efficiently. But as you know, if we want to be able to communicate between a larger number of people than just on a local area, we need more than a single link. That is, if I want to communicate with someone via my laptop to someone in the US, having a single link between the two computers, between the two devices is very inconvenient. So what we do is we create a chain of links. We have one link from my computer to one intermediate device and then that intermediate device to some other device and keep having multiple links until we have one link that goes to the destination computer, the computer I want to communicate with. That is, we form a network of links between our source and destination. So we're now going to start to look at networks, computer networks and the technologies behind them. The first part is the general concept of switching and we look at generally what do we mean by a switched communication network and then we look at different ways to perform switching and they are circuit switching and packet switching and we'll compare them. This topic, reasonably high level, we're not going to go into many details of how they work just so that at the end you understand, well, what do we mean by switching? What do we mean by communications network and what are the differences between circuit and packet switching and some variations of packet switching? The details we will not go into. So first, how do we use networks to interconnect many devices? So now think of not just on a small area to connect my computer to the desktop but any set of computers across the globe. Well, the general technique that we use is using switched communication networks and these concepts I'll describe using this example here. So I'll talk about those concepts using this example switching network. We have, let's say, end user devices, ones around the outside of this cloud labelled A, personal computer, B, C, D, E and F. Generally they're called stations, we'll call them stations. So think of them as the computing devices that the end users use. Servers, mobile devices, PCs, sensors, anything that wants to create data and be the recipient of data on our network. But they are located in such a way that if we want to allow any end user device, any station to communicate with any other, we cannot have direct links between them. So if I wanted A to be able to communicate with all the other stations without a network, what I'll need is a link or a cable going from A to B, another one going from A to C, A to D, A to E and A to F. If I had those five different links from A, and I wouldn't need this switched network. But in practice having a link from one computer to every other computer we want to communicate with is not feasible. So what we do is we use a network which in this case is made up of these intermediate devices, these green blocks. These are called switching nodes. Sometimes it's just called switches. We'll try to distinguish, we'll say a switching node. Their role is to forward the data, forward the information of the end user devices between, say, A and D. So what this diagram shows is links between stations and switching nodes, like A to switching node 4, links between switching nodes and in some arrangements such that all stations have links to at least one, and in this case just one switching node. And via multiple links we would be able to send data, let's say from A to B, via the path send data to switching node 4. Switching node may send that data to switching node 1, which then sends it to B, the destination. So now if we want to communicate from A to B, we don't need a direct link between A and B. We send via three separate links via these switching nodes. That's the general concept of our communication networks. We have intermediate devices that have the role of delivering the data between the source and destination, or some concept. So data is transmitted from source to destination through a network of switching nodes. The switching nodes are not concerned with the content of data. Their role is just to get that data from source to destination. So let's say we have a server, a web server here, D. And A is running a web browser. So what we want to do from the application's perspective is send a request to the web server and the web server sends back a web page to A. The switching nodes don't care that the data being sent from A to D is a request for a web page. They just treat it as a sequence of bits. They don't treat it any differently, whether it's a web page request or an email, it's an instant message, or it's some financial transaction. All they do is say, okay, we have some data, so switching node 4, we receive some data from this station. We don't care the contents of the data, we care about getting it to the destination. So switching nodes simply forward the data irrespective of what the contents are. We refer to the collection of those nodes as a communications network. The devices attached to the network are stations and user devices is another name. A bit about the links. Often, not always the case, but often the links between the stations and the switching node may be a point to point link. That is, imagine a single cable going from this computer into this switching node. There may be other computers, although not shown on this example, other computers also with cables connecting into switching node 4. So you could draw a computer G, H and I all with their own links into 4. It's just that in this example, we only show six nodes, but imagine there are many other nodes as well. Those links are often point to point links in that it's only the data to and from A that goes over this link to switching node 4. No one else's data, if it's not from or destined to A, will go traverse this link. Whereas the links between switching nodes will often carry the data of multiple sources and destinations, multiple pairs. For example, let's choose a good one. A wants to communicate to E, then a possible path it's data could take is A to 4, 4 to 5, 5 to 6 and 6 to E. And C wants to communicate with F. Then a possible path is to 2, 3, 5, 6, F. Considering those two paths, looking at this link between 5 and 6, that link would need to carry the data from both pairs. That is from the pair A to D, sorry, A to E, going here. And also the data from C to F, which passes across this link between 5 and 6. So it's typical that the links between the switching nodes may carry the data of multiple source destination pairs. Whereas the links from stations to switching node only carry the data relevant to that specific station. A more practical example, this PC is connected via a cable into, think of a switching node down on the third floor. Only the data going to and from this computer goes across that cable. This is an end user device, a station. That switching node downstairs in the third floor has a link going into the computer center in the other building. The data from all the PCs in this building go across that one link between those two switching nodes. So there's a difference in terms of how those links are used. We skipped a topic called multiplexing. There wasn't much to it, but that's related to what's happening here. The concept is that multiplexing is used between switching nodes, where multiplexing in the simplest terms is combining the data of multiple users and sending it across the one link. For example, this link carried the data from C to F and also the data from A to E. So multiplexing is the techniques to combine the data from multiple users and send it together across a single link. We don't have time to cover how multiplexing works. You can study that on your own or you may see it next semester in computer networks and architectures. But in practice, the links are usually different, either station to node or node to node. Sorry, going back. What else do we need to say? What about the connectivity between the nodes? This is just one example. A very simple example with just six stations and seven switching nodes. Look at the connectivity in this case. In this case, there's a path from each station to every other station. That's desirable. Any station should be able to communicate with any other station in that network, which is true in this case. If B wants to communicate with anyone else, there's a path that exists. And in fact, in most cases, there are multiple paths from one source to one destination. How do we get from A to E? Give me a path, one path from A to E. Four, seven, six, okay? We can define the path by the set of switching nodes that we go by. Four, seven, six, we get to E. Another path, what's another path from A to E? That was the first path, four, five, six, okay? There's another path there. And in fact, we could even go this roundabout way, like this long way. So there are multiple paths between a pair of stations in this case. And you will see in most cases. So that's common in networks that we want more than one path. Why? It gives us some redundancy. What if something goes wrong at this switching node? In a real network, there's some error here. It's a computing device. There are some problems. Normally, we were sending our data via seven. What we'd like a network to do is to detect that there are some problems here. And let's avoid that and send our data via a different path, okay? So if we have more than one path available, we can take advantage of that. So we can get some performance improvements. So normally, there's at least one, or there's always at least one path between any pair and source destination pair. There's often more than two paths, but it's not fully connected. That is, look at the switching nodes. Not every switching node connects to every other. Four connects to one, five, and seven. It doesn't connect to two, three, or six. Because to do that, we would need many links if we'd need to connect all of those switching nodes. So in practice, usually switching nodes connect to several others, but not to all other switching nodes. We get a partially connected network. And all networks that we have today, most networks that I can think of use this concept that we send via switching nodes. They have different names, these switching nodes, and we'll see that some of them come up, but the same concept applies that we connect the end stations to switching nodes and they are connected together and we send our data via those switching nodes where they have a dedicated purpose of forwarding the data. That's simple. We are going to look at two ways for forwarding that data through the network called circuit switching and packet switching. And in fact, inside packet switching, we'll see there are two variants. Datagram packet switching and virtual circuit packet switching. So we'll see three approaches. Used in usually wide area switch networks. Most of the examples that we'll talk about are relevant to large networks. For example, across a city, between cities, across a country, between countries. The concepts are still used in LANs, but they're more relevant to wide area networks. So we're going to look at those, but before we start on the individual techniques, A, computer A wants to send to E. What path does it take? We've seen that there were at least two paths. There's actually more than two paths. Which one do we take? But okay, it depends on what's happening at four, but choose a path. Anyone want to choose a path from A to E? 476, why did you choose that? Random or okay. So he chose the path 476 based upon what he thought the performance would be. That is, imagine all of them are sending data through the network. Then choose the path which is the least busy. The least amount of data is going through those nodes. That's one approach. I think that's related to what you said, the general way. Choose a path which is not used as much. What about another way? What about, okay, shortest path. What about the path 476 versus 4512356? 476 is shorter, at least in terms of the number of links. So another criteria we may use for choosing the path may be the shorter path. But we'd like to be more precise. Do we mean shorter in terms of the number of links? Or maybe the links have some characteristics which we can measure like delay. Choose the path which gives us the lowest delay between A and E. So in general, we need some way to choose the best path between any pair of source and destination. That is covered in the next topic on routing. Routing is the process of choosing the path from A to E. This topic on switching is about getting the data across a particular path. So for this topic, we'll assume that we can somehow magically choose a path. The next topic on routing will talk about different algorithms, different ways to implement that magic of choosing a path. So let's look at two different ways for performing switching, circuit and packet switching, starting with the oldest approach, which is circuit switching. Here's an example of a switching node. So those green blocks in the other diagram, this is a switching node in an old telephone network. So the main use of circuit switching is in the traditional telephone networks. Think of your home telephone, not your mobile phone so much, not Skype, but your normal home telephone with a fixed line. This is the old style in which the switching nodes worked in that what used to happen in very simple terms is your home, you pick up your telephone. You want to talk to Steve, who's in the same neighborhood as you. So you pick up your telephone and that telephone has a cable going from your home into a telephone exchange. And that telephone exchange covering some neighborhood, some suburb, contains a switching node, this. And in the old time times, there was an operator, you pick up your phone and you say, I want to talk to Steve. And what the operator would do is they would take the port which was your line and connect it to the port which is Steve's line with a physical connection. And you can almost see here or if you look at the original picture, there's some cables here and think here's the port for the person who's calling which connects into their telephone line. And there's a port for the person you're trying to call. And what they do, you say, I want to talk to Steve and they say, okay, and they plug a cable into your port and into Steve's port and that connects the caller's telephone to the callee's telephone, the person being called. And then they start talking, okay? So the operator in this case was performing the role of a switching node. They connected the source and destination together. And today we have the same thing but it's just we use electronics to do it. That is we have some computing device that will automatically, when you pick up your telephone, there's some special things happening which triggers these switching nodes to connect your telephone line to the next telephone line. We'll see some further examples of that network shortly. These are using the concept of circuit switching. What we do in circuit switching is we create a dedicated communications path between the source and destination, between the two stations. And the result, once we perform circuit switching or we say we set up a circuit is that you can imagine the source and the destination device have a single line connecting them. Think of it at one long cable connecting them. It's just that that one long cable goes via a set of switching nodes. That's the idea with circuit switching. Before we talk about how that happens, let's see a few other examples. Related to a telephone network because the first or the main form of communication networking is in telephone networks which have been around for a hundred years. So for many years circuit switching was the main way to communicate across networks. Here's an example where these blue boxes just think simply as telephone exchanges. So we have end users, home telephones. And maybe these users are in some neighbourhood, some suburb or some area. And there's a telephone exchange that covers that area in the city. There's another telephone exchange which covers a different area. And maybe there's even some central or larger exchange which connects the smaller telephone exchanges together. That's what these are showing. Don't worry too much about the name end office intermediate exchange. That's not relevant for us. In fact, telephone networks have their own terminology to describe the relationship between the exchanges. But just think of them as telephone exchanges where everyone in their home, they have their telephone and there's a cable from their home that goes into the exchange. It may travel hundreds of metres, it may travel several kilometres. And there may be cables as in this example from this exchange to this larger telephone exchange and similar in this direction. So if user A wants to call user B, they pick up their phone, dial in the number, the destination number for B, which actually sends some special signal to the telephone exchange. Sends a signal to the exchange saying A wants to call B. This exchange connects A's line through to B's line. So imagine there's a cable connecting them together inside the exchange. It's a computer that does that with electronics but that's the idea. And connects and actually then sends the signal to B and that triggers B's phone to ring. So A picks up their phone, dials in the number, that sends some signal to the exchange. That signal is forwarded to B. B's phone rings. The person at B picks up. That triggers a signal to be sent back saying that B has accepted this call. So a signal comes back and when it comes back to A, A here's the switch from the ringing to now you can talk. So there's some signal that goes when A rings via the exchange to B and when B picks up the phone sends it back to A. This is the process of establishing the circuit, establishing a connection between A and B. Once that circuit has been established, A and B can start communicating, they can exchange data. In a telephone network, they can start talking. So in this example, when A and B were connected to the same exchange, that exchange handled the connection itself. It recognized that B was also connected to the exchange and made a connection between them. Once we achieve this establishment of the circuit, you can think there's a cable going from A to the exchange inside the exchange and then back to B. So effectively there's a single link between A and B as if we have one long link. It's actually made up of two actual links and one say digital circuit but from the perspective of a signal that we send, we can think of it as a single link from A to B. So when I talk at phone A, my signal travels across the link to the exchange, through the exchange and then back through to B. B receives that signal. Of course, you may not call someone on the same exchange as you as shown in this case between C and D. C calls D sends a signal to their local exchange which recognized the destination is not connected to its telephone exchange. So it sends to a central exchange which then forwards it down to the local exchange and then on to D. D picks up after their phone rings, that sends a signal back and then they can start talking because A recognizes that they've picked up, it stopped ringing and they can start communicating, sending their data. Again, it's as if once we've established this circuit, we call it a circuit between C and D, once it's established by sending this special signal to D and D responding, then the data can be exchanged as if we have a single link that goes along this path. You can think the signal that comes out of C goes through the first exchange, across this link, through here, across and to D and similarly similar in the opposite direction. We use telephone networks to give examples here but it doesn't have to be a telephone network with circuit switching. It's just the main application, the longest used application of circuit switching and we'll see some other examples later. So going back, with circuit switching, we go through three phases. We need to establish the circuit, this connection between A and B, between the source and destination and that establishment of the circuit we saw in the general form was we send a request to the destination from source to destination and if the destination wants to accept this connection or circuit it sends a response back saying I accept and in the process of establishing that circuit the telephone exchanges or more generally the switching nodes allocate resources for that circuit. We'll talk about what type shortly. Once we've established a circuit then we can transfer data in either direction usually. The data may be analog or digital and the best way to think of how that data is transferred is if we have a single link going from source all the way through to destination and we use the same techniques that we've covered in this course so far of how to send our data as signals across a link so the different ways of encoding, the different protocols that can be used across a link. When we've finished our data transfer we would normally disconnect that circuit because when we establish the circuit we allocate some resources when we finish the data transfer we disconnect making those resources free or available again available for some other entity to use. So the three phases of circuit switching set up a circuit, establish a circuit transfer your data when you're done with your data transfer disconnect that circuit. Using our telephone network as an example the circuit establishment happens when you pick up your phone you dial in the number of the destination that sends a message to the destination when they pick up their phone that sends a message back to yours that's the process of establishing the circuit between source and destination the data transfer is you talking the data is actually your voice in a telephone network and that goes in both directions with a telephone network and in a telephone network a traditional telephone network that data is analog data or an analog signal that is your voice is analog and it centers an analog signal across the telephone lines. And when you hang up your phone you're finished talking that's the circuit disconnect. It triggers a special message to be sent to the telephone exchanges saying this phone call is finished. Deallocate the resources you can use those resources for another phone call in the future. What else can we say about circuit switching? Okay we establish a path before the data transfer begins. So before we can send anything from source to destination any data we choose a path a set of switching nodes to go via and set up a circuit between them. In circuit switching that path that we use must have enough resources to allow us to transfer our data. Let's see if we can give an example. In this case we have our local exchanges these end offices consider the call between C and D these links between the end office and the intermediate exchange the trunk links. Let's assume they have some capacity and for simplicity the capacity let's measure in the number of voice calls that we can handle. For example the link or let's say both trunk lines have a capacity of 10 voice calls. What that means is that at any one time this trunk line between the end office and intermediate exchange can carry 10 different voice calls at the same time. No more because although not shown here imagine there are many other telephones connected to these local exchanges. Hundreds of telephones on a local exchange. This trunk line needs to or has a capacity to carry 10 calls at the same time. So what happens assuming the current usage of the trunk is zero no one is making a phone call. When C wants to call D they pick up their phone dial in the phone number of D triggers a message to be sent to the local exchange which then realises it needs to send via this trunk line to the intermediate exchange and then down to D. In doing so the exchange the switching node checks does this line have enough capacity to support this one new phone call? If the current usage is zero and the capacity is 10 then in this case yes we can support another phone call in there. So this accepts that connection or that circuit establishment. Similar we check on this line do we have enough capacity or spare capacity to support a phone call between C and D on this line? If we do then we accept that and the connection or the circuit is established between C and D. Now imagine there are already 10 people making a call. 10 other people on these two exchanges making a call via these trunk lines. The capacity is to support 10 concurrent voice calls. There are currently 10 people making voice calls. Then C picks up his phone dials in the destination number for D what happens? Okay that's very detailed and correct. When C the person making the call wants to connect so they want to connect to D or they send a signal to the the local exchange here and there's a determination that this trunk line here with that has a capacity of 10 voice calls is currently full. Okay so the capacity has been reached because there are 10 other people making the voice call at the same time. So what's going to come come back eventually is some message to C saying I could not connect you and you probably have heard that maybe not so much on your home phone but more on your mobile phone although it uses different technology you try and call someone but there's a some dial tone or some not a dial tone but a response an audio response saying you cannot connect. Often happens when there's a lot of people making a phone call at the same time. Mother's Day New Year's Eve everyone wants to make a phone call the network has reached its capacity so when you try and make a new phone call the network sends back a response saying you cannot connect usually it's an audio response. So that's the concept that happens here. We have some capacity on these lines and also in the exchanges. If we reach that capacity the next call cannot be established. We get some error message. What's another thing that could have happened? How can we deal with that case? Let's say okay there are currently 10 voice calls in progress via this line capacity is 10 C makes a call or tries to make a call or another option would be to say well let's disconnect someone else's call. So 10 people are talking and then one of them suddenly has their call or their connection torn down, disconnected so that C can now establish their call. That's not what happens normally in telephone networks it's normal to a once the connection or circuit has been established once the call has been established you maintain that call for the duration. You do not abruptly stop that call. You don't allow the next one to establish the call. That's the typical service provided by telephone networks. So once we reach capacity no one else can use that link until it becomes free. We have spare capacity again. So when we establish a circuit we must reserve those resources along the entire path. So reserve capacity across the links reserve capacity inside the switching nodes. So they're computing devices so CPU memory and so on to support that connection. And once they're reserved they're allocated for you until you disconnect unless there's some special case. So no one else can make use of those resources. Circuit switching networks work well for voice traffic when people are talking. That is telephone networks. They've been designed for telephone networks. There's been a lot of analysis to work out the statistics of how much capacity is needed to support how many phone calls or how many users at the same time. They work well for voice traffic because voice traffic is reasonably predictable. The amount of data you send when you're talking is quite predictable. The length of typical phone calls from but based on past phone calls can be predicted. The amount of time one person is talking and the other one is listening, okay. It can be predicted or estimated. And that's used to allocate resources so that we have enough capacity to support so many users. It doesn't work so well for data traffic. By data traffic, think of typical internet applications, web browsing, downloading files, instant messages, gaming. Because those types of applications, the amount of data we want to send varies a lot over time. It goes up and down. With circuit switching, we allocate resources for the entire duration of the circuit for the entire call. But sometimes if we're sending data traffic during that, we are not using those resources and it becomes very inefficient. We'll come back and compare them when we look at the alternative approach, packet switching. Whereas circuit switching networks used telephone networks, public telephone networks, private telephone networks, SIT has a private telephone network across this campus. We have our own switching node, our own exchange, mini-exchange. And the telephones in the offices, in the rooms are all connected into that switching node. And private data networks. And one example, banks, financial institutions who connected their branches, their central office of the bank, even their ATMs, connect them together and need to exchange data in the past used circuit switching networks, private data networks. One or two more examples of circuit switching and then we'll move on to another approach. Here's an example of a phone call. Again, these blue rectangles are telephone exchanges or switching nodes. In fact, you can think this digital PBX which is a private exchange is also a switching node. These are the stations, the phones. So let's say someone in Chiang Mai is wanting to call my office. This is an exchange inside SIT for our internal network. This is an exchange in the region or the neighborhood of the person in Chiang Mai. This may be the exchange that covers the entire city of Chiang Mai. Which has a connection into an exchange here in Bangkok. Which then connects into our neighborhood bunkered here and then into SIT and into my office. So there are links between the end stations and the exchange and between the exchanges or the switching nodes. What's the capacity of this link in terms of phone calls? Number of voice calls. We'd say it's one. This link is a, where'd we go? It's back. This link is a point to point link from my telephone into the telephone exchange. So there's one cable dedicated for my phone call. I can make one phone call at a time, okay? You cannot make two phone calls over the same telephone line. So think of in terms of number of voice calls, this link has a capacity of one. So would this one. Between end station and switching node, capacity of one voice call. This is a local exchange. Here's a central exchange for an entire city. This link, this one cable between them would have a capacity much larger than one. It would have a capacity to support multiple calls at the same time. Let's say give it a number of 100. Meaning the people connecting into this local exchange, maybe there's a thousand people connecting into this local exchange. At any one time, we can support 100 of them making a phone call via this central exchange. And similar, the capacity of the link between Chiang Mai and Bangkok, maybe 10,000, okay? Usually a larger number because there's more likelihood of more people calling. And the way that we support multiple phone calls across these single links is the thing that we haven't covered, which is multiplexing. How to support many calls across a single link is multiplexing. But imagine these are high capacity links. This is a low capacity or it supports one voice call. So what happens is that I dial in the phone number of the destination. That sends a message to the first exchange. It checks, does it have the resources to establish the call? Are there enough resources across this link? Are there, is the capacity full yet? If not, then it goes through. If we have spare capacity all the way, then this phone rings and sends back, when they pick up, sends back a response which confirms to each of the switching nodes to allocate those resources for this one voice call, this one circuit. And from then on, when I start talking, the data simply travels across my line, goes through this switching node, across the line here, through this switching node, to Bangkok, through that node. Why does it go through them? Because they've been set up to automatically connect anything coming in on this line from this particular source to go out here. So they've been set up so that any data comes in immediately goes out to the correct destination. So that's why I say that think of the data goes through them. There's very little processing that happens inside. The data goes all the way through to here and of course when they talk, the data comes back. It's as if we have one long cable from a phone in Chiang Mai to a phone in my office, once we've established a circuit. Okay, let's move on to our next approach, an alternative. Some of the issues when we compare circuit switching to the next approach we'll come back to, but things we care about are how efficient are we in using our links and using our network. With circuit switching, we reserve resources for the duration of that circuit, for the duration of that voice call or that connection. That's inefficient. If we reserve resources, but don't use those resources, then that can be inefficient. Why would we not use it? Maybe we've reserved a connection all the way through, but we've got currently no data to send. Got a connection from my computer to some server using circuit switching and I'm exchanging some data, but sometimes I've got nothing to send. So we've got a reserved connection, but nothing to send across that connection. So it can be inefficient if applications do not use the capacity that they reserve. Typically okay for voice, not so good for typical internet applications. What about the quality of the data transfer? Because we reserve the resources, we're guaranteed those resources. Come and join us up the front. I know it's hard to hear back here sometimes, so why don't you join us up the front? Okay, the front is there for you. The front for you is right up the front. And yours is, you can stay there. I know you've sat in this lecture before and you know everything. We set up a connection from source to destination. We reserve resources all along the path. Think of it, if you wanna think of it in terms of data rate. Imagine the link between my computer and some server across all of those links, I have reserved one megabit per second. Which means I'm guaranteed to be able to transfer data at one megabit per second for the duration of that connection. Which is good for quality, because I know I'll get exactly one megabit per second. So I get what I reserve. So generally circuit switching is good for quality. We can get high quality data transfer and usually a small delay or a guaranteed delay in some cases. So for performance it's good, but it can be inefficient in some cases. This one we'll talk about later after we go through packet switching. Circuit switching has been around for a hundred plus years, used mainly in telephone networks. But as the internet started to grow in what the 40 years ago, then that and even the networks preceding that, some data networks where we're not so much transferring voice calls but data from computers. A new technique was developed called packet switching. So let's look at how that works and then we'll come back and compare against circuit switching. The idea in circuit switching was we just establish a connection and then send our data. In packet switching, we're going to take that data that we want to send and break it into small chunks, packets, and send those packets one at a time. This is the concept in the diagram. Our source computer, our destination, a computer, some server, we want to send data from source to destination. We take that data. We don't send it all at once. We break it into smaller chunks, packets. We'll see that we'll need to attach some extra information to identify those packets and where they're going, headers, and send them one at a time into our switching network. So this cloud represents several or multiple switching nodes in here. We send them those switching nodes when they receive a packet. They determine where to send it to next to get to the destination. There are two types of packet switching. One of them is the simple one called datagram packet switching. The other one, virtual circuit packet switching, uses packets, but tries to be like circuit switching. So the name virtual circuit packet switching. It's trying to produce the same behavior as circuit switching, but using some different techniques, in particular sending our data as packets. So we'll go through the datagram packet switching first, and we'll use an example to illustrate what happens. First, in datagram packet switching, we have some data to send, say 10,000 bytes to send from A to B. There's no concept of establishing a circuit. There's no concept of setting up a connection. All we do is we take that 10,000 bytes, we break it into smaller packets, say 10 packets of 1,000 bytes, we attach a header, and we send those packets one at a time from the source, sorry, from the source to the first switching node, we send packet one, packet two, packet three, and so on. That first switching node will receive those packets and send them to the next switching node, and we'll keep going until those packets arrive at the destination. When those 10 packets arrive at the destination, it will take them and put them back together so we get the original 10,000 bytes of data. This example shows with just three packets. Let's say we have 3,000 bytes of data, we break it into three packets, and labeled one, two, and three, packet one, two, and three. So the first computer across its link to the first switching node sends those packets one at a time to the first switching node. That switching node, when it receives the packet, inside the header of that packet, must be some information identifying who the destination is. So the header of each packet would have an address identifying this computer. And the switching node will use that to determine where to send the packet. So this switching node will see first packet destined to the server. I'm going to send it across one of these links. Okay, it's got a choice of two links to send it. I didn't show in the picture, but let's say it's sent across this link. And it treats those three packets independently. That means, going back, the first switching node receives packet one, looks at the header, destination is X. Let's say this is X. Let's say now decides to send it to this node to reach X. Receives the second packet, looks at the destination. Destination is X, decides to send it in this way, receives the third one, sends it here. This second switching node received those packets one at a time, decides to send the first one in this direction, the second one in this direction, but the third one in this other direction. See, one and two would go in this direction. Packet number three takes this other path. That's possible in datagram packet switching because the switching nodes treat the packets independently. Even though those three packets were from that same piece of data from the source, and even though they're going to the same destination, the switching nodes don't care. They just see a packet and choose a link and send it. They don't care that that packet was related to a previously sent packet. As a result, we may get packets taking different paths through the network. That's what this diagram illustrates, that packets one and two take some path to the destination, three takes a different path. Now, why may that happen? Well, it may have been this switching node, something changed in the network that when it received packet three, it realized, oh, maybe there's a better way to reach the destination by here. So I actually sent one and two this way, but then before it sent three, it determined a new path to send it by. So it's possible. What may happen because the packets may take different paths through the network to get to the destination, assuming they all get to the destination, they may arrive out of order because it may be that this top path had a shorter delay than the path that one and two took. So in fact, packet three arrives first or it got to this switching node and then say it gets to the server and then packets one and two arrive. So that's possible in datagram packet switching. Packets may take different paths, packets may arrive out of order at the destination. It's then the role of either the last switching node or even just the server to put them back into the right order. In this example, that final switching node put them back into the correct order. So in this step, this final switching node receives three, one and two. It puts them back into the correct order and forwards them onto the destination. So first in packet switching, take our data, split it into packets, attach a header to those packets and send them one at a time into our switching network. A switching node now in datagram packet switching has no concept of establishing a circuit, establishing a connection. All it does is receives a packet and uses the destination in the header to determine where to send it and sends it. And any other packets it receives, it does so in an independent manner. Now, where to send it? Why do we send on this path or this path? Well, that, again, is in our next topic on routing. How to choose the path to send it on is the process of routing. What we're talking about is just the fact that we receive a packet, we send it out on one of our output links to get to the destination. Which one, which is the best one to send it on, we haven't discussed yet. The other form of packet switching is called virtual circuit packet switching. The idea is to still use packets, break our data into smaller chunks, but to try and behave like circuit switching, we get a virtual circuit. The idea is before we send our data, let's say what, A wants to send data to C, it establishes a circuit or a virtual circuit between A and C. Once we establish, we send our packets along that particular path. And all packets belonging to this data transfer will follow the same path. And similar, we may have a virtual circuit from B to D. In circuit switching, we had circuits from source to destination. We established the circuit. All our data went as one across that circuit. In virtual circuit packet switching, we still establish a virtual circuit. And then all of our packets go across that path, that same path. The difference is in circuit switching, we don't have the concept of packets. Because we actually have an actual connection, we just send our signal through that network. In this case, we need to send packets one by one. So A has, our source has three packets to send to the destination with virtual circuit packet switching. We first establish a path. That's shown by the dashed line here. So somehow we decided, let's use this path for our data transfer. Routing will do that for us. Choose a path. And actually, we send some special message similar in circuit switching. We send a special message saying, I want to connect and transfer data with this destination. We'd send it through. This one will send back a response saying, yes, I'm prepared to accept this data transfer. And then we start sending our packets across that path. Again, one, two, and three. The difference to datagram packet switching is that all packets follow the same path, guaranteed. And they'll all get to the destination in the correct order. There's no chance of one taking a different path. We'll see a comparison later, but datagram packet switching is simple. All we do, we have data, break it into packets, send them with virtual circuit packet switching. Before we send that data, we must do this step of sending a special message to establish a connection. That takes time. And it requires some resources on the part of the switching nodes. So they need to do something in advance. Then we send our data. So it's extra time before we can send the data into some extra complexity. Let's go back. Back to the written description. So with datagram packet switching, break our data into packets. All packets are treated independently. They may take different paths through the network. They may arrive at the destination out of order. They may be lost even. A packet may arrive at a switching node. There's an error in that switching node. The packet doesn't get sent. Therefore it will not be delivered to the destination. Packets must contain headers so those switching nodes know where to send it. Switching node receives the packet. It looks in the header, reads the destination address and now knows I need to send it in this direction to reach that destination. In virtual circuit packet switching, before we send data, we establish a virtual circuit. It's not a real circuit in that we don't have a actual physical connection between source and destination. We set up a path so that those switching nodes will forward the packets in the same direction all the time, the same path. So we establish or set up a virtual circuit. We transfer the data and then we tear down or disconnect that virtual circuit. Similar steps as the circuit switching. Establish a circuit, data transfer, disconnect. Virtual circuit packet switching. Establish a virtual circuit, transfer, disconnect. Or tear down. But the data is transferred as packets, not as just one continuous signal. They'll take the same path across the network, not different paths and as a result will arrive in order. But still may be lost. I send a thousand packets. Maybe one of them doesn't get to the destination because there's an error somewhere in the network. We still need headers in the packets so the switches know which virtual circuit that they need to take through the network. In circuit switching, there's no concept of headers, no concept of packets. Think of the data as just one, is the signal that we created the source is sent all the way across our circuit to the destination. That's the main concepts of the three approaches. So really think there are three, circuit switching, virtual circuit packet switching and datagram packet switching. Before we compare them from different perspectives, questions from many students in the past, they find this a little bit confusing in that, well, what are we actually trying to do? But remember now we're no longer dealing with a single link, we have a set of links. And we need some way to get our data from source to destination via multiple links. Well, we have these switching nodes which forward the data. Well, how do we send the data? Well, we can send it as a signal from the source. The way we do that is using circuit switching, we establish an actual think of a physical line, a physical cable going all the way from source to destination via switching nodes. Once that's established, our signal transmitted at the source travels all the way through the switches to the destination. As if we have one long cable from source to destination. We don't need packets, we don't need headers, we just send our data as is. It's good for when we have a constant amount of data to send. Packet switching, we now break our data into separate chunks as packets and send them one at a time. We'll come back to the advantages of that in a moment. Well, actually maybe next lecture. Just staying on packet switching, let's just go through this example to finish today. Packet switching, let's say we have a fixed amount of data we want to send from source to destination. One of the issues is, well, how big should our packet be? Or how does the size of the packet impact upon our performance, in particularly our transmission time? This diagram shows four different cases. We have a network from source is X and destination is Y and the two switching nodes are A and B. So we have three links. Let's go through this example to finish. Let's draw our network which has, in this case, what have we got? This is in our example X, A, switching node and B. And the destination in our case is Y. And we just have three links in this case. And let's say we give some numbers to the time it takes to transmit data. We have, in the first case, a data transmission time of, I'm just choosing some numbers. We'll see the relevance of them in a moment, 1,250 time units, microseconds, milliseconds, that doesn't matter. That's for the payload, the actual data. And we're going to add a 100 byte header. So this is the data and this is the header. Let's give them some numbers of how long it takes to transmit and we'll come back. We're going to go through this first case here and see, okay, we want to send our data from X to Y via A and B. We have a header to transmit and the actual data. So what we do, in the first case, we're going to say let's put all of that data into one packet. So we need to transmit that one packet, this, from first from X to Y. The time it takes depends upon the time to transmit the header and the time to transmit the data. In our case, what is it, 1,350 time units. With packet switching, we assume that when a switching node, in this case A, receives a packet, it must receive the entire packet before it sends it across the next link. So what happens is X sends the first packet to A, A receives that, looks at the header, and then sends that packet to B. B is the next switching node, it receives that packet, and then transmits it to the destination Y. That's what this diagram is showing here. The transmission of the first of that packet from X to Y, then this is the transmission of the packet from A to B and the last part is the transmission of that same packet from B to Y. That's the case where, and I just put some numbers to it, so let's say the transmission time of the data is 1,250 for the header 100 time units. We can measure in length or in time units. In this case, the total data we had to send contained in just one packet, say 1,250, what's the total time to deliver that data from X to Y? From when we start transmitting until we receive, 1350 times 3. So if we have our two numbers there in this diagram, this is 100 time units, the blue box, this is 1,250, and so 1,350 from X to A, then another 1,350 for A to send to B, and then another 1,350 to send to Y. So the total time is just the sum of those three, which is what, 3,4,050. Now let's try a different case. A different size data packet. Let's say we have half the size. Instead of 1,250, what's half of that, 625. Same size header, 100 time units for the header. We have the same amount of data to send, but let's say we need now two packets to transfer that data, because we've got half the size of the packet as the original case. That is, instead of 1,250, we limit the size to 625. And that's what this second diagram shows. Same amount of data, but broken into two packets. So what we need to do from X to A, transmit data one, or packet one, and then packet two. Each of them have their header. So the first packet has 100 units of header, or takes 100 time units to transmit, and then the actual data is 625. And then we transmit from X to A the second packet, the header and the data, another 625. But in this case, when A receives packet one, it receives the packet. Once it's received, it can start transmitting that packet onto B. And that happens at the same time as A is receiving packet two. So A is a switching node. It has two links, at least two links. One link coming in from X, another link going out to B. So during this time, switching node A is receiving packet two from X, and at the same time, transmitting packet one to B. And that's shown, or that's why we show that these things, or these two packets are being transmitted at the same time. And similar to the next step, A then starts receiving, sorry, A has received packet two, now starts transmitting packet two to B. But at the same time, B is transmitting packet one to Y. And we can calculate the total time that takes. What is it? We have 100 time units of header, 625 of data. So 725 for one transmission. And you can look from the diagram. There's one, two, three, four, four in a row. So 725 times four, 2900. You'll check. That is, one packet transmission takes 725. And you can see from the diagram, from the start until the end, there's actually four transmissions in a row. More packets are transmitted, but the time it takes is four times that. Four times 725 is 2900. That is, it's faster than the first case. We take less time to transmit the data. By using a smaller packet in this case, we deliver the data faster. In the third case, we use, what? A fifth, the packet, it contains one fifth of the data as the original one. So instead of 1250, it's one fifth of that, which is 250. Each packet contains, or takes 250 time units to transmit, plus 100 of header. And we see, when packet two is being transmitted from X to A, A is transmitting packet one to B. When packet three is being transmitted from X to A, A is transmitting two to B. And at the same time, B is transmitting packet one to Y. So in fact, we get this concurrent operation, this parallel transmissions. Because we have separate links in this network, we're transmitting packets across each of the links at the same time. You can do the calculations if the data size was 250. You'll see, what do we got? In effect, 250 plus 100, 350 for one packet. We've got one, two, three, four, five, six, seven transmissions in a row. Seven times 350, which is 2450, which is less again. It is faster. Smaller packets means less time to transmit the total data. This last one is, then we have 125 time units to transmit the data. Ten packets. You'll do the calculation and you'll see that it's slower than the third one. And that the diagrams are to scale for the numbers I used. That is, it takes longer, slightly longer than this case. 2,700 here, 2,400 here. This was 2,900. Why? Efficiency related to header. Look in this case, we have very small packets. Ten small packets, we need to transmit a header for each packet. So that time for transmitting ten headers is our overhead, at least the inefficiencies. And with the numbers that we use, it turns out even though we have small packets, we don't gain anything by going any smaller from that in this case. Because we have now too many headers to transmit, too many of the blue boxes compared to here. So there's a trade-off. Normally we want large packets to reduce the impact of the header. The larger the packet, the less overhead we have. But when we have multiple links by having smaller packets, it gives us more chance that we can transmit one packet across the first link, at the same time the preceding packet across the next link and the packet before that across the next link. So that is transmit and parallel. That's what we're getting with these smaller packets compared to the first one. It depends on many factors that the number of links, the size of the header and the data, the data rates across those links and so on. But the packet size has an impact on the total transmission time now. Let's stop, out of time.