0% found this document useful (0 votes)
10 views36 pages

3.5 - Link State Routing

Uploaded by

SUDHAN R CSE
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views36 pages

3.5 - Link State Routing

Uploaded by

SUDHAN R CSE
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 36

Link State Routing

 Routing Algorithm - used for creating least-cost trees and forwarding

tables - Link-

State (LS) Routing.


 Uses term link-state - define the characteristic of a link (an edge)
- represents a

network in the internet.


 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
1 or
Example of a link-state database

2
Link-State Database (LSDB)

 To create least-cost tree - each node needs to have a complete

map of network.

 It needs to know the state of each link.

 Collection of states for all links is called the Link-state database

(LSDB).

 There is only one LSDB for whole internet

 Each node needs to have a duplicate of it to be able to create the

least-cost tree. 3
Link-State Database (LSDB)
How each node can create this LSDB that contains information of
whole Internet?
 This can be done by a process called flooding.
 Each node can send some greeting messages to all its immediate
neighbours (those
nodes to which it is connected directly) to collect two pieces of
information for each
neighbouring node:
 Identity of the node and cost of the link.
 combination of these two pieces of information - LS packet (LSP);
 LSP is sent out of each interface. 4
Link-State Database (LSDB)

If newly arrived LSP is older than one it has (found by checking the
sequence number) - it
discards the LSP.
 If it is newer or the first one received, node discards old LSP (if there
is one) and keeps
received one.

Comparison of link-state routing algorithm with the distance-


vector routing
 Distance-vector routing algorithm - each router tells its neighbours
what it knows about 5
LSPs created and sent out by each node to build LSDB

6
Formation of Least-Cost Trees

 To create a least-cost tree for itself - using shared LSDB- each node

needs to run

famous Dijkstra Algorithm.

 Dijkstra algorithm creates a shortest path tree from a graph.

 The algorithm divides the nodes into two sets: tentative and

permanent.

7
Formation of Least-Cost Trees

Iterative algorithm uses the following steps:


1.Node chooses itself as the root of tree, creating a tree with a single
node and sets total cost of each node based on the information in
the LSDB.
2.Node selects one node, among all nodes not in tree, which is closest to
root, and adds
this to the tree.
3. After this node is added to tree, cost of all other nodes not in tree
needs to be updated
because the paths may have been changed.
8
4. The node repeats step 2 until all nodes are added to the tree.
Least-Cost Trees

9
UNICAST ROUTING PROTOCOLS

Three common protocols used in the Internet:

Routing Information Protocol (RIP) - based on distance-vector


algorithm

Open Shortest Path First (OSPF) - based on link-state algorithm

Border Gateway Protocol (BGP) - based on path-vector algorithm.

10
Routing Information Protocol (RIP)
 RIP is one of most widely used intra domain routing protocols.
 It is based on the distance-vector routing algorithm
 Router in AS needs to know how to forward a packet to different
networks (subnets) in
an AS.
 RIP routers advertise cost of reaching different networks instead of
reaching other
nodes in a theoretical graph.
 In RIP, maximum cost of a path can be 15, which means 16 is
considered as infinity
11
(no connection).
Routing Information Protocol (RIP)

 It is a dynamic routing protocol


 It uses hop count as a routing metric to find the best route
between a source network and a destination network.
 It is a distance-vector routing protocol that operates at
Network layer
 RIP is based on the distance vector-based strategy,
 So, consider entire structure as a graph
 nodes are routers,
 links are networks.
12
Routing Information Protocol (RIP)

 In RIP, infinity is defined as


16
 RIP is useful for smaller
networks or small
autonomous systems.
 maximum number of hops
that RIP can contain is 15
hops
 router 1 forwards packet to router 2 then it will count as 1 hop
count. i.e., it should not have
 1613 routers can be configured in RIP
RIP message format

14
How Does RIP Work?
 8 routers in a network
 Router 1 wants to send the data to
Router 3.
 If the network is configured with RIP,
then
 It will choose route which has least
number of hops.
 There are three routes in network,
 Route 1, Route 2, Route 3.
 Route 2 contains least number of
hops, i.e., 2
 Route 1 contains 3 hops,
15

How Does RIP Work?

 It manages load balancing, and data reach destination a bit


faster.
 Both routes 3 hopes each
16
RIP -Disadvantages

 Route 2 is chosen as it has least hop


count.
 Route 1 is free and data can be reached
more faster;
 instead of this, data is sent to the
Route 2.
 This makes the Route 2 slower due to the
heavy traffic.
• Route is chosen based on hop count metric.
 This is one of the biggest
• If any route of better bandwidth is available, then that route would not
disadvantages of RIP.
be chosen.
17
RIP -Disadvantages

 It faces a problem of Slow


convergence.
 Whenever router or link fails, then it
often takes minutes to stabilize or take
an alternative route; This problem is
known as Slow convergence.

18
RIP –Advantages

• It is easy to configure

• It has less complexity

• CPU utilization is less.

19
RIP –Routing Updates
RIP updates its Routing table

RIP update timer : 30 sec


 Routers send their updates to all the neighboring routers every 30
seconds
RIP Invalid timer : 180 sec
 If router is disconnected from network or some link goes down, then
neighbor router will wait for 180 seconds to take the update.
 If it does not receive update within 180 seconds, then it will mark the
particular route as not reachable.
RIP Flush timer : 240 sec
 240 second which is almost equal to 4 min
 if router does not receive update within 240 seconds then neighbor route will remove

20 that particular route from the routing table


Figure 20.14: Hop counts in RIP

1 hop (N4)

2 hops (N3, N4)

3 hops (N2, N3, N4)

21
Forwarding tables

 all forwarding tables after all routers have been


booted.
 changes in some tables when some update
messages have been exchanged.
 Finally, stabilized forwarding tables when there
is no more change

20.22
Example of an autonomous system using RIP (Part I)

23
Figure 20.18: Example of an autonomous system using RIP (Part II)

24
Example of an autonomous system using RIP (Part III)

25
RIP Algorithm

• router needs to send whole contents of its forwarding table in a


response message.
• Receiver adds one hop to each cost and changes next router
field to address of the sending router.
Received router selects old routes as the new ones except in
following three cases:
1. If received route does not exist in old forwarding table- added to
route.

2. If cost of received route < cost of old one, received route should be
elected as new one.

3. If26cost of received route > old one, but value of next router is same in
Open Shortest Path First
 Open Shortest Path First (OSPF) is also an intra domain routing
protocol like RIP
based on link-state routing protocol.
 OSPF is an open protocol - the specification is a public document.
 In OSPF - cost of reaching a destination from host is calculated from
source router
to the destination network.
 Each link - assigned weight based on throughput, round-trip
time, reliability.
 Each OSPF router create forwarding table after finding shortest-
27
Open Shortest Path First
Figure 20.20 shows the forwarding tables for the simple AS in
Figure below.
 Comparing the forwarding tables for the OSPF and RIP in the same
AS.
 The only difference is the cost values.
 If use the hop count for OSPF, the tables will be exactly the same.
 Consistency is that both protocols use shortest-path trees to
define the best route from a source to a destination.

28
Figure 20.20: Forwarding tables in OSPF

29
Figure 20.21: Areas in an autonomous
system

30
Link-State Advertisement

OSPF requires a router to advertise state of each link to all neighbors


for formation
of LSDB(LSDB).
 Each router -- a node and each network between two routers
is an edge.
 Different types of advertisements - each capable of advertising
different situations.
 Five different types link-state advertisements:
 Router link
 Network link
31

Router link

A router link advertises the existence of a router as a node.

 Advertisement - define one or more types of links that connect


advertising router

to other entities.
 Type of advertisement – define address of transient(short lived)
network and cost

of link.
 A stub(end) link advertises a link to a stub network,

 Advertisement - define the address of the network and the cost.


32
Network Link.

A network link advertises the network as a node.

 Network cannot do announcements itself (it is a passive entity).

 one of the routers is assigned as the designated router and does


the advertising.
 LSP announces IP address of all routers (including the designated
router as a router

and not as speaker of network),


 No cost is advertised because each router announces

cost
20.33 to network - when it sends a router link advertisement.
Summary link to network.
 This is done by an area border router;
 It advertises summary of links collected by the backbone to an
area.
 This type of information exchange is needed to glue the areas
together.
Summary link to AS.
 This is done by an AS router that
advertises summary links from other ASs
to backbone area of current AS,
 This information later can be disseminated
to areas so that they will know about
networks in other ASs.
20.34
Figure 20.23: OSPF message formats (Part I)

Attention

35
Figure 20.23: OSPF message formats (Part II)

Attention

36

You might also like