Download presentation
Presentation is loading. Please wait.
1
Communication Networks
Recitation 6 Routing Comnet
2
Routing Problem: find an Optimal Path
5 A R1 R2 R4 R3 R6 R7 R8 B 40 10 20 4 6 15 40 The example network shown on the picture indicates a set of internal connections and the metric value of each connection. Each router selects a first hop for a path to B, based on the total metric of each potential path to B.R1 for example, selects a first hop to R2, on the basis that a path of cost 39 passes through R2 and is the minimum cost from A to B. Comnet 2010
3
Distance Vector (RIP) Each node maintains a table:
(Destination, Cost, NextHop) Each node sends updates to (and receives updates from) its directly connected neighbors periodically (on the order of several seconds) whenever its table changes (called triggered update) Comnet 2010
4
DV Updates Each update is a list of pairs:
(Destination, Cost) Update local table if receive a “better” route smaller cost came from next-hop Refresh existing routes; delete if they time out Convergence rate Comnet 2010
5
RIP Table Processing RIP routing tables managed by application-level process called routed (daemon) Advertisements sent in UDP packets, periodically repeated Comnet 2010
6
Example - initial distances
1 Distance to node B C Info at node A B C D E 7 A 7 ~ ~ 1 A 8 2 B 7 1 ~ 8 C ~ 1 2 ~ 1 2 D ~ ~ 2 2 D E E 1 8 ~ 2 Comnet 2010
7
E receives D’s routes 1 Distance to node B C Info at node A B C D E 7
7 ~ ~ 1 A 8 2 B 7 1 ~ 8 C ~ 1 2 ~ 1 2 D ~ ~ 2 2 D E E 1 8 ~ 2 Comnet 2010
8
E updates cost to C 1 Distance to node B C Info at node A B C D E 7 A
7 ~ ~ 1 A 8 2 B 7 1 ~ 8 C ~ 1 2 ~ 1 2 D ~ ~ 2 2 D E E 1 8 4 2 Comnet 2010
9
A receives B’s routes 1 Distance to node B C Info at node A B C D E 7
7 ~ ~ 1 A 8 2 B 7 1 ~ 8 C ~ 1 2 ~ 1 2 D ~ ~ 2 2 D E E 1 8 4 2 Comnet 2010
10
A updates cost to C 1 Distance to node B C Info at node A B C D E 7 A
7 8 ~ 1 A 8 2 B 7 1 ~ 8 C ~ 1 2 ~ 1 2 D ~ ~ 2 2 D E E 1 8 4 2 Comnet 2010
11
A receives E’s routes 1 Distance to node B C Info at node A B C D E 7
7 8 ~ 1 A 8 2 B 7 1 ~ 8 C ~ 1 2 ~ 1 2 D ~ ~ 2 2 D E E 1 8 4 2 Comnet 2010
12
A updates cost to C and D 1 Distance to node B C Info at node A B C D
7 A 7 5 3 1 A 8 2 B 7 1 ~ 8 C ~ 1 2 ~ 1 2 D ~ ~ 2 2 D E E 1 8 4 2 Comnet 2010
13
Final distances 1 Distance to node B C Info at node A B C D E 7 A 6 5
6 5 3 1 A 8 2 B 6 1 3 5 C 5 1 2 4 1 2 D 3 3 2 2 D E E 1 5 4 2 Comnet 2010
14
Final distances after link failure
1 Distance to node B C Info at node A B C D E 7 A 7 8 10 1 A 8 2 B 7 1 3 8 C 8 1 2 9 1 2 D 10 3 2 11 D E E 1 8 9 11 Comnet 2010
15
View from a node E’s routing table 1 Next hop B C dest A B D 7 A 1 14
5 B A 8 2 7 8 5 C 6 9 4 D 4 11 2 1 2 D E Comnet
16
Some of the data in the table is based on loops!
E’s routing table 1 Next hop B C dest A B D 7 A 1 14 5 B A 8 2 7 8 5 C 6 9 4 D 4 11 2 1 2 D E E to A through D? Shortest path: E D E A. Cost: 5
17
And the loops might not be that simple…
E’s routing table 1 Next hop B C dest A B D 7 A 1 14 5 B A 8 2 7 8 5 C 6 9 4 D 4 11 2 1 2 D E E to A through B? Shortest path: E B C D E A. Cost: 14
18
All the loops in the table
E’s routing table 1 Next hop B C dest A B D 7 A 1 14 5 B A 8 2 7 8 5 C 6 9 4 D 4 11 2 1 2 D E
19
Distance Vector: 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) we show distance to X only X Z 1 4 50 Y The problematic entry report 1 report 2 Chapter 5: Network Layer: Routing
20
Distance Vector: 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) we show distance to X only X Z 1 4 50 Y algorithm terminates “good news travels fast” report 1 report 2 Chapter 5: Network Layer: Routing
21
Distance Vector: link cost changes
good news travels fast bad news travels slow - “count to infinity” problem! we show distance to X only X Z 1 4 50 Y 60 Y Y Y algorithm continues on! report 6 report 7 Chapter 5: Network Layer: Routing
22
Distance Vector: poisoned reverse
If Z routes through Y to get to X (= Z learned its best dist. to X from Y): 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 Z 1 4 50 Y 60 algorithm terminates Y Y Y Y Chapter 5: Network Layer: Routing
23
The bouncing effect dest cost dest cost 1 A 1 B A B 1 C 1 C 2 25 1 C
Comnet 2010
24
C sends routes to B dest cost dest cost A ~ B A B 1 C 1 C 2 25 1 C
Comnet 2010
25
B updates distance to A dest cost dest cost A 3 B A B 1 C 1 C 2 25 1 C
Comnet 2010
26
B sends routes to C dest cost dest cost A 3 B A B 1 C 1 C 2 25 1 C
4 B 1 Comnet 2010
27
How are these 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! Comnet 2010
28
Solutions Split horizon/Poisoned reverse Works for two node loops
B does not advertise route to C or advertises it with infinite distance (16) Works for two node loops does not work for loops with more nodes Comnet 2010
29
Example where Split Horizon fails
When link breaks, C marks D as unreachable and reports that to A and B Suppose A learns it first. A now thinks best path to D is through B. A reports a route of cost=3 to C. C thinks D is reachable through A at cost 4 and reports that to B. B reports a cost 5 to A who reports new cost to C. etc... 1 A B C D Comnet 2010
30
Link State (OSPF) Link State Protocol
OSPF routing table has detailed information about each link : cost, reliability, etc. This allows OSPF routers to optimize routing Link Comnet 2010
31
Link State Updates Routers send to all nodes (not just neighbors) information about directly connected links. Each router calculates shortest cost path to all others (Dijkstra). At each step of the algorithm, router adds the next shortest (i.e. lowest-cost) path to the tree. Finds spanning tree routed on source router. Comnet 2010
32
Djikstra’s algorithm - step 1
10 3 2 9 6 4 5 7 2 Comnet 2010
33
Djikstra’s algorithm - step 2
1 10 10 3 2 9 6 4 5 7 5 2 Comnet 2010
34
Djikstra’s algorithm - step 3
1 14 8 10 3 2 9 6 4 5 7 5 2 7 Comnet 2010
35
Djikstra’s algorithm - step 4
1 13 8 10 3 2 9 6 4 5 7 5 2 7 Comnet 2010
36
Djikstra’s algorithm - step 5
1 9 8 10 3 2 9 6 4 5 7 5 2 7 Comnet 2010
37
Djikstra’s algorithm - final
1 9 8 10 3 2 9 6 4 5 7 5 2 7 Comnet 2010
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.