Link-state routing protocol: Difference between revisions

Content deleted Content added
spam
 
(400 intermediate revisions by more than 100 users not shown)
Line 1:
{{short description|Class of routing protocols}}
A '''Link-state routing protocol''' is one of the two main classes of [[routing protocol]]s used in [[packet switching|packet-switched network]]s for [[computer communication]]s.
{{More footnotes needed|date=September 2010}}
 
'''Link-state routing protocols''' are one of the two main classes of [[routing protocol]]s used in [[packet switching]] networks for [[computer communication]]s, the others being [[distance-vector routing protocol]]s.<ref>{{Cite web |date=2018-05-18 |title=Unicast Routing - Link State Routing |url=https://www.geeksforgeeks.org/unicast-routing-link-state-routing/ |access-date=2024-05-09 |website=GeeksforGeeks |language=en-US}}</ref> Examples of link-state routing protocols include [[Open Shortest Path First]] (OSPF) and [[Intermediate System to Intermediate System]] (IS-IS).<ref>lec10-lsrouting.pdf (princeton.edu)
The link-state protocol is performed by every ''switching node'' in the network (i.e. nodes which are prepared to forward packets; in the [[Internet]], these are called [[router]]s). The basic concept of link-state routing is that every node receives a ''map'' of the connectivity of the network, in the form of a [[graph theory|graph]] showing which nodes are connected to which other nodes.
 
<nowiki>https://www.cs.princeton.edu/courses/archive/spring23/cos461/lectures/lec10-lsrouting.pdf</nowiki></ref>
Each node then independently calculates the best ''next hop'' from it for every possible destination in the network. (It does this using only its local copy of the map, and without communicating in any other way with any other node.) The collection of best next hops forms the [[routing table]] for the node.
 
The link-state protocol is performed by every ''switching node'' in the network (i.e., nodes which are prepared to forward packets; in the [[Internet]], these are called [[Router (computing)|router]]s).<ref>lecture6.pptx (umich.edu)
This contrasts with [[distance-vector routing protocol]]s, which work by having each node share its '''routing table''' with its neighbors. In a link-state protocol, the only information passed between the nodes is information used to construct the connectivity maps.
 
<nowiki>https://www.eecs.umich.edu/courses/eecs489/w10/winter10/lectures/lecture6_2.pdf</nowiki></ref> The basic concept of link-state routing is that every node constructs a ''map'' of the connectivity to the network in the form of a [[graph theory|graph]], showing which nodes are connected to which other nodes.<ref>123sp15-lec14.pdf (ucsd.edu)
==History==
 
<nowiki>https://cseweb.ucsd.edu/classes/sp15/cse123-a/lectures/123sp15-lec14.pdf</nowiki></ref> Each node then independently calculates the next best logical ''path'' from it to every possible destination in the network.<ref>link state protocol.pdf (fauser.edu)
The first network to use a link-state routing protocol was the [[ARPANET]], after the initial distance-vector routing protocol proved to have a number of major problems, once placed in service.
 
<nowiki>http://nuovolabs.fauser.edu/~valeria/materiale-didattico/sistemi-quinta/link%20state%20protocol.pdf</nowiki></ref> Each collection of best paths will then form each node's [[routing table]].<ref>{{Cite web |date=2019-08-12 |title=9.6: Link-State Routing-Update Algorithm |url=https://eng.libretexts.org/Bookshelves/Computer_Science/Networks/Book%3A_An_Introduction_to_Computer_Networks_(Dordal)/09%3A_Routing-Update_Algorithms/9.06%3A_Link-State_Routing-Update_Algorithm |access-date=2024-05-09 |website=Engineering LibreTexts |language=en}}</ref>
Link-state routing was invented in [[1978]] by [[John McQuillan]], then at [[Bolt, Beranek and Newman]], as a mechanism that would calculate routes more quickly when network conditions changed, and thus lead to more stable routing.
 
This contrasts with distance-vector routing protocols, which work by having each node share its routing table with its neighbors, in a link-state protocol, the only information passed between nodes is ''connectivity related''.<ref>5-routing-part2.pdf (washington.edu)
Later work at BBN showed how to use the link-state technique in a hierarchical system, i.e. one in which the network was divided into areas, so that each switching node does not need a map of the entire network, only the area(s) in which it is included.
 
<nowiki>https://courses.cs.washington.edu/courses/cse461/22sp/slides/5-routing-part2.pdf</nowiki></ref> Link-state algorithms are sometimes characterized informally as each router "telling the world about its neighbors."<ref>{{Cite web |last=Library |first=Broadband |date=2018-08-31 |title=A Closer Look at Routing {{!}} |url=https://broadbandlibrary.com/a-closer-look-at-routing/ |access-date=2024-05-09 |language=en-US}}</ref>
The technique was later adapted for use in the contemporary link-state routing protocols [[IS-IS]] and [[OSPF]].
 
==Overview==
'''Note:''' The impression in various Cisco marketing documents to the contrary, [[EIGRP]] is '''definitely not''' a link-state protocol, or any
In link-state routing protocols, each router possesses information about the complete network topology. Each router then independently calculates the best next hop from it for every possible destination in the network using local information of the topology. The collection of best next hops forms the routing table.
sort of "hybrid" thereof.
 
This contrasts with [[Distance-vector routing protocol|distance-vector routing protocols]], which work by having each node share its routing table with its neighbours. In a link-state protocol, the only information passed between the nodes is the information used to construct the connectivity maps.
More recently, this technique was applied to [[wireless mesh network]]s using the [[optimized link state routing protocol]].
 
==History==
==Detailed description: Distributing maps==
What is believed to be the first adaptive routing network of computers, using link-state routing, was designed and implemented during 1976–1977 by a team from [[Plessey Radar]] led by Bernard J Harris; the project was for "Wavell"{{snd}} a system of computer command and control for the [[British Army]].{{citation needed|date=September 2016}} The first link-state routing concept was published in 1979 by [[John M. McQuillan]] (then at [[Bolt, Beranek and Newman]]) as a mechanism that would calculate routes more quickly when network conditions changed and thus lead to more stable routing.<ref>[[John M. McQuillan]], Isaac Richer and Eric C. Rosen, ''ARPANet Routing Algorithm Improvements'', BBN Report No. 3803, Cambridge, April 1978</ref><ref>[[John M. McQuillan]], Isaac Richer and Eric C. Rosen, ''The New Routing Algorithm for the ARPANet'', [[IEEE]] Trans. on Comm., 28(5), pp.&nbsp;711–719, 1980</ref>
 
This description covers only the simplest configuration; i.e. one with no areas, so that all nodes do have a map of the entire network. The hierarchical case is somewhat more complex; see the various protocol specifications.
 
As previously mentioned, the first main stage in the link-state algorithm is to give a map of the network to every node. This is done with several simple subsidiary steps.
 
===Determining the neighbours of each node===
 
First, each node needs to determine what other nodes it is connected to, over fully-working links; it does this using a simple ''reachability protocol'' which it runs separately with each of its directly-connected neighbours.
 
===Distributing the information for the map===
 
Next, each node periodically makes up a short message, the ''link-state advertisement'', which:
 
* Identifies the node which is producing it.
* Identifies all the other nodes to which it is directly connected.
* Includes a ''sequence number'', which increases every time the source node makes up a new version of the message.
 
This message is then ''flooded'' throughout the network. As a necessary precursor, each node in the network remembers, for every other node in the network, the sequence number of the last link-state message which it received from that node. With that in hand, the method used is simple.
 
Starting with the node which originally produced the message, it sends a copy to all of its neighbours. When a link-state advertisement is received at a node, the node looks up the sequence number it has stored for the source of that link-state message. If this message is newer (i.e. has a higher sequence number), it is saved, and a copy is sent in turn to each of that node's neighbours.
 
This procedure rapidly gets a copy of the latest version of each node's link-state advertisement to every node in the network.
 
===Creating the map===
 
Finally, with the complete set of link-state advertisements (one from each node in the network) in hand, it is obviously easy to produce the graph for the map of the network.
 
The algorithm simply iterates over the collection of link-state advertisements; for each one, it makes links on the map of the network, from the node which sent that message, to all the nodes which that message indicates are neighbours of the sending node.
 
No link is considered to have been correctly reported unless the two ends agree; i.e. if one node reports that it is connected to another, but the other node does not report that it is connected to the first, there is a problem, and the link is not included on the map.
 
===Notes about this stage===
 
The link-state message giving information about the neighbours is recomputed, and then flooded throughout the network, whenever there is a change in the connectivity between the node and its neighbours, e.g. when a link fails. Any such change will be detected by the reachability protocol which each node runs with its neighbours.
 
==Detailed description: Calculating the routing table==
 
As initially mentioned, the second main stage in the link-state algorithm is to produce routing tables, by inspecting the maps. This is again done with several steps.
 
'''Bold text'''''Italic text''[[Link title]]
 
Emit did not download Avast why?== Headline text ==
[http://www.example.com link title][[Media:Example.ogg]]===Calculating the shortest paths===
 
Each node independently runs an [[algorithm]] over the map to determine the [[Shortest_path_problem|shortest path]] from themselves to every other node in the network; generally some variant of [[Dijkstra's algorithm]] is used.
 
The technique was later adapted for use in the contemporary link-state routing protocols IS-IS and OSPF. [[Cisco]] literature refers to [[Enhanced Interior Gateway Routing Protocol]] (EIGRP) as a "hybrid" protocol,<ref>{{Cite web |title=Cisco Firepower Threat Defense Configuration Guide for Firepower Device Manager, Version 7.1 - Enhanced Interior Gateway Routing Protocol (EIGRP) [Cisco Secure Firewall Threat Defense] |url=https://www.cisco.com/c/en/us/td/docs/security/firepower/710/fdm/fptd-fdm-config-guide-710/fptd-fdm-eigrp.html |access-date=2024-01-18 |website=Cisco |language=en}}</ref> despite the fact it distributes routing tables instead of topology maps. However, it does synchronize routing tables at start-up as OSPF does and sends specific updates only when topology changes occur.
Basically, a node maintains two data structures: a [[Tree data structure|tree]] containing nodes which are "done", and a list of ''candidates''. The algorithm starts with both structures empty; it then adds to the first one the node itself. The algorithm then repetitively:
 
In 2004, [[Radia Perlman]] proposed using link-state routing for [[layer 2]] frame forwarding with devices called [[routing bridge]]s, or Rbridges. The [[Internet Engineering Task Force]] has standardized the [[Transparent Interconnection of Lots of Links]] (TRILL) protocol to accomplish this.<ref>{{citation |rfc=7176 |title=Transparent Interconnection of Lots of Links (TRILL) Use of IS-IS|date=May 2014|last1=Eastlake 3Rd|first1=Donald E.|last2=Senevirathne|first2=Tissa|last3=Ghanwani|first3=Anoop|last4=Dutt|first4=Dinesh|last5=Banerjee|first5=Ayan|doi=10.17487/RFC7176 }}</ref>
* Adds to the second (candidate) list all nodes which are connected to the node just added to the tree (excepting of course any nodes which are already in either the tree or the candidate list).
 
More recently, this hierarchical technique was applied to [[wireless mesh network]]s using the [[Optimized Link State Routing Protocol]] (OLSR). Where a connection can have varying quality, the quality of a connection can be used to select better connections. This is used in some [[ad hoc routing protocol]]s that use radio frequency transmission.{{citation needed|date=July 2024}}
* Of the nodes in the candidate list, moves to the tree (attaching it to the appropriate neighbour node already there) the one which is the closest to any of the nodes already in the tree.
 
==Distributing maps==
* Repeat as long as there are any nodes left in the candidate list. (When there are none, all the nodes in the network will have been added to the tree.)
{{Tone|date=October 2023|section}}
The first main stage in the link-state algorithm is to give a map of the network to every node. This is done with several subsidiary steps. First, each node needs to determine what other ports it is connected to over fully working links; it does this using ''reachability protocol'' that it runs periodically and separately with each of its directly connected neighbours.
 
Each node periodically (and in case of connectivity changes) sends a short message, the [[link-state advertisement]], which:
This procedure ends with the tree containing all the nodes in the network, with the node on which the algorithm is running as the ''root'' of the tree. The shortest path from that node to any other node is indicated by the list of nodes one traverses to get from the root of the tree, to the desired node in the tree.
 
* Identifies the node that is producing it.
===Filling the routing table===
* Identifies all the other nodes (either routers or networks) to which it is directly connected.
* Includes a 'sequence number', which increases every time the source node makes up a new version of the message''.''
 
This message is sent to all the nodes on a network. As a necessary precursor, each node in the network remembers, for every one of ''its'' neighbors, the sequence number of the last link-state message which it received from that node. When a link-state advertisement is received at a node, the node looks up the sequence number it has stored for the source of that link-state message; if this message is newer (i.e., has a higher sequence number), it is saved, the sequence number is updated, and a copy is sent in turn to each of that node's neighbors. This procedure rapidly gets a copy of the latest version of each node's link-state advertisement to every node in the network.
With the shortest paths in hand, filling in the routing table is again obviously easy.
 
The complete set produces the graph for the map of the network. The link-state message giving information about the neighbors is recomputed and then flooded throughout the network whenever there is a change in the connectivity between the node and its neighbors, e.g., when a link fails.
For any given destination node, the best next hop for that destination is the node which is the first step from the root node, down the branch in the shortest-path tree which leads toward the desired destination node.
 
==Calculating the routing table==
To create the routing table, it is only necessary to walk the tree, remembering the identity of the node at the head of each branch, and filling in the routing table entry for each node one comes across with that identity.
The second main stage in the link-state algorithm is to produce routing tables by inspecting the maps. Each node independently runs an [[algorithm]] over the map to determine the [[Shortest path problem|shortest path]] from itself to every other node in the network; generally, some variant of [[Dijkstra's algorithm]] is used. A node maintains two data structures: a [[Tree data structure|tree]] containing nodes which are "done", and a list of ''candidates''. The algorithm starts with both structures empty; it then adds to the first one the node itself. The variant of a [[greedy algorithm]] then repetitively does the following:
 
* All neighbour nodes which are directly connected to the node are just added to the tree (excepting any nodes which are already in either the tree or the ''candidate'' list). The rest are added to the second (''candidate'') list.
===Optimizations===
* Each node in the ''candidate'' list is compared to each of the nodes already in the tree. The candidate node which is closest to any of the nodes already in the tree is itself moved into the tree and attached to the appropriate neighbor node. When a node is moved from the candidate list into the tree, it is removed from the candidate list and is not considered in subsequent iterations of the algorithm.
 
The two steps are repeated as long as there are any nodes left in the candidate list. (When there are none, all the nodes in the network will have been added to the tree.) This procedure ends with the tree containing all the nodes in the network. For any given destination node, the best path for that destination is the node which is the first step from the root node, down the branch in the shortest-path tree which leads toward the desired destination node.
The algorithm described above was made as simple as possible, to aid in ease of understanding. In practise, there are a number of optimizations which are used.
 
== Algorithm optimizations ==
Most importantly, whenever a change in the connectivity map happens, it is necessary to recompute the shortest-path tree, and then recreate the routing table. The BBN work discovered how to recompute only that part of the tree which could have been affected by a given change in the map.
Whenever a change in the connectivity map happens, it is necessary to recompute the shortest-path tree and then recreate the routing table. BBN Technologies discovered how to compute only that part of the tree which could have been affected by a given change in the map.{{Citation needed|date=March 2013}}
 
===Topology reduction===
Also, the routing table would normally be filled in as the shortest-path tree is computed, instead of making it a separate operation.
In some cases, it is reasonable to reduce the number of nodes that generate LSA messages. For this reason, a topology reduction strategy can be applied, in which only a subset of the network nodes generate LSA messages. Two widely studied approaches for topology reduction are [[Optimized Link State Routing Protocol#Multipoint relays|multipoint relays]] that are at the base of the [[Optimized Link State Routing Protocol]] (OLSR) but have also been proposed for OSPF<ref>{{Cite journal|url=https://tools.ietf.org/html/rfc5449|title = OSPF Multipoint Relay (MPR) Extension for Ad Hoc Networks|date = February 2009|last1 = Nguyen|first1 = Dang-Quan|last2 = Clausen|first2 = Thomas H.|last3 = Jacquet|first3 = Philippe|last4 = Baccelli|first4 = Emmanuel| doi=10.17487/RFC5449 |doi-access = free|url-access = subscription}}</ref> and [[connected dominating set]]s that were again proposed for OSPF.<ref>{{Cite journal|url=https://tools.ietf.org/html/rfc5614|title = Mobile Ad Hoc Network (MANET) Extension of OSPF Using Connected Dominating Set (CDS) Flooding|date = August 2009|last1 = Ogier|first1 = Richard|last2 = Spagnolo|first2 = Phil| doi=10.17487/RFC5614 |url-access = subscription}}</ref>
===Fisheye State Routing===
With [[Fisheye State Routing]] (FSR), the LSA are sent with different time-to-live values to restrict their diffusion and limit the overhead due to control messages. The same concept is used also in the [[Hazy Sighted Link State Routing Protocol]].
 
==Failure modes==
Where a connection can have varying quality, the quality of a connection can be used to select better connections. This is used in some [[Ad hoc protocol list|wireless routing protocols]] that use radios.
If all the nodes are not working from exactly the same map, ''routing loops'' can form. These are situations in which, in the simplest form, two neighboring nodes each think the other is the best path to a given destination. Any packet headed to that destination arriving at either node will loop between the two, hence the name. Routing loops involving more than two nodes are also possible.
 
This can occur since each node computes its shortest-path tree and its routing table without interacting in any way with any other nodes. If two nodes start with different maps, it is possible to have scenarios in which routing loops are created. In certain circumstances, differential loops may be enabled within a multi-cloud environment. Variable access nodes across the interface protocol may also bypass the simultaneous access node problem.<ref>{{cite journal |last1=Wójcik |first1=R |title=A survey on methods to provide interdomain multipath transmissions |journal=Computer Networks |date=2016 |volume=108|pages=233–259 |doi=10.1016/j.comnet.2016.08.028 }}</ref>
==Notes==
 
==Optimized Link State Routing Protocol ==
If all the nodes are not working from '''exactly''' the same map, ''routing loops'' can form. (These are situations in which, in the simplest form, two neighbouring nodes each think the other is the best next hop to a given destination. Any packet headed to that destination arriving at either node will loop between the two, hence the name. Routing loops involving more than two nodes are also possible.)
The [[Optimized Link State Routing Protocol]] (OLSR) is a link-state routing protocol optimized for [[mobile ad hoc network]]s (which can also be used on other [[wireless ad hoc network]]s).<ref>RFC 3626</ref> OLSR is proactive and uses hello and [[topology control]] messages to disseminate link-state information into the mobile ad hoc network. Using hello messages, each node discovers two-hop neighbor information and elects a set of ''[[multipoint relay]]s'' (MPRs). MPRs make OLSR distinct from other link-state routing protocols. Individual nodes use the topology information to compute next-hop paths regarding all nodes in the network using shortest-hop forwarding paths.
 
==See also==
The reason is fairly simple: since each node computes its shortest-path tree, and its routing table, without interacting in any way with any other nodes, if two nodes start with different maps it is easy to have scenarios in which routing loops are created.
* [[IEEE 802.1aq|802.1aq Shortest Path Bridging]]
 
==References==
==Advantages and disadvantages of link-state routing==
<references />
{{refbegin}}
* Josh Seeger and Atul Khanna, ''Reducing Routing Overhead in a Growing DDN'', MILCOMM '86, IEEE, 1986
* [[Radia Perlman]] [http://www.ieee-infocom.org/2004/Papers/26_1.PDF “Rbridges: Transparent Routing”], Infocom 2004.
{{refend}}
 
==Further reading==
The primary advantage of link-state routing is that it reacts more quickly, and in a bounded amount of time, to connectivity changes. The primary disadvantage of link-state routing is that it requires more storage and more computing to run than does distance-vector routing.
* [http://docwiki.cisco.com/wiki/Routing_Basics#Link-State_Versus_Distance_Vector Section "Link-State Versus Distance Vector"] in the Chapter "Routing Basics" in the [[Cisco Systems|Cisco]] "Internetworking Technology Handbook"
 
{{DEFAULTSORT:Link-State Routing Protocol}}
[[Category:Routing protocols]]
[[Category:Routing algorithms]]