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

Network Intradomain Routing

The document discusses routing algorithms and link state protocols. It begins by explaining that the main function of the network layer is to move packets from one endpoint to another. It then discusses that routing algorithms determine the best paths or routes for packets to take from source to destination. Specifically, link state algorithms require each router to have full visibility of the network graph and link states. The information is exchanged through a process called link state flooding, where each router sends link state advertisements (LSAs) containing neighbor and cost information, and routers flood these LSAs to all other routers in the network.

Uploaded by

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

Network Intradomain Routing

The document discusses routing algorithms and link state protocols. It begins by explaining that the main function of the network layer is to move packets from one endpoint to another. It then discusses that routing algorithms determine the best paths or routes for packets to take from source to destination. Specifically, link state algorithms require each router to have full visibility of the network graph and link states. The information is exchanged through a process called link state flooding, where each router sends link state advertisements (LSAs) containing neighbor and cost information, and routers flood these LSAs to all other routers in the network.

Uploaded by

Zainab Monadhil
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 36

CS 352

Routing Algorithms: Intro


CS 352, Lecture 18.1
http://www.cs.rutgers.edu/~sn624/352

Srinivas Narayana

1
Network
Application HTTPS FTP HTTP SMTP DNS

Transport TCP UDP

IP
Network

802.11 X.25 … ATM


Host-to-Net

The main function of the network layer is to


move packets from one endpoint to another.
How would one design a “Google Maps”
for the Internet?
Review: Network layer functions
• Forwarding: move packets • Data Plane
from routerʼs input to
appropriate router output

• Routing: determine route • Control Plane


taken by packets from source
to destination
• routing algorithms
• Two kinds of control planes:
• Distributed per-router control
• The network layer solves the
• Logically centralized
routing problem.
The next 2
lectures
Review: Per-router control plane
Distributed
control plane: 4.1 • OVERVIEW OF NETWORK LAYER 309

Components in every Routing


control
router interact with Algorithm
Routing algorithm
plane
other components to Control plane

Data plane

produce a routing Local forwarding


table
data
header output

outcome. 0100
0110
3
2
plane
0111 2
1001 1

Data plane Values in arriving

per-packet packet’s header

1101
1

processing, moving 0111


3
2
1
packet from input port 3
2

to output port
values in arriving
Figure 4.2 ♦ Routing algorithms determine values in forward tables

packet
tables. header,
In this example, a routing algorithm runs in each and every router and both
i.e, destination IPareaddress
forwarding and routing functions contained within a router. As we’ll see in Sec-
tions 5.3 and 5.4, the routing algorithm function in one router communicates with
Goal of Routing Algorithms
• Determine good paths from source to destination

• “Good” = least cost


• Least propagation delay
• Least cost per unit bandwidth (e.g., $ per Gbit/s)
• Least congested (workload-driven)

• “Path” = a sequence of router ports (links)

• Routing is a fundamental problem in networking.


The graph abstraction
• Routing algorithms work over an abstract representation of a
network: the graph abstraction
Ex: Rutgers campus 5
3
u: Computer Science v w 5
2
v: School of Engineering u 2
3
1 z

1 2
x y
1

• Each router is a node in a graph


• Each link is an edge in the graph
• Edges have weights (also called link metrics). Set by admin
The graph abstraction
• Routing algorithms work over an abstract representation of a
network: the graph abstraction
Ex: Rutgers campus 5
3
u: Computer Science v w 5
2
v: School of Engineering u 2
3
1 z

1 2
x y
1

• G = (N, E)
• N = {u, v, w, x, y, z}
• E = { (u,v), (u,x), (v,x), (v,w), (x,w), (x,y), (w,y), (w,z), (y,z) }
The graph abstraction
• Cost of an edge: c(x, y) 5
• Examples: c(u, v) = 2, c(u, w) = 5 v 3
w
2 5
• Cost of a path = summation of edge costs u 2 1 z
• c(path x à w à y à z) = 3 + 1 + 2 = 6 1
3
x 2
y
1
• Outcome of routing: each node should determine the least cost
path to every other node
• Q1: What algorithm should each node run to compute the least
cost path to every node?
• Q2: What information should nodes exchange with each other to
enable this computation?
The rest of this lecture
Routing
protocols

Link state Distance vector


protocols protocols
Each router has complete Each router only maintains
information of the graph distances to other routers

Information shared by flooding Messages are exchanged over


over the network each link and stay within the link

Message exchanges expensive Message exchanges cheap


CS 352
Link State Protocols
CS 352, Lecture 18.2
http://www.cs.rutgers.edu/~sn624/352

Srinivas Narayana

12
Review: Routing & Link State Algorithms
• Distributed routing protocols
5
3
• Goal of routing algorithms: find least cost path v w 5
2
in a graph abstraction of the network u 2 1 z
3
1 2
x y
• Link state algorithm: Each router has full 1
visibility of the graph, i.e., the “states” of all
links Routing protocols

• Q1: what algorithm runs at each node?


• Q2: what information is exchanged? Link state Distance vector
protocols protocols
Q2: Information exchange
• Link state flooding: the process by which
5
neighborhood information of each network
3
router is transmitted to all other routers v w 5
2
• Each router sends a link state advertisement u 2
3
1 z
(LSA) to each of its neighbors 1 2
x y
1
• LSA contains the router ID, the IP prefix
owned by the router, the router’s neighbors,
and link cost to those neighbors
• Upon receiving an LSA, a router forwards it to
each of its neighbors: flooding
Q2: Information exchange
• Eventually, the entire network receives LSAs
5
originated by each router
3
v w 5
2
u 2 z
• LSAs occur periodically and whenever the 3
1
1
graph changes x y 2
1
• Example: if a link fails
• Example: if a new link or router is added

• The routing algorithm running at each router


can use the entire network’s graph to
compute least cost paths
Q1: The algorithm

Dijkstra’s algorithm Notation:


• Given a network graph, the • c(x,y): link cost from node x to y;
algorithm computes the least cost = ∞ if not direct neighbors
paths from one node (source) to all
other nodes • D(v): current estimate of cost of
path from source to destination v
• This can then be used to compute
the forwarding table at that node • p(v): (predecessor node) the last
• Iterative algorithm: maintain node before v on the path from
estimates of least costs to reach source to v
every other node. After k iterations, • N': set of nodes whose least cost
each node definitively knows the path is definitively known
least cost path to k destinations
Dijsktra’s Algorithm
1 Initialization:
2 N' = {u} Initial estimates of
3 for all nodes v distances are just the
4 if v adjacent to u link costs of neighbors.
5 then D(v) = c(u,v)
6 else D(v) = ∞
7
8 Loop Least cost node among
9 find w not in N' such that D(w) is a minimum all estimates. This cost
10 add w to N' cannot decrease further.
11 update D(v) for all v adjacent to w and not in N' :
12 D(v) = min( D(v), D(w) + c(w,v) )
13 /* new cost to v is either old cost to v or known Relaxation
14 shortest path cost to w plus cost from w to v */
15 until all nodes in N'

17
Visualization
min cost in N \ N’
W should
N’ move to N’.
nodes whose least N \ N’
cost paths from u are c(w Nodes with estimated
w , v) least path costs, not
definitively known )
D ( w definitively known
v

) Relaxation: for each v


D ( v v’
u in N \ N’, is the cost of
the path via w smaller
v’’ than known least cost
path to v?
Cost of path via w: D(w) + c(w,v) If so, update D(v)
Predecessor of v is w.
Cost of known best path: D(v)
Dijkstra’s algorithm: example
Step N' D(v),p(v) D(w),p(w) D(x),p(x) D(y),p(y) D(z),p(z)
0 u 2,u 5,u 1,u ∞ ∞
1 ux 2,u 4,x 2,x ∞
2 uxy 2,u 3,y 4,y
3 uxyv 3,y 4,y
4 uxyvw 4,y
5 uxyvwz

5
3
v w 5
2
u 2 1 z
3
1 2
x y
1
Constructing the forwarding table
• To find the router port to use for a given destination (router), find
the predecessor of the node iteratively until reaching an
immediate neighbor of the source u

• The port connecting u to this neighbor is the output port for this
destination
Constructing the forwarding table
5

• Suppose we want forwarding entry for z. v 3


w 5
2
u 2 1 z
3
1 2
x y
1

D(v),p(v) D(w),p(w) D(x),p(x) D(y),p(y) D(z),p(z) z: p(z) = y


2,u 3,y 1,u 2,x 4,y
y: p(y) = x
x: p(x) = u
x is an immediate
destination neighbor of u
Forwarding link
table at u: z (u,x)
Summary of link state protocols
• Each router announces link state to the entire network using
flooding

• Each node independently computes least cost paths to every


other node using the full network graph

• Dijkstra’s algorithm can efficiently compute these best paths


• Easy to populate the forwarding table from predecessor information
computed during the algorithm
CS 352
Distance Vector Protocols
CS 352, Lecture 18.3
http://www.cs.rutgers.edu/~sn624/352

Srinivas Narayana

24
Review: Routing & Dist Vector Algorithms
• Distributed routing protocols
5
3
v w 5
• Goal of routing algorithms: find least cost 2
u 2 1 z
path in a graph abstraction of the network 3
1 2
x y
1
• DV proto: Each router maintains a vector of
distances to all other routers; not the graph. Routing protocols

• Q1: what algorithm runs at each node?


Link state Distance vector
• Q2: what information is exchanged? protocols protocols
Q2: Exchanged info = Distance Vectors
• Nodes exchange distance vectors with their neighbors
• No flooding unlike link state protocols. Message not propagated further
• Dx(y) = estimate of least cost from x to y
• Distance vector: Dx = [Dx(y): y є N ]
• Node x knows cost of edge to each neighbor v: c(x,v)
• Node x maintains Dx
• Node x also maintains its neighbors’ distance vectors
• For each neighbor v, x maintains Dv = [Dv(y): y є N ]
• Nodes exchange distance vector periodically and whenever the
local distance vector changes (e.g., link failure, cost changes)
26
Q1: Algorithm
Bellman-Ford algorithm
• Each node initializes its own distance vector (DV) to edge costs
• Each node sends its DVs to its neighbors
• When a node x receives new DV from a neighbor v, it updates
its own DV using the Bellman-Ford equation:
• Given dx(y) := estimated cost of the least-cost path from x to y
• Update dx(y) = minv {c(x,v) + dv(y) }

cost of path from neighbor v to destination y


minimum taken over
all neighbors v of x cost to reach neighbor v directly from x
Visualization
Neighbor v sends
• Which neighbor v offers its distance vector
the current best path from to x. v
x to y? ,v )
• Path through neighbor v c(x
has cost c(x,v) + dv(y) v’
• Choose min-cost neighbor x dv(y)
• Remember min-cost
neighbor as the one used v’’
to reach node y
• This neighbor determines
the output port for the y
packet. Use v’’ and link v’’’
(x,v’’) to reach y.
Q1: Algorithm
Bellman-Ford algorithm
• By iteratively performing Bellman-Ford iterations, under some
conditions, the estimate dx(y) converges to the true cost of the
least cost path from x to y.
Dx(y) = min{c(x,y) + Dy(y), c(x,z) + Dz(y)} Dx(z) = min{c(x,y) + Dy(z),
= min{2+0 , 7+1} = 2 c(x,z) + Dz(z)}
= min{2+1 , 7+0} = 3
node x table
cost to cost to cost to
x y z x y z x y z
x 0 2 7 x 0 2 3 x 0 2 3
from

from
y ∞∞ ∞ y 2 0 1

from
y 2 0 1
z ∞∞ ∞ z 7 1 0 z 3 1 0
node y table cost to cost to cost to
x y z x y z x y z y
2 1
x ∞ ∞ ∞ x 0 2 7 x 0 2 3
x z
from
y 2 0 1 y 2 0 1
from

from
y 2 0 1 7
z ∞∞ ∞ z 7 1 0 z 3 1 0
node z table cost to cost to cost to
x y z x y z x y z

x ∞∞ ∞ x 0 2 7 x 0 2 3
from

from
y 2 0 1 y 2 0 1
from

y ∞∞ ∞
z 7 1 0 z 3 1 0 z 3 1 0
time
Good news with distance vector protocols
• Suppose the link cost reduces or a new better 1
path becomes available in a network. y
4 1
• The immediate neighbors of the change detect x z
2
the better path immediately
• Since their DV changed, these nodes notify their
neighbors immediately.
• And those neighbors notify still more neighbors
• … until the entire network knows to use the better path
• Good news travels fast through the network
• This is despite messages only being exchanged
among neighbors
Bad news with distance vector protocols
• If router goes down, could be a while before network realizes it.
A B C D E

1 2 3 4 Initially Count to infinity


3 2 3 4 After 1 exchange problem
3 4 3 4 After 2 exchanges

5 4 5 4 After 3 exchanges

5 6 5 6 After 4 exchanges

7 6 7 6 After 5 exchanges etc… to infinity


Bad news travels slowly
• Reacting appropriately to bad news requires information that
only other routers have. A B C D E

• B needs to know that C has no other path to A other than via B.

• Poisoned reverse: if X gets its route to Y via Z, then X will


announce dX(Y) = ∞ in its message to Z
• Effect: Z won’t use X to route to Y
• However, this won’t solve the problem in general (think why.)
• Fundamentally, DV protocols must exchange more information
to react robustly to network changes and router errors.
Summary: Comparison of LS and DV

Link State Algorithms Distance Vector Algorithms


• Nodes have full visibility into • Only distances and neighbors
the network’s graph are visible
• Message complexity is high: • Message complexity is low: DVs
each LSA is flooded over the are exchanged among
whole network neighbors only
• In general, robust to network • Brittle against bad news and
changes. Scope of incorrect router bugs: incorrect info can
info is limited to bad LSAs. propagate throughout a network
Deployed routing protocols
• The algorithms we’ve seen are widely deployed in real ISPs
• Link-state protocols
• OSPF (Open Shortest Path First)
• IS-IS: (Intermediate System to Intermediate System)
• Distance-vector protocols
• RIP: Routing Information Protocol
• IGRP: Interior Gateway Routing Protocol
• You’re likely watching this video over a network running one of
these protocols to determine how data should reach your
machine.

You might also like