bgp techniques for internet service providers - apricot · bgp techniques for internet service...

206
© 2009 Cisco Systems, Inc. All rights reserved. APRICOT2009 1 BGP Techniques for Internet Service Providers Philip Smith <[email protected]> APRICOT 2009 18th-27th February 2009 Manila, Philippines

Upload: doantu

Post on 23-Dec-2018

224 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 1

BGP Techniques for Internet ServiceProviders

Philip Smith <[email protected]>APRICOT 200918th-27th February 2009Manila, Philippines

Page 2: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 2

Presentation Slides

Will be available onftp://ftp-eng.cisco.com/pfs/seminars/APRICOT2009-BGP-Techniques.pdfAnd on the APRICOT 2009 website

Feel free to ask questions any time

Page 3: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 3

BGP Techniques for Internet ServiceProviders

BGP Basics

Scaling BGP

Using Communities

Deploying BGP in an ISP network

Page 4: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 4

BGP Basics

What is BGP?What is BGP?

Page 5: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 5

Border Gateway Protocol

A Routing Protocol used to exchange routinginformation between different networks

Exterior gateway protocol

Described in RFC4271RFC4276 gives an implementation report on BGPRFC4277 describes operational experiences using BGP

The Autonomous System is the cornerstone of BGPIt is used to uniquely identify networks with a common routingpolicy

Page 6: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 6

Autonomous System (AS)

Collection of networks with same routing policy

Single routing protocol

Usually under single ownership, trust and administrative control

Identified by a unique 32-bit integer (ASN)

AS 100

Page 7: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 7

Autonomous System Number (ASN)

Two ranges0-65535 (original 16-bit range)65536-4294967295 (32-bit range - RFC4893)

Usage:0 and 65535 (reserved)1-64495 (public Internet)64496-64511 (documentation - RFC5398)64512-65534 (private use only)23456 (represent 32-bit range in 16-bit world)65536-65551 (documentation - RFC5398)65552-4294967295 (public Internet)

32-bit range representation specified in RFC5396Defines “asplain” (traditional format) as standard notation

Page 8: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 8

Autonomous System Number (ASN)

ASNs are distributed by the Regional InternetRegistries

They are also available from upstream ISPs who are membersof one of the RIRs

Current 16-bit ASN allocations up to 49151 have beenmade to the RIRs

Around 30600 are visible on the Internet

The RIRs also have received 1024 32-bit ASNs each18 are visible on the Internet (early adopters)

See www.iana.org/assignments/as-numbers

Page 9: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 9

AS 100 AS 101

AS 102

EE

BB DD

AA CC

Peering

BGP Basics

Runs over TCP – port 179

Path vector protocol

Incremental updates

“Internal” & “External” BGP

Page 10: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 10

AS 100 AS 101

AS 102

DMZNetwork

AA

BB

CC

DD

EE

Shared network between ASes

Demarcation Zone (DMZ)

Page 11: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 11

BGP General Operation

Learns multiple paths via internal and external BGPspeakers

Picks the best path and installs in the forwarding table

Best path is sent to external BGP neighbours

Policies are applied by influencing the best pathselection

Page 12: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 12

eBGP & iBGP

BGP used internally (iBGP) and externally (eBGP)

iBGP used to carrysome/all Internet prefixes across ISP backboneISP’s customer prefixes

eBGP used toexchange prefixes with other ASesimplement routing policy

Page 13: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 13

BGP/IGP model used in ISP networks

Model representation

IGP

iBGP

IGP

iBGP

IGP

iBGP

IGP

iBGP

eBGP eBGP eBGP

Page 14: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 14

External BGP Peering (eBGP)

Between BGP speakers in different AS

Should be directly connected

Never run an IGP between eBGP peers

AS 100 AS 101CC

AA

BB

Page 15: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 15

Internal BGP (iBGP)

BGP peer within the same AS

Not required to be directly connectedIGP takes care of inter-BGP speaker connectivity

iBGP speakers must to be fully meshed:They originate connected networksThey pass on prefixes learned from outside the ASNThey do not pass on prefixes learned from other iBGP speakers

Page 16: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 16

Internal BGP Peering (iBGP)

Topology independent

Each iBGP speaker must peer with every other iBGPspeaker in the AS

AS 100

AA

DD

CC

BB

Page 17: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 17

Peering to Loopback Interfaces

Peer with loop-back interfaceLoop-back interface does not go down – ever!

Do not want iBGP session to depend on state of a single interfaceor the physical topology

AS 100

Page 18: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 18

BGP Attributes

Information about BGP

Page 19: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 19

AS-Path

Sequence of ASes aroute has traversed

Used for:Loop detectionApplying policy

AS 100

AS 300

AS 200

AS 500

AS 400

170.10.0.0/16 180.10.0.0/16

150.10.0.0/16

180.10.0.0/16 300 200 100170.10.0.0/16 300 200150.10.0.0/16 300 400

180.10.0.0/16 300 200 100170.10.0.0/16 300 200

Page 20: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 20

AS-Path (with 16 and 32-bit ASNs)

Internet with 16-bit and32-bit ASNs

32-bit ASNs are 65536and above

AS-PATH lengthmaintained

180.10.0.0/16 300 23456 23456170.10.0.0/16 300 23456

AS 70000

AS 300

AS 80000

AS 90000

AS 400

170.10.0.0/16 180.10.0.0/16

150.10.0.0/16

180.10.0.0/16 300 80000 70000170.10.0.0/16 300 80000150.10.0.0/16 300 400

Page 21: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 21

AS 100

AS 300

AS 200

AS 500

170.10.0.0/16 180.10.0.0/16

180.10.0.0/16 300 200 100170.10.0.0/16 300 200140.10.0.0/16 300

140.10.0.0/16 500 300170.10.0.0/16 500 300 200

140.10.0.0/16

AS-Path loop detection

180.10.0.0/16 is notaccepted by AS100 as theprefix has AS100 in its AS-PATH – this is loopdetection in action

Page 22: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 22

160.10.0.0/16

150.10.0.0/16

150.10.1.1 150.10.1.2

AS 100

AS 300AS 200

AA BB

CC

150.10.0.0/16 150.10.1.1160.10.0.0/16 150.10.1.1

eBGP

iBGP

Next Hop

eBGP – address of external neighbour iBGP – NEXT_HOP from eBGP Mandatory non-transitive attribute

Page 23: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 23

AS 300

BBCC

120.1.1.0/24 120.1.254.2120.1.2.0/23 120.1.254.3

iBGP120.1.1.0/24

120.1.2.0/23

Loopback120.1.254.2/32

Loopback120.1.254.3/32

AA

DD

iBGP Next Hop

Next hop is ibgp router loopback address Recursive route look-up

Page 24: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 24

120.68.1.0/24

150.1.1.3

150.1.1.1

150.1.1.2

120.68.1.0/24 150.1.1.3

AS 201

AS 200

CC

AA BB

Third Party Next Hop

eBGP between Router Aand Router C

eBGP between RouterA andRouterB

120.68.1/24 prefix has nexthop address of 150.1.1.3 –this is passed on to RouterCinstead of 150.1.1.2

More efficient No extra config needed

Page 25: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 25

Next Hop Best Practice

BGP default is for external next-hop to be propagatedunchanged to iBGP peers

This means that IGP has to carry external next-hopsForgetting means external network is invisibleWith many eBGP peers, it is unnecessary extra load on IGP

ISP Best Practice is to change external next-hop to bethat of the local router

Page 26: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 26

Next Hop (Summary)

IGP should carry route to next hops

Recursive route look-up

Unlinks BGP from actual physical topology

Change external next hops to that of local router

Allows IGP to make intelligent forwarding decision

Page 27: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 27

Origin

Conveys the origin of the prefix

Historical attributeUsed in transition from EGP to BGP

Transitive and Mandatory Attribute

Influences best path selection

Three values: IGP, EGP, incompleteIGP – generated by BGP network statementEGP – generated by EGPincomplete – redistributed from another routing protocol

Page 28: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 28

Aggregator

Conveys the IP address of the router or BGP speakergenerating the aggregate route

Optional & transitive attribute

Useful for debugging purposes

Does not influence best path selection

Page 29: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 29

Local Preference

AS 400

AS 200

160.10.0.0/16AS 100

AS 300

160.10.0.0/16 500> 160.10.0.0/16 800

500 800 EE

BB

CC

AA

DD

Page 30: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 30

Local Preference

Non-transitive and optional attribute

Local to an AS – non-transitiveDefault local preference is 100 (IOS)

Used to influence BGP path selectiondetermines best path for outbound traffic

Path with highest local preference wins

Page 31: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 31

Multi-Exit Discriminator (MED)

AS 201

AS 200

120.68.1.0/24

AA BB120.68.1.0/24 1000120.68.1.0/24 2000

CC DD

120.68.1.0/24 2000> 120.68.1.0/24 1000

Page 32: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 32

Multi-Exit Discriminator

Inter-AS – non-transitive & optional attribute

Used to convey the relative preference of entry pointsdetermines best path for inbound traffic

Comparable if paths are from same ASImplementations have a knob to allow comparisons of MEDsfrom different ASes

Path with lowest MED wins

Absence of MED attribute implies MED value of zero(RFC4271)

Page 33: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 33

Multi-Exit Discriminator“metric confusion”

MED is non-transitive and optional attributeSome implementations send learned MEDs to iBGP peers bydefault, others do notSome implementations send MEDs to eBGP peers by default,others do not

Default metric varies according to vendorimplementation

Original BGP spec (RFC1771) made no recommendationSome implementations said that absence of metric wasequivalent to 0Other implementations said that absence of metric wasequivalent to 232-1 (highest possible) or 232-2Potential for “metric confusion”

Page 34: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 34

Community

Communities are described in RFC1997Transitive and Optional Attribute

32 bit integerRepresented as two 16 bit integers (RFC1998)Common format is <local-ASN>:xx0:0 to 0:65535 and 65535:0 to 65535:65535 are reserved

Used to group destinationsEach destination could be member of multiple communities

Very useful in applying policies within and betweenASes

Page 35: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 35

Community Example(before)

permit 160.10.0.0/16 out

ISP 1permit 100.10.0.0/16 in

XX

ISP 2

100.10.0.0/16

AS 300

AS 400FF

EE

permit 170.10.0.0/16 out

AS 200

permit 170.10.0.0/16 in

BB

170.10.0.0/16

permit 160.10.0.0/16 in

AS 100 AA

160.10.0.0/16

CC

DD

Page 36: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 36

Community Example(after)

160.10.0.0/16 300:1

ISP 1100.10.0.0/16 300:9

XX

ISP 2

100.10.0.0/16

AS 300

AS 400FF

EE

170.10.0.0/16 300:1

AS 200

170.10.0.0/16 300:1

BB

170.10.0.0/16

160.10.0.0/16 300:1

AS 100 AA

160.10.0.0/16

CC

DD

Page 37: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 37

Well-Known Communities

Several well known communitieswww.iana.org/assignments/bgp-well-known-communities

no-export 65535:65281do not advertise to any eBGP peers

no-advertise 65535:65282do not advertise to any BGP peer

no-export-subconfed 65535:65283do not advertise outside local AS (only used withconfederations)

no-peer 65535:65284do not advertise to bi-lateral peers (RFC3765)

Page 38: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 38

105.7.0.0/16105.7.X.X No-Export

105.7.0.0/16

AS 100 AS 200

105.7.X.X

CC FF

GG

DDAA

BB EE

No-Export Community

AS100 announces aggregate and subprefixesIntention 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

Page 39: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 39

No-Peer Community

Sub-prefixes marked with no-peer community are not sent to bi-lateralpeers

They are only sent to upstream providers

105.7.0.0/16105.7.X.X No-Peer

105.7.0.0/16

AA

BB

EE

DD

CC

C&D&E arepeers e.g.

Tier-1s

upstream

upstream

upstream

Page 40: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 40

CommunityImplementation details

Community is an optional attributeSome implementations send communities to iBGP peers bydefault, some do notSome implementations send communities to eBGP peers bydefault, some do not

Being careless can lead to community “confusion”ISPs need consistent community policy within their own networksAnd they need to inform peers, upstreams and customers abouttheir community expectations

Page 41: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 41

BGP Path Selection Algorithm

Why Is This the Best Path?

Page 42: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 42

BGP Path Selection Algorithm for IOSPart One

Do not consider path if no route to next hop

Do not consider iBGP path if not synchronised (CiscoIOS only)

Highest weight (local to router)

Highest local preference (global within AS)

Prefer locally originated route

Shortest AS path

Page 43: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 43

BGP Path Selection Algorithm for IOSPart Two

Lowest origin codeIGP < EGP < incomplete

Lowest Multi-Exit Discriminator (MED)If bgp deterministic-med, order the paths before comparing

(BGP spec does not specify in which order the paths shouldbe compared. This means best path depends on order inwhich the paths are compared.)

If bgp always-compare-med, then compare for all pathsotherwise MED only considered if paths are from the same AS(default)

Page 44: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 44

BGP Path Selection Algorithm for IOSPart Three

Prefer eBGP path over iBGP path

Path with lowest IGP metric to next-hop

Lowest router-id (originator-id for reflected routes)

Shortest Cluster-ListClient must be aware of Route Reflector attributes!

Lowest neighbour IP address

Page 45: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 45

BGP Path Selection Algorithm

In multi-vendor environments:Make sure the path selection processes are understood foreach brand of equipmentEach vendor has slightly different implementations, extra steps,extra features, etcWatch out for possible MED confusion

Page 46: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 46

Applying Policy with BGP

Controlling Traffic Flow & Traffic Engineering

Page 47: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 47

Applying Policy in BGP:Why?

Network operators rarely “plug in routers and go”

External relationships:Control who they peer withControl who they give transit toControl who they get transit from

Traffic flow control:Efficiently use the scarce infrastructure resources (external linkload balancing)Congestion avoidanceTerminology: Traffic Engineering

Page 48: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 48

Applying Policy in BGP:How?

Policies are applied by:Setting BGP attributes (local-pref, MED, AS-PATH, community),thereby influencing the path selection processAdvertising or Filtering prefixesAdvertising or Filtering prefixes according to ASN and AS-PATHsAdvertising or Filtering prefixes according to Communitymembership

Page 49: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 49

Applying Policy with BGP:Tools

Most implementations have tools to apply policies toBGP:

Prefix manipulation/filteringAS-PATH manipulation/filteringCommunity Attribute setting and matching

Implementations also have policy language which cando various match/set constructs on the attributes ofchosen BGP routes

Page 50: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 50

BGP Capabilities

Extending BGP

Page 51: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 51

BGP Capabilities

Documented in RFC2842

Capabilities parameters passed in BGP open message

Unknown or unsupported capabilities will result inNOTIFICATION message

Codes:0 to 63 are assigned by IANA by IETF consensus64 to 127 are assigned by IANA “first come first served”128 to 255 are vendor specific

Page 52: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 52

BGP Capabilities

Current capabilities are: 0 Reserved [RFC3392]

1 Multiprotocol Extensions for BGP-4 [RFC4760]

2 Route Refresh Capability for BGP-4 [RFC2918]

3 Outbound Route Filtering Capability [RFC5291]

4 Multiple routes to a destination capability [RFC3107]

64 Graceful Restart Capability [RFC4724]

65 Support for 4 octet ASNs [RFC4893]

66 Deprecated 2003-03-06

67 Support for Dynamic Capability [ID]

68 Multisession BGP [ID]

See www.iana.org/assignments/capability-codes

Page 53: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 53

BGP Capabilities

Multiprotocol extensionsThis is a whole different world, allowing BGP to support morethan IPv4 unicast routesExamples include: v4 multicast, IPv6, v6 multicast, VPNsAnother tutorial (or many!)

Route refresh is a well known scaling technique –covered shortly

32-bit ASNs have recently arrived

The other capabilities are still in development or notwidely implemented or deployed yet

Page 54: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 54

BGP for Internet Service Providers

BGP Basics

Scaling BGP

Using Communities

Deploying BGP in an ISP network

Page 55: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 55

BGP Scaling Techniques

Page 56: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 56

BGP Scaling Techniques

How does a service provider:Scale the iBGP mesh beyond a few peers?Implement new policy without causing flaps and route churning?Keep the network stable, scalable, as well as simple?

Page 57: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 57

BGP Scaling Techniques

Route Refresh

Route Reflectors

Confederations

Page 58: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 58

Dynamic Reconfiguration

Route Refresh

Page 59: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 59

Route Refresh

BGP peer reset required after every policy changeBecause the router does not store prefixes which are rejectedby policy

Hard BGP peer reset:Terminates BGP peering & Consumes CPUSeverely disrupts connectivity for all networks

Soft BGP peer reset (or Route Refresh):BGP peering remains activeImpacts only those prefixes affected by policy change

Page 60: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 60

Route Refresh Capability

Facilitates non-disruptive policy changes

For most implementations, no configuration is neededAutomatically negotiated at peer establishment

No additional memory is used

Requires peering routers to support “route refreshcapability” – RFC2918

Page 61: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 61

Consider the impact to beequivalent to a router reboot

Dynamic Reconfiguration

Use Route Refresh capability if supportedfind out from the BGP neighbour status displayNon-disruptive, “Good For the Internet”

If not supported, see if implementation has aworkaround

Only hard-reset a BGP peering as a last resort

Page 62: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 62

Route Reflectors

Scaling the iBGP mesh

Page 63: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 63

Two solutionsRoute reflector – simpler to deploy and runConfederation – more complex, has corner case advantages

Avoid ½n(n-1) iBGP mesh

Scaling iBGP mesh

13 Routers ⇒78 iBGP

Sessions!

n=1000 ⇒ nearlyhalf a million

ibgp sessions!

Page 64: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 64

AS 100

Route Reflector: Principle

AA

CCBB

Route Reflector

Page 65: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 65

AS 100

AA

BB CC

Clients

Reflectors

Route Reflector

Reflector receives path fromclients and non-clients

Selects best path

If best path is from client,reflect to other clients andnon-clients

If best path is fromnon-client, reflect to clientsonly

Non-meshed clients

Described in RFC4456

Page 66: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 66

Route Reflector: Topology

Divide the backbone into multiple clusters

At least one route reflector and few clients per cluster

Route reflectors are fully meshed

Clients in a cluster could be fully meshed

Single IGP to carry next hop and local routes

Page 67: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 67

Route Reflector: Loop Avoidance

Originator_ID attributeCarries the RID of the originator of the route in the local AS(created by the RR)

Cluster_list attributeThe local cluster-id is added when the update is sent by the RRBest to set cluster-id is from router-id (address of loopback)(Some ISPs use their own cluster-id assignment strategy – butneeds to be well documented!)

Page 68: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 68

Route Reflector: Redundancy

Multiple RRs can be configured in the same cluster –not advised!

All RRs in the cluster must have the same cluster-id (otherwiseit is a different cluster)

A router may be a client of RRs in different clustersCommon today in ISP networks to overlay two clusters –redundancy achieved that way→ Each client has two RRs = redundancy

Page 69: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 69

Route Reflector: Redundancy

AS 100

Cluster One

Cluster Two

PoP2

PoP1

PoP3

Page 70: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 70

Route Reflector: Benefits

Solves iBGP mesh problem

Packet forwarding is not affected

Normal BGP speakers co-exist

Multiple reflectors for redundancy

Easy migration

Multiple levels of route reflectors

Page 71: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 71

Route Reflector: Deployment

Where to place the route reflectors?Always follow the physical topology!This will guarantee that the packet forwarding won’t be affected

Typical ISP network:PoP has two core routersCore routers are RR for the PoPTwo overlaid clusters

Page 72: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 72

Route Reflector: Migration

Typical ISP network:Core routers have fully meshed iBGPCreate further hierarchy if core mesh too big

Split backbone into regions

Configure one cluster pair at a timeEliminate redundant iBGP sessionsPlace maximum one RR per clusterEasy migration, multiple levels

Page 73: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 73

AS 200

AS 100

AS 300AA

BB

GGFFEE

DD

CC

Route Reflector: Migration

Migrate small parts of the network, one part at a time

Page 74: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 74

BGP Confederations

Page 75: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 75

Confederations

Divide the AS into sub-ASeBGP between sub-AS, but some iBGP information is kept

Preserve NEXT_HOP across thesub-AS (IGP carries this information)Preserve LOCAL_PREF and MED

Usually a single IGP

Described in RFC5065

Page 76: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 76

Confederations (Cont.)

Visible to outside world as single AS – “ConfederationIdentifier”

Each sub-AS uses a number from the private AS range (64512-65534)

iBGP speakers in each sub-AS are fully meshedThe total number of neighbours is reduced by limiting the fullmesh requirement to only the peers in the sub-ASCan also use Route-Reflector within sub-AS

Page 77: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 77

Confederations

Configuration (Router C):router bgp 65532 bgp confederation identifier 200 bgp confederation peers 65530 65531 neighbor 141.153.12.1 remote-as 65530 neighbor 141.153.17.2 remote-as 65531

AS 200

Sub-AS65530

Sub-AS65532 Sub-AS

65531C B

A

Page 78: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 78

Confederations: AS-Sequence

Sub-ASSub-AS6500265002

Sub-ASSub-AS6500365003

Sub-ASSub-AS6500165001

Confederation100

GG

Sub-ASSub-AS6500465004

CC

DD EE

BB

180.10.0.0/16 200

180.10.0.0/16 {65002} 200

AA

180.10.0.0/16 {65004 65002} 200

HH FF

180.10.0.0/16 100 200

Page 79: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 79

Route Propagation Decisions

Same as with “normal” BGP:From peer in same sub-AS → only to external peers

From external peers → to all neighbors

“External peers” refers toPeers outside the confederationPeers in a different sub-AS

Preserve LOCAL_PREF, MED and NEXT_HOP

Page 80: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 80

InternetConnectivity

Multi-LevelHierarchy

Policy Control Scalability

MigrationComplexity

Confederations

RouteReflectors

Anywherein the

NetworkYes Yes

Yes

RRs or Confederations

YesAnywhere

in theNetwork

Medium

Very High Very Low

Mediumto High

Most new service provider networks now deploy Route Reflectors from Day One

Page 81: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 81

More points about Confederations

Can ease “absorbing” other ISPs into you ISP – e.g., ifone ISP buys another

Or can use AS masquerading feature available in someimplementations to do a similar thing

Can use route-reflectors with confederation sub-AS toreduce the sub-AS iBGP mesh

Page 82: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 82

Route Flap Damping

Network Stability for the 1990s

Network Instability for the 21st Century!

Page 83: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 83

Route Flap Damping

For many years, Route Flap Damping was a stronglyrecommended practice

Now it is strongly discouraged as it appears to causefar greater network instability than it cures

But first, the theory…

Page 84: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 84

Route Flap Damping

Route flapGoing up and down of path or change in attribute

BGP WITHDRAW followed by UPDATE = 1 flapeBGP neighbour going down/up is NOT a flap

Ripples through the entire InternetWastes CPU

Damping aims to reduce scope of route flappropagation

Page 85: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 85

Route Flap Damping (continued)

RequirementsFast convergence for normal route changesHistory predicts future behaviourSuppress oscillating routesAdvertise stable routes

Implementation described in RFC 2439

Page 86: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 86

Operation

Add penalty (1000) for each flapChange in attribute gets penalty of 500

Exponentially decay penaltyhalf life determines decay rate

Penalty above suppress-limitdo not advertise route to BGP peers

Penalty decayed below reuse-limitre-advertise route to BGP peerspenalty reset to zero when it is half of reuse-limit

Page 87: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 87

Operation

Reuse limit

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

0

1000

2000

3000

4000

Time

Penalty

Suppress limit

NetworkAnnounced

NetworkRe-announced

NetworkNot Announced

Penalty

Page 88: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 88

Operation

Only applied to inbound announcements from eBGPpeers

Alternate paths still usable

Controllable by at least:Half-lifereuse-limitsuppress-limitmaximum suppress time

Page 89: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 89

Configuration

Implementations allow various policy control with flapdamping

Fixed damping, same rate applied to all prefixesVariable damping, different rates applied to different ranges ofprefixes and prefix lengths

Page 90: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 90

Route Flap Damping History

First implementations on the Internet by 1995

Vendor defaults too severeRIPE Routing Working Group recommendations in ripe-178,ripe-210, and ripe-229http://www.ripe.net/ripe/docsBut many ISPs simply switched on the vendors’ default valueswithout thinking

Page 91: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 91

Serious Problems:

"Route Flap Damping Exacerbates Internet RoutingConvergence“

Zhuoqing Morley Mao, Ramesh Govindan, George Varghese &Randy H. Katz, August 2002

“What is the sound of one route flapping?”Tim Griffin, June 2002

Various work on routing convergence by Craig Labovitzand Abha Ahuja a few years ago

“Happy Packets”Closely related work by Randy Bush et al

Page 92: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 92

Problem 1:

One path flaps:BGP speakers pick next best path, announce to all peers, flapcounter incrementedThose peers see change in best path, flap counter incrementedAfter a few hops, peers see multiple changes simply caused bya single flap → prefix is suppressed

Page 93: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 93

Problem 2:

Different BGP implementations have different transittime for prefixes

Some hold onto prefix for some time before advertisingOthers advertise immediately

Race to the finish line causes appearance of flapping,caused by a simple announcement or path change →prefix is suppressed

Page 94: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 94

Solution:

Do NOT use Route Flap Damping whatever you do!

RFD will unnecessarily impair accessto your network andto the Internet

More information contained in RIPE Routing WorkingGroup recommendations:

www.ripe.net/ripe/docs/ripe-378.[pdf,html,txt]

Page 95: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 95

BGP for Internet Service Providers

BGP Basics

Scaling BGP

Using Communities

Deploying BGP in an ISP network

Page 96: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 96

Service Provider use of Communities

Some examples of how ISPs make life easier forthemselves

Page 97: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 97

BGP Communities

Another ISP “scaling technique”

Prefixes are grouped into different “classes” orcommunities within the ISP network

Each community means a different thing, has a differentresult in the ISP network

Page 98: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 98

BGP Communities

Communities are generally set at the edge of the ISPnetwork

Customer edge: customer prefixes belong to differentcommunities depending on the services they have purchasedInternet edge: transit provider prefixes belong to differencecommunities, depending on the loadsharing or trafficengineering requirements of the local ISP, or what the demandsfrom its BGP customers might be

Two simple examples follow to explain the concept

Page 99: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 99

Community Example: Customer Edge

This demonstrates how communities might be used atthe customer edge of an ISP network

ISP has three connections to the Internet:IXP connection, for local peersPrivate peering with a competing ISP in the regionTransit provider, who provides visibility to the entire Internet

Customers have the option of purchasing combinationsof the above connections

Page 100: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 100

Community Example: Customer Edge

Community assignments:IXP connection: community 100:2100Private peer: community 100:2200

Customer who buys local connectivity (via IXP) is put in community100:2100

Customer who buys peer connectivity is put in community100:2200

Customer who wants both IXP and peer connectivity is put in100:2100 and 100:2200

Customer who wants “the Internet” has no community setWe are going to announce his prefix everywhere

Page 101: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 101

CORE

Aggregation Router

CustomersCustomersCustomers

Border Router

Community Example: Customer Edge

Communities set at the aggregation router where the prefix isinjected into the ISP’s iBGP

Page 102: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 102

Community Example: Customer Edge

No need to alter filters at the network border whenadding a new customer

New customer simply is added to the appropriatecommunity

Border filters already in place take care of announcements⇒ Ease of operation!

Page 103: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 103

Community Example: Internet Edge

This demonstrates how communities might be used atthe peering edge of an ISP network

ISP has four types of BGP peers:CustomerIXP peerPrivate peerTransit provider

The prefixes received from each can be classified usingcommunities

Customers can opt to receive any or all of the above

Page 104: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 104

Community Example: Internet Edge

Community assignments:Customer prefix: community 100:3000IXP prefix: community 100:3100Private peer prefix: community 100:3200

BGP customer who buys local connectivity gets 100:3000 BGP customer who buys local and IXP connectivity receives

community 100:3000 and 100:3100 BGP customer who buys full peer connectivity receives community

100:3000, 100:3100, and 100:3200 Customer who wants “the Internet” gets everything

Gets default route originated by aggregation routerOr pays money to get all 220k prefixes

Page 105: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 105

Community Example: Internet Edge

No need to create customised filters when addingcustomers

Border router already sets communitiesInstallation engineers pick the appropriate community set whenestablishing the customer BGP session⇒ Ease of operation!

Page 106: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 106

Community Example – Summary

Two examples of customer edge and internet edge canbe combined to form a simple community solution forISP prefix policy control

More experienced operators tend to have moresophisticated options available

Advice is to start with the easy examples given, and thenproceed onwards as experience is gained

Page 107: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 107

ISP BGP Communities

There are no recommended ISP BGP communities apart fromRFC1998The five standard communities

www.iana.org/assignments/bgp-well-known-communities

Efforts have been made to document from time to timetotem.info.ucl.ac.be/publications/papers-elec-versions/draft-quoitin-bgp-comm-survey-00.pdfBut so far… nothing more… Collection of ISP communities at www.onesc.net/communitiesNANOG Tutorial:www.nanog.org/meetings/nanog40/presentations/BGPcommunities.pdf

ISP policy is usually publishedOn the ISP’s websiteReferenced in the AS Object in the IRR

Page 108: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 108

Some ISP Examples: Sprintlink

More info atwww.sprintlink.net/policy/bgp.html

Page 109: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 109

Some ISP Examples:NTT

More info atwww.us.ntt.net/about/policy/routing.cfm

Page 110: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 110

Some ISP ExamplesAAPT

Australian ISP

Run their own Routing RegistryWhois.connect.com.au

Offer 6 different communities to customers to aid withtheir traffic engineering

Page 111: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 111

Some ISP ExamplesAAPTaut-num: AS2764as-name: ASN-CONNECT-NETdescr: AAPT Limitedadmin-c: CNO2-APtech-c: CNO2-APremarks: Community support definitionsremarks: remarks: Community Definitionremarks: ------------------------------------------------remarks: 2764:2 Don't announce outside local POPremarks: 2764:4 Lower local preference by 15remarks: 2764:5 Lower local preference by 5remarks: 2764:6 Announce to customers and all peers (incl int'l peers), but not transitremarks: 2764:7 Announce to customers onlyremarks: 2764:14 Announce to AANXnotify: [email protected]: CONNECT-AUchanged: [email protected] 20050225source: CCAIR

More at http://info.connect.com.au/docs/routing/general/multi-faq.shtml#q13

Page 112: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 112

Some ISP ExamplesVerizon Business EMEA

Verizon Business’ European operation Permits customers to send communities which

determinelocal preferences within Verizon Business’ networkReachability of the prefixHow the prefix is announced outside of Verizon Business’network

Page 113: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 113

Some ISP ExamplesVerizon Business Europe

aut-num: AS702descr: Verizon Business EMEA - Commercial IP service provider in Eurremarks: VzBi uses the following communities with its customers: 702:80 Set Local Pref 80 within AS702 702:120 Set Local Pref 120 within AS702 702:20 Announce only to VzBi AS'es and VzBi customers 702:30 Keep within Europe, don't announce to other VzBi AS 702:1 Prepend AS702 once at edges of VzBi to Peers 702:2 Prepend AS702 twice at edges of VzBi to Peers 702:3 Prepend AS702 thrice at edges of VzBi to Peers Advanced communities for customers 702:7020 Do not announce to AS702 peers with a scope of National but advertise to Global Peers, European Peers and VzBi customers. 702:7001 Prepend AS702 once at edges of VzBi to AS702 peers with a scope of National. 702:7002 Prepend AS702 twice at edges of VzBi to AS702 peers with a scope of National.(more)

Page 114: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 114

Some ISP ExamplesVzBi Europe

(more) 702:7003 Prepend AS702 thrice at edges of VzBi to AS702 peers with a scope of National. 702:8020 Do not announce to AS702 peers with a scope of European but advertise to Global Peers, National Peers and VzBi customers. 702:8001 Prepend AS702 once at edges of VzBi to AS702 peers with a scope of European. 702:8002 Prepend AS702 twice at edges of VzBi to AS702 peers with a scope of European. 702:8003 Prepend AS702 thrice at edges of VzBi to AS702 peers with a scope of European. -------------------------------------------------------------- Additional details of the VzBi communities are located at: http://www.verizonbusiness.com/uk/customer/bgp/ --------------------------------------------------------------mnt-by: WCOM-EMEA-RICE-MNTsource: RIPE

Page 115: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 115

Some ISP ExamplesBT Ignite

One of the most comprehensive community listsaround

Seems to be based on definitions originally used in Tiscali’snetworkwhois –h whois.ripe.net AS5400 reveals all

Extensive community definitions allow sophisticatedtraffic engineering by customers

Page 116: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 116

Some ISP ExamplesBT Ignite

aut-num: AS5400descr: BT Ignite European Backboneremarks:remarks: Community to Community toremarks: Not announce To peer: AS prepend 5400remarks:remarks: 5400:1000 All peers & Transits 5400:2000remarks:remarks: 5400:1500 All Transits 5400:2500remarks: 5400:1501 Sprint Transit (AS1239) 5400:2501remarks: 5400:1502 SAVVIS Transit (AS3561) 5400:2502remarks: 5400:1503 Level 3 Transit (AS3356) 5400:2503remarks: 5400:1504 AT&T Transit (AS7018) 5400:2504remarks: 5400:1506 GlobalCrossing Trans(AS3549) 5400:2506remarks:remarks: 5400:1001 Nexica (AS24592) 5400:2001remarks: 5400:1002 Fujitsu (AS3324) 5400:2002remarks: 5400:1004 C&W EU (1273) 5400:2004<snip>notify: [email protected]: CIP-MNTsource: RIPE

And manymany more!

Page 117: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 117

Some ISP ExamplesLevel 3

Highly detailed AS object held on the RIPE RoutingRegistry

Also a very comprehensive list of community definitionswhois –h whois.ripe.net AS3356 reveals all

Page 118: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 118

Some ISP ExamplesLevel 3

aut-num: AS3356descr: Level 3 Communications<snip>remarks: -------------------------------------------------------remarks: customer traffic engineering communities - Suppressionremarks: -------------------------------------------------------remarks: 64960:XXX - announce to AS XXX if 65000:0remarks: 65000:0 - announce to customers but not to peersremarks: 65000:XXX - do not announce at peerings to AS XXXremarks: -------------------------------------------------------remarks: customer traffic engineering communities - Prependingremarks: -------------------------------------------------------remarks: 65001:0 - prepend once to all peersremarks: 65001:XXX - prepend once at peerings to AS XXX<snip>remarks: 3356:70 - set local preference to 70remarks: 3356:80 - set local preference to 80remarks: 3356:90 - set local preference to 90remarks: 3356:9999 - blackhole (discard) traffic<snip>mnt-by: LEVEL3-MNTsource: RIPE And many

many more!

Page 119: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 119

BGP for Internet Service Providers

BGP Basics

Scaling BGP

Using Communities

Deploying BGP in an ISP network

Page 120: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 120

Deploying BGP in an ISP Network

Okay, so we’ve learned all about BGP now; how do weuse it on our network??

Page 121: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 121

Deploying BGP

The role of IGPs and iBGP

Aggregation

Receiving Prefixes

Configuration Tips

Page 122: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 122

The role of IGP and iBGP

Ships in the night?OrGood foundations?

Page 123: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 123

BGP versus OSPF/ISIS

Internal Routing Protocols (IGPs)examples are ISIS and OSPFused for carrying infrastructure addressesNOT used for carrying Internet prefixes or customer prefixesdesign goal is to minimise number of prefixes in IGP to aidscalability and rapid convergence

Page 124: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 124

BGP versus OSPF/ISIS

BGP used internally (iBGP) and externally (eBGP) iBGP used to carry

some/all Internet prefixes across backbonecustomer prefixes

eBGP used toexchange prefixes with other ASesimplement routing policy

Page 125: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 125

BGP/IGP model used in ISP networks

Model representation

IGP

iBGP

IGP

iBGP

IGP

iBGP

IGP

iBGP

eBGP eBGP eBGP

Page 126: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 126

BGP versus OSPF/ISIS

DO NOT:distribute BGP prefixes into an IGPdistribute IGP routes into BGPuse an IGP to carry customer prefixes

YOUR NETWORK WILL NOT SCALE

Page 127: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 127

Injecting prefixes into iBGP

Use iBGP to carry customer prefixesDon’t ever use IGP

Point static route to customer interface Enter network into BGP process

Ensure that implementation options are used so that the prefixalways remains in iBGP, regardless of state of interfacei.e. avoid iBGP flaps caused by interface flaps

Page 128: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 128

Aggregation

Quality or Quantity?

Page 129: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 129

Aggregation

Aggregation means announcing the address blockreceived from the RIR to the other ASes connected toyour network

Subprefixes of this aggregate may be:Used internally in the ISP networkAnnounced to other ASes to aid with multihoming

Unfortunately too many people are still thinking aboutclass Cs, resulting in a proliferation of /24s in theInternet routing table

Page 130: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 130

Aggregation

Address block should be announced to the Internet asan aggregate

Subprefixes of address block should NOT beannounced to Internet unless special circumstances(more later)

Aggregate should be generated internallyNot on the network borders!

Page 131: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 131

Announcing an Aggregate

ISPs who don’t and won’t aggregate are held in poorregard by community

Registries publish their minimum allocation sizeAnything from a /20 to a /22 depending on RIRDifferent sizes for different address blocks

No real reason to see anything longer than a /22 prefixin the Internet

BUT there are currently >146000 /24s!

Page 132: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 132

AS100customer

100.10.10.0/23Internet

100.10.10.0/23100.10.0.0/24100.10.4.0/22…

Aggregation – Example

Customer has /23 network assigned from AS100’s /19 address block

AS100 announces customers’ individual networks to the Internet

Page 133: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 133

Customer link returnsTheir /23 network is nowvisible to their ISPTheir /23 network is re-advertised to peersStarts rippling through InternetLoad on Internet backbonerouters as network isreinserted into routing tableSome ISP’s suppress the flapsInternet may take 10-20 min orlonger to be visibleWhere is the Quality ofService???

Customer link goes downTheir /23 network becomesunreachable/23 is withdrawn from AS100’siBGP

Their ISP doesn’t aggregate its/19 network block

/23 network withdrawalannounced to peersstarts rippling through theInternetadded load on all Internetbackbone routers as networkis removed from routing table

Aggregation – Bad Example

Page 134: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 134

AS100customer

100.10.10.0/23

100.10.0.0/19aggregate

Internet

100.10.0.0/19

Aggregation – Example

Customer has /23 network assigned from AS100’s /19 address block

AS100 announced /19 aggregate to the Internet

Page 135: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 135

Aggregation – Good Example

Customer link goes downtheir /23 network becomesunreachable/23 is withdrawn from AS100’siBGP

/19 aggregate is still beingannounced

no BGP hold down problemsno BGP propagation delaysno damping by other ISPs

Customer link returns

Their /23 network is visibleagain

The /23 is re-injected intoAS100’s iBGP

The whole Internet becomesvisible immediately

Customer has Quality ofService perception

Page 136: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 136

Aggregation – Summary

Good example is what everyone should do!Adds to Internet stabilityReduces size of routing tableReduces routing churnImproves Internet QoS for everyone

Bad example is what too many still do!Why? Lack of knowledge?Laziness?

Page 137: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 137

The Internet Today (February 2009)

Current Internet Routing Table StatisticsBGP Routing Table Entries 280535Prefixes after maximum aggregation 133420Unique prefixes in Internet 137533Prefixes smaller than registry alloc 137717/24s announced 146883

only 5812 /24s are from 192.0.0.0/8ASes in use 30610

Page 138: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 138

“The New Swamp”

Swamp space is name used for areas of pooraggregation

The original swamp was 192.0.0.0/8 from the former class Cblock

Name given just after the deployment of CIDR

The new swamp is creeping across all parts of the InternetNot just RIR space, but “legacy” space too

Page 139: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 139

“The New Swamp”RIR Space – February 1999

RIR blocks contribute 49393 prefixes or 88% of the Internet Routing TableBlock Networks118/8 0119/8 0120/8 0121/8 0122/8 0123/8 0124/8 0125/8 0126/8 0173/8 0174/8 0186/8 0187/8 0189/8 0190/8 0192/8 6275193/8 2390194/8 2932195/8 1338196/8 513198/8 4034199/8 3495200/8 1348

Block Networks201/8 0202/8 2276203/8 3622204/8 3792205/8 2584206/8 3127207/8 2723208/8 2817209/8 2574210/8 617211/8 0212/8 717213/8 1216/8 943217/8 0218/8 0219/8 0220/8 0221/8 0222/8 0

Block Networks24/8 16541/8 058/8 059/8 060/8 061/8 362/8 8763/8 2064/8 065/8 066/8 067/8 068/8 069/8 070/8 071/8 072/8 073/8 074/8 075/8 076/8 077/8 078/8 0

Block Networks79/8 080/8 081/8 082/8 083/8 084/8 085/8 086/8 087/8 088/8 089/8 090/8 091/8 096/8 097/8 098/8 099/8 0112/8 0113/8 0114/8 0115/8 0116/8 0117/8 0

Page 140: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 140

“The New Swamp”RIR Space – February 2009

Block Networks118/8 1084119/8 1282120/8 418121/8 1480122/8 2008123/8 1753124/8 1942125/8 2302126/8 71173/8 991174/8 199186/8 305187/8 516189/8 2259190/8 5319192/8 6990193/8 6382194/8 5056195/8 5003196/8 1753198/8 4673199/8 4177 200/8 8822

Block Networks201/8 3847202/8 11142203/8 11261204/8 5527205/8 3129206/8 3810207/8 4484208/8 6536209/8 5600210/8 4700211/8 2810212/8 3353213/8 3449216/8 7728217/8 2710218/8 1360219/8 1332220/8 2308221/8 1028222/8 1223

Block Networks24/8 313241/8 264258/8 153159/8 158260/8 93261/8 281462/8 244363/8 344764/8 624965/8 441366/8 711267/8 351468/8 268169/8 469870/8 187071/8 149072/8 388273/8 874/8 392675/8 118176/8 103077/8 182278/8 1370

Block Networks79/8 101880/8 227181/8 174082/8 147383/8 129784/8 132785/8 252286/8 79087/8 143088/8 96289/8 316890/8 31191/8 369896/8 51897/8 56798/8 87599/8 249112/8 229113/8 409114/8 615115/8 856116/8 1808117/8 1237

RIR blocks contribute 245261 prefixes or 87% of the Internet Routing Table

Page 141: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 141

“The New Swamp”Summary

RIR space shows creeping deaggregationIt seems that an RIR /8 block averages around 5000 prefixesonce fully allocatedSo their existing 95 /8s will eventually cause 440000 prefixannouncements

Food for thought:Remaining 32 unallocated /8s and the 88 RIR /8s combined willcause:635000 prefixes with 5000 prefixes per /8 density762000 prefixes with 6000 prefixes per /8 densityPlus 12% due to “non RIR space deaggregation”→ Routing Table size of 853440 prefixes

Page 142: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 142

“The New Swamp”Summary

Rest of address space is showing similar deaggregationtoo

What are the reasons?Main justification is traffic engineering

Real reasons are:Lack of knowledgeLazinessDeliberate & knowing actions

Page 143: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 143

BGP Report(bgp.potaroo.net)

199336 total announcements in October 2006 129795 prefixes

After aggregating including full AS PATH infoi.e. including each ASN’s traffic engineering

35% saving possible

109034 prefixesAfter aggregating by Origin AS

i.e. ignoring each ASN’s traffic engineering10% saving possible

Page 144: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 144

Deaggregation: The Excuses

Traffic engineering causes 10% of the Internet Routingtable

Deliberate deaggregation causes 35% of the InternetRouting table

Page 145: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 145

Efforts to improve aggregation

The CIDR ReportInitiated and operated for many years by Tony BatesNow combined with Geoff Huston’s routing analysis

www.cidr-report.orgResults e-mailed on a weekly basis to most operations listsaround the worldLists the top 30 service providers who could do better ataggregating

RIPE Routing WG aggregation recommendationRIPE-399 — http://www.ripe.net/ripe/docs/ripe-399.html

Page 146: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 146

Efforts to Improve AggregationThe CIDR Report

Also computes the size of the routing table assumingISPs performed optimal aggregation

Website allows searches and computations ofaggregation to be made on a per AS basis

Flexible and powerful tool to aid ISPsIntended to show how greater efficiency in terms of BGP tablesize can be obtained without loss of routing and policyinformationShows what forms of origin AS aggregation could be performedand the potential benefit of such actions to the total table sizeVery effectively challenges the traffic engineering excuse

Page 147: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 147

Page 148: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 148

Page 149: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 149

Page 150: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 150

Page 151: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 151

Page 152: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 152

Page 153: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 153

Importance of Aggregation

Size of routing tableMemory is no longer a problemRouters can be specified to carry 1 million prefixes

Convergence of the Routing SystemThis is a problemBigger table takes longer for CPU to processBGP updates take longer to deal withBGP Instability Report tracks routing system update activityhttp://bgpupdates.potaroo.net/instability/bgpupd.html

Page 154: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 154

Page 155: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 155

Page 156: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 156

Aggregation Potential(source: bgp.potaroo.net/as2.0/)

AS Path

AS Origin

Page 157: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 157

AggregationSummary

Aggregation on the Internet could be MUCH better35% saving on Internet routing table size is quite feasibleTools are available

Commands on the routers are not hardCIDR-Report webpage

Page 158: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 158

Receiving Prefixes

Page 159: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 159

Receiving Prefixes

There are three scenarios for receiving prefixes fromother ASNs

Customer talking BGPPeer talking BGPUpstream/Transit talking BGP

Each has different filtering requirements and need to beconsidered separately

Page 160: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 160

Receiving Prefixes:From Customers

ISPs should only accept prefixes which have beenassigned or allocated to their downstream customer

If ISP has assigned address space to its customer, thenthe customer IS entitled to announce it back to his ISP

If the ISP has NOT assigned address space to itscustomer, then:

Check the five RIR databases to see if this address space reallyhas been assigned to the customerThe tool: whois

Page 161: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 161

Receiving Prefixes:From Customers

Example use of whois to check if customer is entitled to announceaddress space:

pfs-pc$ whois -h whois.apnic.net 202.12.29.0

inetnum: 202.12.29.0 - 202.12.29.255

netname: APNIC-AP-AU-BNE

descr: APNIC Pty Ltd - Brisbane Offices + Servers

descr: Level 1, 33 Park Rd

descr: PO Box 2131, Milton

descr: Brisbane, QLD.

country: AU

admin-c: HM20-AP

tech-c: NO4-AP

mnt-by: APNIC-HM

changed: [email protected] 20030108

status: ASSIGNED PORTABLE

source: APNIC

Portable – means its an assignmentto the customer, the customer canannounce it to you

Page 162: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 162

Receiving Prefixes:From Customers

Example use of whois to check if customer is entitled to announceaddress space:

$ whois -h whois.ripe.net 193.128.2.0inetnum: 193.128.2.0 - 193.128.2.15descr: Wood Mackenziecountry: GBadmin-c: DB635-RIPEtech-c: DB635-RIPEstatus: ASSIGNED PAmnt-by: AS1849-MNTchanged: [email protected] 20020211source: RIPE

route: 193.128.0.0/14descr: PIPEX-BLOCK1origin: AS1849notify: [email protected]: AS1849-MNTchanged: [email protected] 20020321source: RIPE

ASSIGNED PA – means that it isProvider Aggregatable address spaceand can only be used for connectingto the ISP who assigned it

Page 163: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 163

Receiving Prefixes:From Peers

A peer is an ISP with whom you agree to exchangeprefixes you originate into the Internet routing table

Prefixes you accept from a peer are only those they haveindicated they will announcePrefixes you announce to your peer are only those you haveindicated you will announce

Page 164: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 164

Receiving Prefixes:From Peers

Agreeing what each will announce to the other:Exchange of e-mail documentation as part of the peeringagreement, and then ongoing updates

ORUse of the Internet Routing Registry and configuration toolssuch as the IRRToolSet

www.isc.org/sw/IRRToolSet/

Page 165: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 165

Receiving Prefixes:From Upstream/Transit Provider

Upstream/Transit Provider is an ISP who you pay togive you transit to the WHOLE Internet

Receiving prefixes from them is not desirable unlessreally necessary

special circumstances – see later

Ask upstream/transit provider to either:originate a default-route

ORannounce one prefix you can use as default

Page 166: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 166

Receiving Prefixes:From Upstream/Transit Provider

If necessary to receive prefixes from any provider, careis required

don’t accept RFC1918 etc prefixesftp://ftp.rfc-editor.org/in-notes/rfc3330.txt

don’t accept your own prefixesdon’t accept default (unless you need it)don’t accept prefixes longer than /24

Check Team Cymru’s bogon pageshttp://www.team-cymru.org/Services/Bogons/http://www.team-cymru.org/Services/Bogons/routeserver.html –bogon route server

Page 167: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 167

Receiving Prefixes

Paying attention to prefixes received from customers,peers and transit providers assists with:

The integrity of the local networkThe integrity of the Internet

Responsibility of all ISPs to be good Internet citizens

Page 168: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 168

Preparing the network

Before we begin…

Page 169: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 169

Preparing the Network

We will deploy BGP across the network before we tryand multihome

BGP will be used therefore an ASN is required If multihoming to different ISPs, public ASN needed:

Either go to upstream ISP who is a registry member, orApply to the RIR yourself for a one off assignment, orAsk an ISP who is a registry member, orJoin the RIR and get your own IP address allocation too

(this option strongly recommended)!

Page 170: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 170

Preparing the NetworkInitial Assumptions

The network is not running any BGP at the momentsingle statically routed connection to upstream ISP

The network is not running any IGP at allStatic default and routes through the network to do “routing”

Page 171: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 171

Preparing the NetworkFirst Step: IGP

Decide on an IGP: OSPF or ISIS

Assign loopback interfaces and /32 address to eachrouter which will run the IGP

Loopback is used for OSPF and BGP router id anchorUsed for iBGP and route origination

Deploy IGP (e.g. OSPF)IGP can be deployed with NO IMPACT on the existing staticroutinge.g. OSPF distance might be 110m static distance is 1Smallest distance wins

Page 172: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 172

Preparing the NetworkIGP (cont)

Be prudent deploying IGP – keep the Link StateDatabase Lean!

Router loopbacks go in IGPWAN point to point links go in IGP(In fact, any link where IGP dynamic routing will be run shouldgo into IGP)Summarise on area/level boundaries (if possible) – i.e. thinkabout your IGP address plan

Page 173: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 173

Preparing the NetworkIGP (cont)

Routes which don’t go into the IGP include:Dynamic assignment pools (DSL/Cable/Dial)Customer point to point link addressing

(using next-hop-self in iBGP ensures that these do NOT need to bein IGP)

Static/Hosting LANsCustomer assigned address spaceAnything else not listed in the previous slide

Page 174: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 174

Preparing the NetworkSecond Step: iBGP

Second step is toconfigure the local networkto use iBGP

iBGP can run onall routers, ora subset of routers, orjust on the upstream edge

iBGP must run on allrouters which are in thetransit path betweenexternal connections

AS200FF EE

DD CCAA

BB

Page 175: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 175

Preparing the NetworkSecond Step: iBGP (Transit Path)

iBGP must run on all routerswhich are in the transit pathbetween external connections

Routers C, E and F are not inthe transit path

Static routes or IGP will suffice

Router D is in the transit pathWill need to be in iBGP mesh,otherwise routing loops willresult

AS200FF EE

DD CCAA

BB

Page 176: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 176

Preparing the NetworkLayers

Typical SP networks have three layers:Core – the backbone, usually the transit pathDistribution – the middle, PoP aggregation layerAggregation – the edge, the devices connecting customers

Page 177: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 177

Preparing the NetworkAggregation Layer

iBGP is optionalMany ISPs run iBGP here, either partial routing (more common)or full routing (less common)Full routing is not needed unless customers want full tablePartial routing is cheaper/easier, might usually consist ofinternal prefixes and, optionally, external prefixes to aid externalload balancing

Communities and peer-groups make this administrativelyeasy

Many aggregation devices can’t run iBGPStatic routes from distribution devices for address poolsIGP for best exit

Page 178: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 178

Preparing the NetworkDistribution Layer

Usually runs iBGPPartial or full routing (as with aggregation layer)

But does not have to run iBGPIGP is then used to carry customer prefixes (does not scale)IGP is used to determine nearest exit

Networks which plan to grow large should deploy iBGPfrom day one

Migration at a later date is extra workNo extra overhead in deploying iBGP, indeed IGP benefits

Page 179: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 179

Preparing the NetworkCore Layer

Core of network is usually the transit path

iBGP necessary between core devicesFull routes or partial routes:

Transit ISPs carry full routes in coreEdge ISPs carry partial routes only

Core layer includes AS border routers

Page 180: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 180

Preparing the NetworkiBGP Implementation

Decide on:

Best iBGP policyWill it be full routes everywhere, or partial, or some mix?

iBGP scaling techniqueCommunity policy?Route-reflectors?Techniques such as peer groups and peer templates?

Page 181: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 181

Preparing the NetworkiBGP Implementation

Then deploy iBGP:Step 1: Introduce iBGP mesh on chosen routers

make sure that iBGP distance is greater than IGP distance (itusually is)

Step 2: Install “customer” prefixes into iBGPCheck! Does the network still work?

Step 3: Carefully remove the static routing for the prefixes nowin IGP and iBGP

Check! Does the network still work?

Step 4: Deployment of eBGP follows

Page 182: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 182

Preparing the NetworkiBGP Implementation

Install “customer” prefixes into iBGP? Customer assigned address space

Network statement/static route combinationUse unique community to identify customer assignments

Customer facing point-to-point linksRedistribute connected through filters which only permit point-to-pointlink addresses to enter iBGPUse a unique community to identify point-to-point link addresses (theseare only required for your monitoring system)

Dynamic assignment pools & local LANsSimple network statement will do thisUse unique community to identify these networks

Page 183: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 183

Preparing the NetworkiBGP Implementation

Carefully remove static routes? Work on one router at a time:

Check that static route for a particular destination is also learned by theiBGPIf so, remove itIf not, establish why and fix the problem(Remember to look in the RIB, not the FIB!)

Then the next router, until the whole PoP is done Then the next PoP, and so on until the network is now dependent

on the IGP and iBGP you have deployed

Page 184: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 184

Preparing the NetworkCompletion

Previous steps are NOT flag day stepsEach can be carried out during different maintenance periods,for example:Step One on Week OneStep Two on Week TwoStep Three on Week ThreeAnd so onAnd with proper planning will have NO customer visible impactat all

Page 185: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 185

Preparing the NetworkExample Two

The network is not running any BGP at the momentsingle statically routed connection to upstream ISP

The network is running an IGP thoughAll internal routing information is in the IGPBy IGP, OSPF or ISIS is assumed

Page 186: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 186

Preparing the NetworkIGP

If not already done, assign loopback interfaces and /32addresses to each router which is running the IGP

Loopback is used for OSPF and BGP router id anchorUsed for iBGP and route origination

Ensure that the loopback /32s are appearing in the IGP

Page 187: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 187

Preparing the NetworkiBGP

Go through the iBGP decision process as in ExampleOne

Decide full or partial, and the extent of the iBGP reachin the network

Page 188: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 188

Preparing the NetworkiBGP Implementation

Then deploy iBGP:Step 1: Introduce iBGP mesh on chosen routers

make sure that iBGP distance is greater than IGP distance (it usually is)Step 2: Install “customer” prefixes into iBGP

Check! Does the network still work?Step 3: Reduce BGP distance to be less than the IGP

(so that iBGP routes take priority)Step 4: Carefully remove the “customer” prefixes from the IGP

Check! Does the network still work?Step 5: Restore BGP distance to less than IGPStep 6: Deployment of eBGP follows

Page 189: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 189

Preparing the NetworkiBGP implementation

Install “customer” prefixes into iBGP?

Customer assigned address spaceNetwork statement/static route combinationUse unique community to identify customer assignments

Customer facing point-to-point linksRedistribute connected through filters which only permit point-to-pointlink addresses to enter iBGPUse a unique community to identify point-to-point link addresses (theseare only required for your monitoring system)

Dynamic assignment pools & local LANsSimple network statement will do thisUse unique community to identify these networks

Page 190: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 190

Preparing the NetworkiBGP implementation

Carefully remove “customer” routes from IGP?

Work on one router at a time:Check that IGP route for a particular destination is also learnedby iBGPIf so, remove it from the IGPIf not, establish why and fix the problem(Remember to look in the RIB, not the FIB!)

Then the next router, until the whole PoP is done

Then the next PoP, and so on until the network is nowdependent on the iBGP you have deployed

Page 191: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 191

Preparing the NetworkCompletion

Previous steps are NOT flag day stepsEach can be carried out during different maintenance periods,for example:Step One on Week OneStep Two on Week TwoStep Three on Week ThreeAnd so onAnd with proper planning will have NO customer visible impactat all

Page 192: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 192

Preparing the NetworkConfiguration Summary

IGP essential networks are in IGP

Customer networks are now in iBGPiBGP deployed over the backboneFull or Partial or Upstream Edge only

BGP distance is greater than any IGP

Now ready to deploy eBGP

Page 193: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 193

Configuration Tips

Of passwords, tricks and templates

Page 194: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 194

iBGP and IGPsReminder!

Make sure loopback is configured on routeriBGP between loopbacks, NOT real interfaces

Make sure IGP carries loopback /32 address

Consider the DMZ nets:Use unnumbered interfaces?Use next-hop-self on iBGP neighboursOr carry the DMZ /30s in the iBGPBasically keep the DMZ nets out of the IGP!

Page 195: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 195

iBGP: Next-hop-self

BGP speaker announces external network to iBGPpeers using router’s local address (loopback) as next-hop

Used by many ISPs on edge routersPreferable to carrying DMZ /30 addresses in the IGPReduces size of IGP to just core infrastructureAlternative to using unnumbered interfacesHelps scale networkMany ISPs consider this “best practice”

Page 196: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 196

Limiting AS Path Length

Some BGP implementations have problems with longAS_PATHS

Memory corruptionMemory fragmentation

Even using AS_PATH prepends, it is not normal to seemore than 20 ASes in a typical AS_PATH in theInternet today

The Internet is around 5 ASes deep on averageLargest AS_PATH is usually 16-20 ASNs

Page 197: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 197

Limiting AS Path Length

Some announcements have ridiculous lengths of AS-paths:

*> 3FFE:1600::/24 22 11537 145 12199 1031810566 13193 1930 2200 3425 293 5609 5430 13285 693914277 1849 33 15589 25336 6830 8002 2042 7610 i

This example is an error in one IPv6 implementation*> 194.146.180.0/22 2497 3257 29686 16327 1632716327 16327 16327 16327 16327 16327 16327 1632716327 16327 16327 16327 16327 16327 16327 1632716327 16327 16327 i

This example shows 20 prepends (for no obvious reason)

If your implementation supports it, consider limiting themaximum AS-path length you will accept

Page 198: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 198

BGP TTL “hack”

Implement RFC5082 on BGP peerings(Generalised TTL Security Mechanism)Neighbour sets TTL to 255Local router expects TTL of incoming BGP packets to be 254No one apart from directly attached devices can send BGPpackets which arrive with TTL of 254, so any possible attack bya remote miscreant is dropped due to TTL mismatch

ISP AS 100Attacker

TTL 254

TTL 253 TTL 254R1 R2

Page 199: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 199

BGP TTL “hack”

TTL Hack:Both neighbours must agree to use the featureTTL check is much easier to perform than MD5(Called BTSH – BGP TTL Security Hack)

Provides “security” for BGP sessionsIn addition to packet filters of courseMD5 should still be used for messages which slip through theTTL hackSee www.nanog.org/mtg-0302/hack.html for more details

Page 200: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 200

Templates

Good practice to configure templates for everythingVendor defaults tend not to be optimal or even very useful forISPsISPs create their own defaults by using configuration templates

eBGP and iBGP examples followAlso see Team Cymru’s BGP templates

http://www.team-cymru.org/ReadingRoom/Documents/

Page 201: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 201

iBGP TemplateExample

iBGP between loopbacks!

Next-hop-selfKeep DMZ and external point-to-point out of IGP

Always send communities in iBGPOtherwise accidents will happen

Hardwire BGP to version 4Yes, this is being paranoid!

Page 202: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 202

iBGP TemplateExample continued

Use passwords on iBGP sessionNot being paranoid, VERY necessaryIt’s a secret shared between you and your peerIf arriving packets don’t have the correct MD5 hash, they areignoredHelps defeat miscreants who wish to attack BGP sessions

Powerful preventative tool, especially when combinedwith filters and the TTL “hack”

Page 203: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 203

eBGP TemplateExample

BGP dampingDo NOT use it unless you understand the impactDo NOT use the vendor defaults without thinking

Remove private ASes from announcementsCommon omission today

Use extensive filters, with “backup”Use as-path filters to backup prefix filtersKeep policy language for implementing policy, rather than basicfiltering

Use password agreed between you and peer on eBGPsession

Page 204: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 204

eBGP TemplateExample continued

Use maximum-prefix trackingRouter will warn you if there are sudden increases in BGP tablesize, bringing down eBGP if desired

Limit maximum as-path length inbound

Log changes of neighbour state…and monitor those logs!

Make BGP admin distance higher than that of any IGPOtherwise prefixes heard from outside your network couldoverride your IGP!!

Page 205: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 205

Summary

Use configuration templates

Standardise the configuration

Be aware of standard “tricks” to avoid compromise ofthe BGP session

Anything to make your life easier, network less prone toerrors, network more likely to scale

It’s all about scaling – if your network won’t scale, thenit won’t be successful

Page 206: BGP Techniques for Internet Service Providers - APRICOT · BGP Techniques for Internet Service Providers Philip Smith APRICOT 2009 18th-27th February 2009 Manila,

© 2009 Cisco Systems, Inc. All rights reserved.APRICOT2009 206

BGP Techniques for Internet ServiceProviders

Philip Smith <[email protected]>APRICOT 200918th-27th February 2009Manila, Philippines