 So we'll look at routing with respect to computer networks or specifically switched data networks So sending data through a network using switching Really routing applies to all of the switching techniques circuit switching The two types of packet switching we this we in all cases. We need to find a path But in the examples we use from now on will focus on packet switching networks mainly datagram packet switching because that's what the internet uses so the problem is given a network a set of Devices want to be able to communicate with each other a to f d to b and so on and in a switch network We have the intermediate nodes the switches. We need to find a path through this network from one device to another and It's a problem because there are usually multiple paths to choose from Okay, so from a to f we can go via four seven and six or four five six or four one two three five six So since there are multiple paths to choose from we should choose the one which is best for us We'll call it a path or a route That means the same thing which route to take which path to take So it's an important issue in in data networks how to do routing Which pass should be taken or the answer that people give is take the best path But then we need to define what do we mean by best what's the best path? So we actually would define different metrics different ways to measure best best could be the path with the least number of links or The path with the least delay If we want to get our data quickly from source to destination choose a path which takes the least time or the highest Throughput on all the links because I want to transfer a lot of data I want to choose a path which has links which have a high throughput or a high data rate as opposed to those which Can only transfer my data at a lower rate or choose a path which uses Which incurs the least financial cost? Cost the least amount of money and some other metrics for choosing the best part will list a few more Once we define the metrics usually what we would do is we will assign some cost To the links and you know some algorithms for calculating giving given a Network to calculate the the shortest path or the least cost path will mention some of them I'll show you an example in a moment But the example only has five or six nodes real networks may have hundreds of nodes And many possible path to choose from So even though in our example sometimes we can see the best path In real networks we need computers to calculate the best path best path for us because it's such a complex problem Let's go. We'll come back to those Requirements first we'll introduce some some terminology the terminology on the previous slide. I'll explain using this example This is an example network topology a Topology is the way in which we arrange the nodes and links so a network We can think is made up of nodes and links in this picture the nodes of the green ones and the links of the lines between them So this is one particular topology because it has a link from node one to node four and from node four back to node one And it has six nodes and all these to find links a Different topology would be one that maybe doesn't have node one if we remove node one we get a different topology so the topology just is the The arrangement of nodes and links Another thing that we often care about is that with routing we want to find the best path Well, we were defined best as a generic cost the cost of using that path and That will come from the cost of using the links across the path So what we do is assign a cost to each link and that's what these numbers next to the lines are There are examples of costs of using that link For example to send some data from node one to node four it costs one unit to send data From node four back to node one it costs seven units So we'll assign costs to links and it may be that links Between the same pair of nodes, but in the opposite direction may cost have different costs Like in this case, it's cheaper to send from node one to node four. It's a higher cost to send back Sometimes they'll be the same sometimes they're different in general we can allow them to be different When I say cost I don't mean money I don't mean Bart or dollars. It's not financial cost It's some generic cost and we need to define what we mean by that it could mean The delay of sending a packet across this link is one millisecond and The delay to send it back is seven milliseconds Maybe that's the the cost in this example or it could mean something else. Okay, so Once we define how we'll measure cost Money delay data rate security different factors once we define then we Associate that with a number this generic cost which we can assign to each link Where we'd like to use the links with the lowest cost So once we have nodes we know the topology if we know the costs of using each link Then we can find what's called the least cost path from any source to any destination What is the least cost path from node one to node six? the least cost path One one from note. What is the path? We define the path by the nodes usually We can point but and one two and four Director and six okay, they're a multiple path But if you look at the cost the cost of using a path is the sum of the costs of using the links across that path So the path 1456 That's the path the cost of using that path is one this link Plus the link from four to five plus one plus the link from five to six plus two So the total cost of that path is four and You can check other paths and one three six has a cost of what five plus five is ten and The other parts and you find the path with the least cost Which it turns out to be four five and six if you go by two It's going to cost more than the path cost of four And how do you calculate that if you have a large network if I give you a network of a hundred nodes and many links? You can't do it in your head very easily. You need some algorithm to do it for you So Dijkstra's algorithm is one example that would do that. We're not going to study those algorithms I'll assume you know them, but you won't need them to do this if there are any examples They'll be quite small that you can visually look at and calculate yourself But there are algorithms that will do this for us for this network find all the least cost paths From node six to node one node two to node five and so on you can find all of them What else do we need to introduce? Okay, we can talk about to to travel across one link. We call is one hop So to traverse a link is to is to traverse one hop So the number of hops in the least cost path from one to six is three So the least cost path is one four five six the number of links is three the number of hops is three Hops is just another name. We refer to count the number of links and it's a very easy way to to find Or that there's some systems used to find paths through networks find the path with the least number of hops But the path with the least number of hops is not necessarily the best path The path with the least number of hops from one to six is one Three six two hops But the least cost path is one four five six with a cost of four We'll often care about our neighbors The neighbors are the nodes which we have direct links to so node one has three neighbors the neighbors are node two three and four so in practice These links a node normally knows about who its neighbors are because you can think there's a cable between node one and node four this link represents some some communications link so Whoever owns or operates node one They've already set up the link so they know who's at the other endpoint of the link in most cases So a node usually knows about its neighbors But it may not know about other nodes in the network and we'll see an example of that So our aim for any network if we know the topology and if we can assign cost to links That is we given this information Then we can apply some algorithm that will find the least cost path from any node to any other node We call that least cost routing at least cost route or at least cost path is finding the least cost path through that network To do that though, you need to know that information of the topology and the link costs and That's the hard part about routing in large networks Knowing in advance what the topology is and especially the link costs Once you know it, it's easy to calculate the least cost path so what we need is some algorithm that will Not just calculate the path, but find that information Wrong way. How does node one know that the cost of the link between five and six is two That's the challenge Because these nodes may be spread across the country Maybe operated by different people So the operator of node one may not know that there is actually a link here So somehow they need to learn about the the links between other nodes and the costs of those links And that's what a routing algorithm or routing protocol will do So we need a routing algorithm that will do that for us that will Given a network It will try and find that information about what is the topology What are the link costs and then calculate the least cost paths Such an algorithm Some requirements are listed here quickly go through And now the algorithm should be correct That means if we say I want to get from node one to node six and The algorithm returns the answer that gets me from node one to node two You're right. Okay Make sure you're fresh so you can follow the lecture if if the algorithm Wants to get us from node one to node six but returns us an answer the path from node one to node six is node one node two node four Then it's incorrect sounds obvious But that's a basic requirement that an algorithm that finds the best path should find a path to the actual destination It should be simple that is We'll usually use computers to do this for us as opposed to humans having to calculate the least cost paths We'll get computers to do it. So it should be simple to implement and to execute It should be robust Which means that when things go wrong it still should work. Okay? so if If an algorithm tells us the best path from one to six is one four five six but then as as the networks in operation that the link cost change or A link fails. Let's say this link fails. It no longer exists Then an algorithm should be able to adapt to that and in the presence of say this link failure Find another path that gets us to six So in the presence of things going wrong A routing algorithm should be able to deal with that and maybe find an alternate path So for example, if the link between node four and no five fails, what should our algorithm do? Find a new path, which is what what path in this case? What is the best path in this example? Can anyone find it? one two three five six has a cost of What two five six eight Anyone find a lower cost path than eight one four three five Six is a cost of one plus three plus one plus two is seven. So that one's better I Think you may not find less than seven there. Okay, and again We'd have an algorithm that would do that for us automatically in a large network But the idea of robustness is if this link fails the algorithm should Try and find an alternate path Another requirement is stability That is okay. First. We're sending our data. We've got many packets to send from node one to node six We start sending them across our path one four five six. It's the best path at the start this link fails So it switches to the alternate path one four three five six But then this thing comes back up again a few milliseconds later the link just was in error for a short time so the algorithm is smart enough to switch back to One four five six and start sending packets on this original path again But then there's an error slightly later. So it switches back to the other path and it keeps swapping between alternate paths Because of some problem on this link that sometimes it's working and sometimes it's not working So if an erouting algorithm does that then it's can be constantly swapping between different paths and That can be a problem for some data transfer applications because we get a a Continuous Difference in the performance of our data transfer Sometimes our packets take this path. Sometimes they take this longer or higher cost path and Some applications don't work so well when there's a lot of change in say the delay or the performance of the network So sometimes we'd like a routing algorithm that would be stable Once it finds a path it sticks with that path for as long as possible So that too conflicting requirements robustness and stability robustness says Find an alternate path when things go wrong stability says stick with the same path for as long as possible So it's a trade-off there Choose the optimal path that is choose the best path or we said that the least cost path Be fair that is in a network There are multiple stations that may want to Be able to communicate node ones to node six node five to node two and so on fairness is about making sure that all those nodes get treated equally that is The algorithm shouldn't choose a path such that it's very good for node one but very bad for node two and I Don't have an example. It's not so clear on this one. There's no example here, but in some networks. It could be that say nodes which are close to the destination Five and four may get the best path and It may turn out that other nodes which are further away may end up with the very bad path with very low performance That would be unfair to those nodes which are a long way away, so In some cases and it's not a good example here, but in some cases it can be an issue of fairness We want to make sure that all stations get a good path One doesn't get the best and the others get the worst. We want to be equal amongst them Which sometimes conflicts with choosing the optimal path? Okay, it may mean getting suboptimal past just so that everyone gets good performance The other thing is efficiency and we'll see that come through as we go through some examples To know about the rest of the network We need to exchange some information For node one to know that the cost from five to six is two Which may be on the other side of the country or the other side of the world? There needs to be some exchange of information between the nodes and That incurs some overhead So they may need to exchange some packets saying what is your link cost and node five tells node one? My link cost to six is two that's some overhead that we want to minimize and therefore we want to minimize the transmission overhead the Transmission of extra information and any processing if the node needs to calculate something it needs to be as small as possible And that's the aim for efficiency and that will come up We'll see more examples of efficiency through some of the next few slides So we'd like an algorithm with these requirements that meets these requirements. We'll see Which ones do so a number of issues which will go through What different performance criteria are available? What are the suggestions? How would you measure best in a computer network? You want to get your data to the Facebook web server in the US the paths there are many paths that go via In internal in Thailand and then via different countries to Singapore to to Tokyo via Different links to across the US or go in the opposite direction and go across Asia and Europe and then to the US Which path would you like your data to take? How would you choose the best path to get your data to the Facebook web server in the US? Any suggestions What would you like? What but how would you measure so the performance criteria the things? How do we measure best? What do you define as the best path? What are you interested in in getting your data from your computer to the Facebook web server? Data rate. Okay, that may be one thing. What do you want a low data rate high? Sometimes you may want to hide data rates so a path made up of multiple links You would like to choose the path which has what of all the links along that path the one which has the highest minimum data rate Does that make sense? If we have that one's a hard one to think about But this is a a Bit different than what I wanted wanted to cover but data rate Two examples Here's a simple network There are two paths to know Two paths from node one to node four and the data rates of the links in megabits per second I'll not write them all in megabits per second Two paths from node one to node four and the numbers next to the links are not the cost. They are the data rates Which path do you want? The bottom path the top path Hands up for the bottom path Hands up for the top path Now be careful this in this example that the numbers are not costs the numbers are data rates Two megabits per second just in this example. Sorry The numbers are data rates. We need to translate them to costs But in this quick example, they're just data rates. So again, which path do you want? Why? It's faster than the bottom path. What data rate would you achieve from node one to node four using the top path? three sixteen It's not sixteen three three Remember data rate is a speed so You're you're sending data as fast as possible You can send it at five megabits per second to link to From link to from node two to look node three at three megabits per second and then the last link at eight megabits per second so across that path the highest that you could achieve over time is three You can't get faster than three because we call that the bottleneck link The lowest or the minimum data rate of all the links in the past It's the same as say the flow of water through pipes. You can't make it go any faster than the slowest flow rate So if you're transferring like 10 gigabytes of data Although it would be going at five megabits per second to node two it would then slow down to three megabits per second So that would be the limit On average how fast we can transfer from one to four so that's a With data rate that's a little bit Different from the the other metrics like delay which are much simpler. We sometimes call this bottleneck the bottleneck link Limits our data rate across the path data rate or throughput choose the path with the highest minimum Link data rate Any questions on data rate for best path so Path one two three four we could achieve a rate of three Megabits per second one five four we could achieve a rate of two megabits per second So we'd like to choose the top path. So we'd need to With data rate, it's a little bit more complex because we need to convert the data rates to a cost Any suggestions how to convert that to a cost? If you want to use least cost paths least cost routing the costs should be low for a good value Okay, you want to a low cost for a good value here? We've used we want a high value with data rate One way to convert and maybe don't remember this because it's what we can but it's a little bit off topic Convert it to cost by let's say Make it 100 divided by 5 To convert the data rate to a cost we get the inverse because we want a high data rate to relate to a low cost so we need to take it the inverse and We could consider a maximum data rate say of a hundred so the cost of this link would be 20 this link would be 33 and This one would be what do we get 12 is it about so this is one way to Convert data rates of links to costs. It's not perfect And you need to optimize a little bit, but we see now Look at the green numbers. What's the least cost path? Least cost path the top path has 20 plus 33 plus 8 which is 61 and The bottom one is a total cost of a hundred so the least cost path is the top one, which is what we desire So this is just one way to translate Data rates to costs This is the cost This is the data rate. We want the path with a low with a high data rate or a path with a low cost Where did the number 100 come from? Good question Usually in practice, it's it's set to the highest data rate of all the links Or some some number see it near them, but it depends a little bit about the designer of the network how to choose that With the other metrics, okay, that was the hardest one data rate You want to choose the path from your computer to Facebook which has the highest data rate Sometimes yes, sometimes data rates not so important data rates useful for transferring a large amount of data Because you can send it for example at three megabits per second in this example But sometimes we've only got a small amount of data to transfer a few packets To request a web page and get the web page in response. What would we like in performance there? What's the other metric that we could use to? to choose the best path seconds we and we we use seconds to measure Latency or delay Okay, we've we talked about delay the time to get there and back for example so if the delay of those links Let's say assign the delay of the links in milliseconds The delay in milliseconds The red ones are the delays of those links Let's say we measure do we know the link data rate is two megabits per second and the delay is 10 milliseconds Now they're related, but let's let's simplify and look at it from those two perspectives If we care about delay, which path they're equal, which one do you choose? Doesn't matter when we say least cost if we have two paths, which are the same Then right choose randomly. We don't distinguish between them so if we Change the delay To 100 here, then of course you should choose the bottom path. It has if delays of interest has a cost of 22 or that Maybe not a cost that delay is 22 milliseconds in total and the top path is 112 milliseconds So we choose the bottom path and delay can directly map to cost We want a low delay. We want a low cost So delay is easy if the delay is 10. We can just say the cost is 10 The data rate is more complex if we the data rate is 2 we need to convert that to some cost Let's say a 50 because we want a low cost, but a high data rate So two metrics data rate Related to data rate is throughput data rate delay What else? Let's say you're not your home user, but it's it's not you that chooses the path But your ISP your internet service provider chooses the path from their network to get your data to Facebook in the US There's two metrics that they can use what's another way that they could choose a path What else do you care about? or your your Network provider or internet service provider may care about time. Well, that's delay really Okay delay. Yeah, it's time data rate security Maybe you know that some networks are less trustworthy than others. Okay, it's routing for your business You have there are certain laws in your country that say that your data must not travel through this country So the route may bypass a particular country What else so security? Yes? financial costs money This path is going to cost us a thousand baht per packet this path is going to cost us 10 baht per packet choose the cheapest one So that's another thing that may take into account Usually we as end users don't have a say but the the internet service providers may choose the path Which goes through networks which will cost them the least in financial cost So there are different metrics the simplest metric is Which is commonly used is number of hops Sometimes it's hard to know. What is the data rate of these links? How much is the link being used? Maybe someone is using it so we can't use the full data rate What is the delay? Well, it changes over time What is the financial cost? It's hard to know an easy thing to know is How many hops so a simple way to measure best path is to define it by hops choose the path with the least number of hops But it's not it may not be the best in data rate or delay, but it's easy to calculate So that's another one hops Get back to what? What have we got? So different performance criteria are used They listed here number of hops cost delay throughput throughput or data rate Here cost is financial cost. Now just some examples of the criteria we went through The other problem or some other problems are when do you select a path? You've got data to get from your computer to some destination Do you select a path today and for the next year use that same path or Do you select the path? Send one packet across it and then the next packet you have to send select a path again and and try again So when do you select is another issue? So these questions some of the answers are on this table When do you select is the decision time and the two main options are? based on packets Individual packets the path is chosen per packet or based on sessions for example You set up a voice call Using some technology to talk between two people across a network Then when you set up that call the path is selected and for the duration of the call you use the same path So that's a session based decision who selects the path who's responsible for selecting a path in this network Who should select the path? Where are some computers your calculator, but which computer a Server so some special server maybe there's a seventh node in the network that has the dedicated role of Once it knows the network topology it calculates the least cost paths and tells everyone which ones to use So that's a centralized approach. We have one node That does it all for us There could be a distributed approach that these nodes themselves Try and calculate the least cost paths to everyone else so the nodes that are actually Participating in the network Calculate and determine the paths The third approach is the source Node 1 has data to send to node 6 Node 1 chooses the path All right. I want to get to node 6. I'll calculate. I'll use 4 5 and 6 and Sends across that path Centralized would be some other computer saying to node 1. Okay If you want to get to node 6 send to node 4 and that central computer would tell node 4 If you've got something to get to node 6 send it to node 5 and so on that would be a centralized approach a Distributed approach would be those nodes determine that themselves Node 1 determines. Okay. I've got something to go to node 6. I must send it to node 4 Node 4 determines. I've got something to go to node 6. I must send it to node 5. That's a distributed approach In the internet. It's mainly using a distributed approach The nodes participate in that selection and usually on a packet basis the other issues are How do we know about the links? Then other nodes in the network and the link costs Because if I want to choose the best path I must know this topology and I must know the link costs. The question then is how does node 1 know that information? And because things may change over time Nodes may disappear new nodes may arrive links may go down and come back up Costs may change And the other thing is how often should I update my information about the network? Let's go. So that's Where do we get the information about the network status the current topology the current link costs the current usage of the links and? How often do we update that information? There are different approaches Let's illustrate them with an example Some of the or the approaches are listed here, but we'll try and explain them with an example not this one Here's a node node 1 it has data Node 1 So you're node 1 you're one of the nodes in the network and you have data to send to node 7 Okay, you have a packet and you want to get it to node 7 Where do you send it? you were you were the computer that is node 1 and You want to get it to node 7 you know that there's a node 7 somewhere in the network. Where do you send the data? This is a different network than the example in the collection notes. There's seven notes It's different. Where do you send it? Your node one. Where are you going to send it? You've got a packet destination node 7 you need it to get to node 7 What do you do? Where do you send it? How do you get it to node 7? Where is node 2 and node 3? Well, we need to We need to know about some other nodes. Okay, that's the first point that think this is a computer running here the node It's got some data to get to node 7 It needs to know something about the other nodes to do anything Okay, so I'll give you a bit more information about the network and you'll see over time that the network builds up Come on get this correct We'll build up a network that has in fact seven nodes at the end What's the first one? There'll be a node up here another node here and I'll tell you who they are that this is node 2 and this is node 5 So it's typical You can assume that a node knows its neighbors Because someone has plugged a cable into there. So if you run and operate this node in Bangkok You would know who has links into your node So you would know that there's a cable going from your node in Bangkok to a node in Singapore Okay, there's a link there and another node somewhere else. Okay, so you know about the direct neighbors That's the the minimum knowledge that you would have at that particular node now The question is your node one you've got data to send to node 7. Where do you send it? You've got a data packet to send to node 7. What do you do now? send Send across send across both paths I've got a packet needs to get to node 7 all I know at this stage is that I have a link to 5 and 2 so one approach is to Send a copy of the packet to 5 and hope it gets to 7 from 5 and Send another copy of that same packet to 2 and hope well if it doesn't get there via 5 it should get there via 2 So without any other knowledge of the network a Simple approach to send data to the destination is send the data to everyone in this case all of your neighbors And we'll see that that approach is called flooding Send the data to everyone and the next step when 5 receives the data It will send to all of its neighbors And they'll keep doing that and eventually 7 will receive a copy Our aim is to get the data to 7 So one approach is what we'll call flooding send to everyone But we'll see that it's not very good. It's very inefficient Anything else you could do Node one instead of sending to both. What else could it do? Which one should you send to two or five? select one two or five Random Five okay, so you could do it randomly. You know that you have two neighbors Send the packet to one of them if you don't know any other information what else can you do? It probably won't find the best path though. That's the problem We'll see later what we do if we did it randomly so really if we want to find the best path we need to know something about the other nodes in the network and The costs of the links So let's say We would also can measure that or know the cost of each link that might make it a little bit easier So say the cost of those links We know they're our links this one's three units and this one's two Whatever the metric is Now does that help? Where would you send the data? Send to five why? It's the lower cost there. So one idea if you just know about your neighbors Send it to five Because that link has the lowest cost with the hope that five will be able to send it eventually onto seven Okay So if you only know about your neighbors then You could do it in that approach. Do you think it will find the best path the least cost path? Maybe maybe not. Okay. So maybe and we'll see later If we did send it in this direction Would it eventually get to node seven which is over here on the least cost path? well Not guaranteed So we'd We need to know more information to get the least cost path. What can we do? node one One approach node one asks its neighbors. Who are your neighbors? All right, so node one has links to five and two It sends a special message to five saying please tell me who your neighbors are and Tell me the costs of the links to your neighbors and It gets a response back and similar sends a message to two saying who are your neighbors tell me their link costs and it gets a response back So this is what a routing protocol will do It will exchange some messages between the different nodes to learn about the network status and Once that happens node one will have a larger view of the network. Let's say it did that and What does it do? Node five has a neighbor say draw it here. I know this but you don't that node five has a neighbor here Node one learns it because it sent a message to five saying who are your neighbors five send a message back saying my neighbor One of my neighbors is node three Similar node one sends a message to two two sends a message back saying my neighbors are Four and six. I'll just draw them so we can fit them in up here So this is the information that node one now knows about the network if it talks to its neighbors by exchanging some special packets That's what a routing protocol will do. It can ask them about their neighbors and After that one set of exchanges it learns about nodes three four and six and Can also learn about the costs of those links And we learned that the costs sorry Matoo here eight here and this one's five That's the knowledge of node one about the the network at this point in time Which path should we take now? Remember before we chose to send it to five because the link cost was two Now would you choose the same path to send it to five? Where would you send it? One two four is the current the least cost path so now with more knowledge about the network we can Choose a different path and hopefully a better path Because if we sent it to five By just knowing about our neighbors it would have went across a path which had a cost of seven so far But if we actually sent it to two it could have got across a path which had a cost of five a lower cost path But we still don't know whether the path via one two four will get to seven across the least cost path Okay, we've learned a little bit more information which is better but It's not still enough to make the best decision. What do we do now? We need to know about the other links the other costs so what node one can do instead of just asking your neighbors about their neighbors then ask nodes three four and six tell me about your link costs so Node one can send a message to three saying who are your neighbors? Of course it includes five, but it includes some others when it gets the message back It learns about the neighbors of three similar for four and six so by exchanging more messages in The network we can learn more about that network status The topology and the links the link costs So let's say we exchange with three four and six and we learn their neighbors so Turns out that three is actually a neighbor of four four and six are neighbors three and six are neighbors and there's another node Seven which is a neighbor of six and also a neighbor of three and in Learning that information so node one now has a picture of the network which includes this is in fact This is all the nodes in this example It includes the destination and I'll also write the link costs Now where should node one send the packet? Which path one? Sends to I think if you look one two four three Six seven Okay One to two two to four. That's five four to three six three to six is ten six to seven a total path cost of 12 Is there a low one lower than 12? 12 is the lowest Okay, so you'd find the least cost path there so the point is that You need to know this network topology and the link costs to choose the least cost path If you don't know it you won't be able to choose the least cost path You may be lucky sometimes, but most of the time you'll get a suboptimal path If we only knew our neighbors, we would have sent it to five Then five would have sent it to three which may have sent it to seven and it would have had a cost of 14 it wasn't this is a seven. It wasn't the least cost path Okay, so The more information we know about the network The more chance of choosing the least cost path. That's a good thing But what's the problem of knowing or gathering information about the network? It takes effort that is for node one to know about The neighbors of five it must exchange the message with node five saying who are your neighbors and get a response back So that's some overhead. We need to exchange just to learn that information the larger the network Hundreds of nodes for example many exchanges of packets need to happen to learn about the rest of the network And that's a bad thing that means We're using this network to learn about the network structure when we'd like to use it to transfer our data So the more we learn the better for making the decision of the least cost path But the more we learn the higher the overhead of transmitting packets through the network That's the disadvantage Gathering the knowledge is expensive, but the more knowledge you have the better decisions you can make Okay, so node one chooses the path two four three six seven. It's sending its packets It's got many packets to send and then What happens? Things change okay as the network is being used the cost of The cost of this link from three to four changes from four up to ten Some problem occurs Maybe the cost was related to delay and the delay has gone up very high What should we do? Wish I think you can see we this is no longer the least cost path, but how does a know that? How does a know how does node one know? How does node one know that this link cost has changed? We need some updates of sending messages not just in the first instance to learn about the topology But as the link cost change and even the links may change we need to continually get an update What's the current status? Calculate the least cost path maybe five minutes later get an update What's the current status and? Recalculate the least cost path and keep doing that continuously otherwise You'll miss this situation if we chose the path at the start of one two four three six seven and then while we're using that this link cost goes up If we keep using it, we're using a suboptimal path. So we need regular updates So for example What could happen is that node three? when its links Change It tells its neighbors My link cost to six has changed from four to ten and who then distribute that information to others So some way we need node one to learn that the path from three to four is now has a cost of ten So it's about How much information do we learn about the network? We want to learn more, but there's a higher overhead of doing that and How often we update that information? We want to update as often as possible And then we have an accurate picture of the network, but there's a higher overhead of doing that questions so in this case If node one learned that that changed to ten it could change the path to somewhere else, whichever is the next list cost path You'll find it So this the the right-hand part of this table lists some different alternatives for where do we get information from about the network? worst case use none don't use any information just Randomly choose the your neighbor to send to or send to all your neighbors That's the easiest No overhead of collecting information, but we'll most likely choose the a suboptimal path Use local information, which means really about your neighbors That was our first step. We know that our neighbors were two and five Use just the information about the links to your neighbors. That's local to node one You don't need to exchange any messages with them to know that you have a link with five Because someone plugged the cable in and you know in advance that there's a link to five Adjacent nodes means neighbor nodes ask your neighbors about Their links. That's what we did to expand. We said Node one knows about two and five it sends a message to five saying who are your neighbors? Who are your adjacent nodes? Sends back a response and that allowed node one to learn more about the network topology But it involves some overhead of exchanging packets One we didn't see you could ask the nodes along the a particular path about their neighbors and especially their link costs That's a special case and the last thing we did is we asked all nodes Think all nodes tell every other node about the link topologies other the network topology and link costs That's the best case In that will have the most information about the network, but it has the highest overhead When do we update? That is we do that once We could Continuously update we've always got new information especially local to the node Periodic that is every one minute send a message to a neighbor saying please update me about your neighbors Do it on a periodic basis? When there's a major change in the load, which means for example the link cost When this link cost changes Then that triggers an update for node three to tell everyone in the network my link to node six has changed to 10 So that's when a major change happens. We could update Or a link fails. I don't know the link from three to five is No longer exists That could trigger five to tell one. I don't have a link to three anymore so different ways to trigger an update periodic and and based upon events the more updates The better the information the better the routes, but the higher the overhead The the more information we gather The better chance of selecting the best path That's a good thing But the more overheads of collecting that information similar with updates the more updates we have The better chance of selecting the best path, but the more overheads we have so we need to make a trade-off of How much information we collect and how often we update that information and that's the major challenge of routing protocols in the Internet today getting that trade-off Appropriate last 10 minutes. Let's go back to We will not explain much here, but just to an example This is the same network as as one of the slides back How many least-cost paths are there so you've got it on your slide. I've got it somewhere else me This one how many how many least-cost paths are there how many least-cost paths So if I ask you to calculate the least-cost paths How many are there that you would calculate from anywhere to anywhere? In a network generally we'd like to allow anyone to Communicate with anyone else for example What is the least-cost path from one to six? We found that one before One to six was one four five six. Okay, so that's one least-cost path But there are other least-cost paths not from one to six, but say from one to three and from five to two and From any node to any other node The number of least-cost paths is 30 There are six nodes each Node needs a path to the five other nodes So node one will have five paths node two will have five paths and Each of the six nodes have five paths. So in total there are thirty six times five paths in that network, so With six nodes there are six times five Least-cost paths that need to be calculated you could do it. I Will not ask you to but you could go through and find all 30 paths If there are ten thousand Nodes there are ten thousand times nine hundred and ninety nine thousand nine hundred ninety nine About one million paths to calculate and that's where you need Computer to do it for you. We will not calculate them all, but let's list some actually Let's not let's try a new example a Different network not that network not the one I didn't went through in the example But a third network and I tell you I've calculated the least-cost paths And I find a path which is the least-cost and it's from node one to four to six to nine Add one more to three Let's say I've calculated in another network a bigger network the least-cost path from one to three is via four six and nine Okay I've done that. I've calculated Tell me some other paths least-cost paths in this network So you don't know the network, but I tell you the least-cost path What are some other paths in this network? Don't look at your picture It's a different network Completely different here. This one has many nodes more than nine if this is one least-cost path Then it means the subpaths must also be least-cost paths That's an important point we use in routing You don't know the rest of the network, but what we can work out from this that it must be that there's another path What? Let's say There must be a path from four to three Via six to nine which is the least-cost path as well So to get from four to three There's a least-cost path by six and nine because it's a sub path for the one that we knew about Why why is that the case? Let's say the past. I'll give you some more information I'll give the costs just as an example. This was our path and the costs let's say the links were Two three four and three so the total path cost is what is 12 So what my point is if we know this path That the subpaths are also least-cost paths and one sub path is four six nine three Or the segments of that path Why well consider what if it wasn't the case? What if there was a path from four to three? Which had a lower cost? Than ten what if there was a path say four seven three Another path in the network Which had a cost of let's say this was two and this was Four if this path existed Four seven three and if that was a least-cost path of six in total Then it means there must be a path from one to three One four seven three with a cost of two plus six of eight so if there is a lower cost path than What ten between four and three? Then there will be a lower cost path than twelve between one and three this is the To think about why the sub path must also be a least-cost path So the point is that this path is Not possible. There cannot be such a path Which has a lower cost than ten? Because if we say that the path from one four through to three With a cost of two plus ten is of the least-cost path Then it means that there's no other path which has a lower cost between four and three Otherwise this would not be the least-cost path So there can't be such a path four seven three with a cost of six Otherwise my least-cost path from one to three would be one four seven three with a cost of eight But I told you that the least-cost path from one to three is one four six nine three with a cost of twelve confusing Confirm it yourself over the next week and and look at some paths through our example network and see If you try some different paths, you'll see that it starts to make sense This is a path cost of ten The main point to take away is that in this part The sub paths of the least-cost path are also least-cost path The least-cost path one four six nine three a sub path is four six nine three That's also a least-cost path Six nine three is also a least cost this cost path nine three also Because if there were other lower cost paths then we could get from one to three at a lower cost than 12 What you should do is try and calculate the least-cost path of this example one because we'll see the answers Calculate several of them So if one to six four to six one to four five to six and you'll start to see that pattern that Because this is a least-cost path so is four five six. It cannot be otherwise