Fundamentals of Computer Networks ECE 478/578 Lecture #16: Routing Instructor: Loukas Lazos Dept of Electrical and Computer Engineering University of Arizona.

Download Report

Transcript Fundamentals of Computer Networks ECE 478/578 Lecture #16: Routing Instructor: Loukas Lazos Dept of Electrical and Computer Engineering University of Arizona.

Fundamentals of Computer Networks
ECE 478/578
Lecture #16: Routing
Instructor: Loukas Lazos
Dept of Electrical and Computer Engineering
University of Arizona
What is Routing?
Construct directions from starting point to destination
2
Forwarding vs. Routing
Forwarding: data plane
Directing a data packet to an outgoing link
Individual router using a forwarding table
Routing: control plane
Computing paths the packets will follow
Routers talking amongst themselves
Individual router creating a forwarding table
3
Why Does Routing Matter?
End-to-end performance
Quality of the path affects user performance
Propagation delay, throughput, and packet loss
Use of network resources
Balance of the traffic over the routers and links
Avoiding congestion by directing traffic to lightly-loaded links
Transient disruptions during changes
Failures, maintenance, and load balancing
Limiting packet loss and delay during changes
4
Different Types of Routing
Routing in a GPS device
Routing in computer networks
Shortest path
Smallest delay
Highest reliability
Avoid congested nodes
5
Routing as a Graph Problem
Network is mapped into a graph G(V,E), where each link has an
associated cost
Cost: delay, financial cost, probability of failure, etc.
6
Distance Vector Algorithm
Construct a one-dimensional array (vector) of distances to all other nodes
Exchange info with immediate neighbors
Update distances based on received information
Stop sending updates as soon as no change occurs
Example: Assume unit cost for each link
7
Distance Vector – Global View
Global view of the network
A
B
C
D
E
F
G
A
0
1
1

1
1

B
1
0
1




C
1
1
0
1



D


1
0


1
E
1



0


F
1




0
1
G



1

1
0
8
Distance Vector – Local View
Dest
Cost
Next
Hop
Dest
Cost
Next
Hop
Dest
Cost
Next
Hop
B
1
B
A
1
A
A
1
A
C
1
C
C
1
C
B
1
B
D

–
D

–
D
1
D
E
1
E
E

–
E

–
F
1
F
F

–
F

–
G

–
G

–
G

–
Dest
Cost
Next
Hop
Dest
Cost
Next
Hop
Dest
Cost
Next
Hop
Dest
Cost
Next
Hop
A

–
A
1
A
A
1
A
A

–
B

–
B

–
B

–
B

–
C
1
C
C

–
C

–
C

–
E

–
D

–
D

–
D
1
D
F

–
F

–
E

–
E

–
G
1
G
G

–
G
1
G
F
1
F
9
Distance Vector – 1st Update
Dest
Cost
Next
Hop
Dest
Cost
Next
Hop
Dest
Cost
Next
Hop
B
1
B
A
1
A
A
1
A
C
1
C
C
1
C
B
1
B
D
2
C
D
2
C
D
1
D
E
1
E
E
2
A
E
2
A
F
1
F
F
2
A
F
2
A
G
2
F
G

–
G
2
G
Dest
Cost
Next
Hop
Dest
Cost
Next
Hop
Dest
Cost
Next
Hop
Dest
Cost
Next
Hop
A
2
C
A
1
A
A
1
A
A
2
F
B
2
C
B
2
A
B
2
A
B

–
C
1
C
C
2
A
C
2
A
C
2
D
E

–
D

–
D
2
G
D
1
D
F
2
G
F
2
A
E
2
E
E

–
G
1
G
G

–
G
1
G
F
1
F
10
Distance Vector – 2nd Update
Dest
Cost
Next
Hop
Dest
Cost
Next
Hop
Dest
Cost
Next
Hop
B
1
B
A
1
A
A
1
A
C
1
C
C
1
C
B
1
B
D
2
C
D
2
C
D
1
D
E
1
E
E
2
A
E
2
A
F
1
F
F
2
A
F
2
A
G
2
F
G
3
C
G
2
G
Dest
Cost
Next
Hop
Dest
Cost
Next
Hop
Dest
Cost
Next
Hop
Dest
Cost
Next
Hop
A
2
C
A
1
A
A
1
A
A
2
F
B
2
C
B
2
A
B
2
A
B
3
D
C
1
C
C
2
A
C
2
A
C
2
D
E
3
C
D
3
A
D
2
G
D
1
D
F
2
G
F
2
A
E
2
E
E
3
F
G
1
G
G
3
A
G
1
G
F
1
F
11
Failure of F – G Link
12
Failure of F – G Link Step 1
A/Dest
Cost
Next
Hop
B/Dest
Cost
Next
Hop
C/Dest
Cost
Next
Hop
B
1
B
A
1
A
A
1
A
C
1
C
C
1
C
B
1
B
D
2
C
D
2
C
D
1
D
E
1
E
E
2
A
E
2
A
F
1
F
F
2
A
F
2
A
G
2
F
G
3
C
G
2
G
D/Dest
Cost
Next
Hop
E/Dest
Cost
Next
Hop
F/Dest
Cost
Next
Hop
G/Dest
Cost
Next
Hop
A
2
C
A
1
A
A
1
A
A

–
B
2
C
B
2
A
B
2
A
B
3
D
C
1
C
C
2
A
C
2
A
C
2
D
E
3
C
D
3
A
D

–
D
1
D
F
2
G
F
2
A
E
2
E
E

–
G
1
G
G
3
A
G

–
F

–
13
Failure of F – G Link Step 2
A/Dest
Cost
Next
Hop
B/Dest
Cost
Next
Hop
C/Dest
Cost
Next
Hop
B
1
B
A
1
A
A
1
A
C
1
C
C
1
C
B
1
B
D
2
C
D
2
C
D
1
D
E
1
E
E
2
A
E
2
A
F
1
F
F
2
A
F
2
A
G

–
G
3
C
G
2
G
D/Dest
Cost
Next
Hop
E/Dest
Cost
Next
Hop
F/Dest
Cost
Next
Hop
G/Dest
Cost
Next
Hop
A
1
A
A
1
A
A
1
A
A

–
B
2
C
B
2
A
B
2
A
B
3
D
C
1
C
C
2
A
C
2
A
C
2
D
E
3
C
D
3
A
D

–
D
1
D
F

–
F
2
A
E
2
E
E

–
G
1
G
G

–
G

–
F

–
14
Failure of F – G Link Step 3
A/Dest
Cost
Next
Hop
B/Dest
Cost
Next
Hop
C/Dest
Cost
Next
Hop
B
1
B
A
1
A
A
1
A
C
1
C
C
1
C
B
1
B
D
2
C
D
2
C
D
1
D
E
1
E
E
2
A
E
2
A
F
1
F
F
2
A
F
2
A
G
3
C
G
3
C
G
2
G
D/Dest
Cost
Next
Hop
E/Dest
Cost
Next
Hop
F/Dest
Cost
Next
Hop
G/Dest
Cost
Next
Hop
A
2
C
A
1
A
A
1
A
A
3
D
B
2
C
B
2
A
B
2
A
B
3
D
C
1
C
C
2
A
C
2
A
C
2
D
E
3
C
D
3
A
D
4
A
D
1
D
F
3
C
F
2
A
E
2
E
E
4
D
G
1
G
G

–
G

–
F

–
15
Failure of F – G Link Step 4
A/Dest
Cost
Next
Hop
B/Dest
Cost
Next
Hop
C/Dest
Cost
Next
Hop
B
1
B
A
1
A
A
1
A
C
1
C
C
1
C
B
1
B
D
2
C
D
2
C
D
1
D
E
1
E
E
2
A
E
2
A
F
1
F
F
2
A
F
2
A
G
3
C
G
3
C
G
2
G
D/Dest
Cost
Next
Hop
E/Dest
Cost
Next
Hop
F/Dest
Cost
Next
Hop
G/Dest
Cost
Next
Hop
A
2
C
A
1
A
A
1
A
A
3
D
B
2
C
B
2
A
B
2
A
B
3
D
C
1
C
C
2
A
C
2
A
C
2
D
E
3
C
D
3
A
D
4
C
D
1
D
F
3
C
F
2
A
E
2
E
E
3
F
G
1
G
G
4
A
G
4
A
F
4
D
16
Count-to-Infinity Problem
A advertises a distance of infty to E and updates its neighbors
C advertises a distance of 2 to E via A
B advertises a distance of 3 to E via C
A updates its table and advertises a distance of 4 via B
C updates its table and advertises a distance of 5 via A…
17
Solutions for Count-to-Infinity Problem
Sol A: Use a maximum hop count instead of infinity
Sol B: Split Horizon
Do not send updates on the neighbor that provided the info for a particular
route.
E.g.: B does not send an update for E to A, since it learned about E from A
Sol C: Split Horizon with Poison Reverse
B advertises a route of cost infinity to E to ensure that A does not use B to get
to E
Solutions do not always work for loops with more than 3 nodes
18
Routing Information Protocol (RIP)
Distance-vector algorithm where vertices are networks and not hosts
Valid hop count (distances) 1-15, with 16 representing infinity
Limited to fairly small networks
19
Link-State Routing
Path-selection model
Destination-based
Flood information regarding immediate neighbors to all nodes
Each node obtains a complete map of the network
2
3
2
1
4
20
1
1
4
5
3
Shortest-Path Problem
Given: network topology with link costs
c(x,y): link cost from node x to node y
Infinity if x and y are not direct neighbors
Compute: least-cost paths to all nodes
From a given source u to all other nodes
p(v): predecessor node along path from source to v
2
3
u
2
p(v)
21
1
1
4
1
5
4
3
v
Dijkstra’s Shortest-Path Algorithm
Iterative algorithm
After k iterations, know least-cost path to k nodes
S: nodes whose least-cost path definitively known
Initially, S = {u} where u is the source node
Add one node to S in each iteration
D(v): current cost of path from source to node v
Initially, D(v) = c(u, v) for all nodes v adjacent to u
… and D(v) = ∞ for all other nodes v
Continuously update D(v) as shorter paths are learned
22
Dijsktra’s Algorithm
1 Initialization:
2 S = {u}
3 for all nodes v
4
if v adjacent to u {
5
D(v) = c(u,v)
6
else D(v) = ∞
7
8 Loop
9 find w not in S with the smallest D(w)
10 add w to S
11 update D(v) for all v adjacent to w and not in S:
12
D(v) = min{D(v), D(w) + c(w,v)}
13 until all nodes in S
23
Dijkstra’s Algorithm Example
2
3
2
2
1
1
3
4
2
1
5
4
2
5
4
3
3
4
24
2
1
1
1
4
1
2
3
1
1
3
4
2
5
3
1
1
1
4
4
5
3
Dijkstra’s Algorithm Example
2
3
2
2
1
1
3
4
2
1
5
4
2
5
4
3
3
2
4
25
1
1
1
4
1
2
3
1
1
3
4
2
1
5
3
1
1
4
4
5
3
Shortest-Path Tree
• Shortest-path tree from u
v
u
1
2
1
w
1
4
x
5
4
s
26
link
y
2
3
• Forwarding table at u
z
t
3
v
w
x
y
z
s
t
(u,v)
(u,w)
(u,w)
(u,v)
(u,v)
(u,w)
(u,w)
Dijkstra Table
Step
S
v
w
x
y
z
s
t
D(v)
P(v)
D(w)
P(w)
D(x)
P(x)
D(y)
P(y)
D(z)
P(z)
D(s)
P(s)
D(t)
P(t)
0
u
3
u
2
u

u

u

u

u

u
1
u,w
3
u
-
-
3
w

u

u
6
w

u
2
u, w, v
-
-
-
-
3
w
5
v

u
6
w

u
3
u,w,v,x
-
-
-
-
-
-
5
v

u
6
w
8
x
4
u,w,v,x,
y
-
-
-
-
-
-
-
-
6
y
6
w
8
x
5
u,w,v,x,
y,s,z
-
-
-
-
-
-
-
-
6
y
-
-
8
x
6
u,w,v,x,
y,s,z,t
-
-
-
-
-
-
-
-
-
-
-
-
8
x
27
Link-State Routing
Each router keeps track of the state of its incident links
Link-state: working or non-working
Cost (delay, throughput)
Each router floods the link state in the entire network
Every router gets a complete view of the network
Each router runs Dijkstra’s algorithm to obtain shortest paths to all
other destinations
Link-state protocols
Open Shortest Path First (OSPF)
Intermediate System – Intermediate System (IS-IS)
28
Determining the State of a Link
Beaconing
Periodically exchange “hello” messages with neighbors
Detect a failure after a threshold number of unanswered “hellos”
A
HELLOB
B
29
HELLOC
C
Distributing Link-State Info
Flood the entire network
Every node forwards link-state packet on all links but the incoming one
30
Link-State Packets
Packets to be distributed
Sequence number prevents nodes from using old messages
Age determines a time to live for the packet (why do we need this?)
31
When to Initiate Flooding
Topology change
Link or node failure
Link or node recovery
Configuration change
Link cost change
Periodically
Refresh the link-state information
Typically (say) 30 minutes
Corrects for possible corruption of the data
32
Link State vs. Distance Vector
Link State
Tell every node in the network about your immediate neighbors
Distance Vector
Tell only to your neighbors about every node in the network
33
Open Shortest Path First Protocol
Format of an OSPF message
Version: 1-4, 1:Hello msg, 2: request, 3:send, 4: Ack
Area Id: area where node is connected in case of hierarchical routing
Authentication type: 0:none, 1:simple pswd, 2: MAC
34
Link State Advertisements (LSA)
Type 1: cost of links
Type 2: networks connected
Other types: Hierarchy info
LS Age: TTL
Link-state ID, Advertising router:
32-bit address of router
Length: length in bytes of the LSA
Link ID, data, type: identify the link
Type of Service (TOS): Allows assignment of different metrics for
different services for the same link
35
Link Metrics
Hop count: Assign a metric of one at every hop
Least-cost route  Least-hops route
Delay:
Delay= Tack – Tarr = (Td – Tarr) + Tt + 2 Tp
Weight assigned to each link = average delay for packets passing through
Problems with simply using delay
Instability: A heavily loaded link would oscillate between busy and idle states
Wide value range: a link could look hundreds of time more expensive than
another – may cause very long routes
36
Suppression of the Dynamic Range
New metric based on link utilization
Highly loaded link never shows a cost more than three times its idle cost
The most expensive link is only seven times the cost of the least expensive
A high–speed satellite link is more attractive than a low speed terrestrial link
Cost is a function of link utilization only at moderate to high loads
37
Link Metrics in the Real World
For the most part metrics are static
No dynamic adjustment, but hardcoded by network administrators
Avoids route oscillation problems
Most commonly used metric
w = c/B, where c is a constant and B is the link bandwidth
38
Hierarchical Routing
A scalable solution for very large networks
Cluster routers into areas or regions
39
Hierarchical Routing
Reduction in table size comes at a cost
The route between a particular node pair may not necessarily be the shortest
For large networks, how many levels should the hierarchy have?
Example: Network with 720 nodes
1 level:
720 entries
2 levels: 24 regions and 30 nodes per region
29 (local) + 23 (region) = 52 entries
3 levels: 8 clusters; 9 regions/cluster; 10 routers/region
9 (local) + 8 (region) + 7 (cluster) = 24 entries
40