24-12-24 26-12-24 Lectur Notes (Wk-13)
24-12-24 26-12-24 Lectur Notes (Wk-13)
Week # 13
M.Nadeem Akhtar
CS & IT Department
The University of Lahore
Email: nadeem.akhtar@cs.uol.edu.pk
URL- https://sites.google.com/view/nadeemuolcscn/home/course-material
Powerpoint Templates 1
ACKNOWLEDGMENTS
Mostly adopted from lecture slides by Behrouz A.
Forouzan.
http://www.inetdaemon.com/tutorials/internet/ip/routing/i
nterior_vs_exterior.shtml#sthash.dhDkYN0q.dpuf
Routing
Distance vector routing (RIP)
Link state Routing (OSPF)
Overview of Path vector routing
2
Routing Information Protocol (RIP)
3
Routing Information Protocol
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.
4
Routing Information Protocol
The destination in a routing table is a network, which
means the first column defines a network address
5
RIP Operation
Router sends update message to neighbors every
30 sec
A router expects to receive an update message
from each of its neighbors within 180 seconds in
the worst case
If router does not receive update message from
neighbor X within this limit, it assumes the link to
X has failed and sets the corresponding minimum
cost to 16 (infinity)
Based on convergence speeded up by triggered
updates
neighbors notified immediately of changes in
distance vector table 66
Example of a domain using RIP
88
Example of updating a routing table
9
Initial routing tables in a small
autonomous system
10
Final routing tables (previous figure)
11
RIP is implemented as a process that uses the services of
UDP on the well known port 520
It runs in the background (a daemon process)
RIP routing protocol helps IP in routing datagrams
through AS
So RIP messages are encapsulated inside UDP user
datagrams; which in turn are encapsulated inside IP
datagrams
Two versions are RIP-1 and RIP-2
RIP-2 is backward compatible with RIP-1
12
Link State Routing and OSPF
13
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, i.e.,
the list of nodes and links, how they are connected
including the type, cost (metric), and
the condition of the links (up or down)
Then the node can use the Dijkstra algorithm to build a routing
table
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.
14
LINK STATE DataBase (LSDB)
To create a least-cost tree with this method, each node
needs to have a complete map of the network, which
means it needs to know the state of each link.
15
LINK STATE DataBase (LSDB)
The LSDB can be represented as a two-dimensional array(matrix)
in which the value of each cell defines the cost of the
corresponding link.
16
How LSDB is created?
Done by a process called flooding
Each node can send some greeting messages to all its immediate
neighbors (those nodes to which it is connected directly) to
collect two pieces of information for each neighboring node:
the identity of the node and
the cost of the link.
The combination of these two pieces of information is called the
LS packet (LSP);
17
How LSDB is created?
after receiving all new LSPs, each node creates the
comprehensive LSDB
This LSDB is the same for each node and shows the whole map
of the internet.
18
Formation of Least Cost Trees
To create a least-cost tree for itself, using the shared LSDB, each
node needs to run the famous Dijkstra Algorithm.
This iterative algorithm uses the following steps:
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.
19
Formation of Least Cost Trees
20
Formation of Least Cost Trees
21
Formation of Least Cost Trees
22
Formation of Least Cost Trees
An initialization step and six iterations to find the least-cost tree
23
For Simplicity, link state routing can be stated as five
Parts and each router must do the following things to
make it work:
4. Send this packet to and receive packets from all other routers.
24
Open Shortest Path First (OSPF)
Distance vector based RIP works well in small systems, but less
well as network gets larger
Count to infinity as well as convergence issues
IETF began work on a link state protocol for intra-domain
routing in 1988
The Open Shortest Path First (OSPF) protocol became a
standard in 1990
OSPF is an intra-domain routing protocol based on link state
routing.
Its domain is also an autonomous system.
25
PATH VECTOR ROUTING
Distance vector and link state routing are both interior
routing protocols.
They can be used inside an autonomous system.
Both of these routing protocols become intractable when
the domain of operation becomes large.
Distance vector routing is subject to instability if there is
more than a few hops in the domain of operation.
Link state routing needs a huge amount of resources to
calculate routing tables.
It also creates heavy traffic because of flooding.
There is a need for a third routing protocol which we call
path vector routing.
26
The difference between the distance vector routing and
path vector routing can be compared
to the difference between a national map and an
international map.
A national map can tell us the road to each city and the
distance to be traveled if we choose a particular route;
an international map can tell us which cities exist in each
country and which countries should be passed before
reaching that city.
27
Border Gateway Protocol
Border Gateway Protocol Version 4 (BGP) based on Path vector
Routing
BGP is used between different Ass
BGP has been designed to allow many kinds of routing policies to
be enforced in the interAS traffic
Typical policies involve political, security, or economic
considerations
28