Border Gateway Protocol

• Routing Protocol used to exchange routing
information between networks
exterior gateway protocol
• Described in RFC1771
work in progress to update
Introduction to BGP www.ietf.org/internet-drafts/draft-ietf-idr-bgp4-23.txt
• The Autonomous System is BGP’s fundamental
ISP/IXP Workshops operating unit
It is used to uniquely identify networks with common
routing policy

Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 1 Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 2

BGP Path Vector Protocol

• BGP is classified as a path vector routing
• Path Vector Protocol
protocol (see RFC 1322)
• Incremental Updates
A path vector protocol defines a route as a
• Many options for policy enforcement pairing between a destination and the
• Classless Inter Domain Routing (CIDR) attributes of the path to that destination.

• Widely used for Internet backbone
• Autonomous systems 12.6.126.0/24 207.126.96.43 1021 0 6461 7018 6337 11268 i

AS Path
Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 3 Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 4

Path Vector Protocol Definitions

AS11268 • Transit – carrying traffic across a network,
AS6337
usually for a fee
AS7018 • Peering – exchanging routing information and
traffic
• Default – where to send traffic when there is
AS500 no explicit match in the routing table

AS6461

AS600

Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 5 Cisco ISP Workshops © 2003, Cisco Systems, Inc. All rights reserved. 6

1

All rights reserved. All rights reserved.txt • Single routing protocol • ASNs are distributed by the Regional Internet Registries Also available from upstream ISPs who are members of one • Usually under single ownership. 12 2 . Cisco Systems. Cisco Systems. 8 Autonomous System (AS) Autonomous System Number (ASN) AS 100 • An ASN is a 16 bit number 1-64511 are assigned by the RIRs 64512-65534 are for private use and should never appear on the Internet 0 and 65535 are reserved • 32 bit ASNs are coming soon • Collection of networks with same routing policy www. Inc. 11 Cisco ISP Workshops © 2003.org/internet-drafts/draft-ietf-idr-as4bytes-07. but need transit a default route. All rights reserved. Backbone of Internet routers which have West Provider D explicit routing information provider B about the rest of the Internet. Inc. Cisco Systems. Inc. 9 Cisco ISP Workshops © 2003. Cisco Systems. Inc. provider C and therefore do not need to use A and B can peer. All rights reserved. 10 Demarcation Zone (DMZ) BGP Basics A C Peering DMZ AS 100 Network AS 101 A C B D AS 100 AS 101 B D E E AS 102 BGP speakers are AS 102 called peers • Shared network between ASes Cisco ISP Workshops © 2003. 7 Cisco ISP Workshops © 2003. Inc. arrangements with D to get packets to/from C Cisco ISP Workshops © 2003. Cisco Systems. Default Free Zone Peering and Transit example provider A The default free zone is made up IXP-East IXP. All rights reserved. All rights reserved.ietf. Inc. trust and of the RIRs administrative control Current ASN allocations up to 32767 have been made to the RIRs • Identified by a unique number Cisco ISP Workshops © 2003. Cisco Systems.

All rights reserved. All rights reserved. 13 Cisco ISP Workshops © 2003. All rights reserved. 16 BGP/IGP model used in ISP networks External BGP Peering (eBGP) • Model representation A AS 100 AS 101 eBGP eBGP eBGP C B iBGP iBGP iBGP iBGP IGP IGP IGP IGP • Between BGP speakers in different AS • Should be directly connected • Never run an IGP between eBGP peers Cisco ISP Workshops © 2003. All rights reserved. 18 3 . Inc. Inc. All rights reserved. Inc. 15 Cisco ISP Workshops © 2003. Cisco Systems. All rights reserved. Cisco Systems. Cisco Systems. Cisco Systems. Inc. Cisco Systems. BGP General Operation Constructing the Forwarding Table • BGP “in” process • Learns multiple paths via internal receives path information from peers and external BGP speakers results of BGP path selection placed in the BGP table • Picks the best path and installs in “best path” flagged the forwarding table • BGP “out” process • Policies applied by influencing the announces “best path” information to peers best path selection • Best paths installed in forwarding table if: prefix and prefix length are unique lowest “protocol distance” Cisco ISP Workshops © 2003. Inc. 17 Cisco ISP Workshops © 2003. Inc. 14 Constructing the Forwarding Table eBGP & iBGP discarded in BGP in • BGP used internally (iBGP) and externally process accepted (eBGP) everything • iBGP used to carry bgp BGP forwarding some/all Internet prefixes across ISP backbone peer table table ISP’s customer prefixes best paths • eBGP used to BGP out out exchange prefixes with other ASes process implement routing policy Cisco ISP Workshops © 2003. Cisco Systems.

All rights reserved. 22 Peering to Loop-back Address Configuring Internal BGP AS 100 ip address on loopback interface Router A in AS100 interface loopback 0 ip address 215.1 255.10.8.255.0 network 220.222. 19 Cisco ISP Workshops © 2003.255.10. All rights reserved.10. 21 Cisco ISP Workshops © 2003.7.1 prefix-list RouterC out neighbor 222. Cisco Systems.2 remote-as 100 Remote ASN neighbor 222.0 neighbor 222. All rights reserved.8.222.222.1 255.2 remote-as 100 Local ASN neighbor 215.255.2 update-source loopback0 Loop-back interface does not go down – ever! neighbor 215.10.255.1 remote-as 101 Remote ASN neighbor 222.220.10.0 mask 255. Inc.222.7. Cisco Systems. 20 Internal BGP (iBGP) Internal BGP Peering (iBGP) • BGP peer within the same AS AS 100 D • Not required to be directly connected A B IGP takes care of inter-BGP speaker connectivity • iBGP speakers need to be fully meshed they originate connected networks E • Topology independent they do not pass on prefixes learned from • Each iBGP speaker must peer with other iBGP speakers every other iBGP speaker in the AS Cisco ISP Workshops © 2003.255.220.2 255.3 update-source loopback0 • iBGP session is not dependent on state of a single ! interface ip address of Router B loopback interface • iBGP session is not dependent on physical topology Cisco ISP Workshops © 2003.7.3 remote-as 100 neighbor 215. Inc. Inc. 23 Cisco ISP Workshops © 2003.222.10. All rights reserved. 24 4 .240 ! Local ASN ! Local ASN router bgp 100 router bgp 101 network 220. Inc.10.1. All rights reserved. Configuring External BGP Configuring External BGP ip address on ip address on ethernet interface ethernet interface Router A in AS100 Router C in AS101 interface ethernet 5/0 interface ethernet 1/0/0 ip address 222.220. Cisco Systems.222.240 ip address 222. Cisco Systems. Cisco Systems.252.255.255.255.7. Cisco Systems. Inc.2 prefix-list RouterA out ! ! ip address of Router C Inbound and ip address of Router A Inbound and ethernet interface outbound filters ethernet interface outbound filters Cisco ISP Workshops © 2003.1 prefix-list RouterC in neighbor 222.222.222.0 • Peer with loop-back address neighbor 215.10.10.10.252.255 ! router bgp 100 Local ASN network 220.10.7.2 prefix-list RouterA in neighbor 222. All rights reserved.10.0 mask 255. Inc.10.

10.1.0 redistribute static ip route 222. Inc. Cisco Systems. Cisco Systems.10. Cisco Systems.0 255. Inc.0 Local ASN network command neighbor 215.0 mask 255.255. 30 5 . Inc.255. All rights reserved.3 update-source loopback0 ! ip address of Router A loopback interface Cisco ISP Workshops © 2003. Inc.0 serial0 aggregate-address • A matching route must exist in the routing network command table before the network is announced • Forces origin to be “IGP” Cisco ISP Workshops © 2003. Configuring Internal BGP Inserting prefixes into BGP ip address on loopback interface Router B in AS100 interface loopback 0 • Two ways to insert prefixes into BGP ip address 215.254.255. 25 Cisco ISP Workshops © 2003.0 serial0 the current routing protocol • Static route must exist before redistribute Will not scale if uncontrolled command will work Best avoided if at all possible • Forces origin to be “incomplete” redistribute normally used with “route-maps” and • Care required! under tight administrative control Cisco ISP Workshops © 2003.0 255.255.7. 29 Cisco ISP Workshops © 2003. 26 Inserting prefixes into BGP – Inserting prefixes into BGP – redistribute static redistribute static • Configuration Example: • Care required with redistribute! router bgp 100 redistribute <routing-protocol> means everything redistribute static in the <routing-protocol> will be transferred into ip route 222. All rights reserved.2 255.1 update-source loopback0 neighbor 215.32. Cisco Systems.7.254. All rights reserved.3 remote-as 100 neighbor 215.1 remote-as 100 neighbor 215.10.7.10. Cisco Systems.32. Inc.255.10.10. Cisco Systems. Inc. All rights reserved.32.254.10. All rights reserved. 27 Cisco ISP Workshops © 2003. All rights reserved.255 ! Local ASN redistribute static router bgp 100 network 220.7.10. 28 Inserting prefixes into BGP – network command Configuring Aggregation • Configuration Example router bgp 100 • Three ways to configure route aggregation network 222.7.220.

255.0 [ summary-only ] from another routing protocol • Requires more specific prefix in routing table before Example: aggregate is announced 61.0 • static route to “null0” is called a pull up route ip route 222.0.0. 33 Cisco ISP Workshops © 2003.255.0 mask 255. Cisco Systems. Cisco Systems. All rights reserved. Inc.0. Configuring Aggregation – Configuring Aggregation Network Command • Configuration Example: router bgp 100 • Configuration Example redistribute static router bgp 100 ip route 222. All rights reserved.255.0.10. 34 Historical Defaults – Synchronisation Summary • Disable historical default 2 • In Cisco IOS.0/8 • {summary-only} keyword optional keyword which ensures that only the summary • Must be turned off for any Internet connected is announced if a more specific prefix exists in the site using BGP routing table router bgp 100 no auto-summary Cisco ISP Workshops © 2003.0. Cisco Systems. All rights reserved.0.10. or iBGP is used across backbone • no synchronization & no auto-summary router bgp 100 no synchronization Cisco ISP Workshops © 2003.255.0 255.10. Cisco Systems.0. All rights reserved.10. Inc. 36 6 . or • announcing prefixes & aggregates All transit routers in AS run BGP.0 null0 250 network 222.255. 31 Cisco ISP Workshops © 2003.8.0/22 → 61. All rights reserved. Inc. Inc. 32 Configuring Aggregation – aggregate-address command Historical Defaults – Auto Summarisation • Disable historical default 1 • Configuration Example • Automatically summarises subprefixes to the router bgp 100 classful network when redistributing to BGP network 222.0 mask 255. Cisco Systems.32.0 255.0.10.0 null0 250 packets only sent here if there is no more specific match in • A matching route must exist in the routing table the routing table before the network is announced distance of 250 ensures this is last resort static • Easiest and best way of generating an aggregate care required – see previously! Cisco ISP Workshops © 2003. Inc. All rights reserved. Cisco Systems.0. 35 Cisco ISP Workshops © 2003. BGP does not advertise a • BGP4 – path vector protocol route before all routers in the AS have learned it via an IGP • iBGP versus eBGP • Disable synchronisation if: • stable iBGP – peer with loopbacks AS doesn’t pass traffic from one AS to another.0 aggregate-address 222. Inc.10.0 255.252.0.

All rights reserved. 37 7 . Inc. Cisco Systems. Introduction to BGP ISP/IXP Workshops Cisco ISP Workshops © 2003.