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

CCN Module 4 - Routing Protocols

The document provides an overview of distance vector routing. It discusses how distance vector routing works by having each router share its routing table with neighbors so they can calculate the shortest paths. Issues like counting to infinity when link costs change and two-node instability are addressed through techniques like split horizon and poison reverse. Popular distance vector routing protocols like RIP that implement these concepts are also mentioned.

Uploaded by

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

CCN Module 4 - Routing Protocols

The document provides an overview of distance vector routing. It discusses how distance vector routing works by having each router share its routing table with neighbors so they can calculate the shortest paths. Issues like counting to infinity when link costs change and two-node instability are addressed through techniques like split horizon and poison reverse. Popular distance vector routing protocols like RIP that implement these concepts are also mentioned.

Uploaded by

Prisha Singhania
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 47

Module 4

1
OBJECTIVES:
❑ To introduce the idea of autonomous systems (ASs) that divide the
Internet into smaller administrative regions.
❑ To discuss the idea of distance vector routing and the RIP that is used
to implement the idea.
❑ To discuss the idea of link state routing as the second intra-AS
routing method and OSPF that is used to implement the idea.
❑ To discuss the idea of path vector routing as the dominant inter-AS
routing method and BGP that is used to implement the idea.

2
INTRODUCTION

An internet is a combination of networks connected


by routers. When a datagram goes from a source to
a destination, it will probably pass through many
routers until it reaches the router attached to the
destination network.

3
Topics Discussed in the Section
✓ Cost or Metric (delay, throughput)
✓ Static versus Dynamic Routing Table:
• A static table is one with manual entries.
• A dynamic table, is updated automatically when
there is a change somewhere in the internet
✓ Routing Protocol
• A routing protocol is a combination of rules and
procedures that lets routers in the internet inform each
other of changes
• It allows routers to share whatever they know about the
internet or their neighborhood.
• Routing protocols can be either an interior protocol
(handles intradomain routing) or an exterior protocol
(interdomain routing). 4
INTER- AND INTRA-DOMAIN ROUTING

• Today, an internet can be so large that one routing protocol


cannot handle the task of updating the routing tables of all
routers.
• For this reason, an internet is divided into autonomous systems.
• An autonomous system (AS) is a group of networks and routers
under the authority of a single administration.
• Routing inside an autonomous system is called intra-domain
routing. Routing between autonomous systems is called inter-
domain routing

5
Autonomous systems

6
Popular routing protocols

• Routing Information Protocol (RIP) is the implementation of the


distance vector protocol.
• Open Shortest Path First (OSPF) is the implementation of the link
state protocol.
• Border Gateway Protocol (BGP) is the implementation of the path
vector protocol.
7
Distance vector routing
• Considers all routers and networks, as a graph, a set
of nodes and lines (edges) connecting the nodes.
• A router can be represented by a node and a network
by a link connecting two nodes.
• The graph theory uses an algorithm called Bellman-
Ford to find the shortest path between nodes in a
graph given the distance between nodes.

8
A graph for Bellman-Ford algorithm

If we know the cost between each pair of nodes, we


can use the algorithm to find the least cost (shortest
path) between any two nodes
9
The fact behind Bellman-Ford algorithm

If all neighbors of node i know the shortest distance to node j,


then the shortest distance between node i and j can be found
by adding the distance between node i and each neighbor to
the neighbor’s shortest distance to node j and then select the
minimum. 10
Distance Vector Routing Algorithm
The bellman ford algorithm is designed to calculate the shortest path
between two nodes but If we want to use the algorithm for creating the
routing table for routers in an AS, we need to change the algorithm:
1. Each router needs to update its routing table, whenever it has
received some information from its neighbors. In other words, each
router executes part of the whole algorithm in the Bellman-Ford
algorithm.
2. After a router has updated its routing table, it should send the result
to its neighbors so that they can also update their routing table.
3. Each router should keep at least three pieces of information for each
route: destination network, the cost, and the next hop.
4. We refer to information about each route received from a neighbor
as R (record), which has only two pieces of information: R.dest and R.
cost. The next hop is not included in the received record because it is
the source address of the sender. 11
Updating Routing Table
• The router creates a preliminary routing table that can only be
used to route packets to the networks directly attached to its
interfaces.
• For each entry in the routing table, it sends a record to all
neighbors with only two fields: destination address and the
cost to each neighbor.
• The router updates itself whenever it receives a record from a
neighbor. After each update, the route sends a record for each
entry in the routing table to its neighbors to let them also
update themselves.
When to update routing table
If the next-node entry is different
The receiving node chooses the row with the smaller cost
If there is a tie, the old one is kept
12
Example -1
Step-1:Initialization of tables in DVR

13
Step-2:Sharing of table with neighbours

14
Final routing tables of all routers

15
Example 2
Figure shows the initial routing table for an AS. Note that the
figure does not mean that all routing tables have been created
at the same time; each router creates its own routing table
when it is booted.

16
Example

17
Example
Now assume router A sends four records to its neighbors, routers B, D, and
C. Figure shows the changes in B’s routing table when it receives these
records.
a. When router B receives record 1, it searches its routing table for the
route to net1, and since it is not found there, it adds it to the table with
the next hop to be A.
b. When router B receives record 2, it searches its routing table and finds
the destination net2 there. However, since the announced cost plus 1 is
larger than the cost in the table, the record is discarded.
c. When router B receives record 3, it searches its router, and since Net4 is
not found, it is added to the table.
d. When router B receives record 4, it searches its router, and since Net5 is
not found, it is added to the table. Now router B has more information,
but it is not complete.
e. Router B does not even know that net7 exists. More updating is required
f. Each neighbouring router shares its routing table with B to complete the
routing table of B.
18
Example

4 3 2
Net5 , 1 Net4 , 1 Net2 , 1

19
Example

Figure shows the final routing tables for routers

20
Count to Infinity problem
• For a routing protocol to work properly, 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.
• The problem is referred to as count to infinity. It takes
several updates before the cost for a broken link is
recorded as infinity by all routers.

21
Two-node instability
• When the link between
A and X fails. Node A
changes its table. If A
can send its table to B
immediately, everything
is fine.
• However, the system
becomes unstable if B
sends its routing table
to A before receiving A’s
routing table
• Packets bounce
between A and B,
creating a two-node
loop problem.

22
Solution to Two-Node Instability

Defining Infinity
Most implementations define 16 as infinity
Split Horizon: Never send routing information back in the
direction from which it was received.
Instead of flooding the table through each interface, each
node sends only part of its table through each interface
E.g. 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.
Taking information from node A, modifying it, and sending
it back to node A is what creates the confusion.

23
Solution to Two-Node Instability
Split Horizon with Poison Reverse
One drawback of Split Horizon
Normally, the DV protocol uses a timer and if there is
no news about a route, the node deletes the route
from its table
In the previous e.g., node A cannot guess that this is
due to split horizon or because B has not received any
news about X recently
Poison Reverse
Node B can still advertise the value for X, but is 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.”
24
Three-node instability

If the instability is btw


three nodes, stability
cannot be guaranteed

Update loop
TCP/IP Protocol
until infinity Suite 25
Three-node instability
Suppose, after finding that X is not reachable, node A sends a packet to B and C to
inform them of the situation. Node B immediately updates its table, but the packet
to C is lost in the network and never reaches C. Node C remains in the dark and still
thinks that there is a route to X via A with a distance of 2. After a while, node C
sends its routing table to B, which includes the route to X. Node B is totally fooled
here. It receives information on the route to X from C, and according to the
algorithm, it updates its table showing the route to X via C with a cost of 3. This
information has come from C, not from A, so after awhile node B may advertise
this route to A. Now A is fooled and updates its table to show that A can reach X via
B with a cost of 4. Of course, the loop continues; now A advertises the route to X to
C, with increased cost, but not to B. C then advertises the route to B with an
increased cost. B does the same to A. And so on. The loop stops when the cost in
each node reaches infinity.

26
RIP

The Routing Information Protocol (RIP) is an intra-


domain (interior) routing protocol used inside an
autonomous system. It is a very simple protocol
based on distance vector routing. RIP implements
distance vector routing directly with some
considerations.

27
1. In an autonomous system, we are dealing with routers and
networks (links), what was described as a node.
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) that have to be
used 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.

28
Example of a domain using RIP

29
Example
Figure shows the update message sent from router R1 to router
R2 . The message is sent out of interface 130.10.0.2.
The message is prepared with the combination of split
horizon and poison reverse strategy in mind. Router R1 has
obtained information about networks 195.2.4.0, 195.2.5.0, and
195.2.6.0 from router R2. When R1 sends an update message
to R2, it replaces the actual value of the hop counts for these
three networks with 16 (infinity) to prevent any confusion for R2.
The figure also shows the table extracted from the message.
Router R2 uses the source address of the IP datagram carrying
the RIP message from R1 (130.10.02) as the next hop address.
Router R2 also increments each hop count by 1 because the
values in the message are relative to R1, not R2.

30
Note

RIP uses the services of UDP on well-


known port 520.

31
LINK STATE ROUTING

Link state routing has a different philosophy from


that of distance vector routing.
In link state routing, if each node in the domain has
the entire topology of the domain—the list of nodes
and links, how they are connected including the type,
cost (metric), and the condition of the links (up or
down)—the node can use the Dijkstra algorithm to
build a routing table.
The topology must be dynamic, representing the latest
situation of each node and each link. If there are changes
in any point in the network (a link is down, for example),
the topology must be updated for each node. 32
Concept of Link state routing

33
Link state knowledge

• Link state routing is based on the assumption that, though the


global knowledge about the topology is not clear, but each node has
partial knowledge: it knows the state (type, condition, and cost) of
its links.
• The whole topology can be compiled from the partial knowledge of
each node.
34
Building Routing Tables
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 or 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

35
Step-1:Creation of LSP
LSP data: E.g. the node ID, the list of links, a sequence
number, and age/hop count.
• Node identity and the list of links, are needed to make
the topology.
• Sequence number, facilitates flooding and distinguishes
new LSPs from old ones.
• The age, prevents old LSPs from remaining in the
domain for a long time

36
LSP Generation
• When there is a change in the topology of the
domain
• On a periodic basis
There is no actual need for this type of LSP, normally
60 minutes or 2 hours

37
Step 2: Flooding of LSPs
Once a node has prepared an LSP, it must be disseminated
to all other nodes, not only to its neighbors. The process is
called flooding and based on the following:
1. The creating node sends a copy of the LSP out of each
interface.
2. 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 (found by checking the sequence number),
it discards the LSP. If it is newer, the node does the
following:
a. It discards the old LSP and keeps the new one.
b. It sends a copy of it out of each interface except the
one from which the packet arrived. 38
Step 3: Formation of Shortest Path Tree: Dijkstra Algorithm

After receiving all LSPs, each node will have a copy


of the whole topology. However, the topology is not
sufficient to find the shortest path to every other
node; a shortest path tree is needed.

39
Step 3: Formation of Shortest Path Tree: Dijkstra Algorithm
The Dijkstra algorithm uses the following steps to create a shortest
path tree from a given graph:
1. Initialization: Select the node as the root of the tree and add it to
the path. Set the shortest distances for all the root’s neighbors to the
cost between the root and those neighbors. Set the shortest distance
of the root to zero.
2. Iteration: Repeat the following two steps until all nodes are added
to the path:
a. Adding the next node to the path: Search the nodes not in the
path. Select the one with minimum shortest distance and add it to
the path.
b. Updating: Update the shortest distance for all remaining nodes
using the shortest distance of the node just moved to the path in
step 2
Dj = minimum (Dj , Di + cij) for all remaining nodes
40
Dijkstra Algorithm

41
A-B-C=7
A-D=3
A-B-E=6
A-B=2
Permanent node : A, B,D
A-D=3
Temporary node : C,E
Permanent node : A, B
Temporary node : D

42
A-B-C=7
A-B-E-F=8
Permanent node : A, B, C, D, E
Temporary node : F, G

A-B-C=7
A-B-E=6
Permanent node : A, B, D, E
Temporary node : C, F

43
Permanent node : A, B, C, D, E ,F, G
Temporary node : --

A-B-C-G=10
A-B-E-F-G=9
Permanent node : A, B, C, D, E ,F
Temporary node : G

44
Continued

45
Step 4: Calculation of Routing Table from Shortest Path
Tree

46
Shortest path tree for each node as seen by node C

47

You might also like