Link State Routing Protocol and building it

Link-State Routing Protocol Features

Like distance vector protocols, link-state protocols send routing updates to neighboring routers, which in turn send updates to their neighboring routers, and so on.  Routers that use link-state protocols add the best routes to their routing tables, based on metrics, just like distance vector.

Building the Same LSDB on Every Router

Routers using link-state routing protocols need to collectively advertise practically every detail about the internetwork to all the other routers.  At the end of the process, called flooding, every router in the internetwork has the exact same information about the internetwork.  Routers use this information, stored in RAM inside a data structure called the link-state database (LSDB), to perform the other major link-state process to calculate the currently best routes to each subnet.

Open Shortest Path First (OSPF) advertises information in routing update messages of various types, with the updates containing information called link-state advertisements (LSA).  LSAs come in many forms, including the following two main types:

* Router LSA: Includes a number to identify the router (router ID), the router’s interface IP addresses and masks, the state (up or down) of each interface, and the cost (metric) associated with the interface.

* Link LSA: Identifies each link (subnet) and the routers that are attached to that link.  It also identifies the link’s state (up or down).

Some routers must first create the router and link LSAs, and then flood the LSAs to all other routers.  Each router creates a router LSA for itself and then floods that LSA to other routers in routing update messages.  To flood an LSA, a router sends the LSA to its neighbors.  Those neighbors in turn forward the LSA to their neighbors, until all the routers have learned about the LSA.  For the link LSAs, one router attached to a subnet also creates and floods a link LSA for each subnet.  At the end of the process, every router has every other router’s router LSA and a copy of all the link LSAs as well.

To prevent looping LSA advertisements, a router that knows about the LSA first asks its neighbor if that neighbor already knows about this LSA.

The origins of the term link state can be explained by considering the contents of the router LSA.  Link-state protocols get their name from the fact that the LSAs advertise each interface (link) and whether the interface is up or down (state).  So the LSDB contains information about not only the up and working routers and interfaces and links (subnets), but all routers and interfaces and links (subnets), even if the interfaces are down.

After the LSA has been flooded, even if the LSAs do not change, link-state protocols do require periodic flooding of the LSAs, similar to the periodic updates sent by distance vector protocols.  OSPF refloods each LSA based on each LSA’s separate aging timer (default 30 minutes).  As a result, in a stable internetwork, link-state protocols use less network bandwidth to send routing information than do distance vector protocols.  If an LSA changes, the router immediately floods the changed LSA.