Professional Documents
Culture Documents
Unit 3 Routing: CO3: Outline The Functionality of Each Layer of The Network
Unit 3 Routing: CO3: Outline The Functionality of Each Layer of The Network
Unit 3 Routing: CO3: Outline The Functionality of Each Layer of The Network
Routing
Routing - Unicast Routing – Algorithms – Protocols – Multicast
Routing and its basics – Overview of Intradomain and
interdomain protocols – Overview of IPv6 Addressing – Transition
from IPv4 to IPv6
20.2
Figure 20.1: An internet and its graphical representation
20.3
20.20.2 Least-Cost Routing
A least-cost tree
is a tree with the
source router as the
root that spans the
whole graph (visits
all other nodes) and
in which the path
between the root and
any other node is the
shortest.
20.5
20-2 ROUTING ALGORITHMS
20.7
Figure 20.3: Graphical idea behind Bellman-Ford equation
20.9
Figure 20.5: The first distance vector for an internet
• Each node in an internet, when it
is booted, sends some greeting
messages out of its interfaces
and discovers the identity of the
immediate neighbors and the
distance between itself and each
neighbor.
• It then makes a simple distance
vector (rudimentary) and leaves
the value of other cells as
infinity.
• These rudimentary vectors
cannot help the internet to
effectively forward a packet.
• Eg: Node A thinks that it is not
connected to node G because the
corresponding cell shows
infinity.
• To improve these vectors, the
nodes in the internet need to
help each other by exchanging
20.10 information.
Figure 20.6: Updating distance vectors
20.11
Figure 20.7: Two-node instability
Count to Infinity
If a link is broken (cost becomes infinity), every other router
should be aware of it immediately, but in distance-vector
routing, this takes some time.
Example: Two-node loop problem.
1.At the beginning, both nodes A and B know how to reach node
X.
2.Suddenly, the link between A and X fails. Node A changes its
table. If A can send its table to B immediately, everything is fine.
3.The system becomes unstable if B sends its forwarding table to
A before receiving A’s forwarding table. Node A receives the
update and, assuming that B has found a way to reach X, updates
its forwarding table.
4.Now A sends its new update to B. B thinks that something has
been changed around A and updates its forwarding table.
5.The cost of reaching X increases gradually until it reaches
infinity. Then, A and B know that X cannot be reached.
The system is not stable. Node A thinks that the route to X is via
B; node B thinks that the route to X is via A. Packets destined for
X will bounce between A and B, creating a two-node loop
problem.
20.12
Link-State Routing(Dijkstra’s Algorithm)
• A routing algorithm used to find the shortest path from one node to every other node in the
network .
• Term link-state define the characteristics of a link (an edge) that represents a network in the
internet.
• In this algorithm the cost associated with an edge defines the state of the link.
• Links with lower costs are preferred to links with higher costs.
• If the cost of a link is infinity, it means that the link does not exist or has been broken.
• Two phases:
(i)Reliable Flooding
-Each Node Knows the cost of its neighbor.
- Each Node Knows the entire graph.
(i)Route Calculation
-Each Node uses Dijkstra’s Algorithm to calculate the optimal path.
20.13
Figure 20.8: Example of a link-state database
20.14
Figure 20.9: LSPs created and sent out by each node to build LSDB
Then the node sends a copy of it out of each interface except the one from which the packet arrived.
This guarantees that flooding stops somewhere in the network (where a node has only one interface).
Each node creates the comprehensive LSDB. This LSDB is the same for each node and shows the whole
map of the internet. In other words, a node can make the whole map if it needs to, using this LSDB.
20.15
Compare link-state routing with
distance-vector routing
20.16
Table 20.2: Dijkstra’s Algorithm
To create a least-cost tree for itself, using the shared LSDB, each node needs to run the
Dijkstra Algorithm:
1. The node chooses itself as the root
of the tree, creating a tree with a
single node, and sets the total cost of
each node based on the information
in the LSDB.
2. The node selects one node, among
all nodes not in the tree, which is
closest to the root, and adds this to
the tree. After this node is added to
the tree, the cost of all other nodes
not in the tree needs to be updated
because the paths may have been
changed.
3. The node repeats step 2 until all
nodes are added to the tree.
20.17
Figure 20.10: Least-cost tree
The figure shows the formation of the least-cost tree using Dijkstra’s algorithm. We need to
go through an initialization step and six iterations to find the least-cost tree.
20.18
20.2.3 Path-Vector Routing
• Both link-state and distance-vector routing are based
on the least-cost goal.
• In path routing protocol ,source can control, the path
and can prevent the packet in passing through certain
node.
• Path vector routing is not actually used in Internet but
can prevent the packet in passing through certain
nodes.
• Two Policies:
• i)Minimum no. of nodes to be visited
• ii) To avoid some nodes as the middle node in a route.
20.19
Figure 20.11: Spanning trees in path-vector routing
20.20
Figure 20.12: Path vectors made at booting time
20.21
Figure 20.13: Updating path vectors S
20.22
Table 20.3: Path-vector algorithm for a node S
20.23