0% found this document useful (0 votes)
11 views

8 Routing Part2

The document discusses Link State Routing, where each router knows the entire network topology and computes the shortest path using Dijkstra's algorithm. It details the process of topology dissemination through Link State Packets (LSPs) and compares Link State and Distance Vector routing algorithms in terms of message complexity, speed of convergence, and robustness. Additionally, it introduces hierarchical routing in large networks and outlines various routing protocols used in the Internet, including EGP, BGP, RIP, and OSPF.

Uploaded by

Hemn Ahmed
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

8 Routing Part2

The document discusses Link State Routing, where each router knows the entire network topology and computes the shortest path using Dijkstra's algorithm. It details the process of topology dissemination through Link State Packets (LSPs) and compares Link State and Distance Vector routing algorithms in terms of message complexity, speed of convergence, and robustness. Additionally, it introduces hierarchical routing in large networks and outlines various routing protocols used in the Internet, including EGP, BGP, RIP, and OSPF.

Uploaded by

Hemn Ahmed
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

Northern Technical University

TECHNICAL ENG. COLLEGE \ MOSUL

Routing
Part-2-
Link State Routing
• Each router knows the entire network topology.

• Computes the shortest path by itself.

• Two key elements:


• Topology dissemination
• Computing shortest routes
Topology dissemination

• A router describes its neighbors with a Link State Packet LSP.

• This information needs to be distributed every where


• Routers store LSPs in an LSP data base
• When receiving a new LSP, forwards the LSP to every interface other than the
incoming one.
Example

LSP Created by A
A B 2
A D 1
A C 5
Computing shortest paths

• The routers computes the routing tables based on the topology.

• Typically, they use Dijkstra’s algorithm.


Dijkstra’s Algorithm (Basic idea)
• Greedy search looking for
shortest path first.

• Find every way to reach one


node in T and choose the
shortest one.

• Add this node to N and proceed.


Define

• N: set of all nodes to which we know shortest path, initially this is empty.

• D(V): cost of the least cost path from the source to V.

• C(i,j): cost of link i,j , where c(i,j)= ∞ if i,j are not directly connected.

• p(v): previous node (neighbor of v) along current least cost path from
source to v
Dijkstra’s Algorithm
• Initialization
• N={A} /* suppose A is source */
• For all nodes V
• If V is adjacent to A
• D(V)=C(A,V)
• Else
• D(V)=∞

• Loop
• Find node W not in N such that D(W) is smallest.
• Add W into N
• Update D(V) for all nodes V not in N
• D(V)=min{ D(V) , D(W)+C(W,V) } /* new cost to v is either old cost to v or known
shortest path cost to w plus cost from w to v */
• Until all nodes are in N

• After k steps, we know the shortest path to the nearest k neighbors.


Example (from A)
•In the initialization step, the currently known least path costs from A to its directly attached neighbors, B, C and D are
initialized to 2, 5 and 1 respectively. Note in particular that the cost to C is set to 5 (even though we will soon see that a
lesser cost path does indeed exists) since this is cost of the direct (one hop) link from A to C. The costs to E and F are set
to infinity since they are not directly connected to A.

•In the first iteration, we look among those nodes not yet added to the set N and find that node with the least cost as of
the end of the previous iteration. That node is D, with a cost of 1, and thus D is added to the set N. Line 12 of the LS
algorithm is then performed to update D(v) for all nodes v, yielding the results shown in the second line (step 1) in Table
4.2-1. The cost of the path to B is unchanged. The cost of the path to C (which was 5 at the end of the initialization)
through node D is found to have a cost of 4. Hence this lower cost path is selected and C's predecessor along the shortest
path from A is set to D. Similarly, the cost to E (through D) is computed to be 2, and the table is updated accordingly.

•In the second iteration, nodes B and E are found to have the shortest path costs (2), and we break the tie arbitrarily and
add E to the set N so that N now contains A, D, and E. The cost to the remaining nodes not yet in N, i.e., nodes B, C and
F, are updated via line 12 of the LS algorithm , yielding the results shown in the third row in the above table.

•and so on …

When the LS algorithm terminates, we have for each node, its predecessor along the least cost path from the source node.
For each predecessor, we also have its predecessor and so in this manner we can construct the entire path from the source
to all destinations.
What is the computation complexity of this algorithm?
That is, given n nodes (not counting the source), how much computation must be done in the worst case to find the
least cost paths from the source to all destinations? In the first iteration, we need to search through all n nodes to
determine the node, w, not in N that has the minimum cost. In the second iteration, we need to check n-1 nodes to
determine the minimum cost; in the third iteration n-2 nodes and so on. Overall, the total number of nodes we
need to search through over all the iterations is n*(n+1)/2, and thus we say that the above implementation of the
link-state algorithm has the worst-case complexity of order n squared: O(n2).
Link cost

• Link cost needs to take the following criteria into account:


• Differences in link delay
• Differences in link capacity
• Differences in link load
• Differences in packet loss

• The problem is to capture these differences in a single scalar value for


each link.
A Comparison of Link State and Distance Vector Routing Algorithms
•Message Complexity. We have seen that LS requires each node to know the cost of each
link in the network. This requires O(nE) messages to be sent, where n is the number of
nodes in the network and E is the number of links. Also, whenever a link cost changes,
the new link cost must be sent to all nodes. The DV algorithm requires message
exchanges between directly connected neighbors at each iteration. We have seen that
the time needed for the algorithm to converge can depend on many factors. When link
costs change, the DV algorithm will propagate the results of the changed link cost only if
the new link cost results in a changed least cost path for one of the nodes attached to that
link.
•Speed of Convergence. We have seen that our implementation of the LS is an O(n 2)
algorithm requiring O(nE) messages, and potentially suffer from oscillations. The DV
algorithm can converge slowly (depending on the relative path costs) and can have
routing loops while the algorithm is converging. DV also suffers from the count to infinity
problem.
•Robustness. What can happen is a router fails, misbehaves, or is sabotaged? Under
LS, a router could broadcast an incorrect cost for one of its attached links (but no
others). A node could also corrupt or drop any LS broadcast packets it receives as
part of link state broadcast. But an LS node is only computing its own routing tables;
other nodes are performing the similar calculations for themselves. This means
route calculations are somewhat separated under LS, providing a degree of
robustness. Under DV, a node can advertise incorrect least path costs to any/all
destinations. More generally, we note that at each iteration, a node's calculation in
DV is passed on to its neighbor and then indirectly to its neighbor's neighbor on the
next iteration. In this sense, an incorrect node calculation can be diffused through
the entire network under DV.​

In the end, neither algorithm is a "winner" over the other, both algorithms
are used in the Internet.
Generally speaking

• Large networks need large routing tables

• More computations to find shortest path

• More bandwidth wasted on exchanging distance vectors and link


state packets

• Solution?!!
Hierarchical Routing
• Divide the network into a set of administrative domains or
autonomous systems (AS)

• The ASs are connected through gateways

• The computers in one AS are unaware of all computers outside the AS

• A gateway knows only about other gateways.


The Internet

• The internet has three levels of routing


• Highest is at backbone level, connecting autonomous systems.
• Next level is within AS
• Lowest level is within a LAN
Routing protocols between routing levels

• Exterior gateway protocol (EGP): between AS gateways


• It is a DV protocol but distance to other nodes is either 128 (reachable) or 255
(unreachable), which makes it a reachability protocols.

• Border gateway protocol (BGP): between AS gateways


• It is a DV protocol annotated with entire path (known as path vector)

• Interior gateway protocol (IGP): routing protocol within AS


IGP protocols

• Routing Information Protocol (RIP): DV algorithm with split horizon


using hop count as cost metric.

• Open shortest path first (OSPF): link state routing using Dijkstra’s
algorithm, has some extra features as compared to RIP (e.g. QoS
routing, multiple paths ,etc.) but is much more complex.

You might also like