 Having seen how the distance vector algorithm works, now let us move on to seeing another important concept which is the link state routing. So this is a different idea and the key point here is that instead of exchanging routing tables that keep getting bigger and bigger as they progress through the network, all that is done is that every router broadcasts the state of its links and these link state packets as they are called, they are propagated all through the network. What happens as a result of this? Essentially every router receives a packet saying that A is connected to B with a link cost of something and then X is connected to Y with a link cost of something else and so on. So it receives all these packets as a result of which it is now able to construct the topology of the network for itself. So to be a little more precise what happens is that a router describes the state of its links using a link state packet. A link state packet could be something like A, B, 1 which basically means A is connected to B with a cost of 1. These link state packets are flooded throughout the network and any router which receives a link state packet stores it in what is called a LSB database. Once it has a number of such link state packets in its database, the router now constructs the topology of the network because it knows which are the other routers in the network and how they are connected to each other. Once each router has the topology of the network, what does it do? In order to send a packet from its source or from one of its incoming interfaces, in order to determine what is the outgoing interface, what the router does is it looks at the destination address on the packet and it computes the shortest path to that destination through the topology that it has already got. How does it compute the shortest path? It uses a standard shortest path algorithm which is the famous Dijkstra's shortest path algorithm in order to compute what is the shortest path to the destination. Does it put the entire path on the packet? No, having computed the shortest path, it simply forwards the packet along the outgoing link, along the appropriate outgoing interface so that the next router can now carry out the same computation and thus the packet is forwarded hop by hop through the network. What happens when something changes in the network? As you might have thought, when some change happens in the network, a new link state packet is generated and it is again flooded throughout the network. What do we mean by flooding? Flooding basically means that if I receive a packet on an interface and it is not a packet that I have seen earlier, then I send that packet on all the outgoing interfaces. A packet in this case, what I mean is a link state packet. So these are control packets which are used only among routers for constructing their routing tables. Now the next obvious question is what if there are two packets which say the same information between two routers A and B? For example, the link between A and B might have been up with the cost of one at some point. So a link state packet was constructed which said AB1. After a while the link went down, so in which case a new link state packet might have been constructed or after some more time the link comes back up in which case there is yet another link state packet which is constructed maybe with a different cost this time. Now all these link state packets are flooding through the network and when a router at the other end of the network receives this packet, how does it know which is the most recent packet? As many of you would have guessed, the obvious thing to do here is to number these link state updates. So each time a router sends a link state packet from its, about its own links, it applies sequence numbers on those packets and it sends them in an increasing order of sequence numbers. Yes, sequence numbers are also bounded and how do these rotate and how do we reset the sequence numbers to zero? There are lots of such questions and in order to explore all these questions in detail, here is a reference that you can look at and having gone through it, come back and answer the question at the end of this module.