Copyright 1998, Cisco Systems, Inc. All rights reserved. Printed in USA. 0945_05F9_c1.scr 1. RST _05_2001_c1

Similar documents
LACNIC XIII. Using BGP for Traffic Engineering in an ISP

Ravi Chandra cisco Systems Cisco Systems Confidential

Internet Interconnection Structure

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

Routing Between Autonomous Systems (Example: BGP4) RFC 1771

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. BGP Configuration 1

Table of Contents 1 BGP Configuration 1-1

Connecting to a Service Provider Using External BGP

BGP Attributes and Policy Control

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

BGP Attributes and Policy Control

Inter-Domain Routing: BGP

BGP Attributes and Policy Control

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

Connecting to a Service Provider Using External BGP

BGP Protocol & Configuration. Scalable Infrastructure Workshop AfNOG2008

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

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

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

Chapter 13 Configuring BGP4

BGP Attributes and Path Selection

BGP Commands. Network Protocols Command Reference, Part 1 P1R-355

Configuring BGP. Cisco s BGP Implementation

Multiprotocol BGP (MBGP)

LARGE SCALE IP ROUTING LECTURE BY SEBASTIAN GRAF

internet technologies and standards

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

BGP can also be used for carrying routing information for IPv6 prefix over IPv6 networks.

Module 6 Implementing BGP

BGP. Autonomous system (AS) BGP version 4

BGP. Autonomous system (AS) BGP version 4

Operation Manual BGP. Table of Contents

BGP-v4 Theory and Practice

BGP. Autonomous system (AS) BGP version 4

Routing Protocols --- Exterior Gateway Protocol

BGP Tutorial. APRICOT 2003, Taipei February Philip Smith APRICOT , Cisco Systems, Inc. All rights reserved.

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

BGP Commands. Network Protocols Command Reference, Part 1 P1R-355

TELE 301 Network Management

How BGP Routers Use the Multi Exit Discriminator for Best Path Selection

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

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)

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

Routing Unicast routing protocols

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

BGP Tutorial. APRICOT 2004, Kuala Lumpur February Philip Smith APRICOT , Cisco Systems, Inc. All rights reserved.

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

Internet inter-as routing: BGP

Chapter 17 BGP4 Commands

Border Gateway Protocol - BGP

Configuring Internal BGP Features

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

PART III. Implementing Inter-Network Relationships with BGP

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

Routing. Jens A Andersson Communication Systems

CertifyMe. CertifyMe

Internet Routing Protocols Lecture 01 & 02

BGP Route Reflector Commands

University of Belgrade - School of Electrical Engineering Department of Telecommunications

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

Configuring BGP on Cisco Routers Volume 1

BGP Attributes and Policy Control. BGP Attributes. BGP Attributes. Agenda. What Is an Attribute? AS-Path. ISP/IXP Workshops.

BGP Attributes and Policy Control. BGP Attributes. Agenda. What Is an Attribute? AS-Path. AS-Path loop detection. BGP Attributes

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

FiberstoreOS BGP Command Line Reference

From the given configuration taken from RTA and graphic, which network will be filtered from being propagated to RTC from RTA?

HP Load Balancing Module

BGP for Internet Service Providers

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

Configuring a Basic BGP Network

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

BGP. BGP Overview. BGP Operation. BGP Neighbors

Configuring Advanced BGP

Internetwork Expert s CCNP Bootcamp. Border Gateway Protocol (BGP) What Is BGP?

BGP Part-1.

Inter-domain Routing. Outline. Border Gateway Protocol

Routing part 2. Electrical and Information Technology

Q&As. CCIP Configuring BGP on Cisco Routers (BGP) Pass Cisco Exam with 100% Guarantee

Implementing BGP. BGP Functional Overview. Border Gateway Protocol (BGP) is an Exterior Gateway Protocol (EGP) that allows you to create loop-free

Border Gateway Protocol (BGP-4)

IP Routing: BGP Command Reference, Cisco IOS XE Release 3SE (Catalyst 3850 Switches)

H3C S9500 Series Routing Switches

BGP Cost Community. Prerequisites for the BGP Cost Community Feature

Internet Routing : Fundamentals of Computer Networks Bill Nace

CS BGP v4. Fall 2014

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

Border Gateway Protocol

Introduction to BGP ISP/IXP Workshops

BGP Multihoming ISP/IXP Workshops

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

APNIC elearning: BGP Basics. 30 September :00 PM AEST Brisbane (UTC+10) Revision: 2.0

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

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

BGP and the Internet. Why Multihome? Why Multihome? Why Multihome? Why Multihome? Why Multihome? Redundancy. Reliability

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

Fast IP Convergence. Section 4. Period from when a topology change occurs, to the moment when all the routers have a consistent view of the network.

BGP Scaling Techniques

Introduction to BGP. ISP/IXP Workshops

Transcription:

3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 1 0945_05F9_c1.scr 1

Introduction to BGP Scalable, Stable, Simple Session 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 3 Contacts Speaker: Mark Turner (markt@cisco.com) BGP support list: cs-iprouting-bgp@cisco.com Copy of slides: ftp-eng.cisco.com:/markt/bgp_intro.ppt 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 4 0945_05F9_c1.scr 2

Overview What Is BGP? Why Use BGP? Protocol Overview Using BGP Attributes Some Features to Turn off Demo Configs only Not for Use in Real World! 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 5 Prerequisites Know what IP is Know what an ISP is Basic knowledge of IP routing Know what route-maps are Basic Cisco configuration 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 6 0945_05F9_c1.scr 3

Border Gateway Protocol What Is it? Why Use it? 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 7 Complex Network Scalability Scalable Stable Simple 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 8 0945_05F9_c1.scr 4

BGP Basics Peering ISP A A C ISP B B D Customer E ISP C Enterprise A F G 100,000 Routes Many Autonomous Systems Can a Single IGP do this? 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 9 Reasons for Using BGP 1: You need to scale your IGP 2: You re a multi-homed ISP customer and need to implement routing policy 3: You need to transit full Internet routes 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 10 0945_05F9_c1.scr 5

Interior Vs. Exterior Routing Interior Automatic discovery Generally trust your IGP routers Routes go to all IGP routers Exterior Specifically configured peers Connecting with outside networks Set administrative boundaries 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 11 Why Do We Need an EGP? Scaling a large network Divide and Conquer Hierarchy Periodic IGPs/Flooding Isolate network stability Complex Policies Control reachability to prefixes Merge separate organizations Connect multiple IGPs 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 12 0945_05F9_c1.scr 6

Concept of Autonomous System A network(s) sharing the same routing policy Possibly multiple IGPs Usually under single administrative control Contiguous internal connectivity Numbering range form 1 to 65,535 globally unique AS Number Private range: 64512 65535 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 13 IGP of Each AS Is Hidden Peering A C AS 100 AS 101 B D E AS 102 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 14 0945_05F9_c1.scr 7

Reasons for Using BGP 1: You need to scale your IGP 2: You re a multi-homed ISP customer and need to implement routing policy 3: You need to transit full Internet routes 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 15 Stub Network No need for BGP ISP advertises the stub network Policy confined within ISP policy Default to the border 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 16 0945_05F9_c1.scr 8

Stub Network A B AS 101 (ISP) AS 100 Don t Need BGP UNLESS You Want to Control Which Link Is Used for Which Traffic 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 17 Multi-Homed Network Many situations possible Multiple links to same ISP without BGP Secondary for only backup without BGP Loadshare between primary and secondary without BGP Selectively use different ISPs need BGP 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 18 0945_05F9_c1.scr 9

Multi-Homed Network AS 100 A D AS 300 B C AS 200 Can Still Use Default, UNLESS You Want to Selectively Use Either ISP for Optimal Performance 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 19 Multiple Links to the Same ISP I Can still use default for outbound routing For inbound routing: Option1: ISP can use floating statics, or IGP to learn your routes and loadshare Option2: Can use BGP to loadshare ISP AS 201 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 20 0945_05F9_c1.scr 10

Multiple Links to the Same ISP II Simplest scheme is to use two defaults Watershed effect Again, can use statics/igp at borders, or use BGP ISP D F A B 0.0.0.0 AS 201 0.0.0.0 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 21 Multiple Links to the Same ISP III Again, can just use two equal cost defaults to reach ISP Statics/IGP OR BGP to advertise your routes to ISP ISP D F 0.0.0.0 0.0.0.0 A AS 201 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 22 0945_05F9_c1.scr 11

Why Use BGP for Multi-Homing? Tier 1 ISP AS 4 Tier 1 ISP AS 5 AS 6 Tier 2 ISP AS 2 D E Tier 1 ISP AS3 A AS 1 B 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 23 C Reasons for Using BGP You need to scale your IGP You re a multi-homed ISP customer and need to implement routing policy You need to transit full Internet routes 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 24 0945_05F9_c1.scr 12

You Need to Transit Internet Routes (ie, You are an ISP) Rest of the Internet AS 100 A D AS 300 Your Network B AS 200 C Full Internet Routes (Your Multi-homed Customer) 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 25 Back to Basics Peering A C AS 100 AS 101 B D Runs over TCP port 179 Path vector protocol Incremental updates Internal and External BGP AS 102 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 26 E 0945_05F9_c1.scr 13

General Operation Learns multiple paths via internal and external BGP speakers Picks THE bestpath, installs it in the IP forwarding table, forwards to EBGP neighbors (not IBGP) Policies applied by influencing the bestpath selection 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 27 Summary of Operation TCP connection established (port 179) Both peers attempt to connect there is an algorithm to resolve connection collisions Exchange messages to open and confirm the connection parameters Initial exchange of entire table Incremental updates after initial exchange Keep alive messages exchanged when there no updates 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 28 0945_05F9_c1.scr 14

What Are Incremental Updates? IGPs typically rebroadcast routes BGP runs over TCP => reliable date delivery Once BGP sends a route to a peer, it assumes the peer will keep it unless: A replacement route is sent implicit withdraw of old route The route is withdrawn explicit withdraw The BGP session goes down (keepalive failure) 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 29 BGP Sessions Tcp Port 179, 4 Basic Message Types 1: OPEN MESSAGE Exchange AS, router ID, holdtime Capability negotiation 2: NOTIFICATION Example: peer in wrong AS 3: KEEPALIVE when no updates 4: UPDATES (incremental) 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 30 0945_05F9_c1.scr 15

BGP Thru a Firewall Need to open port 179 Both peers try to establish session You can allow only session from inside the firewall it will still work 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 31 BGP Header 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + + + + Marker + + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Length Type +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 32 0945_05F9_c1.scr 16

BGP Header (Cont.) 19 octets Marker: synchronization and authentication. Not used by cisco for authentication (TCP MD5 instead) => all 1 s Type: 1 = OPEN 2 = UPDATE 3 = NOTIFICATION 4 = KEEPALIVE 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 33 KEEPALIVE Message Consists of only the header Algorithm: The defaults are 180sec for the holdtime and 60sec for the keepalive timer. If the user has configured a value, then they override the defaults. The holdtime will be the min of what the router receives in the Open message and the default (or configured) value. If this results in 0, then the keepalive timer will be set to 0 (don t send/expire) If the holdtime is not 0, then it will be set to at least 3 sec. In this case, the keepalive timer will be at least one second or the min between the default (or configured) value, holdtime/3 and (holdtime-1). 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 34 0945_05F9_c1.scr 17

Finite State Machine 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 35 NOTIFICATION Message 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Error code Error subcode Data +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1 = Header error 2 = OPEN message error 3 = UPDATE error 4 = Hold time expired 5 = BGP finite state machine error 6 = Cease all other problems 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 36 0945_05F9_c1.scr 18

BGP Sessions Open Message 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Version My Autonomous System Hold Time BGP Identifier (aka ROUTER_ID) Opt. Parm. Len. Optional Parameters 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 37 Aside on Router ID 1. Use the manually configured address 2. Use the router ID of the OSPF process into which BGP is redistributing routes Use the loopback interface with the highest IP address Use the physical interface with the highest IP address 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 38 0945_05F9_c1.scr 19

BGP Updates Withdraws Attributes Prefixes NLRI: Network Layer Reachability Information 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 39 BGP Attributes Tools for Routing Policy 1: ORIGIN 2: AS-PATH 3: NEXT-HOP 4: MED 5: LOCAL_PREF 6: ATOMIC_AGGREGATE 7: AGGREGATOR 8: COMMUNITY 9: ORIGINATOR_ID 10: CLUSTER_LIST 14: MP_REACH_NLRI 15: MP_UNREACH_NLRI 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 40 0945_05F9_c1.scr 20

Basic Decision Algorithm Consider only (synchronized) routes with no AS loops and valid next-hop, then prefer: Highest WEIGHT Highest LOCAL PREFERENCE LOCALLY ORIGINATED (eg network/aggregate) Shortest AS-PATH Lowest ORIGIN (IGP < EGP < incomplete) Lowest MED EBGP IBGP Lowest IGP METRIC to next-hop Neighbor with lowest ROUTER_ID Full story see: www.cisco.com/warp/public/459/25.shtml 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 41 External BGP Between BGP speakers in different AS Usually directly connected Usually sets next-hop to self Router A router bgp 1 neighbor 2.0.1.1 remote-as 2 Router B router bgp 2 neighbor 2.0.1.2 remote-as 1 2.0.0.0 AS 2.1 B 2.0.1.0 neighbor 2.0.1.2 route-map X {in out}. route-map X permit 10 {set match} <attribute> 1.0.0.0.2 A AS 1 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 42 0945_05F9_c1.scr 21

Internal BGP Neighbor in same AS Next-hop unchanged May be several hops away Don t forward IBGP routes => scaling problem! Router B: Router A: router bgp 1 neighbor 1.0.1.1 remote-as 1 router bgp 1 neighbor 1.0.2.1 remote-as 1 A B 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 43 NEXT_HOP The next hop to reach a network ebgp ibgp IP address of the peer NEXT_HOP advertised by ebgp IGP should carry route to NEXT_HOPs Recursive route lookup Unlinks BGP from the physical topology Allows IGP to make intelligent forwarding decision AS 2 2.0.0.0.1 B 2.0.1.0.2 1.0.0.0 A 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 44 0945_05F9_c1.scr 22

BGP Attributes: NEXT_HOP EBGP next-hop set to self 6.0.1.1 6.0.1.2 AS 1 AS 2 2.0.0.0/8 D E 6.0.0.0/8 F 5.1.1.1 AS 3 B C 5.1.1.2 5.1.1.3 A AS 4 4.0.0.0/8 Prevent GRE VPNS : Don t carry routes for public peering subnets!!!!! 4.0.0.0/8 5.1.1.3 3rd Party EBGP Overriding defaults: 4.0.0.0/8 6.0.1.1 2.0.0.0/8 6.0.1.1 IBGP next-hop unmodified EBGP NLRI only: neighbor x.x.x.x next-hop-self route-map: set ip next-hop { A.B.C.D peeraddress} 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 45 Prevent GRE VPNs AS 2 6.0.1.1 6.0.1.2 2.0.0.0/8 D E AS 1 6.0.0.0/8 F 5.1.1.1 5.1.1.2 C B AS 1 Peering NAP AS1 Has a Free GRE Tunnel Via AS2!! Router E: interface tunnel 0 ip address 6.0.0.1 255.255.255.252 tunnel source 6.0.1.2 tunnel destination 5.1.1.2 ip route 5.1.1.2 255.255.255.255 6.0.1.1 Router B: interface tunnel 0 ip address 6.0.0.2 255.55.255.252 tunnel source 5.1.1.2 tunnel destination 6.0.1.2 ip route 6.0.1.2 255.255.255.255 5.1.1.1 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 46 0945_05F9_c1.scr 23

Details: Overriding Next-Hop (Cont.) Set ip next-hop peer-address If used in an inbound route-map, the next-hop of the received (matching) routes will be set to be the neighbor peering address, thus overriding any third-party next-hops; the same route-map can be applied to multiple BGP peers If used in an outbound route-map, the next-hop of the advertised (matching) routes will be set to be the peering address of the local router, thus disabling the next-hop calculation; this command has finer granularity than the perneighbor next-hop-self command 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 47 Problem: Loop Detection, Policy Solution: AS-PATH AS SEQUENCE List of AS s that a route has traversed AS SET Summarizes contributing sequence Sequence ordering is lost route-map prepend: set as-path prepend 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 48 E AS4 2.0.0/24 D AS1 2.0.1/24 AS2 2.0.2/24 A: 2.0.2.0/24, ASPATH = 4 2 B: 2.0.0.0/24, ASPATH = 4 C: 2.0.1.0/24. ASPATH = 4 1 E: 2.0.0.0/22, ASPATH = 4 {1 2 3} A B AS3 2.0.3/24 C 0945_05F9_c1.scr 24

Detail: AS-SET AS_SET Unordered set of all AS s traversed Helps avoid loops Advertise the prefix and the components AND include AS_SET information in the path 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 49 AS-SET (Cont.) A: 2.0.2.0/24 4 2 B: 2.0.0.0/24 4 C: 2.0.1.0/24 4 1 E: 2.0.0.0/22 4 {1 2 3} AS4 2.0.0/24 D AS1 2.0.1/24 A AS2 2.0.2/24 B AS3 2.0.3/24 E Example: Router D router bgp 4 network 2.0.1.0 mask 255.255.255.0 aggregate address 2.0.0.0 255.255.252.0 as-set ip route 2.0.1.0 255.255.255.0 null0 254 C 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 50 0945_05F9_c1.scr 25

AS PATH and Routing Decisions In the absence of configured policy, the BGP route with the shortest AS PATH is selected as the best path => rightly or wrongly, traffic via the Internet takes the path through the least number of ISPs BUT: path through ISP A may actually be worse than the path through ISP B plus ISP C 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 51 AS-Path pre-pending 9.0.0.0/24 AS4 B AS3 AS2 Configuration (rtr B): router bgp 4 neighbor x.x.x.x remote-as 5 neighbor x.x.x.x route-map prepend out! route -map prepend permit 10 match as-path 2 set as -path prepend 4 4! ip as-path access list 2 permit ^$ AS5 AS1 AS1 sees: 9.0.0.0/24 2 3 4 9.0.0.0/24 5 4 4 4 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 52 A BGP Regular Expression - Match any empty AS Path ie all routes from the Local AS, AS4. 0945_05F9_c1.scr 26

Problem: Indicate Best Path Into AS Solution: MED CITY A AS6 AS3 CITY A AS1 AS2 AS5 AS4 CITY B Conveys relative preference of entry points Lowest MED is best default is no MED==0 Comparable only if paths are from same AS Non-transitive do not pass MED from one AS to another Route-map: set metric set metric-type internal 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 53 Setting MED to Match IGP Cost AS6 AS1 A AS2 AS4 B Configuration: router bgp 1 neighbor x.x.x.x remote-as 2 neighbor x.x x.x route-map set_med out! route-map set_med permit 10 set metric-type internal 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 54 0945_05F9_c1.scr 27

MED and IGP Metric set metric-type internal Enable BGP to advertise a MED which corresponds to the IGP metric values Changes are monitored (and re-advertised if needed) every 600s bgp dynamic-med-interval <secs> 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 55 Problem: Override AS-path/MED? Solution: LOCAL PREFERENCE AS4 AS3 AS2 AS5 AS1 Attribute local to AS mandatory for IBGP updates Highest LOCAL_PREF is preferred default 100 Route-map: set local-preference 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 56 0945_05F9_c1.scr 28

LOCAL_PREF: Configuration AS4 B AS3 AS2 AS5 Configuration (rtr A): router bgp 1 neighbor x.x.x.x remote -as 2 neighbor x.x.x.x route -map foo in! route-map foo permit 10 match as-path 2 set local-preference 120! ip as-path access-list 2 permit ^2 3 4$ AS1 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 57 A bgp regular expression Match only AS Path 2 3 4 LOCAL_PREF Indication of preferred path to exit the local AS Global to the local AS Paths with highest LOCAL-PREF are most desirable (default = 100) bgp default local-preference value 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 58 0945_05F9_c1.scr 29

Weight Used to Deploy RPF AS4 Link to Use for Most Traffic From AS1 AS4, LOCAL_PREF 200 Backup Link, but RPF Still Needs to Work AS1 AS4, LOCAL_PREF 100 Local to router on which it s configured route-map: set weight Highest weight wins over all valid paths Weight customer EBGP on edge routers to allow RPF to work correctly 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 59 Least Useful Attribute Award: ORIGIN IGP network statement under router bgp EGP Redistributed from EGP Incomplete redistribute <IGP process> under router bgp To avoid confusion BGP bestpath decisions, use a route-map to: set origin igp for all BGP routes 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 60 0945_05F9_c1.scr 30

Basic Decision Algorithm Consider only (synchronized) routes with no AS loops and valid next-hop, then prefer: Highest WEIGHT Highest LOCAL PREFERENCE LOCALLY ORIGINATED (eg network/aggregate) Shortest AS-PATH Lowest ORIGIN (IGP < EGP < incomplete) Lowest MED EBGP IBGP Lowest IGP METRIC to next-hop Neighbor with lowest ROUTE_ID Full story see: www.cisco.com/warp/public/459/25.shtml 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 61 Problem: Scale Routing Policy Solution: COMMUNITY NOT in decision algorithm BGP route can be a member of many communities Typical communities: Destinations learned from customers Destinations learned from ISPs or peers Destinations in VPN BGP community is fundamental to the operation of BGP VPNs 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 62 0945_05F9_c1.scr 31

Problem: Scale Routing Policy Solution: COMMUNITY Communities: 1:100 Customer Routes 1:80 ISP Routes ISP 1 ISP 2 ISP 3 ISP 4 0.0.0.0 Customer 1 (No Default, Wants Full Routes) Customer 2 (Uses Default, Wants ISP1 Routes) 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 63 Problem: Scale Routing Policy Solution: COMMUNITY Communities: 1:100 Customer Routes 1:80 ISP Routes ISP 1 Set Community 1:80 Match Community 1:100 ISP 2 Match Community 1:100 1:80 Match Community 1:100 ISP 3 Set Community 1:100 0.0.0.0 ISP 4 Customer 1 (No Default, Wants Full Routes) Customer 2 (Uses Default, Wants Your Routes) 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 64 0945_05F9_c1.scr 32

Attributes in a Route-map as-path Prepend string for a BGP AS-path attribute comm-list Set BGP community list (for deletion) community BGP community attribute dampening Set BGP route flap dampening parameters local-preference BGP local preference path attribute metric Metric value for destination routing protocol origin BGP origin code weight BGP weight for routing table ip next-hop { A.B.C.D peer-address } 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 65 Aside What Is Dampening? Several years ago, route flap was a serious problem for Tier 1 ISPs those running the core of the Internet Constant up and down of routes (route flap or churn) consumes valuable CPU in core Internet routers Many flaps are due to poor configuration Why not penalize unstable configurations? 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 66 0945_05F9_c1.scr 33

Aside What Is Dampening? After several flaps your routes will be dampened => removed from IP forwarding table; you are cut off from parts of the net Routes not re-instated until they are stable You ISP might not dampen you; peers of your ISP (other ISPs) may 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 67 Tip: Confused about route-map Logic? ROUTE-MAP STANZA MATCH CLAUSE/ PREFIX-LIST ACCEPT ROUTE And SET ATTRIBUTE EXIT ROUTE-MAP PERMIT YES/PERMIT YES YES PERMIT NO/DENY NO NO DENY YES/PERMIT NO YES DENY NO/DENY NO NO 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 68 0945_05F9_c1.scr 34

BGP Attributes 75k1#sh ip bgp 10.0.0.0 BGP routing table entry for 10.0.0.0/24, version 139267814 Paths: (1 available, best #1) Not advertised to any peer! AS-PATH AS ID 60 50 {10 20}, (aggregated by 50 16.0.0.2)! NEXT-HOP IGP METRIC PEER-IP PEER-ID 10.0.10.4 (metric 10) from 10.0.0.1 (10.0.0.2) Origin IGP, metric 100, localpref 230, valid, aggregated internal (or external or local), atomic-aggregate, best Community: 64:3 10:0 20:10 Originator: 10.0.0.1, Cluster list: 16.0.0.4, 16.0.0.14 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 69 Synchronization AS2 A AS 1 AS3 IGP Carries all Inter AS Routes B Relic from the dark ages, before pervasive IBGP :-) SYCHRONIZATION RULE: B only advertises prefixes from AS2 that are also know by an IGP Run IBGP, and disable synchronization: router bgp 1 no synchronization 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 70 0945_05F9_c1.scr 35

Summary: The Decision Algorithm Consider only (synchronized) routes with no AS loops and valid next-hop, then prefer: Highest WEIGHT Highest LOCAL PREFERENCE LOCALLY ORIGINATED (eg network/aggregate) Shortest AS-PATH Lowest ORIGIN (IGP < EGP < incomplete) Lowest MED EBGP IBGP Lowest IGP METRIC to next-hop Neighbor with lowest ROUTE_ID Full story see: www.cisco.com/warp/public/459/25.shtml 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 71 Distance AS2 A AS 1 AS3 IGP carries all inter AS routes B B only advertises prefixes from AS2 also in IGP (=>admin distance of EBGP must be < all IGPs) However, if synchronization is disabled: do you really EVER want to prefer EBGP over your IGP? If no, then: router bgp 1 no synchronization distance 200 200 200 EBGP IBGP LOCAL (eg network command) 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 72 0945_05F9_c1.scr 36

The Decision Algorithm Where Is Distance? Consider only (synchronized) routes with no AS loops and valid next-hop, then prefer: Highest WEIGHT Highest LOCAL PREFERENCE LOCALLY ORIGINATED (eg network/aggregate) Shortest AS-PATH Lowest ORIGIN (IGP < EGP < incomplete) Lowest MED EBGP IBGP Lowest IGP METRIC to next-hop Neighbor with lowest ROUTE_ID DISTANCE: - Does not affect BGP bestpath selection. - Is applied to the bestpath prior to insertion in the IP routing table - Lowest DISTANCE is chosen when mulitple routing protocols have the same route. Not part of BGP decision algorithm. 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 73 auto summary By default BGP4 does auto summarization: If you have 24.10.0.0/24, BGP will summarize this into 24/8 to send to EBGP neighbors Very impolite if you have portion of class A! => do this router bgp1 no synchronization no auto-summary distance 200 200 200 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 74 0945_05F9_c1.scr 37

Deterministic Med Prevents inconsistent decision by BGP in some corner cases (mostly for large ISP) Should always be enabled on new network rollouts: router bgp 1 bgp deterministic-med 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 75 Summary BGP scales Internet routing Connects ISPs with AS numbers Not required to connect to the Internet may be useful for multi-homed customers Useful to scale enterprise routing External and internal BGP modes TCP port 179 incremental updates 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 76 0945_05F9_c1.scr 38

Summary BGP attributes: ASPATH, NEXT_HOP MED, LOCAL_PREF allow routing policy via route-map Understand the bestpath decision in order to understand BGP! Scale policy application by grouping routes into large communities 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 77 Summary router bgp 1 bgp deterministic-med no synchronization no auto-summary distance 200 200 200 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 78 0945_05F9_c1.scr 39

Want to Learn about? Real-world configs? Scaling IBGP? Stable connectivity to ISPs? ISP multi-homing using BGP? Routing policy: safeguarding your network, and your ISP/peers? => Come to Deploying BGP (RST-210) 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 79 For Further Reference: BGP bestpath http://www.cisco.com/warp/public/459/25.shtml Case studies on www.cisco.com: http://www.cisco.com/warp/public/ 459/18.html www.cisco.com search BGP <feature> www.nanog.org 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 80 0945_05F9_c1.scr 40

For Further Reference: Cisco Press: Internet Routing Architectures Advanced IP Network Design Large-Scale IP Network Solutions John Stewart, BGP4, Addison Wesley 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 81 Thank You! Related presentations: Deploying BGP RST211 Troubleshooting BGP4 RST310 BGP Power Session PS545 VPN sessions Questions? 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 82 0945_05F9_c1.scr 41

Introduction to BGP Scalable, Stable, Simple Session 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 83 Please Complete Your Evaluation Form Session 3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 84 0945_05F9_c1.scr 42

3003_05_2001_c1 2001, Cisco Systems, Inc. All rights reserved. 85 0945_05F9_c1.scr 43