Vous êtes sur la page 1sur 19

Object 1

1
Malathi Veeraraghavan
(originals by
Jörg Liebeherr
)
1

Link State Routing Algorithm



Use a routing protocol to collect the whole network topology

Obtain destination
reachability
information as well as link
weights/states

Compute shortest paths using
Dijkstra’s
algorithm from a
node to all other nodes

Construct routing tables that show the destination addresses
and the next hop addresses

Note that while
Dijkstra’s
algorithm gives you end
-
to
-
end
routes, the routing tables may only store the next hop
address.
Malathi Veeraraghavan
(originals by
Jörg Liebeherr
)
2

Shortest path calculations


Calculate shortest paths for node
s
to all other nodes
Dijkstra’s
Algorithm:
s
source node.
D
n

cost of the least


-
cost path from node s to node n
M = {s};
for each n


M
D
n
=
d
sn
;
while (M


all nodes) do
Find w


M for which
D
w
= min{
D
j
; j


M};
Add w to M;
for each n


M
D
n
=
min
w
[
D
n
,
D
w
+
d
wn
];
Update route;
enddo
2
Malathi Veeraraghavan
(originals by
Jörg Liebeherr
)
3

Example
1
2
3
4
5
6
5
2
1
2
3
3
1
1
2
5

Assume node 1 has obtained the entire network topology
using some link state routing protocol

Construct the routing table at node 1 using
Dijkstra’s
algorithm to determine shortest paths from node 1 to all
other nodes in the network
Malathi Veeraraghavan
(originals by
Jörg Liebeherr
)
4

Example (at node 1)


Iteration
M
D
1
D
2
D
3
D
4
D
5
D
6
Init
3
Malathi Veeraraghavan
(originals by
Jörg Liebeherr
)
5

Solution

Use
Dijkstra’s
algorithm described in slide 2

Start with M consisting of only node 1.
M
D1
D2
D3
D4
D5
D6
0
{1}
0
2
5
1
inf
inf
1
{1,4}
0
2
4
1
2
inf
2
{1,4,2,5}
0
2
3
1
2
4
3
{1,4,2,5,3}
0
2
3
1
2
4
4
{1,4,2,5,3,6}
0
2
3
1
2
4
Malathi Veeraraghavan
(originals by
Jörg Liebeherr
)
6

Resulting Routing Tree


1
2
3
4
5
6
2
1
1
1
2

The tree is translated into a routing table at node 1:
Destination
Next Hop
2
2
3
4
4
4
5
4
6
4
4
Malathi Veeraraghavan
(originals by
Jörg Liebeherr
)
7

Link State Discussion



Each node requires complete topology information.

Link state Information must be flooded to all nodes.
Guaranteed to converge.

Each node must maintain a global database.

Convergence of the algorithm is guaranteed.
Malathi Veeraraghavan
(originals by
Jörg Liebeherr
)
8

IP Routing

IP Forwarding is performed by IP (in OS kernel)

IP Routing is performed by a user
-
level process

In Unix, by the daemon processes
routed
and
gated
5
Malathi Veeraraghavan
(originals by
Jörg Liebeherr
)
9

IP Routing
TCP
Network Interfaces
IP Input
Queue
IP Output: Calculate
Next Hop Router
ICMP
routing
daemon
Process IP
Options
For me ?
UDP
route
command
netstat
command
routing
table
ICMP Redirect
Source
Routing
NO:
if forwarding enabled
YES
Malathi Veeraraghavan
(originals by
Jörg Liebeherr
)
10

Routing Table Lookup



For each IP packet, there is one routing table lookup.
1.
Find matching host address
2. Find matching network address
3. Find default entry

Routing table printout with
netstat
-
rn

Example:
Destination
Gateway Flags Refcnt
Use Interface
140.252.23.32 140.252.23.1
UGH 3
25000
emd0
127.0.0.1
127.0.0.1
UH
1
0
lo0
default
140.252.13.33
UG
0
0
emd0
6
Malathi Veeraraghavan
(originals by
Jörg Liebeherr
)
11

Explanation of the printout



Flags:

U: route is up

G: route is to a gateway (router); if flag is not set, destinati
on is directly
connected

H: route is to a host, I.e., destination address is the complete
host
address; if flag is not set, route is to a network and destinati
on address
is
netID
or
subnetID

D: route created by redirect

M: route modified by redirect

Refcnt
: reference count: number of active uses of each route; for each
TCP connection passing through route, this is increased by 1

Use: number of packets sent on route

Interface: local interface
Malathi Veeraraghavan
(originals by
Jörg Liebeherr
)
12

Statically Setting IP Routing Tables



There are several ways for setting IP routing tables
without a routing protocol (=
Static Routing
)
1. Automatic creation of entry during
initialization of a local
interface (with
ifconfig
)
2. During bootstrap with
route
command
3. Via
ICMP redirect
messages
4. Via
ICMP router advertisement/router
discovery
messages
7
Malathi Veeraraghavan
(originals by
Jörg Liebeherr
)
13

Route Command

Route commands are put in a system file that is read during
system bootstrap

System file is:
/etc/rc2.d/S69inet in Solaris,
/etc/netstart in FreeBSD.

Example:
“default:” destination “sun:” gateway or router 1: metric
route add default sun 1
route add slip bsdi 1
Malathi Veeraraghavan
(originals by
Jörg Liebeherr
)
14

ICMP Redirect

Based on routing data in host, it does an
arp
for router 1 and sends packet
to router 1

When router 1 detects that an IP datagram should have gone to a
different
router, the router:

forwards the IP
datagram
to the correct router

sends an ICMP redirect message to the host

Host uses ICMP message to update its routing table
(3) ICMP Redirect
Router 2
Router 1
(2) IP datagram
(1) IP datagram





Also known as Shortest path Routing algorithm.
Link states:
Information about the state of (Router interfaces) links is known as
link-states. As you can see in the figure, this
information includes:

The interface's IP address and subnet mask.

The type of network, such as Ethernet (broadcast) or Serial point-to-
point link.

The cost of that link.

Any neighbor routers on that link.
So exactly how does a link-state routing protocol work? All routers will
complete the following generic link-
Dijkstra's Shortest Path first algorithm
state routing process to reach a state of convergence:
1.
Each router learns about its own links, its own directly connected
networks.
This is done by
detecting that an interface is in the up state.
2.
Each router is responsible for meeting its neighbors on directly
connected networks.
link state
routers do this by exchanging Hello packets with other link-state
routers on directly connected networks.
3.
Each router builds a Link-State Packet (LSP) containing the state of
each directly connected link.
This is done by recording all the pertinent information about each
neighbor, including neighbor ID, link
type, and bandwidth.
4.
Each router floods the LSP to all neighbors, who then store all LSPs
received in a database.
Neighbors then flood the LSPs to their neighbors until all routers in the
area have received the LSPs.
Each router stores a copy of each LSP received from its neighbors in a
local database.
5.
Each router uses the database to construct a complete map of the
topology and computes the best
path to each destination network
. Like having a road map, the router now has a complete map of all
destinations in the topology and the routes to reach them. The SPF
algorithm is used to construct the
map of the topology and to determine the best path to each network.
Advantages of Link state Routing protocol:
Build the topological map:
Link-state routing protocols create a topological map, or SPF tree of
the network topology. Distance vector
routing protocols do not have a topological map of the network.
Faster Convergence:
When receiving a Link-state Packet (LSP), link-state routing protocols
immediately flood the LSP out all
interfaces except for the interface from which the LSP was received.
This way, it achieve the faster convergence.
With distance vector routing algorithm, router needs to process each
routing update and update its routing table
before flooding them out other interfaces.
Event Driven Updates:
After the initial flooding of LSPs, link-state routing protocols only send
out an LSP when there is a change in the
topology. The LSP contains only the information regarding the affected
link. Unlike some distance vector
routing protocols, link-state routing protocols do not send periodic
updates.
Distance vector vs. Link state:
Sno. Distance Vector
Link State
1 Uses hop count as Metric.
Uses shortest path.
2 View the network from the perspective of
neighbor.
Gets common view of entire network topology.
3 Has frequent and periodic updates
Has event triggered updates.
4 Slow convergence
Faster convergence
Page: 120
compiled by: JP NEC. Daya Ram Budhathoki
5 Susceptible to routing loops.
Not as susceptible to routing loops.
6 Easy to configure and administer.
Difficult to configure and administer.
7 Requires less memory and processing power
of routers.
Requires more precessing power and memory
than distance vector.
8 Consumes a lot of Bandwidth.
Consumes less BW than distance vector.
9 Passes copies of routing table to neighbor
routers.
Passes link-state routing updates to other routers.
10 Eg. RIP
Eg. OSPF
Flow based routing:
A flooding algorithm is an algorithm for distributing material to every
part of a connected network. The name
derives from the concept of inundation by a flood. Its implemented by
the ospf:
Advantages of Flooding
The main advantage of flooding the increased reliability provided by
this routing method. Since the message will
be sent at least once to every host it is almost guaranteed to reach its
destination. In addition, the message will
reach the host through the shortest possible path.
Disadvantages of Flooding
There are several disadvantages with this approach to routing. It is
very wasteful in terms of the networks total
bandwidth. While a message may only have one destination it has to
be sent to every host. This increases the
maximum load placed upon the network.
Messages can also become duplicated in the network further
increasing the load on the networks bandwidth as
well as requiring an increase in processing complexity to disregard
duplicate messages.
A variant of flooding called
selective flooding
partially addresses these issues by only sending packets to routers
in the same direction.
Link State Routing:

• The following sequence of steps can be executed in the Link State Routing.
• The basis of this advertising is a short packed called a Link State Packet (LSP).
• OSPF (Open shortest path first) and IS-IS are examples of Link state routing.
• Link State Packet(LSP) contains the following information:
1. The ID of the node that created the LSP;
2. A list of directly connected neighbors of that node, with the cost of the link to
each one;
3. A sequence number;
4. A time to live(TTL) for this packet.
• When a router floods the network with information about its neighbourhood, it is said to be
advertising.
1. Discover your neighbors
2. Measure delay to your neighbors
3. Bundle all the information about your neighbors together
4. Send this information to all other routers in the subnet
5. Compute the shortest path to every router with the information you receive
6. Each router finds out its own shortest paths to the other routers by using Dijkstra's
algorithm.
• In link state routing, each router shares its knowledge of its neighbourhood with all routers
in the network.
• Link-state protocols implement an algorithm called the shortest path first (SPF, also known
as Dijkstra's Algorithm) to determine the path to a remote destination.
• There is no hop count limit. (For an IP datagram, the maximum time to live ensures that
loops are avoided.)
• Only when changes occur, It sends all summary information every 30 minutes by
default. Only devices running routing algorithms listen to these updates. Updates are sent to
a multicast address.
• Updates are faster and convergence times are reduced. Higher CPU and memory
requirements to maintain link-state databases.
• Link-state protocols maintain three separate tables:
1. Neighbor table: It contains a list of all neighbors, and the interface each neighbor is
connected off of. Neighbors are formed by sending Hello packets.
2. Topology table (Link- State table) : It contains a map of all links within an area,
including each link’s status.
3. Routing table : It contains the best routes to each particular destination
Flooding Algorithm:

• It is a non-adaptive algorithm or static algorithm.


• When a router receives a packet, it sends a copy of the packet out on each line (except the
one on which it arrived).
• To prevent form looping forever, each router decrements a hop count contained in the packet
header.
• As soon as the hop count decrements to zero, the router discards the packet.

Flow Based Routing Algorithm:

• It is a non-adaptive routing algorithm.


• It takes into account both the topology and the load in this routing algorithm;
• We can estimate the flow between all pairs of routers.
• From the known average amount of traffic and the average length of a packet you can
compute the mean packet delays using queuing theory.
• Flow-based routing then seeks to find a routing table to minimize the average packet delay
through the subnet.
• Given the line capacity and the flow, we can determine the delay. It needs to use the formula
for delay time T.

• Where, μ = Mean number of arrivals in packet/sec, 1/μ = The mean packet size in the
bits, and c = Line capacity (bits/s).

The Optimality Principal: This simple states that if router J is on the optimal path form router I to
router k, then the optimal path from J to K also falls along this same path.
• 54 upvotes
• 5 comments

Tags :GATE CSGATE CSComputer Networks


Posted by:
Mallesham Devasane
shared infoJan 13GATE CS
UpvoteCommentShare
Stay updated with our latest content by following us on Facebook
GATE, IES, PGEE, BARC Exam Preparation

Related Posts
Routers
525Jan 13

Application Layer Protocols (DNS, SMTP, POP, FTP, HTTP)


8630Jan 13

GATE CS : Computer Networks - Rapid Quiz 1


649Jan 13
Comments
Write a comment
PravinSep 20
Nice work i was unaware about this section its amazing nice work thanks a lot
0Upvote
0Reply
Sagar KumarDec 30
What is lambda here??
1Upvote
1Reply
Sumanta DeyJan 23
ok
0Upvote
0Reply
Mahendra Lãlãni JainMar 7
Sir flooding & random walk is non adaptive routing
0Upvote
0Reply
Mahendra Lãlãni JainMar 7
U can see
cse.iitk.ac.in/users/dheeraj/cs425/lec11.html
0Upvote
0Reply
NIELIT Scientist Officer & Assistant Test Series
Based on latest pattern, get AIR & full analysis

6 Full length & 15 Mini Mock Tests @ Rs. 125/-


GET TESTS NOW

GATE 2018 Computer Science Mock Test Series


Based on latest pattern with Virtual Calculator, get AIR & full analysis

10 Full Length, 24 Chapter, 20 Topic & 15 Practice Tests @ Rs. 695/-


GET TESTS NOW

Our Apps
• Exam Preparation App
• Test Series App

Gradeup Apps
• GATE CSE Preparation App
• Gradeup Test Series App

Exams
• Computer Science Engineering
• GATE CSE
• ISRO Computer Science
• AFCAT CS
• Coal India CS
• BARC CSE
8 Square Building, 6th Floor,
Plot No. 8, Sector 125,
Noida - 201313

support@gradeup.co
+91 9650053463
About UsFAQTerms & Conditions
Top

Link-State Routing Protocols


Link-state algorithms (also known as shortest path first algorithms) flood only incremental changes
that have occurred since the last routing table update. During this incremental update, each router
sends only that portion of the routing table that describes the state of its own links, as opposed to its
entire routing table.
Link-state routing protocols require routers to periodically send routing updates to their neighboring
routers in the internetwork. In addition, link-state routing protocols are quick to converge their
routing updates across the network in comparison to distance vector protocols.
The speed at which they converge makes link-state protocols less prone to routing loops than
distance vector protocols. However, link-state protocols also require more CPU power and system
memory. One of the primary reasons that additional CPU power and memory are needed is that
link-state protocols are based on the distributed map concept, which means that every router has a
copy of the network map that is regularly updated. In addition to the size of the routing table, the
number of routers in an area and the number of adjacencies amongst routers also has an affect on
router memory and CPU usage in linkstate protocols. These factors were obvious in the old fully
meshed asynchronous transfer mode (ATM) networks, where some routers had 50 or more OSPF
adjacent peers and performed poorly.
Link-state protocols are based on link-state algorithms, which are also called shortest path first
(SPF) algorithms or Dijkstra algorithms. "SPF in Operation," later in this tutorial, covers the SPF
algorithm in more detail.
A simple way to understand how link-state technology operates is to picture the network as a large
jigsaw puzzle; the number of pieces in your puzzle depends on the size of your network. Each piece
of the puzzle holds only one router or one LAN. Each router "draws" itself on that jigsaw piece,
including arrows to other routers and LANs. Those pieces are then replicated and sent throughout
the network from router to router (via link-state advertisements [LSAs]), until each router has a
complete and accurate copy of each piece of the puzzle. Each router then assembles these pieces by
using the SPF algorithm.
NOTE The principle of link-state routing is that all the routers within an area maintain an identical
copy of the network topology. From this map, each router performs a series of calculations that
determine the best routes. This network topology is contained within a link-state database, where
each record represents the links to a particular node in the network.
Each record contains the following pieces of information:
• Interface identifier
• Link number
• Metric information regarding the state of the link

Armed with that information, each router can quickly compute the shortest path from itself to all
other routers.
The SPF algorithm determines how the various pieces of the puzzle fit together. Figure below
illustrates all of these pieces put together in operation.
Link-state protocols such as OSPF flood all the routing information when they first become active
in link-state packets. After the network converges, they send only small updates via link-state
packets.

Vous aimerez peut-être aussi