How does a router know where to send a packet next?

Similar documents
An overview of how packets are routed in the Internet

Internet Protocols Fall Lectures Inter-domain routing, mobility support, multicast routing Andreas Terzis

CS 640: Introduction to Computer Networks. Intra-domain routing. Inter-domain Routing: Hierarchy. Aditya Akella

Important Lessons From Last Lecture Computer Networking. Outline. Routing Review. Routing hierarchy. Internet structure. External BGP (E-BGP)

CS BGP v4. Fall 2014

Professor Yashar Ganjali Department of Computer Science University of Toronto.

Internet Routing Protocols Lecture 01 & 02

Advanced Computer Networks. Lecture 4 Internetworking and Routing

TELE 301 Network Management

BGP. Autonomous system (AS) BGP version 4

Internet Routing Protocols Lecture 03 Inter-domain Routing

CS 268: Computer Networking. Next Lecture: Interdomain Routing

BGP. Autonomous system (AS) BGP version 4

Outline Computer Networking. Inter and Intra-Domain Routing. Internet s Area Hierarchy Routing hierarchy. Internet structure

BGP. Autonomous system (AS) BGP version 4

Interdomain Routing Reading: Sections P&D 4.3.{3,4}

Lecture 16: Interdomain Routing. CSE 123: Computer Networks Stefan Savage

BGP. Autonomous system (AS) BGP version 4. Definition (AS Autonomous System)

Computer Networking Introduction

Next Lecture: Interdomain Routing : Computer Networking. Outline. Routing Hierarchies BGP

Routing in the Internet

BGP. Autonomous system (AS) BGP version 4. Definition (AS Autonomous System)

PART III. Implementing Inter-Network Relationships with BGP

COMP/ELEC 429 Introduction to Computer Networks

Network Protocols. Routing. TDC375 Autumn 03/04 John Kristoff - DePaul University 1

Routing. Jens A Andersson Communication Systems

CS4700/CS5700 Fundamentals of Computer Networks

Inter-Domain Routing: BGP II

Routing Protocols. Autonomous System (AS)

Inter-domain Routing. Outline. Border Gateway Protocol

Inter-Domain Routing: BGP

Hierarchical Routing. Our routing study thus far - idealization all routers identical network flat not true in practice

Routing Unicast routing protocols

ETSF10 Internet Protocols Routing on the Internet

Border Gateway Protocol (an introduction) Karst Koymans. Monday, March 10, 2014

Last time. Transitioning to IPv6. Routing. Tunneling. Gateways. Graph abstraction. Link-state routing. Distance-vector routing. Dijkstra's Algorithm

CSCE 463/612 Networks and Distributed Processing Spring 2018

Chapter 4: outline. Network Layer 4-1

Network Protocols. Routing. TDC375 Winter 2002 John Kristoff - DePaul University 1

Introduction to IP Routing. Geoff Huston

Internet Routing : Fundamentals of Computer Networks Bill Nace

CSc 450/550 Computer Networks Internet Routing

Interdomain routing CSCI 466: Networks Keith Vertanen Fall 2011

CMSC 417. Computer Networks Prof. Ashok K Agrawala Ashok Agrawala October 9, 2018 (a) October 18 October 9,

Lecture 17: Border Gateway Protocol

CS4450. Computer Networks: Architecture and Protocols. Lecture 15 BGP. Spring 2018 Rachit Agarwal

CS321: Computer Networks Unicast Routing

Inter-AS routing. Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley

Interdomain Routing Reading: Sections K&R EE122: Intro to Communication Networks Fall 2007 (WF 4:00-5:30 in Cory 277)

Computer Networks. Routing

CS 268: Computer Networking

ITEC310 Computer Networks II

Chapter 4: Network Layer

Lecture 18: Border Gateway Protocol

ETSF10 Internet Protocols Routing on the Internet

Chapter 4: Network Layer. Lecture 12 Internet Routing Protocols. Chapter goals: understand principles behind network layer services:

CSC 4900 Computer Networks: Routing Protocols

Multicast Communications

Multicast Communications. Slide Set were original prepared by Dr. Tatsuya Susa

ICS 351: Today's plan. distance-vector routing game link-state routing OSPF

Advanced Computer Networks

CSCI Topics: Internet Programming Fall 2008

Topic: Multicast routing

Link State Routing & Inter-Domain Routing

BGP. Autonomous system (AS) BGP version 4. Definition (AS Autonomous System)

Inter-Domain Routing: BGP II

ETSF10 Internet Protocols Routing on the Internet

Lecture 19: Network Layer Routing in the Internet

Routing part 2. Electrical and Information Technology

Chapter 7 Routing Protocols

Border Gateway Protocol (an introduction) Karst Koymans. Tuesday, March 8, 2016

Multiprotocol BGP (MBGP)

BGP. Border Gateway Protocol (an introduction) Karst Koymans. Informatics Institute University of Amsterdam. (version 17.3, 2017/12/04 13:20:08)

CS Networks and Distributed Systems. Lecture 8: Inter Domain Routing

Communication Networks

CSCD 433/533 Network Programming Fall Lecture 14 Global Address Space Autonomous Systems, BGP Protocol Routing

BGP. Autonomous system (AS) BGP version 4. Definition (AS Autonomous System)

IP Addressing & Interdomain Routing. Next Topic

Master Course Computer Networks IN2097

BGP. Border Gateway Protocol A short introduction. Karst Koymans. Informatics Institute University of Amsterdam. (version 18.3, 2018/12/03 13:53:22)

Lecture 16: Border Gateway Protocol

Module 6 Implementing BGP

internet technologies and standards

Master Course Computer Networks IN2097

CSE/EE 461 Lecture 11. Inter-domain Routing. This Lecture. Structure of the Internet. Focus How do we make routing scale?

ICS 351: Today's plan. OSPF BGP Routing in general

2011, Sushile Tejwani

Configuring PIM. Information About PIM. Send document comments to CHAPTER

Overview. Information About Layer 3 Unicast Routing. Send document comments to CHAPTER

Department of Computer and IT Engineering University of Kurdistan. Computer Networks II Border Gateway protocol (BGP) By: Dr. Alireza Abdollahpouri

Configuring BGP community 43 Configuring a BGP route reflector 44 Configuring a BGP confederation 44 Configuring BGP GR 45 Enabling Guard route

Inter-Autonomous-System Routing: Border Gateway Protocol

Internet Architecture and Experimentation

Initial motivation: 32-bit address space soon to be completely allocated. Additional motivation:

Connecting to a Service Provider Using External BGP

Network Layer: Routing

Interdomain Routing. EE122 Fall 2011 Scott Shenker

Lecture 4. The Network Layer (cont d)

Da t e: August 2 0 th a t 9: :00 SOLUTIONS

Routing Between Autonomous Systems (Example: BGP4) RFC 1771

Transcription:

How does a router know where to send a packet next?

The Problem Which path should packets take from A to B? A B R2 R R4 R3 C D 2

The Internet forwards packets hop-by-hop Data IP Address Next-hop A R B R4 C R4 D R4 B A B R2 IP Address Next-hop A A B R2 C R3 D R3 R R4 R3 C IP Address Next-hop A R3 B B C R3 D R3 D 3

It s not always obvious Which path should packets take from A to B? A R5 R2 B R6 5 5 R R4 R3 C D 4

How do the routers know how to populate the forwarding table? 5

Here are four common ways. Flooding: Every router sends every arriving packet to every neighbor 2. Source Routing: End host adds a list of routers to visit along the way 3. Static Entries: If the network owner knows, then simply write the entries into the table. 4. Routers talk to each other and construct forwarding tables using a clever algorithm 6

Find the shortest path from to 40 6 7 32 2 3 4 5 6 7 8 5 4 3 2 0 9 8 9 20 2 22 23 24 3 30 29 28 27 26 25 33 34 35 36 37 38 39 40 7

What if each link has a cost? 8

Cost = +4+4+2 = Cost = 4+9 = 3 4 4 4 A B C D E 5 2 9 5 Expensive link : It might be very long. e.g. a link from Europe to USA. Or it might be very busy. e.g. it connects to Google or CNN. Or it may be very slow. e.g. Mb/s instead of Gb/s. F G 2 H 9

A distributed algorithm to find the lowest cost spanning tree CS44, Stanford University 0

Find lowest cost path from A to H 4 4 A B C D 4 5 E 9 2 F 5 9 G 5 H 2 2 Remember the lowest cost we have heard, and the next hop to reach H. Tell our neighbors the lowest cost we know to reach H. Round #

Find lowest cost path from A to H 4 4 3 6 2 4 2 5 5 F G 5 9 9 A B C D E H 2 2 Round #2 2

Find lowest cost path from A to H 4 4 3 6 2 4 2 5 5 F G 5 9 9 A B C D E H 2 2 Round #3 3

Find lowest cost path from A to H 4 4 3 6 2 4 2 5 5 F G 4 5 9 9 A B C D E H 2 2 Round #3 4

Find lowest cost path from A to H 7 4 4 3 6 2 4 2 5 5 F G 4 5 9 9 A B C D E H 2 2 Round #3 5

Find lowest cost path from A to H 7 4 4 3 6 2 4 2 5 5 F G 4 5 9 9 A B C D E H 2 2 Round #4 6

Find lowest cost path from A to H 4 4 7 3 5 6 2 4 2 5 5 F G 4 5 9 9 A B C D E H 2 2 Round #5 7

Find lowest cost path from A to H 4 4 6 7 5 6 2 4 2 5 5 F G 4 5 9 9 A B C D E H 2 2 Round #5 8

Find lowest cost path from A to H Known as the Bellman-Ford Distance Vector Algorithm 6 5 A B C 2 D E 4 9 2 F 9 G 2 H 2 Questions. How do we know we finished? 2. In general, what is the maximum number of steps the algorithm needs to complete? 3. How do we turn this into a distributed algorithm between the routers? 4. What happens when the topology changes? 9

A more complicated topology CS44, Stanford University 20

Find the lowest cost path from to 2 24 4 27 6 25 8 5 7 4 7 9 6 8 0 28 3 7 32 26 5 7 4 30 2 6 9 6 20 2 3 4 2 2 23 22 8 0 3 3 5 29 3 2 2 Router 4 tells its neighbors: I can reach 2 with a cost of 5 2

Solution 7 6 5 24 4 27 6 25 8 5 7 4 7 9 6 8 0 28 3 7 32 26 5 7 8 4 30 2 6 4 8 9 6 28 8 9 7 20 7 2 6 2 3 7 3 4 2 2 5 23 4 5 4 22 8 0 3 3 5 29 3 3 2 7 2 2 Cost = 22 and so on! 22

A second algorithm 23

Dijkstra s shortest path first algorithm (An example of a Link State Algorithm ). Exchange link state: A router floods to every other router the state of links connected to it. - Periodically - When link state changes 2. Run Dijkstra s algorithm: Each router independently runs Dijkstra s shortest path first algorithm. Each router runs an algorithm to find the lowest cost spanning tree to reach every other router. CS44, Stanford University 24

Find lowest cost path from H to every router 4 4 A B C D 4 5 E 2 F 9 G 5 H 2 Every router learns the topology from the flooded link-state 25

Find lowest cost path from H to every router 4 4 A B C D 4 5 E 2 F 9 G 5 H 2 Add path of cost Add path of cost 2 Add path of cost 2 D C D G H G H G H 26

Find lowest cost path from H to every router 4 4 A B C D 4 5 E 2 F 9 G 5 H 2 C Add path of cost 4 D B Add path of cost 5 C D F G H F G H.. 27

How to find the lowest cost tree manually 4 4 A B C D 4 5 E 2 F 9 G 5 H 2 0 2 3 4 5 6 7 Shortest Path Set Candidate Set Add H DEFG G 28

Dijkstra s Algorithm Questions:. How long does the algorithm take to run? 2. What happens when link costs change, or when routers/links fail? CS44, Stanford University 29

Dijkstra s algorithm in practice Dijkstra s algorithm is an example of a Link State algorithm. - Link state is known by every router. - Each router finds the shortest path spanning tree to every other router. It is the basis of OSPF (Open Shortest Path First), a very widely used routing protocol. CS44, Stanford University 30

Another view of Dijkstra CS44, Stanford University 3

R 3 A 4 4 4 R 4 2 R 2 R 3 R 5 3 4 B 2 CS44, Stanford University 32

A R R 4 R 2 R 3 R 5 B CS44, Stanford University 33

A R 3 4 4 4 R 2 R 3 R 4 R 5 4 2 3 2 CS44, Stanford University B 34

Routing between Autonomous Systems The Border Gateway Protocol (BGP) CS44, Stanford University 35

All organizations (Autonomous Systems) use the same algorithm to talk to each other CENIC Internet2 Stanford University Cambridge University 36

AS (Autonomous System) numbers nickm> traceroute -q www.cam.ac.uk nickm> whois -h whois.cymru.com 62.40.24.98 traceroute to www.cam.ac.uk (3..50.25), 30 hops max, 40 byte packets csmx-west-rtr.sunet (7.64.74.2) 8.567 ms 2 dc-svl-rtr-vl8.sunet (7.64.255.204) 0.334 ms 3 dc-svl-agg4--stanford-00ge.cenic.net (37.64.23.44).04 ms 7 et-4-0-0.4079.sdn-sw.lasv.net.internet2.edu (62.252.70.28) 4.320 ms 4 internet2.mx.lon.uk.geant.net (62.40.24.44) 44.085 ms 5 janet-gw.mx.lon.uk.geant.net (62.40.24.98) 44.552 ms 24 primary.admin.cam.ac.uk (3..50.25) 50.353 ms [Querying whois.cymru.com] [whois.cymru.com] AS IP AS Name 20965 62.40.24.98 GEANT The GEANT IP Service, GB 2320 62.40.24.98 GEANT_IAS_VRF, EU CS44, Stanford University 37

38

Border Gateway Protocol (BGP) BGP neighbors ( peers ) establish a TCP connection. BGP is not a link-state or a distance-vector routing protocol. Instead, BGP uses what is called a Path vector. For each prefix, a BGP router advertises a path of AS s to reach it. This is the path vector Example of path vector advertisement: The network 7.64/6 can be reached via the path {AS, AS5, AS3} When a link/router fails, the path vector is withdrawn 39

Border Gateway Protocol (BGP) The network 7.64/6 can be reached via the path {AS, AS5, AS3} Paths with loops are detected locally and ignored. Local policies pick the preferred path among all advertised paths. 40

Current Version BGP Version 4 or BGP-4 Described in RFC 427 (2006) Used by the Internet since 994 Used to connect all Border Gateways in the Internet Used internally in some very large private networks, such as data-centers 4

Customers and Providers provider provider customer IP traffic customer Customer pays provider to carry its packets. 42

Customer-Provider Hierarchy provider customer IP traffic 43

The Peering Relationship peer provider traffic allowed peer customer traffic NOT allowed Peers provide transit between their respective customers Peers do not provide transit between peers Peers (typically) do not exchange $$$ So how does traffic from the left side reach the right side? 44

Tier Providers A tier network is a transit-free network that peers with every other tier network Tier Tier Tier Tier Examples: AT&T, CenturyLink, Level 3, Deutsche Telekom, Tata, Verizon, CS44, Stanford University 45

Tier Tier Tier peer provider traffic allowed peer customer traffic NOT allowed Peers provide transit between their respective customers Peers do not provide transit between peers Peers (typically) do not exchange $$$ 46

BGP Messages Open : Establish a BGP session. Keep Alive : Handshake at regular intervals. Notification : Shuts down a peering session. Update : Announcing new routes or withdrawing previously announced routes. BGP announcement = prefix + path attributes Path attributes Include: next hop, AS Path, local preference, Multi-exit discriminator, Used to select among multiple options for paths. 47

BGP Route Selection Summary Highest Local Preference Enforce relationships E.g. prefer customer routes over peer routes Shortest ASPATH Lowest MED i-bgp < e-bgp Lowest IGP cost to BGP egress Lowest router ID Traffic Engineering Throw up hands and break ties 48

AS Path Selection AS 29 AS 755 AS 239 AS 2654 AS 708 AS 634 35.207.0.0/6 AS 3549 Prefix Originated 49

AS Path Selection 35.207.0.0/6 AS Path = 755 239 708 634 AS 29 35.207.0.0/6 AS Path = 239 708 634 AS 755 35.207.0.0/6 AS Path = 29 755 239 708 634 AS 239 35.207.0.0/6 AS Path = 708 634 Pick preferred AS path AS 2654 35.207.0.0/6 AS Path = 634 AS 634 35.207.0.0/6 AS 708 35.207.0.0/6 AS Path = 708 634 35.207.0.0/6 AS Path = 3549 708 634 AS 3549 Prefix Originated 50

So Many Choices peer provider peer customer AS 4 Frank s Internet Barn AS 3 AS 2 Which route should Frank pick to 3.3.0.0/6? AS 3.3.0.0/6 5

Summary of BGP All AS s in the Internet must connect using BGP-4. BGP-4 is a path vector algorithm, allowing loops to be detected easily. BGP-4 has a rich and complex interface to let AS s choose a local, private policy. Each AS decides a local policy for traffic engineering, security and any private preferences. CS44, Stanford University 52

Thank you! CS44, Stanford University 53

If there is time. CS44, Stanford University 54

Multicast routing in the Internet 55

Multicast A B C D R R 2 R 4 R 6 R 5 R 7 R 3 R 8 E X 56

Multicast A B C D R R 2 R 4 R 6 R 5 R 7 R 3 R 8 E X 57

Techniques and Principles Multicast - Reverse Path Broadcast (RPB) and Pruning - One versus multiple trees Practice - IGMP group management - DVMRP the first multicast routing protocol - PIM protocol independent multicast CS44, Stanford University 58

Reverse Path Broadcast (RPB) aka Reverse Path Forwarding (RPF) A B C D R R 2 R 4 R 6 R 5 R 7 R 3 R 8 E X CS44, Stanford University 59

RPB + Pruning. Packets delivered loop-free to every end host. 2. Routers with no interested hosts send prune messages towards source. 3. Resulting tree is the minimum cost spanning tree from source to the set of interested hosts. CS44, Stanford University 60

One tree versus several trees? A B C D R R 2 R 4 R 6 R 5 R 7 R 3 R 8 E X 6

Addresses and joining a group IPv4: Class D addresses are set aside for multicast. IGMP (Internet group management protocol) - Between host and directly attached router. - Hosts ask to receive packets belonging to a particular multicast group. - Routers periodically poll hosts to ask which groups they want. - If no reply, membership times out (soft-state). CS44, Stanford University 62

Multicast in practice Multicast used less than originally expected - Most communication is individualized (e.g. time shifting) - Early implementations were inefficient - Today, used for some IP TV and fast dissemination - Some application-layer multicast routing used Some interesting questions - How to make multicast reliable? - How to implement flow-control? - How to support different rates for different end users? - How to secure a multicast conversation? 63