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

Chap-3-Routing-Distance Vector - Link State

Uploaded by

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

Chap-3-Routing-Distance Vector - Link State

Uploaded by

madhurcb1
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 48

Routing Protocols I

1
Routing

• Recall: There are two parts to routing IP packets:


1. How to pass a packet from an input interface to
the output
interface of a router (packet forwarding) ?
2. How to find and setup a route ?

• Packet forwarding is done differently in datagram


and virtual- circuit packet networks

• Route calculation is done in a similar fashion

2
Routing Algorithms

• Objective of routing algorithms is to calculate


`good’ routes

• Routing algorithms for both datagrams and virtual


circuits should satisfy:
- Correctnes - Simplicity
s - Robustnes
- Simplicity s
- Stability - Fairness
- Optimality
• Impossible to satisfy everything at the
same time

© Jörg Liebeherr,
Fairness vs. maximum throughput

• Example: Assume that stations A, B, C wants to


send to A’, B’, and C’, each at 5 Mb/s
• Assume the capacity of the network links is 10
Mb/s.

A B C

D D

A B C
’ ’ ’
Stability vs. optimal delay

• Example: Optimize delay by sending all packets over


link with the least traffic.
– Update the routing decision every 10 sec

96 Kbps

A D

C
Elements of Routing Algorithms

• Optimization
Criteria: - “Cost”
- Number of - Throughp
Hops ut
- Delay
– Once per session (VCs)
• Decision
– Once perTime:
packet (datagram)

• Decision Place:
– Each node (distributed
routing)
– Central node (centralized
routing)
– Sending node (source
Shortest-Path Routing

• Routing algorithms generally use a shortest path


algorithm to calculate the route with the least cost
• Three components:
1. Measurement Component
• Nodes (routers) measure the current
characteristics
such as delay, throughput, and “cost”
2. Protocol
• Nodes disseminate the measured information to
other
nodes
3. Calculation
• Nodes run a least-cost routing algorithm to
Goal of Shortest Path Routing

• Goal: Given a network were each link between


two nodes i and j is assigned a
cost. Find the path
with the least cost between nodes i and j.

• Parameters:
cost of link between node i and
dij
node j;
dij = , if nodes i and j are not
N connected; dii = 0
set of nodes
Approaches to Shortest Path Routing

• There are two basic approaches to least-cost


routing in a communication network

• There are two basic approaches to shortest-path


routing:
1. Link State Routing
2. Distance Vector Routing
Approaches to Shortest Path Routing

• 1. Link State Routing


– Each node knows the distance to its neighbors
– The distance information (=link state) is
broadcast to all nodes in the network
– Each node calculates the routing tables
independently

2. Distance Vector Routing


– Each node knows the distance (=cost) to its
directly
connected neighbors
– A node sends a list to its neighbors with the current
distances to all nodes
– If all nodes update their distances, the
Distance Vector Routing

11
Distance Vector Routing Algorithm

• o The Distance vector algorithm is iterative,


asynchronous and distributed.
– Distributed: It is distributed in that each node
receives information from one or more of
its directly attached neighbors, performs
calculation and then distributes the result
back to its neighbors.
– Iterative: It is iterative in that its process continues
until no more information is available to be
exchanged between neighbors.
– Asynchronous: It does not require that all of its
nodes operate in the lock step with each
other.
12
Distance Vector Routing Algorithm

• The Distance vector algorithm is a dynamic algorithm.


• It is mainly used in ARPANET, and RIP.
• Each router maintains a distance table known as Vector.
• Three Keys to understand the working of Distance Vector
Routing Algorithm:
– Knowledge about the whole network: Each router shares
its knowledge through the entire network. The Router
sends its collected knowledge about the network to its
neighbors.
– Routing only to neighbors: The router sends its knowledge
about the network to only those routers which have direct
links. The router sends whatever it has about the
network through the ports. The information is received by
the router and uses the information to update its own
routing table.
– Information sharing at regular intervals: Within 30 seconds, 13
Distance Vector Routing Algorithm

• Let dx(y) be the cost of the least-cost path from node x to node y.
• The least costs are related by Bellman-Ford equation, dx(y) =
minv{c(x,v) +
dv(y)}
• Where the minv is the equation taken for all x neighbors. After
traveling from x to v, if we consider the least-cost path from
v to y, the path cost will be c(x,v)+dv(y). The least cost from
x to y is the minimum of c(x,v)+dv(y) taken over all
neighbors.
• With the Distance Vector Routing algorithm, the node x contains the
following routing information:
• For each neighbor v, the cost c(x,v) is the path cost from x to
directly attached
neighbor, v.
• The distance vector x, i.e., Dx = [ Dx(y) :y in N ], containing its
cost to all destinations, y, in N.
14
Distance Vector Routing Algorithm

• Distance vector routing is an asynchronous algorithm


in which node x sends the copy of its
distance vector to all its neighbors.
• When node x receives the new distance vector from
one of its neighboring vector, v, it saves the
distance vector of v and uses the Bellman-Ford
equation to update its own distance vector.
• The equation is given below: dx(y) = minv{ c(x,v) +
dv(y)} for each node y in N
• The node x has updated its own distance vector
table by using the above equation and sends its
updated table to all its neighbors so that they can
update their own distance vectors.
15
Distance Vector Routing Algorithm

16
Distance Vector Routing Algorithm

17
Distance Vector Routing Algorithm

• In the above figure, we observe that the router sends


the knowledge to the immediate neighbors.
• The neighbors add this knowledge to
their own knowledge and sends the updated
table to their own neighbors.
• In this way, routers get its own information plus
the new
information about the neighbors.
• Routing Table Two process occurs:
– Creating the Table
– Updating the Table

18
Creating the Table

• Initially, the routing


table is created for
each router that
contains
of informationatleast
suchthree
types
as Network ID(fin
destination), cost
al and
the
the next hop.
• These routing tables sent to all
– A sends its routing table to B, F
are the
& E.
neighbors. For
– B sends its routing table to A &
Example:
C.
– C sends its routing table to B &
D.
– D sends its routing table to E &
C
– E sends its routing table to A &
D.
– F sends its routing table to A. 19
Updating the Table

20
Final Routing Tables

21
Discussion of Distance Vector Routing

• Entries of routing tables can change while a packet


is being transmitted. This can lead to a single
datagram visiting the same node more than once
(Looping)

• If the period for updating the routing tables is too


short, routing table entries are changed before
convergence (from the previous updates) is
achieved

• Example: The ARPANET used a Distance Vector


algorithm with an update period of <1 sec. Due to the
instability of routing, the ARPANET switched in 1979
to a link state routing algorithm
Characteristics of Distance Vector Routing

• Periodic Updates: Updates to the routing tables are


sent at the end of a certain time period. A typical
value is 90 seconds.
• Triggered Updates: If a metric changes on a link, a
router immediately sends out an update without
waiting for the end of the update period.
• Full Routing Table Update: Most distance vector
routing protocol send their neighbors the entire
routing table (not only entries which change).
• Route invalidation timers: Routing table entries are
invalid if they are not refreshed. A typical value is
to invalidate an entry if no update is received after
3-6 update periods.
23
The Count-to-Infinity Problem

A 1 B 1 C
A's Routing B's Routing
Table Table
to via cost to via cost
(next (next
hop) hop)
C B 2 C C 1
now link B-C goes
down
C B 2 C - oo

C 2 C oo

C - oo C A 3

C oo C 3

C B 4 C - oo

C 4 C oo
24
Count-to-Infinity

• The reason for the count-to-infinity problem is that


each node only has a “next-hop-view”
• For example, in the first step, A did not realize that
its route (with cost 2) to C went through node B

• How can the Count-to-Infinity problem be solved?

25
Count-to-Infinity

• The reason for the count-to-infinity problem is that


each node only has a “next-hop-view”
• For example, in the first step, A did not realize that
its route (with cost 2) to C went through node B

• How can the Count-to-Infinity problem be solved?


• Solution 1: Always advertise the entire path in an
update message (Path vectors)
– If routing tables are large, the routing
messages require substantial bandwidth
– BGP uses this solution

26
Count-to-Infinity

• The reason for the count-to-infinity problem is that


each node only has a “next-hop-view”
• For example, in the first step, A did not realize that
its route (with cost 2) to C went through node B

• How can the Count-to-Infinity problem be solved?


• Solution 2: Never advertise the cost to a neighbor if
this neighbor is the next hop on the current path
(Split Horizon)
– Example: A would not send the first routing update to
B, since B is the next hop on A’s current route to C
– Split Horizon does not solve count-to-infinity in all
cases!
27
Link State Routing

28
Distance Vector vs. Link State Routing

• With distance vector routing, each node has


information only about the next hop:
• Node A: to reach F go
to B
• Node B: to reach F go to
D
• Node D: to reach F go A B C
to E
• Distance
• Nodevector routing
E: go directly to F
makes poor routing
decisions if directions are
not completely correct D E F
(e.g., because a node is
down).
• If parts of the directions incorrect, the routing may be
incorrect until the routing algorithms has re-converged.
29
Distance Vector vs. Link State Routing

• In link state routing, each node has a complete


map of the topology
A B C A B C A B C

D E F D E F D E F
• If a node fails, A B C
each node can
calculate the
new route

• Difficulty: All nodes need D E F


A B C
to have a consistent view A B C A B C

of the network
D E F
D E F D E F

30
Link State Routing

• Each node must


– discover its neighbors
– measure the delay (=cost) to its neighbors
– broadcast a packet with this information to all
other nodes
– compute the shortest paths to every other router

• The broadcast can be accomplished by flooding


• The shortest paths can be computer with Dijkstra’s
algorithm
Link State Routing: Basic princples

1. Each router establishes a relationship


(“adjacency”) with its neighbors
2.Each router generates link state advertisements
(LSAs)
which are distributed to all routers
LSA = (link id, state of the link, cost, neighbors of the
link)
3. Each router maintains a database of all
received LSAs (topological database or link state
database), which describes the network has a
graph with weighted edges
4. Each router uses its link state database to run a
shortest path algorithm (Dijikstra’s algorithm) to
produce the shortest path to each network 32
Link State Routing: Properties

• Each node requires complete topology


information
• Link state information must be flooded to all
nodes
• Guaranteed to converge

33
Operation of a Link State Routing protocol

Receive Link Dijkstra’ IP


d State s Routin
LSAs Databas g
Algorith
e Table
m

LSAs are
flooded to other
interfaces

34
Link State Routing

• Link state routing is a technique in which each router shares


the
knowledge of its neighborhood with every other router in the
internetwork.
• The three keys to understand the Link State Routing algorithm:
– Knowledge about the neighborhood: Instead of sending its
routing table, a router sends the information about its
neighborhood only. A router broadcast its identities
and cost of the directly attached links to other routers.
– Flooding: Each router sends the information to every other
router on the internetwork except its neighbors. This
process is known as Flooding. Every router that
receives the packet sends the copies to all its
neighbors. Finally, each and every router receives a copy
of the same information.
– Information sharing: A router sends the information to every
other router only when the change occurs in the information 35
Link State Routing

• Link State Routing has two phases:


• Reliable Flooding
– Initial state: Each node knows the cost of its
neighbors.
– Final state: Each node knows the entire graph.
• Route Calculation
• Each node uses Dijkstra's algorithm on the graph to
calculate the optimal routes to all nodes.
– The Link state routing algorithm is also known as
Dijkstra's algorithm which is used to find the
shortest path from one node to every other node
in the network.
– The
cost Dijkstra's
paths arealgorithm
well known
is for k destination
an iterative, and it has 36
Link State Routing

37
Link State Routing

38
Link State Routing

39
40
41
42
43
44
45
CONGESTION CONTROL ALGORITHMS

• What is congestion?
– A state occurring in network layer when the
message traffic
is so heavy that it slows down network response
time.
• Effects of Congestion
– As delay increases, performance decreases.
– If delay increases, retransmission occurs, making
situation worse.

46
Leaky Bucket Algorithm

• Let us consider an example


to understand Imagine a
bucket with a small hole in the
bottom. No matter at what rate
water enters the bucket, the
outflow is at constant rate.
When the bucket is full with
water additional water entering
• spills over the sides
Similarly, and is lost
network
each contains a interface
following steps are
bucket
involved
andin
leaky the
bucket algorithm:
– When host wants to send packet,
packet is thrown into the bucket.
– meaning
The bucket the network
leaks atinterface
a constant
transmits
rate,
packets at a constant rate.
– Bursty traffic is converted to a
uniform traffic by the leaky bucket.
– 47
In practice the bucket is a finite
Token bucket Algorithm

• Need of token bucket Algorithm:-


• The leaky bucket algorithm
enforces output pattern at the
average rate, no matter how
bursty the traffic is. So in order
to deal with the bursty traffic we
need a flexible algorithm so
that the data is not lost. One
such algorithm is token bucket
algorithm.
• Steps of this
– In regular algorithm
intervals tokens can
are
bethrown
described as follows:
into the bucket. ƒ
– The bucket has a maximum
capacity. ƒ
– If there is a ready packet, a
token is removed from the
bucket, and the packet is sent.
– If there is no token in the 48
bucket, the packet cannot be

You might also like