Communication Networks Recitation 6 Routing Comnet 2010 1

  • Slides: 30
Download presentation
Communication Networks Recitation 6 Routing Comnet 2010 1

Communication Networks Recitation 6 Routing Comnet 2010 1

Routing Problem: find an Optimal Path R 1 R 4 5 R 7 40

Routing Problem: find an Optimal Path R 1 R 4 5 R 7 40 5 40 10 R 6 6 R 2 A B 15 10 20 R 8 10 4 R 3 5 5 10 R 5 Comnet 2010 2

Distance Vector (RIP) • Each node maintains a table: • (Destination, Cost, Next. Hop)

Distance Vector (RIP) • Each node maintains a table: • (Destination, Cost, Next. Hop) • 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 3

DV Updates • Each update is a list of pairs: • (Destination, Cost) •

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 4

RIP Table Processing • RIP routing tables managed by applicationlevel process called routed (daemon)

RIP Table Processing • RIP routing tables managed by applicationlevel process called routed (daemon) • Advertisements sent in UDP packets, periodically repeated Comnet 2010 5

Example - initial distances 1 B C Info at node 7 8 A 1

Example - initial distances 1 B C Info at node 7 8 A 1 E 2 2 D Comnet 2010 Distance to node A B C D E 0 7 ~ ~ 1 C 7 ~ 0 1 1 0 ~ 2 8 ~ D ~ ~ 2 0 2 E 1 8 ~ 2 0 A B 6

E receives D’s routes 1 B C Info at node 7 8 A 1

E receives D’s routes 1 B C Info at node 7 8 A 1 E 2 2 D Comnet 2010 Distance to node A B C D E 0 7 ~ ~ 1 C 7 ~ 0 1 1 0 ~ 2 8 ~ D ~ ~ 2 0 2 E 1 8 ~ 2 0 A B 7

E updates cost to C 1 B C Info at node 7 8 A

E updates cost to C 1 B C Info at node 7 8 A 1 E 2 2 D Comnet 2010 Distance to node A B C D E 0 7 ~ ~ 1 C 7 ~ 0 1 1 0 ~ 2 8 ~ D ~ ~ 2 0 2 E 1 8 4 2 0 A B 8

A receives B’s routes 1 B C Info at node 7 8 A 1

A receives B’s routes 1 B C Info at node 7 8 A 1 E 2 2 D Comnet 2010 Distance to node A B C D E 0 7 ~ ~ 1 C 7 ~ 0 1 1 0 ~ 2 8 ~ D ~ ~ 2 0 2 E 1 8 4 2 0 A B 9

A updates cost to C 1 B C Info at node 7 8 A

A updates cost to C 1 B C Info at node 7 8 A 1 E 2 2 D Comnet 2010 Distance to node A B C D E 0 7 8 ~ 1 C 7 ~ 0 1 1 0 ~ 2 8 ~ D ~ ~ 2 0 2 E 1 8 4 2 0 A B 10

A receives E’s routes 1 B C Info at node 7 8 A 1

A receives E’s routes 1 B C Info at node 7 8 A 1 E 2 2 D Comnet 2010 Distance to node A B C D E 0 7 8 ~ 1 C 7 ~ 0 1 1 0 ~ 2 8 ~ D ~ ~ 2 0 2 E 1 8 4 2 0 A B 11

A updates cost to C and D 1 B C Info at node 7

A updates cost to C and D 1 B C Info at node 7 8 A 1 E 2 2 D Comnet 2010 Distance to node A B C D E 0 7 5 3 1 C 7 ~ 0 1 1 0 ~ 2 8 ~ D ~ ~ 2 0 2 E 1 8 4 2 0 A B 12

Final distances 1 B C Info at node 7 8 A 1 E 2

Final distances 1 B C Info at node 7 8 A 1 E 2 2 D Comnet 2010 Distance to node A B C D E 0 6 5 3 1 C 6 5 0 1 1 0 3 2 5 4 D 3 3 2 0 2 E 1 5 4 2 0 A B 13

Final distances after link failure 1 B C Info at node 7 8 A

Final distances after link failure 1 B C Info at node 7 8 A 1 E 2 2 D Comnet 2010 Distance to node A B C D E A B 0 7 8 10 1 7 0 1 3 8 C 8 1 0 2 9 D 10 3 2 0 11 E 1 9 11 0 8 14

View from a node 1 B E’s routing table Next hop C 7 8

View from a node 1 B E’s routing table Next hop C 7 8 A 1 E 2 2 D Comnet 2010 dest A B D A B 1 14 5 C 7 6 8 9 5 4 D 4 11 2 15

The bouncing effect dest cost B C 1 2 dest cost 1 A B

The bouncing effect dest cost B C 1 2 dest cost 1 A B A C 1 1 1 25 C Comnet 2010 dest cost A B 2 1 16

C sends routes to B dest cost B C 1 2 A B A

C sends routes to B dest cost B C 1 2 A B A C ~ 1 1 25 C Comnet 2010 dest cost A B 2 1 17

B updates distance to A dest cost B C 1 2 A B A

B updates distance to A dest cost B C 1 2 A B A C 3 1 1 25 C Comnet 2010 dest cost A B 2 1 18

B sends routes to C dest cost B C 1 2 A B A

B sends routes to C dest cost B C 1 2 A B A C 3 1 1 25 C Comnet 2010 dest cost A B 4 1 19

How are these loops caused? • Observation 1: – B’s metric increases • Observation

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 20

Solutions • Split horizon/Poisoned reverse – B does not advertise route to C or

Solutions • Split horizon/Poisoned reverse – 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 21

Example where Split Horizon fails A B 1 1 1 C D 1 •

Example where Split Horizon fails A B 1 1 1 C D 1 • 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. . . Comnet 2010 22

Link State (OSPF) • Link State Protocol – OSPF routing table has detailed information

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 23

Link State Updates • Routers send to all nodes (not just neighbors) • •

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 24

Djikstra’s algorithm - step 1 1 10 2 0 3 9 5 4 6

Djikstra’s algorithm - step 1 1 10 2 0 3 9 5 4 6 7 2 Comnet 2010 25

Djikstra’s algorithm - step 2 10 10 3 2 0 1 9 5 4

Djikstra’s algorithm - step 2 10 10 3 2 0 1 9 5 4 6 7 5 2 Comnet 2010 26

Djikstra’s algorithm - step 3 8 10 3 2 0 1 14 9 5

Djikstra’s algorithm - step 3 8 10 3 2 0 1 14 9 5 6 4 7 5 2 Comnet 2010 7 27

Djikstra’s algorithm - step 4 8 10 3 2 0 1 13 9 5

Djikstra’s algorithm - step 4 8 10 3 2 0 1 13 9 5 6 4 7 5 2 Comnet 2010 7 28

Djikstra’s algorithm - step 5 8 10 3 2 0 1 9 9 5

Djikstra’s algorithm - step 5 8 10 3 2 0 1 9 9 5 6 4 7 5 2 Comnet 2010 7 29

Djikstra’s algorithm - final 8 10 3 2 0 1 9 9 5 6

Djikstra’s algorithm - final 8 10 3 2 0 1 9 9 5 6 4 7 5 2 Comnet 2010 7 30