Network Technologies essentials Week 5: Routing Compilation made by Tim Moors, UNSW Australia Original slides by David Wetherall, University of Washington ISBN-10: © 2014 For the book A. Tanenbaum and D. Wetherall: Computer Networks, 5 th ed, Prentice-Hall, 2011A. Tanenbaum and D. Wetherall: Computer Networks, 5 th ed, Prentice-Hall, 2011 Tim added green graffiti
Computer Networks2 Shortest Paths (4) Optimality property: – Subpaths of shortest paths are also shortest paths ABCE is a shortest path So are ABC, AB, BCE, BC, CE AB C D E F G H
Computer Networks3 Dijkstra’s Algorithm Algorithm : Mark all nodes tentative, set distances from source to 0 (zero) for source, and ∞ (infinity) for all other nodes While tentative nodes remain: – Extract N, a node with lowest distance – Add link to N to the shortest path tree – Relax the distances of neighbors of N by lowering any better distance estimates 5-3.4
Dijkstra’s Algorithm (2) Initialization Computer Networks4 AB C D E F G H ∞ ∞ ∞ ∞ ∞ ∞ We’ll compute shortest paths from A ∞ 5-3.5
Computer Networks5 Distance Vector Algorithm Each node maintains a vector of distances (and next hops) to all destinations 1.Initialize vector with 0 (zero) cost to self, ∞ (infinity) to other destinations 2.Periodically send vector to neighbors 3.Update vector for each destination by selecting the shortest distance heard, after adding cost of neighbor link – Use the best neighbor for forwarding 5-4.5
DV Example (4) Second exchange for all nodes to find best 2-hop routes Computer Networks6 A learns Cost Next 0-- 3B 9D 6B To A says B says C says D says A03∞7 B3063 C∞602 D7320 = learned better route B C D A B learns Cost Next 3A 0-- 5D 3D C learns Cost Next 9B 5D 0-- 2D D learns Cost Next 6B 3B 2C
Forwarding with ECMP (2) Computer Networks7 AB C D E F G H Multipath routes from F/E to C/HE’s Forwarding Choices Flow Possible next hops Example choice F HC, DD F CC, DD E HC, DC E CC, DC Use both paths to get to one destination 5-7.9
Hierarchical Routing (4) Penalty is longer paths Computer Networks8 1C is best route to region 5, except for destination 5C
Subnets Internally split up one IP prefix Computer Networks9 64K addresses One prefix sent to rest of Internet 16K 32K 8K CompanyRest of Internet
Computer Networks10 Routing Policies – Transit One party (customer) gets TRANSIT service from another party (ISP) – ISP accepts traffic from customer to deliver to the rest of Internet – ISP accepts traffic from the rest of the Internet to delivery to customer – Customer pays ISP for the privilege Customer 1 ISP Customer 2 Rest of Internet Non- customer
Computer Networks11 Routing Policies – Peer Both party (ISPs in example) get PEER service from each other – Each ISP accepts traffic from the other ISP only for their customers – ISPs do not carry traffic to the rest of the Internet for each other – ISPs don’t pay each other Customer A1 ISP A Customer A2 Customer B1 ISP B Customer B
BGP Example AS2 buys TRANSIT service from AS1 and PEER service from AS3 Computer Networks ← B, AS3 → A, AS2 ← C, AS4 → B, AS3 ↑ C, AS4 ↓ A, AS1,AS2 ↓ B, AS1, AS3 ↑ A, AS2 ↓ B, AS1, AS3 ↓ C, AS1, AS4 ↑ B, AS3 ↓ A, AS1, AS2 ↓ C, AS1, AS4
END © 2013 D. Wetherall Slide material from: TANENBAUM, ANDREW S.; WETHERALL, DAVID J., COMPUTER NETWORKS, 5th Edition, © Electronically reproduced by permission of Pearson Education, Inc., Upper Saddle River, New Jersey Computer Networks13