ip routing intradomain
play

IP Routing: Intradomain CS/ECE 438: Spring 2014 Instructor: Matthew - PowerPoint PPT Presentation

IP Routing: Intradomain CS/ECE 438: Spring 2014 Instructor: Matthew Caesar http://courses.engr.illinois.edu/cs438/ Today Application Transport Network Link Layer Physical Starting on the internals of the network layer Many pieces to the


  1. IP Routing: Intradomain CS/ECE 438: Spring 2014 Instructor: Matthew Caesar http://courses.engr.illinois.edu/cs438/

  2. Today Application Transport Network Link Layer Physical Starting on the internals of the network layer

  3. Many pieces to the network layer • Addressing • Routing • Forwarding • Policy and management • IP protocol details • … Today + next 1-2 lectures: Routing

  4. Context and Terminology “Autonomous System (AS) ” or “Domain” Region of a network under a single administrative entity “End hosts” “Clients”, “Users” “End points” “Border Routers” “Route” or “Path” “Interior Routers”

  5. Lecture#2: Routers Forward Packets UCB to MIT switch#4 switch#2 Forwarding Table 111010010 MIT Destination Next Hop UCB 4 UW 5 MIT 2 NYU 3 switch#5 to UW to NYU switch#3

  6. Context and Terminology Destination Destination Destination M I 111010010 Destination T Destination Destination Destination Destination MIT Internet routing protocols are responsible for constructing and updating the forwarding tables at routers

  7. How can routers find paths? Robert’s local .com authoritative DNS server DNS sever Robert Routing Table at B Prefix IF Hops 4.0.0.0/8 D 1 10.1.8.7 IP address 23.2.0.1 A 4.9.0.1 10.1.0.0/16 B 23.2.0.0/24 4.18.5.1 Prefix D C 4.0.0.0/8 10.1.0.1 81.2.0.0/24 Routing Table at A twitter.com Prefix IF Hops 81.2.0.1 4.5.16.2 4.0.0.0/8 B 2 Routing Table at C Prefix IF Hops 4.0.0.0/8 D 1 Twitter’s authoritative • Hosts assigned topology-dependent addresses DNS server • Routers advertise address blocks (“prefixes”) • Routers compute “shortest” paths to prefixes • Map IP addresses to names with DNS

  8. Routing Protocols • Routing protocols implement the core function of a network • Establish paths between nodes • Part of the network’s “ control plane ” 5 • Network modeled as a graph 3 B C 5 • Routers are graph vertices 2 A • Links are edges 2 1 F 3 1 • Edges have an associated “cost” 2 D E 1 • e.g., distance, loss • Goal: compute a “good” path from source to destination • “good” usually means the shortest (least cost) path

  9. Internet Routing • Internet Routing works at two levels • Each AS runs an intra-domain routing protocol that establishes routes within its domain • (AS -- region of network under a single administrative entity) • Link State, e.g., Open Shortest Path First (OSPF) • Distance Vector, e.g., Routing Information Protocol (RIP) • ASes participate in an inter-domain routing protocol that establishes routes between domains • Path Vector, e.g., Border Gateway Protocol (BGP)

  10. Intra- vs. Inter-domain routing dest Sprint source AT&T BGP session • Run “Interior Gateway Protocol” (IGP) within ISPs • OSPF, IS-IS, RIP • Use “Border Gateway Protocol” (BGP) to connect ISPs • To reduce costs, peer at exchange points (AMS-IX, MAE-EAST)

  11. Addressing (for now) • Assume each host has a unique ID (address) • No particular structure to those IDs • Later in course will talk about real IP addressing

  12. Outline • Link State • Distance Vector • Routing: goals and metrics (if time)

  13. Link-State Routing

  14. Link state: update propagation Each node maintains a “topology database” F tells all routers: there is a link between F and E [D,E] [C,A] [D,F] [C,E] [B,D] [C,B] [E,F] [A,B] [D,E] [C,A] [E,F] [D,F] [A,B] [C,B] [B,D] [C,E] B D [D,E] [C,A] [A,B] [D,F] [C,B] [E,F] [C,E] [B,D] [C,A] [D,E] [C,E] [B,D] [D,F] [A,B] [E,F] [C,B] [C,A] [D,E] [C,E] [C,B] [A,B] [B,D] [D,F] [E,F] [D,E] [C,A] [C,B] [E,F] [A,B] [D,F] [C,E] [B,D] [C,A] [D,E] [C,B] [D,F] [C,E] [A,B] [B,D] [E,F] A F [C,A] [D,E] [B,D] [C,E] [A,B] [C,B] [E,F] [D,F] [C,A] [D,E] [B,D] [C,E] [A,B] [C,B] C E [D,F] [E,F] [D,E] [C,A] [B,D] [A,B] [C,B] [C,E] [D,F] [E,F] • How to prevent update loops: (seq numbers) • How to bring up new node: (load TDB from neighbor)

  15. Link state: route computation B D A F C E • Each router computes shortest path tree, rooted at that router • Determines next-hop to each dest, publish to forwarding table • Operators can assign link costs to control path selection

  16. Link-state: packet forwarding B D A F IP packet source destination C E • In practice: shortest path precomputed, next-hops stored in forwarding table • Downsides of link-state: – Lesser control on policy (certain routes can’t be filtered), more cpu – Increased visibility (bad for privacy, but good for diagnostics)

  17. Link State Routing • Each node maintains its local “link state” (LS) • i.e., a list of its directly attached links and their costs (N1,N2) (N1,N4) Host C (N1,N5) Host D Host A N2 N1 N3 N5 Host B N4 Host E N6 N7

  18. Link State Routing • Each node maintains its local “link state” (LS) • Each node floods its local link state • on receiving a new LS message, a router forwards the message to all its neighbors other than the one it received the message from Host C Host D Host A (N1,N2) (N1, N4) (N1, N5) (N1,N2) (N1, N4) (N1, N5) N2 N1 (N1,N2) (N1, N4) (N1, N5) N3 (N1,N2) (N1, N4) (N1, N5) N5 (N1,N2) (N1,N2) (N1, N4) (N1, N4) (N1,N2) (N1, N5) (N1, N5) (N1, N4) (N1,N2) (N1, N5) (N1, N4) (N1, N5) Host B N4 Host E (N1,N2) (N1, N4) N6 N7 (N1,N2) (N1, N5) (N1, N4) (N1, N5)

  19. Link State Routing • Each node maintains its local “link state” (LS) • Each node floods its local link state • Hence, each node learns the entire network topology • Can use Dijkstra’s to compute the shortest paths between nodes C Host C C A D A D Host D Host A B E B E N2 N1 C C A D A D N3 C B A E D N5 B C E A D Host B B E N4 Host E C B E A D N6 N7 B E

  20. Dijkstra’ s Shortest Path Algorithm • INPUT: • Network topology (graph), with link costs • OUTPUT: • Least cost paths from one node to all other nodes • Iterative: after k iterations, a node knows the least cost path to its k closest neighbors

  21. Example 5 3 B C 2 5 A 2 1 F 3 1 2 D E 1

  22. Notation • c(i,j): link cost from node i to j ; cost is infinite if not direct neighbors; ≥ 0 5 • D(v): total cost of the 3 current least cost path from B C 5 2 source to destination v A 2 1 F 3 1 • p(v): v ’s predecessor along 2 D E 1 path from source to v • S: set of nodes whose least Source cost path definitively known

  23. Dijkstra ’ s Algorithm • c(i,j): link cost from node i to j 1 Initialization: D(v): current cost source  v • 2 S = { A }; • p(v): v ’s predecessor along path 3 for all nodes v from source to v 4 if v adjacent to A • 5 then D(v) = c(A,v); S: set of nodes whose least cost ¥ path definitively known 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 if D(w) + c(w,v) < D(v) then // w gives us a shorter path to v than we’ ve found so far 13 D(v) = D(w) + c(w,v); p(v) = w; 14 until all nodes in S;

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

  25. Example: Dijkstra ’ s Algorithm Step D(B),p(B) D(C),p(C) D(D),p(D) D(E),p(E) set S D(F),p(F) ¥ ¥ 0 2,A 5,A 1,A A 1 2 3 4 5 … 5 8 Loop 9 find w not in S s.t. D(w) is a minimum; 3 B C 10 add w to S ; 5 2 11 update D(v) for all v adjacent A 2 1 F to w and not in S : 3 1 12 If D(w) + c(w,v) < D(v) then 2 D E 13 D(v) = D(w) + c(w,v); p(v) = w; 1 14 until all nodes in S;

  26. Example: Dijkstra ’ s Algorithm Step D(B),p(B) D(C),p(C) D(D),p(D) D(E),p(E) set S D(F),p(F) ¥ ¥ 0 2,A 5,A 1,A A 1 AD 2 3 4 5 … 5 8 Loop 9 find w not in S s.t. D(w) is a minimum; 3 B C 10 add w to S ; 5 2 11 update D(v) for all v adjacent A 2 1 F to w and not in S : 3 1 12 If D(w) + c(w,v) < D(v) then 2 D E 13 D(v) = D(w) + c(w,v); p(v) = w; 1 14 until all nodes in S;

  27. Example: Dijkstra ’ s Algorithm Step D(B),p(B) D(C),p(C) D(D),p(D) D(E),p(E) set S D(F),p(F) ¥ ¥ 0 2,A 5,A 1,A A 1 4,D 2,D AD 2 3 4 5 … 5 8 Loop 9 find w not in S s.t. D(w) is a minimum; 3 B C 10 add w to S ; 5 2 11 update D(v) for all v adjacent A 2 1 F to w and not in S : 3 1 12 If D(w) + c(w,v) < D(v) then 2 D E 13 D(v) = D(w) + c(w,v); p(v) = w; 1 14 until all nodes in S;

  28. Example: Dijkstra ’ s Algorithm Step D(B),p(B) D(C),p(C) D(D),p(D) D(E),p(E) set S D(F),p(F) ¥ ¥ 0 2,A 5,A 1,A A 1 4,D 2,D AD 2 3,E ADE 4,E 3 4 5 … 5 8 Loop 9 find w not in S s.t. D(w) is a minimum; 3 B C 10 add w to S ; 5 2 11 update D(v) for all v adjacent A 2 1 F to w and not in S : 3 1 12 If D(w) + c(w,v) < D(v) then 2 D E 13 D(v) = D(w) + c(w,v); p(v) = w; 1 14 until all nodes in S;

Recommend


More recommend