1 comnet 2010 communication networks recitation 6 routing
Post on 20-Dec-2015
216 views
TRANSCRIPT
![Page 1: 1 Comnet 2010 Communication Networks Recitation 6 Routing](https://reader030.vdocument.in/reader030/viewer/2022032704/56649d415503460f94a1b9d1/html5/thumbnails/1.jpg)
1Comnet 2010
Communication NetworksCommunication Networks
Recitation 6Recitation 6
RoutingRouting
![Page 2: 1 Comnet 2010 Communication Networks Recitation 6 Routing](https://reader030.vdocument.in/reader030/viewer/2022032704/56649d415503460f94a1b9d1/html5/thumbnails/2.jpg)
2Comnet 2010
Routing Problem: Routing Problem: find an find an Optimal PathOptimal Path
R5
5
A
R1
R2
R4
R3
R6
R7
R8
B
5
4010
2010
4 10
10
55
6
15
40
![Page 3: 1 Comnet 2010 Communication Networks Recitation 6 Routing](https://reader030.vdocument.in/reader030/viewer/2022032704/56649d415503460f94a1b9d1/html5/thumbnails/3.jpg)
3Comnet 2010
Distance Vector (RIP)Distance Vector (RIP)
• Each node maintains a table:Each node maintains a table:• (Destination, Cost, NextHop)(Destination, Cost, NextHop)
• Each node sends updates to (and Each node sends updates to (and receives updates from) its directly receives updates from) its directly connected neighborsconnected neighbors– periodically (on the order of several periodically (on the order of several
seconds)seconds)– whenever its table changes (called whenever its table changes (called
triggered update)triggered update)
![Page 4: 1 Comnet 2010 Communication Networks Recitation 6 Routing](https://reader030.vdocument.in/reader030/viewer/2022032704/56649d415503460f94a1b9d1/html5/thumbnails/4.jpg)
4Comnet 2010
DV UpdatesDV Updates
• Each update is a list of pairs:Each update is a list of pairs:• (Destination, Cost)(Destination, Cost)
• Update local table if receive a “better” routeUpdate local table if receive a “better” route– smaller costsmaller cost– came from next-hopcame from next-hop
• Refresh existing routes; delete if they time outRefresh existing routes; delete if they time out
• Convergence rateConvergence rate
![Page 5: 1 Comnet 2010 Communication Networks Recitation 6 Routing](https://reader030.vdocument.in/reader030/viewer/2022032704/56649d415503460f94a1b9d1/html5/thumbnails/5.jpg)
5Comnet 2010
RIP Table ProcessingRIP Table Processing• RIP routing tables managed by RIP routing tables managed by application-application-
levellevel process called routed (daemon) process called routed (daemon)• Advertisements sent in UDP packets, Advertisements sent in UDP packets,
periodically repeatedperiodically repeated
![Page 6: 1 Comnet 2010 Communication Networks Recitation 6 Routing](https://reader030.vdocument.in/reader030/viewer/2022032704/56649d415503460f94a1b9d1/html5/thumbnails/6.jpg)
6Comnet 2010
Example - initial distancesExample - initial distances
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
![Page 7: 1 Comnet 2010 Communication Networks Recitation 6 Routing](https://reader030.vdocument.in/reader030/viewer/2022032704/56649d415503460f94a1b9d1/html5/thumbnails/7.jpg)
7Comnet 2010
E receives D’s routesE receives D’s routes
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
![Page 8: 1 Comnet 2010 Communication Networks Recitation 6 Routing](https://reader030.vdocument.in/reader030/viewer/2022032704/56649d415503460f94a1b9d1/html5/thumbnails/8.jpg)
8Comnet 2010
E updates cost to CE updates cost to C
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 4 2
1
8~
2
0
E
![Page 9: 1 Comnet 2010 Communication Networks Recitation 6 Routing](https://reader030.vdocument.in/reader030/viewer/2022032704/56649d415503460f94a1b9d1/html5/thumbnails/9.jpg)
9Comnet 2010
A receives B’s routesA receives B’s routes
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 4 2
1
8~
2
0
E
![Page 10: 1 Comnet 2010 Communication Networks Recitation 6 Routing](https://reader030.vdocument.in/reader030/viewer/2022032704/56649d415503460f94a1b9d1/html5/thumbnails/10.jpg)
10Comnet 2010
A updates cost to CA updates cost to C
A
B
E
C
D
Info atnode
A
B
C
D
A B C
0 7 8
7 0 1~ 1 0
~ ~ 2
7
1
1
2
28
Distance to node
D
~
~2
0
E 1 8 4 2
1
8~
2
0
E
![Page 11: 1 Comnet 2010 Communication Networks Recitation 6 Routing](https://reader030.vdocument.in/reader030/viewer/2022032704/56649d415503460f94a1b9d1/html5/thumbnails/11.jpg)
11Comnet 2010
A receives E’s routesA receives E’s routes
A
B
E
C
D
Info atnode
A
B
C
D
A B C
0 7 8
7 0 1~ 1 0
~ ~ 2
7
1
1
2
28
Distance to node
D
~
~2
0
E 1 8 4 2
1
8~
2
0
E
![Page 12: 1 Comnet 2010 Communication Networks Recitation 6 Routing](https://reader030.vdocument.in/reader030/viewer/2022032704/56649d415503460f94a1b9d1/html5/thumbnails/12.jpg)
12Comnet 2010
A updates cost to C and DA updates cost to C and D
A
B
E
C
D
Info atnode
A
B
C
D
A B C
0 7 5
7 0 1~ 1 0
~ ~ 2
7
1
1
2
28
Distance to node
D
3
~2
0
E 1 8 4 2
1
8~
2
0
E
![Page 13: 1 Comnet 2010 Communication Networks Recitation 6 Routing](https://reader030.vdocument.in/reader030/viewer/2022032704/56649d415503460f94a1b9d1/html5/thumbnails/13.jpg)
13Comnet 2010
Final distancesFinal distances
A
B C
D
Info atnode
A
B
C
D
A B C
0 6 5
6 0 15 1 0
3 3 2
7
1
1
2
28
Distance to node
D
3
32
0
E 1 5 4 2
1
54
2
0
E
E
![Page 14: 1 Comnet 2010 Communication Networks Recitation 6 Routing](https://reader030.vdocument.in/reader030/viewer/2022032704/56649d415503460f94a1b9d1/html5/thumbnails/14.jpg)
14Comnet 2010
Final distances after link Final distances after link failurefailure
A
B C
D
Info atnode
A
B
C
D
A B C
0 7 8
7 0 1
8 1 0
10 3 2
7
1
1
2
28
Distance to node
D
10
3
2
0
E 1 8 9 11
1
8
9
11
0
E
E
![Page 15: 1 Comnet 2010 Communication Networks Recitation 6 Routing](https://reader030.vdocument.in/reader030/viewer/2022032704/56649d415503460f94a1b9d1/html5/thumbnails/15.jpg)
15Comnet 2010
View from a nodeView from a node
A
B
E
C
D
dest
A
B
C
D
A B D
1 14 5
7 8 56 9 4
4 11 2
7
1
1
2
28
Next hop
E’s routing table
![Page 16: 1 Comnet 2010 Communication Networks Recitation 6 Routing](https://reader030.vdocument.in/reader030/viewer/2022032704/56649d415503460f94a1b9d1/html5/thumbnails/16.jpg)
16Comnet 2010
The bouncing effectThe bouncing effect
A
25
1
1
B
C
B
C 21
dest costA
C 11
dest cost
A
B 12
dest cost
![Page 17: 1 Comnet 2010 Communication Networks Recitation 6 Routing](https://reader030.vdocument.in/reader030/viewer/2022032704/56649d415503460f94a1b9d1/html5/thumbnails/17.jpg)
17Comnet 2010
C sends routes to BC sends routes to B
A
25 1
B
C
B
C 21
dest costA
C 1~
dest cost
A
B 12
dest cost
![Page 18: 1 Comnet 2010 Communication Networks Recitation 6 Routing](https://reader030.vdocument.in/reader030/viewer/2022032704/56649d415503460f94a1b9d1/html5/thumbnails/18.jpg)
18Comnet 2010
B updates distance to AB updates distance to A
A
25 1
B
C
B
C 21
dest costA
C 13
dest cost
A
B 12
dest cost
![Page 19: 1 Comnet 2010 Communication Networks Recitation 6 Routing](https://reader030.vdocument.in/reader030/viewer/2022032704/56649d415503460f94a1b9d1/html5/thumbnails/19.jpg)
19Comnet 2010
B sends routes to CB sends routes to C
A
25 1
B
C
B
C 21
dest costA
C 13
dest cost
A
B 14
dest cost
![Page 20: 1 Comnet 2010 Communication Networks Recitation 6 Routing](https://reader030.vdocument.in/reader030/viewer/2022032704/56649d415503460f94a1b9d1/html5/thumbnails/20.jpg)
20Comnet 2010
How are these loops caused?How are these loops caused?
• Observation 1:Observation 1:– B’s metric B’s metric increasesincreases
• Observation 2:Observation 2:– C picks B as next hop to AC picks B as next hop to A– But, the But, the implicit pathimplicit path from C to A includes from C to A includes
itself!itself!
![Page 21: 1 Comnet 2010 Communication Networks Recitation 6 Routing](https://reader030.vdocument.in/reader030/viewer/2022032704/56649d415503460f94a1b9d1/html5/thumbnails/21.jpg)
21Comnet 2010
SolutionsSolutions
• Split horizon/Poisoned reverseSplit horizon/Poisoned reverse– B does not advertise route to C or B does not advertise route to C or
advertises it with infinite distance (16)advertises it with infinite distance (16)
• Works for two node loopsWorks for two node loops– does not work for loops with more nodesdoes not work for loops with more nodes
![Page 22: 1 Comnet 2010 Communication Networks Recitation 6 Routing](https://reader030.vdocument.in/reader030/viewer/2022032704/56649d415503460f94a1b9d1/html5/thumbnails/22.jpg)
22Comnet 2010
Example where Split Horizon failsExample where Split Horizon fails
1
11
1
A B
C
D
• When link breaks, C marks When link breaks, C marks D as unreachable and D as unreachable and reports that to A and Breports that to A and B
• Suppose A learns it first. A Suppose A learns it first. A now thinks best path to D is now thinks best path to D is through B. A reports a route through B. A reports a route of cost=3 to C.of cost=3 to C.
• C thinks D is reachable C thinks D is reachable through A at cost 4 and through A at cost 4 and reports that to B.reports that to B.
• B reports a cost 5 to A who B reports a cost 5 to A who reports new cost to C.reports new cost to C.
• etc...etc...
![Page 23: 1 Comnet 2010 Communication Networks Recitation 6 Routing](https://reader030.vdocument.in/reader030/viewer/2022032704/56649d415503460f94a1b9d1/html5/thumbnails/23.jpg)
23Comnet 2010
Link State (OSPF)Link State (OSPF)• Link State ProtocolLink State Protocol
– OSPF routing table has detailed OSPF routing table has detailed information about each link : cost, information about each link : cost, reliability, etc.reliability, etc.
– This allows OSPF routers to This allows OSPF routers to optimize routingoptimize routing
Link
![Page 24: 1 Comnet 2010 Communication Networks Recitation 6 Routing](https://reader030.vdocument.in/reader030/viewer/2022032704/56649d415503460f94a1b9d1/html5/thumbnails/24.jpg)
24Comnet 2010
Link State UpdatesLink State Updates
• Routers send to Routers send to all nodesall nodes (not just neighbors) (not just neighbors) information about directly connected links.information about directly connected links.
• Each router calculates shortest cost path to all Each router calculates shortest cost path to all others (Dijkstra).others (Dijkstra).
• At each step of the algorithm, router adds the At each step of the algorithm, router adds the next shortest (i.e. lowest-cost) path to the tree. next shortest (i.e. lowest-cost) path to the tree.
• Finds spanning tree routed on source router.Finds spanning tree routed on source router.
![Page 25: 1 Comnet 2010 Communication Networks Recitation 6 Routing](https://reader030.vdocument.in/reader030/viewer/2022032704/56649d415503460f94a1b9d1/html5/thumbnails/25.jpg)
25Comnet 2010
Djikstra’s algorithm - step 1Djikstra’s algorithm - step 1
0
10
5
2 3
1
9
7
2
4 6
![Page 26: 1 Comnet 2010 Communication Networks Recitation 6 Routing](https://reader030.vdocument.in/reader030/viewer/2022032704/56649d415503460f94a1b9d1/html5/thumbnails/26.jpg)
26Comnet 2010
Djikstra’s algorithm - step 2Djikstra’s algorithm - step 2
0
10
5
10
5
2 3
1
9
7
2
4 6
![Page 27: 1 Comnet 2010 Communication Networks Recitation 6 Routing](https://reader030.vdocument.in/reader030/viewer/2022032704/56649d415503460f94a1b9d1/html5/thumbnails/27.jpg)
27Comnet 2010
Djikstra’s algorithm - step 3Djikstra’s algorithm - step 3
0
8
5
14
7
10
5
2 3
1
9
7
2
4 6
![Page 28: 1 Comnet 2010 Communication Networks Recitation 6 Routing](https://reader030.vdocument.in/reader030/viewer/2022032704/56649d415503460f94a1b9d1/html5/thumbnails/28.jpg)
28Comnet 2010
Djikstra’s algorithm - step 4Djikstra’s algorithm - step 4
0
8
5
13
7
10
5
2 3
1
9
7
2
4 6
![Page 29: 1 Comnet 2010 Communication Networks Recitation 6 Routing](https://reader030.vdocument.in/reader030/viewer/2022032704/56649d415503460f94a1b9d1/html5/thumbnails/29.jpg)
29Comnet 2010
Djikstra’s algorithm - step 5Djikstra’s algorithm - step 5
0
8
5
9
7
10
5
2 3
1
9
7
2
4 6
![Page 30: 1 Comnet 2010 Communication Networks Recitation 6 Routing](https://reader030.vdocument.in/reader030/viewer/2022032704/56649d415503460f94a1b9d1/html5/thumbnails/30.jpg)
30Comnet 2010
Djikstra’s algorithm - finalDjikstra’s algorithm - final
0
8
5
9
7
10
5
2 3
1
9
7
2
4 6