Date post: | 21-Jan-2016 |
Category: |
Documents |
Upload: | briana-shelton |
View: | 214 times |
Download: | 0 times |
1
CSE524: Lecture 12
Network layerFunctions
2
Where we’re at…• Internet architecture and history• Internet protocols in practice• Application layer• Transport layer• Network layer
– Network-layer functions• Addressing, Demux to upper layer, Error detection, Delivery semantics• Security, Fragmentation, Quality of service• Routing
– Algorithms» Link-state (Dijkstra’s SPT)» Distance-vector (Distributed Bellman-Ford)
– Hierarchies
– Specific network layer protocols (IP) and devices• Data-link layer• Physical layer
3
Recall
• Link-state algorithms– Broadcast all link states to each router– Each router performs Dijkstra’s shortest-path tree
calculation to generate forwarding tables per-destination
• Now…– Analyzing link-state algorithms
4
NL: Link State Characteristics• Computation overhead
– n nodes– each iteration: need to check all nodes,
w, not in N• n*(n+1)/2 comparisons: O(n**2)• more efficient implementations possible:
O(n log(n))
• Space requirements• Bandwidth requirements• Stability
– Inconsistencies can cause transient loops
– Consistent LSDBs required for loop-free paths
A
B
C
D
1
3
5 2
1
Packet from CAmay loop around BDCif B knows about failureand C & D do not
X
5
NL: Link-state issues
Oscillations possible:• e.g., link cost = amount of carried traffic• Example: path to A flaps as traffic routed clockwise
and counter-clockwise• Common problem in load-based link metrics
– A. Khanna and J. Zinky, "The Revised ARPANET Routing Metric," in ACM SIGCOMM, 1989, pp. 45--46.
A
D
C
B1 1+e
e0
e
1 1
0 0
A
D
C
B2+e 0
001+e1
A
D
C
B0 2+e
1+e10 0
A
D
C
B2+e 0
e01+e1
initially… recompute
routing… recompute … recompute
6
NL: Distance vector routing algorithms
• Variants used in– Early ARPAnet
– RIP (intra-domain routing protocol)
– BGP (inter-domain routing protocol)
• Distributed next hop computation– “Gossip with immediate neighbors until you find the best
route”
– Best route is achieved when there are no more changes
• Unit of information exchange– Vector of distances to destinations
7
NL: Distance vector routing algorithms
• Exchange known distance information iteratively• Example (Bellman 1957)
– Start with link table (as with Dijkstra), calculate distance table iteratively
– Distance table data structure• table of known distances and next hops kept per node• row for each possible destination• column for each directly-attached neighbor to node• example: in node X, for dest. Y via neighbor Z:
D (Y,Z)X
distance from X toY, via Z as next hop
c(X,Z) + min {D (Y,w)}Z
w
=
=
D (Y,*)X Minimum known
distance from X to Y=
H (Y)X
=Next hop node from X to Y
8
NL: Distance table example
A
E D
CB7
8
1
2
1
2
D ()
A
B
C
D
A
1
7
6
4
B
14
8
9
11
D
5
5
4
2
Ecost to destination via
dest
inat
ion
D (C,D)E
c(E,D) + min {D (C,w)}D
w== 2+2 = 4
D (A,D)E
c(E,D) + min {D (A,w)}D
w== 2+3 = 5
D (A,B)E
c(E,B) + min {D (A,w)}B
w== 8+6 = 14
loop!
loop! H (Y) = X
9
NL: Distance table gives routing table
D ()
A
B
C
D
A
1
7
6
4
B
14
8
9
11
D
5
5
4
2
Ecost to destination via
dest
inat
ion
A
B
C
D
A,1
D,5
D,4
D,4
Outgoing link to use, cost
dest
inat
ion
Distance table Routing table
H (Y)X
10
Dj(k,*)
NL: Bellman algorithm
• How to calculate best routes?
i j
k
j’ k’
c(i,j)
c(i,j’)
Dj’(k,*)
Di(k,*)
For node i
while there is a change in D {
for all k not neighbor of i {
for each j neighbor of i {
Di(k,j) = c(i,j) + Dj(k,*)
if Di(k,j) < Di(k,*) {
Di(k,*) = Di(k,j)
Hi(k) = j
}
}
}
}
11
NL: Distributed Bellman-Ford
• Make Bellman algorithm distributed (Ford-Fulkerson 1962)– Each node i knows part of link table– Iterative
• Each node sends around and recalculates D[i,*]• continues until no nodes exchange info.• self-terminating: no “signal” to stop
– Asynchronous• nodes need not exchange info/iterate in lock step!• “triggered updates”
– Distributed• each node communicates only with directly-attached neighbors
12
NL: Distributed Bellman-Ford overview
Iterative, asynchronous: each local iteration caused by:
• local link cost change • message from neighbor:
its least cost path change from neighbor
Distributed:• each node notifies
neighbors only when its least cost path to any destination changes– neighbors then notify their
neighbors if necessary
wait for (change in local link cost of msg from neighbor)
recompute distance table
if least cost path to any dest
has changed, notify neighbors
Each node:
13
NL: Distributed Bellman-Ford algorithm
1 Initialization: 2 for all adjacent nodes v: 3 DX(*,v) = infinity /* the * operator means "for all rows" */ 4 DX(v,v) = c(X,v) 5 for all destinations, y 6 send minwDX(y,w) to each neighbor /* w over all X's neighbors */
At all nodes, X:
14
NL: Distributed Bellman-Ford algorithm (cont.):8 loop 9 wait (until I see a link cost change to neighbor V 10 or until I receive update from neighbor V) 11 12 if (c(X,V) changes by d) 13 /* change cost to all dest's via neighbor v by d */ 14 /* note: d could be positive or negative */ 15 for all destinations y: DX(y,V) = DX(y,V) + d 16 17 else if (update received from V wrt destination Y) 18 /* shortest path from V to some Y has changed */
19 /* V has sent a new value for its minwDV(Y,w) */ 20 /* call this received new value is "newval" */ 21 for the single destination y: DX(Y,V) = c(X,V) + newval 22 23 if we have a new minwDX(Y,w)for any destination Y 24 send new value of minwDX(Y,w) to all neighbors 25 26 forever
15
NL: DBF example
A
B
E
C
D
Info atNode
A
B
C
D
A B C
0 7 ~
7 0 1
~ 1 0
~ ~ 2
7
1
1
2
28
Distance to Node
D
~
~
2
0
E 1 8 ~ 2
1
8
~
2
0
E
Initial Distance Vectors
16
NL: DBF example
Info atNode
A
B
C
D
A B C
0 7 ~
7 0 1
~ 1 0
~ ~ 2
Distance to Node
D
~
~
2
0
E 1 8 4 2
1
8
~
2
0
E
A
B
E
C
D
7
1
1
2
28
E Receives D’s RoutesUpdates cost to C
17
NL: DBF example
Info atNode
A
B
C
D
A B C
0 7 8
7 0 1
~ 1 0
~ ~ 2
Distance to Node
D
~
~
2
0
E 1 8 4 2
1
8
~
2
0
E
A
B
E
C
D
7
1
1
2
28
A receives B’s updateUpdates cost to C, but cost to E unchanged
18
NL: DBF example
Info atNode
A
B
C
D
A B C
0 7 5
7 0 1
~ 1 0
~ ~ 2
Distance to Node
D
3
~
2
0
E 1 8 4 2
1
8
~
2
0
E
A
B
E
C
D
7
1
1
2
28
A receives E’s routesUpdates cost to C (new min) and D
19
NL: DBF example
Info atNode
A
B
C
D
A B C
0 6 5
6 0 1
5 1 0
3 3 2
Distance to Node
D
3
3
2
0
E 1 5 4 2
1
5
4
2
0
E
A
B
E
C
D
7
1
1
2
28
And so on, until final distances....
20
NL: DBF example
dest
A
B
C
D
A B D
1 14 5
7 8 5
6 9 4
4 11 2
Next hop
E’s routing table
A
B
E
C
D
7
1
1
2
28
E’s routing table
21
NL: DBF (another example)
X Z12
7
Y
• See book for explanation of this example
22
NL: DBF (another example)
X Z12
7
Y
D (Y,Z)X
c(X,Z) + min {D (Y,w)}w
=
= 7+1 = 8
Z
D (Z,Y)X
c(X,Y) + min {D (Z,w)}w=
= 2+1 = 3
Y
23
Analyzing Distributed Bellman-Ford
• Continuously send local distance tables of best known routes to all neighbors until your table converges– Computation diffuses until all nodes converge
– Will computation converge quickly and deterministically?
• Not all the time
• Pathologic cases possible
• Several algorithms for minimizing such cases
24
NL: DBF (good news example)
Link cost changes:• node detects local link cost change
• updates distance table (line 15)
• if cost change in least cost path, notify neighbors (lines 23,24)
• fast convergence (see book for details)
X Z14
50
Y1
algorithmterminates“good
news travelsfast”
25
NL: DBF (count-to-infinity example)
Link cost changes:• good news travels fast
• bad news travels slow - “count to infinity” problem!
• alternate route implicitly used link that changed
X Z14
50
Y60
algorithmcontinues
on!
26
NL: DBF: (count-to-infinity example)
A
25
1
1
B
C
B
C 21
dest cost
A
C 11
dest cost
A
B 12
dest cost
X
27
NL: DBF: (count-to-infinity example)
A
25 1
B
C
B
C 21
dest cost
A
C 1~
dest cost
A
B 12
dest cost
C Sends Routes to B
28
NL: DBF: (count-to-infinity example)
A
25 1
B
C
B
C 21
dest cost
A
C 13
dest cost
A
B 12
dest cost
B Updates Distance to A
29
NL: DBF: (count-to-infinity example)
A
25 1
B
C
B
C 21
dest cost
A
C 13
dest cost
A
B 14
dest cost
B Sends Routes to C
30
NL: DBF: (count-to-infinity example)
A
25 1
B
C
B
C 21
dest cost
A
C 15
dest cost
A
B 14
dest cost
C Sends Routes to B
31
NL: How are loops caused?
• Observation 1:– B’s metric increases
• Observation 2:– C picks B as next hop to A– But, the implicit path from C to A includes itself!
32
NL: Solutions to looping
• Split horizon– Do not advertise route to X to an adjacent neighbor if your
route to X goes through that neighbor– If C routes through B to get to A, C does not advertise (C=>A)
route to B.
• Poisoned reverse– Advertise an infinite distance route to X to an adjacent
neighbor if your route to X goes through that neighbor– If C routes through B to get to A, C advertises to B that its
distance to A is infinity
• Works for two node loops– Does not work for loops with more nodes
33
NL: Split-horizon with poisoned reverse
If Z routes through Y to get to X :• Z tells Y its (Z’s) distance to X is
infinite (so Y won’t route to X via Z)
• will this completely solve count to infinity problem?
X Z14
50
Y60
algorithmterminates
new route to X not involving Y
can now select and advertise route to X via Z
route to X through Y goes thru Zpoison it!
34
NL: Solutions to looping
1
11
1
A
X
B
C
D
35
NL: Solutions to looping
• Route poisoning– Advertise infinite cost on a route to everyone (not just next
hop) when lowest cost route increases– Gets rid of stale information throughout network– Used in conjunction with Path Holdown
• Path Holddown– Freeze route for a fixed time
• Do not switch to an alternate while route poisoning is happening• In our example, A and B delay changing and advertising new routes• A and B both set route to D to infinity after single step
– Configuring holddown delay• Delay too large: Slow convergence• Delay too small: Count-to-infinity more probable
36
NL: Solutions to looping
• Path vector – Select loop-free paths– Each route advertisement carries entire path– If a router sees itself in path, it rejects the route– BGP does it this way– Space proportional to diameter of network
37
NL: Solutions to looping
• Do solutions completely eliminate loops?– No! Transient loops are still possible– Why? Because implicit path information may be stale– See this in BGP convergence
• Only way to fix this– Ensure that you have up-to-date information by
explicitly querying
38
NL: Comparing Link State vs. Distance Vector
• Network bandwidth– DV
• send everything you know to your neighbors
• large messages, transfers only to neighbors
– LS• send info about your neighbors to everyone
• small messages, but broadcast globally
39
NL: Link State vs. Distance Vector
• Convergence speed:– LS
• faster – don’t need to process LSPs before forwarding• single SPT calculation
– DV• fast with triggered updates• count-to-infinity problem
• Space requirements:– LS
• maintains entire topology
– DV • maintains only neighbor state• path vector maintains routes proportional to network diameter
40
NL: Link State vs. Distance Vector
• Robustness:– LS can broadcast incorrect/corrupted LSP
• Can be made robust since sources are aware of alternate paths within topology
– DV can advertise incorrect paths to all destinations• Incorrect calculation can spread to entire network
41
NL: DUAL
• Distributed Update Algorithm – Garcia-Luna-Aceves 1989
– Goal: Avoid transient loops in DV and LS algorithms• Similar in flavor to route poisoning and path holddown
– 2 ideas• A path shorter than current path cannot contain a loop
• Based on diffusing computation (Dijkstra-Scholten 1980)– Wait until computation completes before changing routes in response to a
new update
– Similar to path-holddown
– 3 kinds of messages• Update, query, reply
– 2 states for routers• Active (queries outstanding), passive
42
NL: DUALOn update if (lower cost) adoptelse if (higher cost) { if (from next hop) { if (any path exists < old length from next hop) switch path else freeze route send query to all neighbors except next hop go into active wait for reply from all neighbors update route return to passive } send reply to all querying neighbors}
43
NL: Routing Hierarchies
• Flat routing doesn’t scale– Each node/router cannot be expected to store routes to every
destination (or destination network)
– 50 million destinations
– Route table exchange would swamp network
• Key observation– Need less information with increasing distance to destination
• Two radically different approaches for routing– The area hierarchy
– The landmark hierarchy
• Covered in advanced topics at end of course...
44
NL: Areas
• Divide network into areas– Areas can have nested sub-areas– No path between two sub-areas of an area can exit that area– Within area, each node has routes to every other node – Outside area
• Each node has routes for other top-level areas only• Inter-area packets are routed to nearest appropriate border router• Can result in sub-optimal paths
• Hierarchically address nodes in a network– Sequentially number top-level areas– Sub-areas of area are labeled relative to that area– Nodes are numbered relative to the smallest containing area
45
NL: Network layer functions summary
• Each networking layer provides varying degrees of functionality including….– security, delivery semantics, quality of service, demux to upper
layer, error detection, fragmentation, addressing, routing
• Next: IP network layer– IP demux to upper layer– IP error detection– IP delivery semantics– IP security– IP fragmentation– IP quality-of-service– IP addressing– IP routing