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

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

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

BGP. Autonomous system (AS) BGP version 4

BGP. Autonomous system (AS) BGP version 4

BGP. Autonomous system (AS) BGP version 4

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

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

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

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

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

Internet Routing Protocols Lecture 03 Inter-domain Routing

PART III. Implementing Inter-Network Relationships with BGP

BGP Configuration. BGP Overview. Introduction to BGP. Formats of BGP Messages. Header

L11 : Inter-domain Routing with BGP Lecture14 Michaelmas, 2016

internet technologies and standards

Inter-Domain Routing: BGP

Internet Routing Protocols Lecture 01 & 02

BGP. Inter-domain routing with the Border Gateway Protocol. Iljitsch van Beijnum Amsterdam, 13 & 16 March 2007

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

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

BGP Attributes and Path Selection

Routing Between Autonomous Systems (Example: BGP4) RFC 1771

Internet Interconnection Structure

LARGE SCALE IP ROUTING LECTURE BY SEBASTIAN GRAF

BGP. BGP Overview. Formats of BGP Messages. I. Header

Internet inter-as routing: BGP

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

BGP Protocol & Configuration. Scalable Infrastructure Workshop AfNOG2008

Connecting to a Service Provider Using External BGP

BGP Attributes (C) Herbert Haas 2005/03/11 1

TELE 301 Network Management

Lecture 18: Border Gateway Protocol

CS BGP v4. Fall 2014

Table of Contents. BGP Configuration 1

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

Dynamics of Hot-Potato Routing in IP Networks

Lecture 16: Border Gateway Protocol

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

Table of Contents 1 BGP Configuration 1-1

Lecture 17: Border Gateway Protocol

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

Connecting to a Service Provider Using External BGP

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

Module 6 Implementing BGP

Border Gateway Protocol - BGP

Professor Yashar Ganjali Department of Computer Science University of Toronto.

University of Belgrade - School of Electrical Engineering Department of Telecommunications

Configuration prerequisites 45 Configuring BGP community 45 Configuring a BGP route reflector 46 Configuring a BGP confederation 46 Configuring BGP

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

CSCI-1680 Network Layer: Inter-domain Routing Rodrigo Fonseca

Configuring BGP. Cisco s BGP Implementation

Ravi Chandra cisco Systems Cisco Systems Confidential

CSE 561 Lecture 6, Spring David Wetherall

Introduction. Keith Barker, CCIE #6783. YouTube - Keith6783.

CertifyMe. CertifyMe

COMP/ELEC 429 Introduction to Computer Networks

2011, Sushile Tejwani

BGP. Attributes 2005/03/11. (C) Herbert Haas

CS4700/CS5700 Fundamentals of Computer Networks

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

BGP-v4 Theory and Practice

Routing Unicast routing protocols

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

c2001, Dr.Y.N.Singh, EED, IITK 2 Border Gateway Protocol - 4 BGP-4 (RFC intended to be used for routing between Autonomou

Routing. Jens A Andersson Communication Systems

Routing part 2. Electrical and Information Technology

Operation Manual BGP. Table of Contents

BGP Routing and BGP Policy. BGP Routing. Agenda. BGP Routing Information Base. L47 - BGP Routing. L47 - BGP Routing

Protecting an EBGP peer when memory usage reaches level 2 threshold 66 Configuring a large-scale BGP network 67 Configuring BGP community 67

Routing Protocols --- Exterior Gateway Protocol

An overview of how packets are routed in the Internet

Chapter 13 Configuring BGP4

Internet Routing : Fundamentals of Computer Networks Bill Nace

Multiprotocol BGP (MBGP)

CS 268: Computer Networking. Next Lecture: Interdomain Routing

Exterior Gateway Protocols: EGP, BGP-4, CIDR

Graph abstraction: costs. Graph abstraction 10/26/2018. Interplay between routing and forwarding

Communication Networks

BGP101. Howard C. Berkowitz. (703)

CSCI-1680 Network Layer: Inter-domain Routing Rodrigo Fonseca

Inter-Domain Routing: BGP II

Master Course Computer Networks IN2097

Advanced Computer Networks

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

BGP Attributes and Policy Control

Balancing incoming traffic over multiple links

Unit 3: Dynamic Routing

Inter-domain Routing. Outline. Border Gateway Protocol

Master Course Computer Networks IN2097

Interdomain Routing. EE122 Fall 2011 Scott Shenker

This appendix contains supplementary Border Gateway Protocol (BGP) information and covers the following topics:

CS 457 Networking and the Internet. The Global Internet (Then) The Global Internet (And Now) 10/4/16. Fall 2016

IBGP internals. BGP Advanced Topics. Agenda. BGP Continuity 1. L49 - BGP Advanced Topics. L49 - BGP Advanced Topics

CSCI-1680 Network Layer: Inter-domain Routing Rodrigo Fonseca

BGP Attributes and Policy Control

ISP Border Definition. Alexander Azimov

Interdomain Routing BGP. Benjamin Baron

Lecture 4: Intradomain Routing. CS 598: Advanced Internetworking Matthew Caesar February 1, 2011

Advanced Multihoming. BGP Traffic Engineering

The Contemporary Internet p. 3 Evolution of the Internet p. 5 Origins and Recent History of the Internet p. 5 From ARPANET to NSFNET p.

Transcription:

.. BGP Border Gateway Protocol (an introduction) Karst Koymans Informatics Institute University of Amsterdam (version 3.10, 2014/03/11 10:50:06) Monday, March 10, 2014 Karst Koymans (UvA) BGP Monday, March 10, 2014 1 / 75

. 1 General ideas behind BGP Background Providers, Customers and Peers External and Internal BGP BGP information bases. 2 The BGP protocol BGP attributes BGP messages. 3 Traffic Engineering Outbound Traffic Engineering Inbound Traffic Engineering. 4 IBGP scaling Karst Koymans (UvA) BGP Monday, March 10, 2014 2 / 75

General ideas behind BGP Outline. 1 General ideas behind BGP Background Providers, Customers and Peers External and Internal BGP BGP information bases. 2 The BGP protocol BGP attributes BGP messages. 3 Traffic Engineering Outbound Traffic Engineering Inbound Traffic Engineering. 4 IBGP scaling Karst Koymans (UvA) BGP Monday, March 10, 2014 3 / 75

General ideas behind BGP Background Outline. 1 General ideas behind BGP Background Providers, Customers and Peers External and Internal BGP BGP information bases. 2 The BGP protocol BGP attributes BGP messages. 3 Traffic Engineering Outbound Traffic Engineering Inbound Traffic Engineering. 4 IBGP scaling Karst Koymans (UvA) BGP Monday, March 10, 2014 4 / 75

General ideas behind BGP Background BGP version 4 Border Gateway Protocol version 4 (BGP4) Specified in RFC 4271 The inter-as routing protocol Monopolises the Internet Based on path vector routing which is inbetween distance vector and link state Uses (often non-coordinated) routing policies which can be problematic for convergence Karst Koymans (UvA) BGP Monday, March 10, 2014 5 / 75

General ideas behind BGP Background Autonomous system (AS). Definition (AS Autonomous System). A connected group of networks and routers Representing some assigned set of IP prefixes Having a single, consistent routing policy. Both internally and externally Karst Koymans (UvA) BGP Monday, March 10, 2014 6 / 75

Autonomous system illustration Autonomous Systems AS2503 AS192 AS29077 Slide courtesy Iljitsch van Beijnum 3

General ideas behind BGP Providers, Customers and Peers Outline. 1 General ideas behind BGP Background Providers, Customers and Peers External and Internal BGP BGP information bases. 2 The BGP protocol BGP attributes BGP messages. 3 Traffic Engineering Outbound Traffic Engineering Inbound Traffic Engineering. 4 IBGP scaling Karst Koymans (UvA) BGP Monday, March 10, 2014 8 / 75

Providers and Customers Internet IP IP Provider $$ IP Customer Internet

Peers Provider 1 $$ Provider 2 $$ Provider 3 IP IP $$ $$ $$ Customer 1 Customer 2 No packets Customer 3

Providers, Customers and Peers G1 IP $$ $$ G2 $$ $$ R1 $$ C1 C2 $$ $$ P1 IP P2 $$ $$ C3 $$ C4

The AS abstraction AS Graph!= Internet Topology BGP was designed to throw away information! The AS graph may look like this. Reality may be closer to this Slide courtesy Timothy Griffin

Providers, Customers and Peers routing preferences The order of preference for a route is Customers have highest preference Peers have the next highest preference Providers have the lowest preference Transit relationships are enforced by export filtering Do not advertise provider or peer routes to other providers or peers Do advertise all routes to customers Do advertise customer routes to providers and peers

Providers, Customers and Peers: Import Import Routes provider route peer route customer route ISP route From provider From provider From peer From peer From customer From customer Slide courtesy Timothy Griffin

Providers, Customers and Peers: Export Export Routes provider route peer route customer route ISP route To provider From provider To peer To peer To customer To customer filters block Slide courtesy Timothy Griffin

General ideas behind BGP External and Internal BGP Outline. 1 General ideas behind BGP Background Providers, Customers and Peers External and Internal BGP BGP information bases. 2 The BGP protocol BGP attributes BGP messages. 3 Traffic Engineering Outbound Traffic Engineering Inbound Traffic Engineering. 4 IBGP scaling Karst Koymans (UvA) BGP Monday, March 10, 2014 16 / 75

General ideas behind BGP External and Internal BGP External and Internal BGP (1) EBGP (External BGP) Used for BGP neighbors between different ASs Exchanging prefixes Implementing policies IBGP (Internal BGP) Used for BGP neighbors within one and the same AS Distributing Internet prefixes across the backbone in order to create a consistent view among all entry/exit points Inserting locally originated prefixes for instance for customers that do not speak BGP Karst Koymans (UvA) BGP Monday, March 10, 2014 17 / 75

General ideas behind BGP External and Internal BGP External and Internal BGP (2) Routes imported from one IBGP peer are not distributed to another IBGP peer This prevents possible routing loops Loop detection is based on duplicates in AS paths EBGP detects this between different ASs IBGP cannot detect this inside one and the same AS Requires IBGP peers to be configured as a full mesh Karst Koymans (UvA) BGP Monday, March 10, 2014 18 / 75

General ideas behind BGP BGP information bases Outline. 1 General ideas behind BGP Background Providers, Customers and Peers External and Internal BGP BGP information bases. 2 The BGP protocol BGP attributes BGP messages. 3 Traffic Engineering Outbound Traffic Engineering Inbound Traffic Engineering. 4 IBGP scaling Karst Koymans (UvA) BGP Monday, March 10, 2014 19 / 75

General ideas behind BGP BGP information bases Routing Information Bases (RIBs) Adj-RIB-In (one per peer) Routes after input filtering Every AS needs an input policy Loc-RIB (only one globally) Routes after best path selection Path selection is a fixed and specified algorithm Adj-RIB-Out (one per peer) Routes after output filtering Every AS needs an output policy Karst Koymans (UvA) BGP Monday, March 10, 2014 20 / 75

BGP route processing BGP Route Processing Open ended programming. Constrained only by vendor configuration language Receive BGP Updates Apply Policy = filter routes & tweak attributes Based on Attribute Values Best Routes Apply Policy = filter routes & tweak attributes Transmit BGP Updates Apply Import Policies Best Route Selection Best Route Table Apply Export Policies Install forwarding Entries for best Routes. IP Forwarding Table 52 Slide courtesy Timothy Griffin

The BGP protocol Outline. 1 General ideas behind BGP Background Providers, Customers and Peers External and Internal BGP BGP information bases. 2 The BGP protocol BGP attributes BGP messages. 3 Traffic Engineering Outbound Traffic Engineering Inbound Traffic Engineering. 4 IBGP scaling Karst Koymans (UvA) BGP Monday, March 10, 2014 22 / 75

The BGP protocol BGP protocol Uses TCP over port 179 Usually with a directly connected neighbor on layer 2 Exchanges Network Layer Reachability Information (NLRI) Prefixes that can or can no longer be reached through the router Accompanied by BGP attributes used by the best route selection algorithm Karst Koymans (UvA) BGP Monday, March 10, 2014 23 / 75

The BGP protocol BGP attributes Outline. 1 General ideas behind BGP Background Providers, Customers and Peers External and Internal BGP BGP information bases. 2 The BGP protocol BGP attributes BGP messages. 3 Traffic Engineering Outbound Traffic Engineering Inbound Traffic Engineering. 4 IBGP scaling Karst Koymans (UvA) BGP Monday, March 10, 2014 24 / 75

The BGP protocol BGP attributes Some important BGP attributes In order of path selection importance LOCAL PREF (Local Preference) AS PATH ORIGIN (Historical) MULTI EXIT DISC (MED; Multi-exit discriminator) And unrelated to path selection NEXT HOP Must be reachable (directly or via IGP) except in the case of multi-hop BGP Karst Koymans (UvA) BGP Monday, March 10, 2014 25 / 75

Next Hop in EBGP and IBGP BGP Next Hop Attribute 12.125.133.90 AS 6431 AT&T Research AS 7018 AT&T 12.127.0.121 AS 12654 RIPE NCC RIS project 135.207.0.0/16 Next Hop = 12.125.133.90 135.207.0.0/16 Next Hop = 12.127.0.121 Every time a route announcement crosses an AS boundary, the Next Hop attribute is changed to the IP address of the border router that announced the route. 53 Slide courtesy Timothy Griffin

Interaction between BGP and IGP Join EGP with IGP For Connectivity 135.207.0.0/16 Next Hop = 192.0.2.1 135.207.0.0/16 10.10.10.10 Forwarding Table destination next hop 192.0.2.0/30 10.10.10.10 + EGP destination next hop 135.207.0.0/16 192.0.2.1 AS 1 AS 2 192.0.2.1 192.0.2.0/30 Forwarding Table destination next hop 135.207.0.0/16 10.10.10.10 192.0.2.0/30 10.10.10.10 Slide courtesy Timothy Griffin

The BGP protocol BGP attributes BGP attribute types Well-known mandatory ORIGIN, AS PATH, NEXT HOP Well-known discretionary LOCAL PREF, ATOMIC AGGREGATE Optional transitive COMMUNITIES, AGGREGATOR Optional non-transitive MULTI EXIT DISC Karst Koymans (UvA) BGP Monday, March 10, 2014 28 / 75

The BGP protocol BGP attributes LOCAL PREF (Local Preference) Advertised within a single AS (via IBGP) Used to implement local policies Can depend on any locally available information This might be learned outside of BGP Default value is 100 Highest value wins Karst Koymans (UvA) BGP Monday, March 10, 2014 29 / 75

The BGP protocol BGP attributes AS PATH Sequence of ASs An AS can also be generalized to a set of ASs Used for loop detection The sequence length defines the metric (distance) Shortest path wins Prepend your own AS in EBGP updates Possibly multiple times, enabling traffic engineering Leave unchanged in IBGP updates Karst Koymans (UvA) BGP Monday, March 10, 2014 30 / 75

AS PATH example ASPATH Attribute 135.207.0.0/16 AS Path = 1755 1239 7018 6341 AS 1129 Global Access 135.207.0.0/16 AS Path = 1239 7018 6341 AS 1239 Sprint AS 1755 Ebone 135.207.0.0/16 AS Path = 7018 6341 135.207.0.0/16 AS Path = 1129 1755 1239 7018 6341 AS 12654 RIPE NCC RIS project 135.207.0.0/16 AS Path = 6341 AS 6341 AT&T Research 135.207.0.0/16 Prefix Originated AS7018 AT&T 135.207.0.0/16 AS Path = 7018 6341 135.207.0.0/16 AS Path = 3549 7018 6341 AS 3549 Global Crossing 64 Slide courtesy Timothy Griffin

AS PATH length can be deceptive Shorter Doesn t Always Mean Shorter In fairness: could you do this right and still scale? AS 3 Mr. BGP says that path 4 1 is better than path 3 2 1 Duh! AS 4 Exporting internal state would dramatically increase global instability and amount of routing state AS 2 AS 1 Slide courtesy Timothy Griffin

AS PATH for loop prevention Interdomain Loop Prevention AS 7018 BGP at AS YYY will never accept a route with ASPATH containing YYY. Don t Accept! 12.22.0.0/16 ASPATH = 1 333 7018 877 AS 1 66 Slide courtesy Timothy Griffin

Traffic often follows AS PATH Traffic Often Follows ASPATH 135.207.0.0/16 ASPATH = 3 2 1 AS 1 135.207.0.0/16 AS 2 AS 3 AS 4 IP Packet Dest = 135.207.44.66 Slide courtesy Timothy Griffin

Sometimes traffic does not follow AS PATH But It Might Not AS 1 135.207.0.0/16 135.207.0.0/16 ASPATH = 1 135.207.44.0/25 ASPATH = 5 AS 2 AS 2 filters all subnets with masks longer than /24 AS 3 135.207.0.0/16 ASPATH = 3 2 1 AS 4 IP Packet Dest = 135.207.44.66 AS 5 135.207.44.0/25 From AS 4, it may look like this packet will take path 3 2 1, but it actually takes path 3 2 5 Slide courtesy Timothy Griffin

The BGP protocol BGP attributes ORIGIN The ORIGIN attribute tells where the route (NLRI) originated Interior to the originating AS: ORIGIN = 0 Via the EGP protocol (historic): ORIGIN = 1 Via some other means: ORIGIN = 2 A lower ORIGIN wins Karst Koymans (UvA) BGP Monday, March 10, 2014 36 / 75

The BGP protocol BGP attributes MULTI EXIT DISC (Multi-Exit Discriminator or MED) The MED (or metric, formerly INTER AS METRIC) is meant to be advertised between neighboring ASs (via EBGP) Some implementations carry MED on by IBGP Hot potato versus cold potato The MED is non-transitive (is not transferred into a third AS) A lower MED wins The default MED is 0 (lowest possible value) Some implementations choose the highest possible value Karst Koymans (UvA) BGP Monday, March 10, 2014 37 / 75

Best route selection. Definition (Route selection preference). 1. (Weight; Cisco specific). 2 Highest Local Preference. 3 Shortest AS Path. 4 (Lowest Origin; hardly used; historic). 5 Lowest MED. 6 Prefer EBGP over IBGP. 7 Lowest IGP cost to BGP egress.. 8 Lowest Router ID

The BGP protocol BGP messages Outline. 1 General ideas behind BGP Background Providers, Customers and Peers External and Internal BGP BGP information bases. 2 The BGP protocol BGP attributes BGP messages. 3 Traffic Engineering Outbound Traffic Engineering Inbound Traffic Engineering. 4 IBGP scaling Karst Koymans (UvA) BGP Monday, March 10, 2014 39 / 75

The BGP protocol BGP messages BGP message header 0 15 16 23 24 31 Marker Length Type We use the term message and not packet, because BGP packets are in fact part of one single TCP-stream. Karst Koymans (UvA) BGP Monday, March 10, 2014 40 / 75

The BGP protocol BGP messages BGP header fields. BGP header fields. Marker 128 bits of 1 (compatibility) Length Total length (min 19, max 4096) No padding a, Including header Type 1: OPEN 2: UPDATE 3: NOTIFICATION 4: KEEPALIVE 5: Route-REFRESH. a No superfluous bytes are allowed inside the TCP stream Karst Koymans (UvA) BGP Monday, March 10, 2014 41 / 75

The BGP protocol BGP messages BGP OPEN message 0 7 8 15 16 31 Version My Autonomous System Opt Parm Len Hold Time BGP Identifier Optional Parameters (variable) Karst Koymans (UvA) BGP Monday, March 10, 2014 42 / 75

The BGP protocol BGP messages OPEN message fields. OPEN message fields. Version 4. My Autonomous System Hold Time BGP Identifier Opt Parm Length Optional Parameters Sender s AS Liveness detection Sender s identifying IP address Length of parameter field TLV-encoded options One interesting parameter is the Capabilities Optional Parameter, which defines (among others) the Route Refresh Capability. Karst Koymans (UvA) BGP Monday, March 10, 2014 43 / 75

The BGP protocol BGP messages BGP KEEPALIVE message Karst Koymans (UvA) BGP Monday, March 10, 2014 44 / 75

The BGP protocol BGP messages BGP KEEPALIVE message This page intentionally left blank. Karst Koymans (UvA) BGP Monday, March 10, 2014 44 / 75

The BGP protocol BGP messages BGP KEEPALIVE message This page intentionally left blank. http://www.this-page-intentionally-left-blank.org/ Karst Koymans (UvA) BGP Monday, March 10, 2014 44 / 75

The BGP protocol BGP messages KEEPALIVE message fields. KEEPALIVE message fields.. :) Karst Koymans (UvA) BGP Monday, March 10, 2014 45 / 75

The BGP protocol BGP messages BGP NOTIFICATION message 0 7 8 15 16 31 Error code Error subcode Data (variable) Karst Koymans (UvA) BGP Monday, March 10, 2014 46 / 75

The BGP protocol BGP messages NOTIFICATION message fields. NOTIFICATION message fields. Error code 1: Message Header Error 2: OPEN Error 3: UPDATE Error 4: Hold Timer Expired.... Error subcode Data Depends on error code Depends on error code and subcode Karst Koymans (UvA) BGP Monday, March 10, 2014 47 / 75

The BGP protocol BGP messages BGP Route-REFRESH message 0 15 16 23 24 31 AFI Reserved SAFI Karst Koymans (UvA) BGP Monday, March 10, 2014 48 / 75

The BGP protocol BGP messages Route-REFRESH message fields. Route-REFRESH message fields. AFI Address Family Identifier Reserved 0. SAFI Subsequent Address Family Identifier Karst Koymans (UvA) BGP Monday, March 10, 2014 49 / 75

The BGP protocol BGP messages BGP UPDATE message 0 15 16 31 Unfeasible Routes Length Total Path Attribute Length Withdrawn Routes (variable length) Path Attributes (variable length) Network Layer Reachability Information (variable length) Karst Koymans (UvA) BGP Monday, March 10, 2014 50 / 75

The BGP protocol BGP messages UPDATE message fields. UPDATE message fields. Unfeasible Routes Length Withdrawn Routes Total Path Attribute Length Path Attributes Network Layer Reachability Information a A prefix is specified by its length and just enough bytes of the network IP address to cover this length. Length of Withdrawn Routes List of prefixes a Length of Path Attributes TLV-encoded attributes List of NLRI prefixes Karst Koymans (UvA) BGP Monday, March 10, 2014 51 / 75

Traffic Engineering Outline. 1 General ideas behind BGP Background Providers, Customers and Peers External and Internal BGP BGP information bases. 2 The BGP protocol BGP attributes BGP messages. 3 Traffic Engineering Outbound Traffic Engineering Inbound Traffic Engineering. 4 IBGP scaling Karst Koymans (UvA) BGP Monday, March 10, 2014 52 / 75

Tweaking your policies Tweak Tweak Tweak For inbound traffic Filter outbound routes Tweak attributes on outbound routes in the hope of influencing your neighbor s best route selection For outbound traffic Filter inbound routes Tweak attributes on inbound routes to influence best route selection inbound traffic outbound traffic outbound routes inbound routes In general, an AS has more control over outbound traffic Slide courtesy Timothy Griffin

Traffic Engineering Outbound Traffic Engineering Outline. 1 General ideas behind BGP Background Providers, Customers and Peers External and Internal BGP BGP information bases. 2 The BGP protocol BGP attributes BGP messages. 3 Traffic Engineering Outbound Traffic Engineering Inbound Traffic Engineering. 4 IBGP scaling Karst Koymans (UvA) BGP Monday, March 10, 2014 54 / 75

Traffic Engineering Outbound Traffic Engineering Outbound Traffic Engineering This works by manipulating incoming routes Changing local preference Extending inbound AS paths Manipulating the metric (MED), for instance by using inbound communities It is relatively simple Based on your own policy You are in control yourself Karst Koymans (UvA) BGP Monday, March 10, 2014 55 / 75

Choice between provider, peer or customer So Many Choices peer provider peer customer AS 4 Frank s Internet Barn AS 3 AS 2 Which route should Frank pick to 13.13.0.0./16? AS 1 13.13.0.0/16 60 Slide courtesy Timothy Griffin

Manipulating local preference Prefer customer over peer over provider LOCAL PREFERENCE Local preference used ONLY in ibgp AS 4 local pref = 80 local pref = 90 AS 3 local pref = 100 Higher Local preference values are more preferred AS 2 AS 1 13.13.0.0/16 61 Slide courtesy Timothy Griffin

Primary and backup links Implementing Backup Links with Local Preference (Outbound Traffic) AS 1 primary link backup link Set Local Pref = 100 for all routes from AS 1 AS 65000 Set Local Pref = 50 for all routes from AS 1 Forces outbound traffic to take primary link, unless link is down. We ll talk about inbound traffic soon 70 Slide courtesy Timothy Griffin

Multihomed primary and backup links Multihomed Backups (Outbound Traffic) AS 1 provider primary link AS 3 provider backup link Set Local Pref = 100 for all routes from AS 1 AS 2 Set Local Pref = 50 for all routes from AS 3 Forces outbound traffic to take primary link, unless link is down. 71 Slide courtesy Timothy Griffin

Traffic Engineering Inbound Traffic Engineering Outline. 1 General ideas behind BGP Background Providers, Customers and Peers External and Internal BGP BGP information bases. 2 The BGP protocol BGP attributes BGP messages. 3 Traffic Engineering Outbound Traffic Engineering Inbound Traffic Engineering. 4 IBGP scaling Karst Koymans (UvA) BGP Monday, March 10, 2014 60 / 75

Traffic Engineering Inbound Traffic Engineering Inbound Traffic Engineering This works by manipulating outgoing routes Extending outbound AS PATHs is a traditional hack Manipulating the metric (MED) is the official way Setting outbound communities is a more modern approach Agreements with your neighbors are necessary (common policy) Inbound is more complex than outbound Inbound depends (also) on neighbor s policy You are not in control by yourself Announcing more specific routes Method of last resort, but often a bad idea Karst Koymans (UvA) BGP Monday, March 10, 2014 61 / 75

Traffic engineering a longer AS PATH Shedding Inbound Traffic with ASPATH Padding. Yes, this is a Glorious Hack AS 1 provider 192.0.2.0/24 ASPATH = 2 192.0.2.0/24 ASPATH = 2 2 2 primary customer AS 2 backup 192.0.2.0/24 Padding will (usually) force inbound traffic from AS 1 to take primary link 72 Slide courtesy Timothy Griffin

Your provider might overrule your effort But Padding Does Not Always Work AS 1 provider AS 3 provider 192.0.2.0/24 ASPATH = 2 192.0.2.0/24 ASPATH = 2 2 2 2 2 2 2 2 2 2 2 2 2 2 primary customer AS 2 backup 192.0.2.0/24 AS 3 will send traffic on backup link because it prefers customer routes and local preference is considered before ASPATH length! Slide courtesy Timothy Griffin Padding in this way is often used as a form of load 73 balancing

But you can make an agreement by using a community COMMUNITY Attribute to the Rescue! AS 1 provider AS 3 provider AS 3: normal customer local pref is 100, peer local pref is 90 192.0.2.0/24 ASPATH = 2 192.0.2.0/24 ASPATH = 2 COMMUNITY = 3:70 primary customer AS 2 backup 192.0.2.0/24 Customer import policy at AS 3: If 3:90 in COMMUNITY then set local preference to 90 If 3:80 in COMMUNITY then set local preference to 80 If 3:70 in COMMUNITY then set local preference to 70 74 Slide courtesy Timothy Griffin

Hot potato routing Hot Potato Routing: Go for the Closest Egress Point 192.44.78.0/24 egress 1 egress 2 15 56 IGP distances This Router has two BGP routes to 192.44.78.0/24. Hot potato: get traffic off of your network as Soon as possible. Go for egress 1! 75 Slide courtesy Timothy Griffin

Burnt by the hot potato Getting Burned by the Hot Potato High bandwidth Provider backbone 2865 17 Heavy Content Web Farm SFF NYC Low bandwidth customer backbone 15 San Diego 56 Many customers want their provider to carry the bits! tiny http request huge http reply 76 Slide courtesy Timothy Griffin

Cold potato routing by honoring MEDs Cold Potato Routing with MEDs (Multi-Exit Discriminator Attribute) Prefer lower MED values 2865 17 Heavy Content Web Farm 192.44.78.0/24 MED = 15 192.44.78.0/24 MED = 56 15 56 192.44.78.0/24 This means that MEDs must be considered BEFORE IGP distance! Note1 : some providers will not listen to MEDs Note2 : MEDs need not be tied to IGP distance 77 Slide courtesy Timothy Griffin

Traffic Engineering Inbound Traffic Engineering Communities An optional transitive attribute A community can be used to communicate preferred treatment of a route Communities can be used with both inbound as well as outbound Some communities have a well-known semantics NO EXPORT: don t export beyond current AS (or confederation) NO ADVERTISE: don t export at all Karst Koymans (UvA) BGP Monday, March 10, 2014 68 / 75

Traffic Engineering Inbound Traffic Engineering Use of communities Inbound from your upstream Learn where your upstream imported this route You can base policy decisions on that Outbound to your upstream Request specific upstream treatment Setting of local preference Announcements or not to specific ASs AS PATH prepending for certain peerings Your upstream promises to implement the requested policy Karst Koymans (UvA) BGP Monday, March 10, 2014 69 / 75

Structure and semantics of communities How Can Routes be Colored? BGP Communities! A community value is 32 bits Used for signally within and between ASes By convention, first 16 bits is ASN indicating who is giving it an interpretation community number Very powerful BECAUSE it has no (predefined) meaning Community Attribute = a list of community values. (So one route can belong to multiple communities) RFC 1997 (August 1996) Two reserved communities no_export = 0xFFFFFF01: don t export out of AS no_advertise 0xFFFFFF02: don t pass to BGP neighbors 58 Slide courtesy Timothy Griffin

IBGP scaling Outline. 1 General ideas behind BGP Background Providers, Customers and Peers External and Internal BGP BGP information bases. 2 The BGP protocol BGP attributes BGP messages. 3 Traffic Engineering Outbound Traffic Engineering Inbound Traffic Engineering. 4 IBGP scaling Karst Koymans (UvA) BGP Monday, March 10, 2014 71 / 75

IBGP scaling Route Reflectors Specified in RFC 4456 A route reflector is a kind of super IBGP peer A route reflector has clients with which it peers via IBGP and for which it reflects (transitively) routes A route reflector is part of a full mesh of other route reflectors and non-clients Karst Koymans (UvA) BGP Monday, March 10, 2014 72 / 75

Route reflectors illustration Full Mesh Slide courtesy Iljitsch van Beijnum 39

Route reflectors illustration Route Reflection Slide courtesy Iljitsch van Beijnum 40

IBGP scaling Confederations Specified in RFC 5065 Use multiple private ASs inside your main AS Talk to the outside world with your main AS This hides the private ASs Talk to the inside world as if using EBGP and IBGP Using the different private ASs This needs special AS PATH segment types Karst Koymans (UvA) BGP Monday, March 10, 2014 74 / 75

Confederations illustration Confederations Slide courtesy Iljitsch van Beijnum 41