BGP Attributes and Path Selections

Slides:



Advertisements
Similar presentations
BGP Overview Processing BGP Routes.
Advertisements

BGP Protocol & Configuration Scalable Infrastructure Workshop AfNOG2010.
1 © 2001, Cisco Systems, Inc. All rights reserved. ISP Workshops BGP Deployment & Scalability Mike Pennington Network Consulting Engineer Cisco Systems,
1 Interdomain Traffic Engineering with BGP By Behzad Akbari Spring 2011 These slides are based on the slides of Tim. G. Griffin (AT&T) and Shivkumar (RPI)
1 Copyright  1999, Cisco Systems, Inc. Module10.ppt10/7/1999 8:27 AM BGP — Border Gateway Protocol Routing Protocol used between AS’s Currently Version.
BGP.
Border Gateway Protocol Ankit Agarwal Dashang Trivedi Kirti Tiwari.
CS540/TE630 Computer Network Architecture Spring 2009 Tu/Th 10:30am-Noon Sue Moon.
© J. Liebeherr, All rights reserved 1 Border Gateway Protocol This lecture is largely based on a BGP tutorial by T. Griffin from AT&T Research.
Border Gateway Protocol Autonomous Systems and Interdomain Routing (Exterior Gateway Protocol EGP)
Fundamentals of Computer Networks ECE 478/578 Lecture #18: Policy-Based Routing Instructor: Loukas Lazos Dept of Electrical and Computer Engineering University.
1 Interdomain Routing Protocols. 2 Autonomous Systems An autonomous system (AS) is a region of the Internet that is administered by a single entity and.
1 Network Architecture and Design Routing: Exterior Gateway Protocols and Autonomous Systems Border Gateway Protocol (BGP) Reference D. E. Comer, Internetworking.
Practical and Configuration issues of BGP and Policy routing Cameron Harvey Simon Fraser University.
CS Summer 2003 Lecture 3. CS Summer 2003 What is a BGP Path Attribute? BGP uses a set of parameters known as path attributes to characterize.
CS Summer 2003 Lecture 4. CS Summer 2003 Route Aggregation The process of representing a group of prefixes with a single prefix is known as.
The Border Gateway Protocol (BGP) Sharad Jaiswal.
Computer Networking Lecture 10: Inter-Domain Routing
© 2006 Cisco Systems, Inc. All rights reserved.Cisco PublicBSCI Module 6 1 Configuring Basic BGP BSCI Module 6.
Presented By: Hanping Feng Configuring BGP With Cisco IOS Software (Part 1)
Ion Stoica October 2, 2002 (* this presentation is based on Lakshmi Subramanian’s slides) EE 122: Inter-domain routing – Border Gateway Protocol (BGP)
Release 5.1, Revision 0 Copyright © 2001, Juniper Networks, Inc. Advanced Juniper Networks Routing Module 6: Border Gateway Protocol.
Border Gateway Protocol(BGP) L.Subramanian 23 rd October, 2001.
Border Gateway Protocol (BGP4)
BGP Policy Control.
Introduction to BGP 1. Border Gateway Protocol A Routing Protocol used to exchange routing information between different networks – Exterior gateway protocol.
BGP Training. Terms IGP (Interior Gateway Protocol) - RIP, IGRP, EIGRP, OSPF = Routing protocol used to exchange routing information within an autonomous.
BGP Best Current Practices
1 © 2000, Cisco Systems, Inc. Session # Presentation_ID Border Gateway Protocol.
© 2001, Cisco Systems, Inc. Customer-to-Provider Connectivity with BGP.
Explaining BGP Concepts and Terminology
© 2009 Cisco Systems, Inc. All rights reserved. ROUTE v1.0—6-1 Connecting an Enterprise Network to an ISP Network BGP Attributes and Path Selection Process.
CS 3700 Networks and Distributed Systems Inter Domain Routing (It’s all about the Money) Revised 8/20/15.
The Hebe-jebes (or He-B-GPs): Understanding the Roles of EBGP, IBGP and an IGP Using Lab 7-4, IBGP, Next Hop and Synchronization Rick Graziani Cabrillo.
Lecture 4: BGP Presentations Lab information H/W update.
Chapter 9. Implementing Scalability Features in Your Internetwork.
Border Gateway Protocol
BGP V1.1. When is BGP Applicable Basic BGP Peer Configuration Troubleshooting BGP Connections BGP Operation and Path Attributes Route Import/Export Selected.
BGP routing table entry for /16, version Paths: (4 available, best #1) Advertised to peer-groups: AS4544-AGG-CUSTOMER-FULL
Xuan Zheng (modified by M. Veeraraghavan) 1 BGP overview BGP operations BGP messages BGP decision algorithm BGP states.
© 2001, Cisco Systems, Inc. A_BGP_Confed BGP Confederations.
BGP4 - Border Gateway Protocol. Autonomous Systems Routers under a single administrative control are grouped into autonomous systems Identified by a 16.
Border Gateway Protocol (BGP) W.lilakiatsakun. BGP Basics (1) BGP is the protocol which is used to make core routing decisions on the Internet It involves.
More on Internet Routing A large portion of this lecture material comes from BGP tutorial given by Philip Smith from Cisco (ftp://ftp- eng.cisco.com/pfs/seminars/APRICOT2004.
Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1 ECSE-6600: Internet Protocols Informal Quiz #08: SOLUTIONS Shivkumar Kalyanaraman: GOOGLE: “Shiv.
© 2006 Cisco Systems, Inc. All rights reserved.Cisco PublicBSCI Module 6 1 Configuring Basic BGP BSCI Module 6.
CS 640: Introduction to Computer Networks Aditya Akella Lecture 11 - Inter-Domain Routing - BGP (Border Gateway Protocol)
© 2005 Cisco Systems, Inc. All rights reserved. BGP v3.2—5-1 Customer-to-Provider Connectivity with BGP Connecting a Multihomed Customer to a Single Service.
© 2005 Cisco Systems, Inc. All rights reserved. BGP v3.2—3-1 Route Selection Using Policy Controls Applying Route-Maps as BGP Filters.
© 2005 Cisco Systems, Inc. All rights reserved. BGP v3.2—2-1 BGP Transit Autonomous Systems Forwarding Packets in a Transit AS.
© 2005 Cisco Systems, Inc. All rights reserved. BGP v3.2—1-1 BGP Overview Understanding BGP Path Attributes.
1 Border Gateway Protocol (BGP) and BGP Security Jeff Gribschaw Sai Thwin ECE 4112 Final Project April 28, 2005.
BGP Transit Autonomous System
BGP Basics BGP uses TCP (port 179) BGP Established unicast-based connection to each of its BGP- speaking peers. BGP allowing the TCP layer to handle such.
Route Selection Using Attributes
Text BGP Basics. Document Name CONFIDENTIAL Border Gateway Protocol (BGP) Introduction to BGP BGP Neighbor Establishment Process BGP Message Types BGP.
Bgp-WoRkShOP Arturo Servin | Carlos Martínez. Acknowledges Special thanks to Phillip Smith (APNIC) and Alvaro Retana (Cisco Systems) whose material has.
Border Gateway Protocol DPNM Lab. Seongho Cho
BGP Deployment & Scalability
Working at a Small-to-Medium Business or ISP – Chapter 6
Border Gateway Protocol
BGP Routing Policies.
BGP (cont) 1. BGP Peering 2. BGP Attributes
Explaining BGP Concepts and Terminology
BGP supplement Abhigyan Sharma.
Interdomain Traffic Engineering with BGP
Lixin Gao ECE Dept. UMASS, Amherst
Cours BGP-MPLS-IPV6-QOS
BGP Route Selection.
Working at a Small-to-Medium Business or ISP – Chapter 6
Presentation transcript:

BGP Attributes and Path Selections

The “tools” available for the job BGP Attributes The “tools” available for the job

What Is an Attribute? Part of a BGP Update Next Hop ... ... ... AS Path MED Part of a BGP Update Describes the characteristics of prefix Can either be transitive or non-transitive Some are mandatory

AS-Path Sequence of ASes a route has traversed Mandatory transitive attribute Used for: Loop detection Applying policy AS 200 AS 100 170.10.0.0/16 180.10.0.0/16 180.10.0.0/16 300 200 100 170.10.0.0/16 300 200 AS 300 AS 400 150.10.0.0/16 180.10.0.0/16 300 200 100 170.10.0.0/16 300 200 150.10.0.0/16 300 400 AS 500

AS-Path (with 16 and 32-bit ASNs) Internet with 16-bit and 32-bit ASNs 32-bit ASNs are 65536 and above AS-PATH length maintained AS 80000 AS 70000 170.10.0.0/16 180.10.0.0/16 180.10.0.0/16 300 23456 23456 170.10.0.0/16 300 23456 AS 300 AS 400 150.10.0.0/16 180.10.0.0/16 300 80000 70000 170.10.0.0/16 300 80000 150.10.0.0/16 300 400 AS 90000

AS-Path loop detection 170.10.0.0/16 180.10.0.0/16 140.10.0.0/16 500 300 170.10.0.0/16 500 300 200 AS 300 140.10.0.0/16 180.10.0.0/16 is not accepted by AS100 as the prefix has AS100 in its AS-PATH – this is loop detection in action AS 500 180.10.0.0/16 300 200 100 170.10.0.0/16 300 200 140.10.0.0/16 300

Next Hop AS 200 AS 300 AS 100 iBGP eBGP 150.10.1.1 150.10.1.2 C iBGP AS 200 A B 150.10.0.0/16 eBGP AS 300 150.10.0.0/16 150.10.1.1 160.10.0.0/16 150.10.1.1 eBGP – address of external neighbour iBGP – NEXT_HOP from eBGP Mandatory non-transitive attribute AS 100 160.10.0.0/16

iBGP Next Hop AS 300 iBGP Next hop is ibgp router loopback address 120.1.2.0/23 120.1.1.0/24 Loopback 120.1.254.3/32 iBGP C B Loopback 120.1.254.2/32 AS 300 D A 120.1.1.0/24 120.1.254.2 120.1.2.0/23 120.1.254.3 Next hop is ibgp router loopback address Recursive route look-up

Third Party Next Hop AS 200 AS 205 AS 201 120.68.1.0/24 150.1.1.3 A eBGP between Router A and Router B eBGP between Router B and Router C 120.68.1/24 prefix has next hop address of 150.1.1.3 – this is used by Router A instead of 150.1.1.2 as it is on same subnet as Router B More efficient No extra config needed 150.1.1.1 150.1.1.2 150.1.1.3 B C AS 205 120.68.1.0/24 AS 201

Next Hop Best Practice Cisco IOS default is for external next-hop to be propagated unchanged to iBGP peers This means that IGP has to carry external next-hops Forgetting means external network is invisible With many eBGP peers, it is unnecessary extra load on IGP ISP Best Practice is to change external next-hop to be that of the local router neighbor x.x.x.x next-hop-self

Next Hop (Summary) IGP should carry route to next hops Recursive route look-up Unlinks BGP from actual physical topology Use “next-hop-self” for external next hops Allows IGP to make intelligent forwarding decision

Origin Conveys the origin of the prefix Historical attribute Used in transition from EGP to BGP Transitive and Mandatory Attribute Influences best path selection Three values: IGP, EGP, incomplete IGP – generated by BGP network statement EGP – generated by EGP incomplete – redistributed from another routing protocol

Aggregator Conveys the IP address of the router or BGP speaker generating the aggregate route Optional & transitive attribute Useful for debugging purposes Does not influence best path selection Creating aggregate using “aggregate-address” sets the aggregator attribute: router bgp 100 aggregate-address 100.1.0.0 255.255.0.0

Local Preference AS 100 AS 200 AS 300 AS 400 160.10.0.0/16 D E A B C 500 800 E A B AS 400 160.10.0.0/16 500 > 160.10.0.0/16 800 C

Local Preference Non-transitive and optional attribute Local to an AS only Default local preference is 100 (IOS) Used to influence BGP path selection determines best path for outbound traffic Path with highest local preference wins

Local Preference Configuration of Router B: router bgp 400 neighbor 120.5.1.1 remote-as 300 neighbor 120.5.1.1 route-map local-pref in ! route-map local-pref permit 10 match ip address prefix-list MATCH set local-preference 800 route-map local-pref permit 20 ip prefix-list MATCH permit 160.10.0.0/16

Multi-Exit Discriminator (MED) 120.68.1.0/24 2000 > 120.68.1.0/24 1000 AS 200 C D 120.68.1.0/24 1000 120.68.1.0/24 2000 A B 120.68.1.0/24 AS 400

Multi-Exit Discriminator Inter-AS – non-transitive & optional attribute Used to convey the relative preference of entry points determines best path for inbound traffic Comparable if paths are from same AS bgp always-compare-med allows comparisons of MEDs from different ASes Path with lowest MED wins Absence of MED attribute implies MED value of zero (RFC4271)

MED & IGP Metric IGP metric can be conveyed as MED set metric-type internal in route-map enables 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>

Multi-Exit Discriminator Configuration of Router B: router bgp 400 neighbor 120.5.1.1 remote-as 200 neighbor 120.5.1.1 route-map set-med out ! route-map set-med permit 10 match ip address prefix-list MATCH set metric 1000 route-map set-med permit 20 ip prefix-list MATCH permit 120.68.1.0/24

Weight Not really an attribute – local to router Highest weight wins Applied to all routes from a neighbour neighbor 120.5.7.1 weight 100 Weight assigned to routes based on filter neighbor 120.5.7.3 filter-list 3 weight 50

Weight – Used to help Deploy RPF AS4 Link to use for most traffic from AS1 C AS4, LOCAL_PREF 200 B AS4, LOCAL_PREF 100, weight 100 Backup link, but RPF still needs to work AS1 A Best path to AS4 from AS1 is always via B due to local-pref But packets arriving at A from AS4 over the direct C to A link will pass the RPF check as that path has a priority due to the weight being set If weight was not set, best path back to AS4 would be via B, and the RPF check would fail

Aside: What is uRPF? FIB: 172.16.1.0/24 fa0/0 192.168.1.0/24 se0/1 src=172.16.1.1 fa0/0 se0/1 router src=192.168.1.1 Router compares source address of incoming packet with FIB entry If FIB entry interface matches incoming interface, the packet is forwarded If FIB entry interface does not match incoming interface, the packet is dropped

Weight – Used for traffic policy AS4 Link to use for most customer traffic from AS1 C AS4, LOCAL_PREF 200 B AS7 AS1 D A Router A customers have best path to AS7 AS4, LOCAL_PREF 100, weight 100 Best path to AS4 from AS1 is always via B due to local-pref But customers connected directly to Router A use the link to AS7 as best outbound path because of the high weight applied to routes heard from AS7 If the A to D link goes down, then the Router A customers see best path via Router B and AS4

Community Communities are described in RFC1997 32 bit integer Transitive and Optional Attribute 32 bit integer Represented as two 16 bit integers (RFC1998) Common format is <local-ASN>:xx 0:0 to 0:65535 and 65535:0 to 65535:65535 are reserved Used to group destinations Each destination could be member of multiple communities Very useful in applying policies within and between ASes

Community Example (before) permit 100.10.0.0/16 in X Peer AS1 100.10.0.0/16 permit 160.10.0.0/16 out Upstream AS 400 F E permit 170.10.0.0/16 out D ISP 1 AS 300 permit 160.10.0.0/16 in AS 100 A 160.10.0.0/16 C Transitions explain what needs to be done as each new customer is connected… AS 200 permit 170.10.0.0/16 in B 170.10.0.0/16

Community Example (after) 100.10.0.0/16 300:9 X Peer AS1 100.10.0.0/16 160.10.0.0/16 300:1 Upstream AS 400 F E 170.10.0.0/16 300:1 D ISP 1 AS 300 C Transitions explain what needs to be done as each new customer is connected… 160.10.0.0/16 300:1 AS 200 170.10.0.0/16 300:1 B 170.10.0.0/16 A AS 100 160.10.0.0/16

Well-Known Communities Several well known communities www.iana.org/assignments/bgp-well-known-communities no-export 65535:65281 do not advertise to any eBGP peers no-advertise 65535:65282 do not advertise to any BGP peer no-export-subconfed 65535:65283 do not advertise outside local AS (only used with confederations) no-peer 65535:65284 do not advertise to bi-lateral peers (RFC3765)

No-Export Community A D AS 100 AS 200 G B E F C 105.7.0.0/16 105.7.X.X no-export 105.7.X.X A D 105.7.0.0/16 AS 100 AS 200 G B E F C AS100 announces aggregate and subprefixes Intention is to improve loadsharing by leaking subprefixes Subprefixes marked with no-export community Router G in AS200 does not announce prefixes with no-export community set

C&D&E are peers e.g. Tier-1s No-Peer Community D upstream 105.7.0.0/16 105.7.X.X no-peer C&D&E are peers e.g. Tier-1s 105.7.0.0/16 C E A 105.7.0.0/16 upstream B upstream Sub-prefixes marked with no-peer community are not sent to bi-lateral peers They are only sent to upstream providers

What about 4-byte ASNs? Communities are widely used for encoding ISP routing policy 32 bit attribute RFC1998 format is now “standard” practice ASN:number Fine for 2-byte ASNs, but 4-byte ASNs cannot be encoded Solutions: Use “private ASN” for the first 16 bits Wait for http://datatracker.ietf.org/doc/draft-ietf-idr-as4octet-extcomm-generic-subtype/ to be implemented

Summary Attributes in Action Router6>sh ip bgp BGP table version is 30, local router ID is 10.0.15.246 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, r RIB-failure, S Stale Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path *>i10.0.0.0/26 10.0.15.241 0 100 0 i *>i10.0.0.64/26 10.0.15.242 0 100 0 i *>i10.0.0.128/26 10.0.15.243 0 100 0 i *>i10.0.0.192/26 10.0.15.244 0 100 0 i *>i10.0.1.0/26 10.0.15.245 0 100 0 i *> 10.0.1.64/26 0.0.0.0 0 32768 i ...

BGP Path Selection Algorithm Why is this the best path?

BGP Path Selection Algorithm for Cisco IOS: Part One Do not consider path if no route to next hop Do not consider iBGP path if not synchronised (Cisco IOS) Highest weight (local to router) Highest local preference (global within AS) Prefer locally originated route Shortest AS path

BGP Path Selection Algorithm for Cisco IOS: Part Two Lowest origin code IGP < EGP < incomplete Lowest Multi-Exit Discriminator (MED) If bgp deterministic-med, order the paths by AS number before comparing If bgp always-compare-med, then compare for all paths Otherwise MED only considered if paths are from the same AS (default)

BGP Path Selection Algorithm for Cisco IOS: Part Three Prefer eBGP path over iBGP path Path with lowest IGP metric to next-hop For eBGP paths: If multipath is enabled, install N parallel paths in forwarding table If router-id is the same, go to next step If router-id is not the same, select the oldest path

BGP Path Selection Algorithm for Cisco IOS: Part Four Lowest router-id (originator-id for reflected routes) Shortest cluster-list Client must be aware of Route Reflector attributes! Lowest neighbour address

BGP Attributes and Path Selection ISP Training Workshops

Acknowledgement and Attribution This presentation contains content and information originally developed and maintained by the following organisation(s)/individual(s) and provided for the African Union AXIS Project Cisco ISP/IXP Workshops Philip Smith: - pfsinoz@gmail.com www.apnic.net

BGP Attributes and Path Selection End