Routing
Routing
• The table at each node also guides the packets to the desired node
by showing the next stop in the route (next-hop routing).
Figure : Initialization of tables in distance vector routing
Note
In distance vector routing, each node shares its routing table with its
immediate neighbors periodically and when there is a change.
Figure Updating in distance vector routing
Figure Distance vector routing tables
When does a node send its partial routing table (only two columns)
to all its immediate neighbors?
Periodic Update: A node sends its routing table, normally every 30 s, in a periodic
update. The period depends on the protocol that is using distance vector routing.
Triggered Update: A node sends its two-column routing table to its neighbors
anytime there is a change in its routing table. This is called a triggered update.
1. A node receives a table from a neighbor, resulting in changes in its own table
after updating.
2. A node detects some failure in the neighboring links which results in a distance
change to infinity.
Figure Two-node instability
Defining Infinity
• The first obvious solution is to redefine infinity to a smaller number,
such as 100.
• For our previous scenario, the system will be stable in less than 20
updates. As a matter of fact, most implementations of the distance
vector protocol define the distance between each node to be I and
define 16 as infinity.
• However, this means that the distance vector routing cannot be used
in large systems.
• The size of the network, in each direction, can not exceed 15 hops.
Split Horizon
• If node B thinks that the optimum route to reach X is via A, it
does not need to advertise this piece of information to A; the
information has come from A (A already knows).
• Taking information from node A, modifying it, and sending it
back to node A creates the confusion.
Split Horizon and Poison Reverse
• Normally, the distance vector protocol uses a timer, and if there is no
news about a route, the node deletes the route from its table.
• When node B in the previous scenario eliminates the route to X from
its advertisement to A, node A cannot guess that this is due to the split
horizon strategy (the source of information was A) or because B has
not received any news about X recently.
• The split horizon strategy can be combined with the poison reverse
strategy.
• Node B can still advertise the value for X, but if the source of
information is A, it can replace the distance with infinity as a warning:
"Do not use this value; what I know about this route comes from you."
Figure Three-node instability
Routing Information Protocol (RIP)
It is an Intradomain routing protocol used inside an autonomous system. It is a very simple protocol
based on distance vector routing.
1. In an autonomous system, we are dealing with routers and networks (links). The
routers have routing tables; networks do not.
2. The destination in a routing table is a network, which means the first column
defines a network address.
3. The metric used by RIP is very simple; the distance is defined as the number of
links (networks) to reach the destination. For this reason, the metric in RIP is called
a hop count.
4. Infinity is defined as 16, which means that any route in an autonomous system using RIP cannot
have more than 15 hops.
5. The next-node column defines the address of the router to which the packet is to be sent to reach
its destination.
Figure Example of a domain using RIP
Link state routing
• In link state routing, each node in the domain has
the entire topology of the domain
• List of nodes and links, how they are connected
including cost (metric), and condition of the links
(up or down)
Link state knowledge
Build routing table
In link state routing, four sets of actions are required to ensure that each node has the
routing table showing the least-cost node to every other node.
1. Creation of the states of the links by each node, called the link state packet (LSP).
2. Dissemination of LSPs to every other router, called flooding, in an efficient and
reliable way.
3. Formation of a shortest path tree for each node.
4. Calculation of a routing table based on the shortest path tree.
– node identity
– list of links
– sequence number,
– age.
• The first two, node identity and the list of links, are needed to make the topology. The third, sequence
number, facilitates flooding and distinguishes new LSPs from old ones.
• The fourth, age, prevents old LSPs from remaining in the domain for a long time
• The creating node sends a copy of the LSP out of each interface.
• A node that receives an LSP compares it with the copy it may already have.
• If the newly arrived LSP is older than the one it has, it discards the LSP. If it is newer, the node does the
following:
• b. It sends a copy of it out of each interface except the one from which the packet arrived.
Figure Example of formation of shortest path tree
Dijkstra algorithm
Table Routing table for node A
OSPF
The Open Shortest Path First (OSPF) protocol is an intradomain routing
protocol based on link state routing. Its domain is also an autonomous
system.
Figure Areas in an autonomous system
Metric in OSPF
• OSPF allows administrator to assign a cost called metric.
Initialization
Sharing
Updating
• Problem in distance vector is node instability.