Download
routing protocol review n.
Skip this Video
Loading SlideShow in 5 Seconds..
Routing Protocol Review PowerPoint Presentation
Download Presentation
Routing Protocol Review

Routing Protocol Review

112 Vues Download Presentation
Télécharger la présentation

Routing Protocol Review

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

  1. Routing Protocol Review (some slides borrowed from Eugene Ng @ Rice Univ.)

  2. AS 101 AS 4554 AS 9 Internet AS 73 AS 3999 AS 5050 Internet Routing

  3. Routing Protocol Review Part 1: Intra-domain routing

  4. Intra-domain Routing Protocols • Two intra-domain routing protocols • Both try to achieve the “shortest path” forwarding • Quite commonly used • OSPF: Based on Link-State routing algorithm • RIP: Based on Distance-Vector routing algorithm • In Project 2, you implemented and played around with OSPF!

  5. 5 3 5 2 2 1 3 1 2 1 C D A E B F Link State Routing (OSPF): Flooding • Each node knows its connectivity and cost to a direct neighbor • Every node tells every other node this local connectivity/cost information • Via flooding • In the end, every node learns the complete topology of the network • E.g. A floods message A connected to B cost 2 A connected to D cost 1 A connected to C cost 5

  6. Flooding Details • Each node periodically generates Link State Packet (LSP) contains • ID of node created LSP • List of direct neighbors and costs • Sequence number (64 bit, assume to never wrap around) • Time to live • Flood is reliable • Use acknowledgement and retransmission • Sequence number used to identify *newer* LSP • An older LSP is discarded • What if a router crash and sequence number reset to 0? • Receiving node flood LSP to all its neighbors except the neighbor where the LSP came from • LSP is also generated when a link’s state changes (failed or restored)

  7. Link State Flooding Example 5 7 4 8 6 11 2 10 3 1 13 12

  8. Link State Flooding Example 5 7 4 8 6 11 2 10 3 1 13 12

  9. Link State Flooding Example 5 7 4 8 6 11 2 10 3 1 13 12

  10. Link State Flooding Example 5 7 4 8 6 11 2 10 3 1 13 12

  11. Dijkstra’s algorithm Net topology, link costs known to all nodes Accomplished via “link state flooding” All nodes have same info Compute least cost paths from one node (‘source”) to all other nodes Repeat for all sources Notations c(i,j): link cost from node i to j; cost infinite if not direct neighbors D(v): current value of cost of path from source to node v p(v): predecessor node along path from source to v, that is next to v S: set of nodes whose least cost path definitively known A Link State Routing Algorithm

  12. Dijsktra’s Algorithm (A “Greedy” Algorithm) 1 Initialization: 2 S = {A}; 3 for all nodes v 4 if v adjacent to A 5 then D(v) = c(A,v); 6 else D(v) = ; 7 8 Loop 9 find w not in S such that D(w) is a minimum; 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) ); // new cost to v is either old cost to v or known // shortest path cost to w plus cost from w to v 13 until all nodes in S;

  13. C D E A B F Example: Dijkstra’s Algorithm D(B),p(B) 2,A D(D),p(D) 1,A D(C),p(C) 5,A D(E),p(E) Step 0 1 2 3 4 5 start S A D(F),p(F) 1 Initialization: 2 S = {A}; 3 for all nodes v 4 if v adjacent to A 5 then D(v) = c(A,v); 6 else D(v) = ; … 5 3 5 2 2 1 3 1 2 1

  14. C D E A B F Example: Dijkstra’s Algorithm D(B),p(B) 2,A D(D),p(D) 1,A D(C),p(C) 5,A 4,D D(E),p(E) 2,D Step 0 1 2 3 4 5 start S A AD D(F),p(F) • … • 8 Loop • 9 find w not in S s.t. D(w) is a minimum; • 10 add w to S; • 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; 5 3 5 2 2 1 3 1 2 1

  15. C D E A B F Example: Dijkstra’s Algorithm D(B),p(B) 2,A D(D),p(D) 1,A D(C),p(C) 5,A 4,D 3,E D(E),p(E) 2,D Step 0 1 2 3 4 5 start S A AD ADE D(F),p(F) 4,E • … • 8 Loop • 9 find w not in S s.t. D(w) is a minimum; • 10 add w to S; • 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; 5 3 5 2 2 1 3 1 2 1

  16. C D E A B F Example: Dijkstra’s Algorithm D(B),p(B) 2,A D(D),p(D) 1,A D(C),p(C) 5,A 4,D 3,E D(E),p(E) 2,D Step 0 1 2 3 4 5 start S A AD ADE ADEB D(F),p(F) 4,E • … • 8 Loop • 9 find w not in S s.t. D(w) is a minimum; • 10 add w to S; • 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; 5 3 5 2 2 1 3 1 2 1

  17. C D E A B F Example: Dijkstra’s Algorithm D(B),p(B) 2,A D(D),p(D) 1,A D(C),p(C) 5,A 4,D 3,E D(E),p(E) 2,D Step 0 1 2 3 4 5 start S A AD ADE ADEB ADEBC D(F),p(F) 4,E • … • 8 Loop • 9 find w not in S s.t. D(w) is a minimum; • 10 add w to S; • 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; 5 3 5 2 2 1 3 1 2 1

  18. C D E A B F Example: Dijkstra’s Algorithm D(B),p(B) 2,A D(D),p(D) 1,A D(C),p(C) 5,A 4,D 3,E D(E),p(E) 2,D Step 0 1 2 3 4 5 start S A AD ADE ADEB ADEBC ADEBCF D(F),p(F) 4,E • … • 8 Loop • 9 find w not in S s.t. D(w) is a minimum; • 10 add w to S; • 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; 5 3 5 2 2 1 3 1 2 1

  19. Distance Vector Routing (RIP) • What is a distance vector? • Current best known cost to get to a destination • Idea: Exchange distance vectors among neighbors to learn about lowest cost paths Node C Note no vector entry for C itself At the beginning, distance vector only has information about directly attached neighbors, all other dests have cost  Eventually the vector is filled

  20. Distance Vector Routing Algorithm • Iterative: continues until no nodes exchange info • Asynchronous: nodes need not exchange info/iterate in lock steps • Distributed: each node communicates only with directly-attached neighbors • Each router maintains • Row for each possible destination • Column for each directly-attached neighbor to node • Entry in row Y and column Z of node X  best known distance from X to Y, via Z as next hop • Note: for simplicity in this lecture examples we show only the shortest distances to each destination

  21. wait for (change in local link cost or msg from neighbor) recompute distance table if least cost path to any dest has changed, notify neighbors Distance Vector Routing • Each local iteration caused by: • Local link cost change • Message from neighbor: its least cost path change from neighbor to destination • Each node notifies neighbors only when its least cost path to any destination changes • Neighbors then notify their neighbors if necessary Each node:

  22. Distance Vector Algorithm (cont’d) • 1 Initialization: • 2 for all neighbors V do • 3 ifV adjacent to A • 4 D(A, V) = c(A,V); • 5 else • D(A, V) = ∞; • loop: • 8 wait (until A sees a link cost change to neighbor V • 9 or until A receives update from neighbor V) • 10 if (D(A,V) changes by d) • 11 for all destinations Y through Vdo • 12 D(A,Y) = D(A,Y) + d • 13 else if (update D(V, Y) received from V) • /* shortest path from V to some Y has changed */ • 14 D(A,Y) = D(A,V) + D(V, Y); • 15 if (there is a new minimum for destination Y) • 16 send D(A, Y) to all neighbors • 17 forever

  23. C D B A Example: Distance Vector Algorithm Node A Node B 3 2 1 1 7 Node C Node D • 1 Initialization: • 2 for all neighbors V do • 3 ifV adjacent to A • 4 D(A, V) = c(A,V); • else • D(A, V) = ∞; • …

  24. D C B A Example: 1st Iteration (C  A) Node A Node B 3 2 1 1 7 • loop: • … • 13 else if (update D(V, Y) received from V) • 14 D(A,Y) = D(A,V) + D(V, Y); • 15 if (there is a new min. for destination Y) • 16 send D(A, Y) to all neighbors • 17 forever D(A, D) = D(A, C) + D(C,D) = 7 + 1 = 8 (D(C,A), D(C,B), D(C,D)) Node C Node D

  25. D C B A Example: 1st Iteration (BA, CA) Node A Node B 3 2 1 1 7 D(A,D) = D(A,B) + D(B,D) = 2 + 3 = 5 D(A,C) = D(A,B) + D(B,C) = 2 + 1 = 3 Node C Node D • loop: • … • 13 else if (update D(V, Y) received from V) • 14 D(A,Y) = min(D(A,V), D(A,V) + D(V, Y)) • 15 if (there is a new min. for destination Y) • 16 send D(A, Y) to all neighbors • 17 forever

  26. C D B A Example: End of 1st Iteration Node A Node B 3 2 1 1 7 • loop: • … • 13 else if (update D(V, Y) received from V) • 14 D(A,Y) = D(A,V) + D(V, Y); • 15 if (there is a new min. for destination Y) • 16 send D(A, Y) to all neighbors • 17 forever Node C Node D

  27. C D B A Example: End of 2nd Iteration Node A Node B 3 2 1 1 7 • loop: • … • 13 else if (update D(V, Y) received from V) • 14 D(A,Y) = D(A,V) + D(V, Y); • 15 if (there is a new min. for destination Y) • 16 send D(A, Y) to all neighbors • 17 forever Node C Node D

  28. C D B A Nothing changes  algorithm terminates Example: End of 3rd Iteration Node A Node B 3 2 1 1 7 • loop: • … • 13 else if (update D(V, Y) received from V) • 14 D(A,Y) = D(A,V) + D(V, Y); • 15 if (there is a new min. for destination Y) • 16 send D(A, Y) to all neighbors • 17 forever Node C Node D

  29. 1 4 1 50 C A B Distance Vector: Link Cost Changes 7 loop: 8 wait (until A sees a link cost change to neighbor V 9 or until A receives update from neighbor V) 10 if (D(A,V) changes by d) 11 for all destinations Y through Vdo 12 D(A,Y) = D(A,Y) + d 13 else if (update D(V, Y) received from V) 14 D(A,Y) = D(A,V) + D(V, Y); 15 if (there is a new minimum for destination Y) 16 send D(A, Y) to all neighbors 17 forever Node B “good news travels fast” Node C time Link cost changes here Algorithm terminates

  30. 60 4 1 50 C A B Distance Vector: Count to Infinity Problem 7 loop: 8 wait (until A sees a link cost change to neighbor V 9 or until A receives update from neighbor V) 10 if (D(A,V) changes by d) 11 for all destinations Y through Vdo 12 D(A,Y) = D(A,Y) + d ; 13 else if (update D(V, Y) received from V) 14 D(A,Y) = D(A,V) + D(V, Y); 15 if (there is a new minimum for destination Y) 16 send D(A, Y) to all neighbors 17 forever Node B “bad news travels slowly” Node C … time Link cost changes here; recall that B also maintains shortest distance to A through C, which is 6. Thus D(B, A) becomes 6 !

  31. 60 4 1 50 C A B Distance Vector: Poisoned Reverse • If C routes through B to get to A: • C tells B its (C’s) distance to A is infinite (so B won’t route to A via C) Node B Node C time Link cost changes here; B updates D(B, A) = 60 as C has advertised D(C, A) = ∞ Algorithm terminates

  32. Intra-domain Routing Protocols • Based on unreliable datagram delivery • Distance vector • Routing Information Protocol (RIP), based on Bellman-Ford algorithm • Each neighbor periodically exchange reachability information to its neighbors • Minimal communication overhead, but it takes long to converge, i.e., in proportion to the maximum path length • Link state • Open Shortest Path First (OSPF), based on Dijkstra’s algorithm • Each router periodically floods immediate reachability information to other routers • Fast convergence, but high communication and computation overhead

  33. Routing Protocol Review Part 2: Inter-domain routing

  34. Internet Structure Interior router BGP router AS-1 AS-3 AS-2

  35. Intra-Domain Interior router BGP router AS-1 AS-3 AS-2 Intra-domain routing protocol aka Interior Gateway Protocol (IGP), e.g. OSPF, RIP

  36. Inter-Domain Interior router BGP router AS-1 AS-3 AS-2 Inter-domain routing protocol aka Exterior Gateway Protocol (EGP), e.g. BGP

  37. BGP: Path Vector Protocol • Distance vector algorithm with extra information • For each route, store the complete path (ASs) • No extra computation, just extra storage • Advantages: • can make policy choices based on set of ASs in path • can easily avoid loops

  38. BGP Operations (Simplified) Establish session on TCP port 179 AS1 BGP session Exchange all active routes AS2 While connection is ALIVE exchange route UPDATE messages Exchange incremental updates

  39. Four Types of BGP Messages • Open : Establish a peering session. • Keep Alive : Handshake at regular intervals. • Notification : Shuts down a peering session. • Update : Announcing new routes or withdrawing previously announced routes. Announcement = prefix + attributes values

  40. Attributes are Used to Select Best Routes 192.0.2.0/24 pick me! 192.0.2.0/24 pick me! 192.0.2.0/24 pick me! Given multiple routes to the same prefix, a BGP speaker must pick at most one best route (Note: it could reject them all!) 192.0.2.0/24 pick me!

  41. AS73 AS701 AS7018 AS1239 AS9 Example: Multiple AS Paths 128.2/16 128.2/16 9 701 128.2/16 9 7018 1239

  42. Routing Protocol Review Part 3: Multicast Routing

  43. Example Uses of Multicast • Internet TV radio • Stock price update • Video conference • Spam?!

  44. Backbone ISP This approach does not scale… Broadcast Center

  45. Backbone ISP Use routers in distribution tree Copy data at routers At most one copy of a data packet per link Broadcast Center Routers compute trees and forward packets along them LANs implement link layer multicast by broadcasting

  46. R1 joins G [G, data] [G, data] [G, data] R0 joins G [G, data] Rn-1 joins G Multicast Service Model • Receivers join a multicast group which is identified by a multicast address (e.g. G) • Sender(s) send data to address G • Network routes data to each of the receivers R0 R1 S Net . . . Rn-1

  47. Supporting Multicast on the Internet At which layer should multicast be implemented? Application ? ? IP Network Internet architecture

  48. IP Multicast • Highly efficient • Good delay MIT Berkeley UCSD CMU routers end systems multicast flow

  49. Failure of IP Multicast • Not widely deployed even after 15 years! • Use carefully – e.g., on LAN or campus, rarely over WAN • Various failings • Scalability of routing protocols • Hard to manage • Hard to implement TCP equivalent • Hard to get applications to use IP Multicast without existing wide deployment • Hard to get router vendors to support functionality and hard to get ISPs to configure routers to enable

  50. Berkeley MIT1 Overlay Tree MIT2 UCSD CMU1 CMU2 End System Multicast MIT1 MIT Berkeley MIT2 UCSD CMU1 CMU CMU2