0% found this document useful (0 votes)
27 views9 pages

15 RoutingDV

Uploaded by

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

15 RoutingDV

Uploaded by

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

The Internet Network Layer

Host, router network layer functions:

Transport layer: TCP, UDP


Computer Networks
Forwarding protocol (IP)
Routing protocols
•addressing conventions
•path selection
•datagram format
•RIP, OSPF, BGP
Network •packet handling conventions
layer forwarding “Signalling”
table protocol (ICMP)
Lecture 15: Routing: •error reporting
•router “signaling”
Distance Vector Algorithm Link layer: Ethernet, WiFi, SONET, ATM

Physical layer: copper, fiber, radio, microwave

Routing on the Internet Routing vs. Forwarding


Routers on the Internet are store-and-forward routers:
• each incoming packet is buffered Routing: so-called “control plane”
• packet’s destination is • compute paths that packets follow across an internetwork
looked up in the forwarding table routing algorithm • used by routers to talk to each other
• packet is forwarded to the next • individual router creates a forwarding table from routing data
hop towards the destination local forwarding table
dest address output link
0100
0101
0111
3
2
2
Forwarding: “data plane”
packet transmitted 1001 1
• individual router uses forwarding table to direct packets from
(forwarded) destination
address in an incoming to an outgoing link inside the router
packet’s
A header
0111
1

3 2
B
packets queued (stored)
free (available) buffers: arriving packets
dropped (loss) if no free buffers
[after Rexford]
Inside a Router Line Cards
(Interface Cards, Adaptors)
control plane Interfacing
to/from link
Processor • physical link
data plane
• switching fabric

Packet handling

Transmit
Receive
Line card Line card
• packet forwarding
• decrement 8me-to-live lookup
• buffer management
Switching
Line card
Fabric
Line card • link scheduling
• packet filtering
• rate limi8ng
Line card Line card
• packet marking to/from switch
• measurement
[Rexford] [Rexford]

Switching Fabric data plane Processor


control plane
Router Processor Processor

Deliver packets inside router Line card Line card “Loopback” interface Line card Line card

• from incoming to outgoing interfaces Line card


Switching
Fabric
Line card • IP address of the CPU on the router Line card
Switching
Fabric
Line card

• a network in and of itself


“Control-plane” software
Line card Line card Line card Line card

Must operate very quickly • implementation of routing protocols


• multitude of packets destined to the same outgoing interface • creation of forwarding table for the line cards

• switch scheduling to match inputs to outputs


Handling of special data packets
• packets with IP options enabled
Implementation techniques • packets with expired Time-to-Live
• bus, crossbar, interconnection network, …
• running at a faster speed (e.g., 2 ) than links Network management functions:
• divide variable-length packets into fixed-size cells • command-line interface (CLI) for configuration
• transmission of measurement statistics

[after Rexford] [after Rexford]


Computing Paths Between Routers Graph Abstraction
5

v 3 w
2 5
Routers need to know two things Graph: G = {N, E} u 2 1 z
3
1. which router to use to reach a destination prefix
N = set of nodes = {u, v, w, x, y, z} 1
y 2
2. which outgoing interface to use to reach that router x
1
u z E = set of edges/links =
{(u,v), (u,x), (v,x), (v,w), (x,w), (x,y), (w,y), (w,z), (y,z)}
12.34.158.0/24
c(u,v) = cost of link (u,v), assume full-duplex (bidirectional)
• e.g., c(w, z) = 5
interface along router z that can • cost could always be manually assigned, e.g., based on price
the path to z reach destination • or could be hop count, or inversely related to bandwidth, reliability
• or could be dynamic, e.g., proportionally related to congestion
How does a router construct its routing table?
Cost of path (x1, x2, x3,…, xp) = c(x1,x2) + c(x2,x3) + … + c(xp-1,xp)
How does a router know which is the next hop towards
a destination? What is the least-cost path between node u and z?
Use a routing protocol to propagate (and update)
reachability information Routing algorithm: algorithm that finds least-cost path
[after Rexford]

Routing Algorithm Classification Routing Algorithm Classification


Centralized or decentralized? Static or dynamic?
• traditionally decentralized preferred for scalability • static:
• software-defined networking (SDN) is centralizing routes change slowly over time

• dynamic:
Global or distributed, local information? routes change more quickly
periodic update in response to link cost changes
• global: all routers have complete topology
• and link cost information
• “link state” algorithms

• local: each router knows only of physically-connected


neighbors and its link costs to neighbors
• iterative process of computation, information exchange with neighbors
• “distance vector” algorithms
Dynamic Programming Dynamic Programming
Used when a problem can be divided into DP used primarily to solve optimization problem,
sub-problems that overlap e.g., find the shortest, longest, “best” way of doing
something
Solves each sub-problem once and stores the
solution in a table Requirement: an optimal solution to the problem
• if the same sub-problem is encountered again, must be a composition of optimal solutions to all
simply looks up its solution in the table sub-problems
• reconstructs the solution to the original problem
from solutions to the sub-problems In other words, there must not be an optimal
• the more overlap the better, as this reduces the solution that contains suboptimal solution to a
number of sub-problems sub-problem

Distance Vector Algorithm Example: Initial Values l10


5 3
Bellman’s shortest path algorithm (1957) L l1 l2 l3 l4 l5 l6 l7 l8 l9 l10 2
v
l4
w
l8
5
l1
• a centralized distance vector algorithm n u u v v x x w w y u u
l2
l3 2 l5 l 1
3 7
z
1 l9
• the origin of the name “dynamic programming”: m v x x w w y y z z w x
l6
y
2
• dynamic: multi-stage, time-varying process 1
c(n,m) 2 1 2 3 3 1 1 5 2 5
• programming: planning, decision making by a tabular method, Initial values:
e.g., TV programming
Initial values: D u v w x y z

D[] encodes shortest path between two nodes x and y H u v w x y z u 0 2 5 1 ∞ ∞


computed as D[x, y] = min{c(x, v) + D[v, y]}, where v is u l0 l1 l10 l2 - -
v 2 0 3 2 ∞ ∞
a neighbor of x and min is taken over all neighbors of x v l1 l0 l4 l3 - -
w l10 l4 l0 l5 l7 l8 w 5 3 0 3 1 5
Relies on two other tables: x l2 l3 l5 l0 l6 - x 1 2 3 0 1 ∞
• L[]: link table y - - l7 l6 l0 l9
y ∞ ∞ 1 1 0 2
• H[]: next hop table z - - l8 - l9 l0
z ∞ ∞ 5 ∞ 2 0
l0: loopback
Example: Final Values l10 Distributed Distance Vector Alg.
do { 5
for each node i in graph do { 3
v w
for all node k not i in graph do { 2 l4 5
for each j neighbor of i {
u
l1 l8 Ford-Fulkerson (1962): modified Bellman’s algorithm to
d = c(i,j)+D[j,k]; l3 2 l5 l 1 z
if (d < D[i,k]) {
D[i,k]= d; 1
l2 3 7 l9
2
a distributed version (a.k.a. Bellman-Ford algorithm)
l6
H[i,k]= index of L[] where n=i,m=j; x y
}
} 1
Basic idea:
} Final values:
} • each node periodically sends its own distance estimates to all its
} while there has been a change in D[];
D u v w x y z immediate neighbors
Final values:
H u v w x y z
u 0 2 3 1 2 4 • when node i receives new distance estimates from a neighbor,
u l0 l1 l2 l2 l2 l2 v 2 0 3 2 3 5 it updates its own distance estimates using the Bellman distance
v l1 l0 l4 l3 l3 l3
equation:
w 3 3 0 2 1 3
w l7 l4 l0 l7 l7 l7
D[x, y] = min{c(x, v) + D[v, y]}, for each node y ∊ N
x 1 2 2 0 1 3
x l2 l3 l6 l0 l6 l6 • under stable conditions, the estimate D[x,y] converges to the
y 2 3 1 1 0 2
y l6 l6 l7 l6 l0 l9 actual least cost
z l9 l9 l9 l9 l9 l0 z 4 5 3 3 2 0

D[x,y] = min{c(x,y) + D[y,y], c(x,z) + D[z,y]} D[x,z] = min{c(x,y) + D[y,z], c(x,z) + D[z,z]}
= min{2+0 , 7+1} = 2 = min{2+1 , 7+0} = 3
Distributed DVA Implementation l10
x’s table cost to cost to cost to Each node i: 5
v
3
w
x y z x y z 2 5
x y z • knows the cost to each neighbor l1
l4 l8
x 0 2 7 x 0 2 3 • keeps entries of L table for local links u l3 2 l5 l 1 z
x 0 2 3 l2 3 7
from

from

y ∞∞ ∞ • i’s routing table consists of the i-th l9


from

y 2 0 1 1
y 2 0 1 l6 2
z ∞∞ ∞ z 7 1 0 x y
z 3 1 0 row of tables D and H 1
y’s table cost to cost to cost to • sends i-th row of table D as route update from i
x y z y
x y z x y z 2 1 • upon receiving a route update from another node,
x ∞∞ ∞ 0 2 7
x x 0 2 3 x z i recomputes its routing table (row i of D and H)
from

y 7
from

from

2 0 1 y 2 0 1 y 2 0 1
z ∞∞ ∞ z 7 1 0 z 3 1 0 Example:
z’s table cost to cost to cost to • u’s link table: [l1, l2]
x y z x y z x y z • u’s routing table:
• u’s route update/distance vector:
x ∞ ∞∞ x 0 2 7 x 0 2 3
from

dest dest
from

y y 2 0 1 u v w x y z u v w x y z
from

y 2 0 1
∞ ∞∞
z z 3 1 0 z 3 1 0 D 0 2 3 1 2 4 D 0 2 3 1 2 4
7 1 0
time H l0 l1 l2 l2 l2 l2
Route Updates Routing Loop
Even statically assigned link cost can change over Problems with distributed DVA: A

1
/ B 1
time, e.g., when a link goes down (breaks) • bouncing effect, when there’s alternate
path, e.g., between A and D: when AB 1 1 C
Each node: breaks, A and D (to B) count to 11 before D
Design question: how does a /
1
E 1
router communicate changes settling on ADEB ∞
waits for change in local link in link cost to other routers? • counting to ∞, when there’s no alternate path, e.g.,
cost or message from neighbor
• when cost increases (“bad between B, C, and E (to A or D) when both AB and DE break
news”) send on-demand/ • leads to: routing loop
recomputes distance estimates triggered updates
• cost decreases (“good Cause of routing loop (in 3 variations):
if distance to any destination news”) travel slowly with • inconsistent routing tables
has increased, notify neighbors periodic updates, with • route updates do not reflect reality
or send periodic update random periods
• routers do not know when they are in their neighbor’s path to
Design principle: soft-state a destination

10

Routing Loop E D C
1

B // A
Loop-free Routing
1 1 1 t1 1 ∞
Heuristics (not solution) to alleviate routing loop in Solutions to routing loop:
distributed distance vector algorithm: time B C D E • diffusing computation (DUAL)
• triggered updates t0 1 2 3 2 • path finding/source tracing
• split horizon (with poisonous reverse): t1 ∞
3 2 3 2
• link reversal
don’t advertise reachability t2 ∞
3 ∞
4 3 ∞
4

5 ∞
4 ∞
5 ∞ • path vector
(or advertise ∞) to next-hop neighbor t3 4
t4 ∞
5 ∞
6 ∞
5 10
6
• path hold-down, route poisoning: Cost to A,
t5 7 ∞
11 6 11
7 10
6
don’t switch path for n rounds or with n = 2:
t6 7 12
11 8 11
7 10
8
advertise ∞ if cost has been
t7 9 8 9 8
going up for n rounds
t8 9 10 9 10
t9 11 10 11 10
All heuristics rely on counting to ∞ to t10 11 12 11 10
detect loop, but differ in convergence time t11 11 12 11 10
Distributed DVA Deployment History Jaffe-Moss Algorithm
• Early days: GGP, HELLO, Fuzzball (ARPANET, early Internet)
Observations:
• 1988 (standardized): RIP (routed)
• v1: 30 secs periodic update with triggered updates and split horizon with
1. for each destination, nodes on the network form a
poisonous reverse directed spanning tree rooted at the destination
• v2 (1993): supports CIDR 2. loops occur in BF algorithm only after link cost
• 1988: IGRP (cisco): Interior Gateway Routing Protocol increases (incl. going to ∞)
• v1: split horizon, with path hold-down (n=2)

• v2: 90 secs periodic update with triggered updates, route poisoning 1


A B 3
• 1993: EIGRP (cisco): Enhanced IGRP for intra-domain/AS routing
• uses DUAL, supports CIDR 1 1 C
• 1994: BGPv4 for inter-domain routing D E 1
1
• uses path vector, supports CIDR, runs on TCP

Jaffe-Moss Algorithm Diffusing Computation


Each node queries all its neighbors for a shorter path
New idea: impose strong constraints on the ordering of
(queries carry increased link cost): first, E queries B and D
route updates among nodes:
• when a link cost increase is 1 If query comes from shortest 1
detected, all nodes in the spanning A B 3
path next hop, a node freezes
A B 3
tree rooted at the destination
(= C) that uses the link must 1 1 C its path to the destination and 1 1 C
freeze their next-hop (successor) ✗ recursively queries its neighbors ✗
D E D E
choice to that destination, i.e., 1 1 ∞ for a shorter path: B freezes 1 1 ∞
they cannot pick an alternate next-hop path to C and queries A, C, and E
• instead, they run a diffusing computation
Otherwise, node replies with current cost: C replies to B
Diffusing Computation Jaffe-Moss Algorithm
A node doesn’t unfreeze and reply to a query until it has Short-coming: may freeze path unnecessarily
received replies from all of its neighbors: B doesn’t reply
• it’s right that E doesn’t switch to B
to E until it has heard from both C and A
• but there’s no reason for B to wait for A’s ACK before
When a frozen node receives 1 switching to its direct link to C
A B 3
another query, it replies 1
A B 3
immediately with increased 1 1 C
cost: D and B reply immediately ✗ 1 1 C
D E
to A with increased cost 1 1 ∞

D 1
E 1 ∞

DUAL: Diffusing Update ALgorithm DUAL: Diffusing Update ALgorithm


Solves Jaffe-Moss’ short-coming by not freezing a Why it works: a path through a feasible successor cannot
destination to which there is a viable alternate path contain a loop, i.e., it could not and cannot be using the
Successor: next hop node link whose cost has gone up to get to destination
Feasible successor: an alternate successor whose cost B 2
3
towards destination is ≤ the cost of the current 1 F 2 ∞

successor before the link cost increased A
C
2 D 3
Cost from F to C → ∞, which of B, D, and E are 1
3 E
feasible successor for A? B
3
1 F 2 ∞
2
A node freezes a path to a particular destination and
✗ C initiate diffusing computation only when it cannot find
A 2 D 3 any feasible successor
3 E 1
DUAL: Diffusing Update ALgorithm Path Vector
Worst-case complexity analysis: cost required for the Idea:
network to converge after a resource failure: • instead of sending only the path cost to a destination in
distance vector, send the full path to each destination
• time complexity (TC): number of steps
• a router adopts a neighbor as the next hop to a destination
• communication complexity (CC): number of messages only if it is not in neighbor’s path to the destination
• a router prepends itself to all of its paths before propagating
DBF ILS JM DUAL them further
TC O(N) O(D) O(x) O(x)
CC O(N2) O(2E) O(E) O(6dx)
Path vector is used in BGP
1
A B
DBF: Distributed Bellman-Ford Example: A’s path vector: 1

D: network diameter
ILS: Incremental Link-State dest A B C D E
1 1 C
d: max degree of a node ( N)
JM: Jaffe-Moss metric 0 1 2 1 2 D E 1
x: # nodes affected by failure; 1
path A BA CBA DA EDA
worst case, e.g., on network partition, x = N

You might also like