BGP Advanced topics

Olivier Bonaventure
Olivier BonaventureProfessor at Université catholique de Louvain (UCL) and co-founder at Tessares
BGP : Advanced topics
Olivier Bonaventure, UCLouvain, 2018
Agenda
• iBGP and the BGP Decision process
• How to scale iBGP to large networks ?
• BGP traffic engineering
BGP in large networks
• What happens when a network contains tens,
hundreds or thousands of routers ?
AS1
AS2
AS3
AS4
3
How to distribute BGP routes
in a large network ?
AS1
AS2
AS3
eBGP
iBGP
IP addresses used on routers
AS1
AS2
AS3
A /64 prefix belonging
to the AS1, 2001:11:1:/64
A /64 prefix belonging
to AS2, e.g. 2001:222:12:/64 A /64 prefix belonging
to AS1, e.g. 2001:222:11:13:/64
A closer look at the BGP messages
AS1
AS2
2001:222:11:13::33
Prefix: p
AS Path : AS3
BGP Nexhop : 2001:222:11:13::33
AS3
Prefix: p
AS Path : AS3
BGP Nexhop : 2001:222:11:13::33
Prefix: p
AS Path : AS1:AS3
BGP Nexhop : 2001:222:12::1234
2001:222:12::1234
p
Endpoints of the eBGP sessions
• eBGP sessions are TCP connections
established between
the IP addresses of
the two routers
on the peering link
AS1
AS2
2001:222:11:13::33
AS3
2001:222:12::1234
2001:222:12::5678
How to distribute BGP routes
in a large network ?
• Full mesh of iBGP sessions
– Why ?
Draw iBGP sessions in AS1
AS1
AS2
AS3
AS4
Endpoints of the iBGP sessions
• A router has several IP addresses, on which
address should an iBGP session terminate ?
– Any IP address belonging to the router
• Address is associated to an interface, if the interface stops,
iBGP session stops as well even if the router is still reachable
over other interfaces
– A loopback address
• A software only interface that is always up and announced
through the intradomain routing protocol so that it remains
reachable as long as the router has one interface up
• Best Current Practice
How to deal with routers that are not
connected to other ASes ?
• Run BGP on these routers
• Include them in
iBGP full-mesh
AS1
AS2
AS3
How to deal with routers that are not
connected to other ASes ?
• Make sure that they wlll
never have to
forward a packet
to an external
destination
• MPLS
AS1
AS2
AS3
What are the roles of the IGP ?
• The intradomain routing protocol distributes
information about the reachability of :
– IP prefixes associated to internal links between
routers of the AS
– IP addresses associated to loopback interfaces or
routers of the AS
– IP prefixes associated to peering links between a
router of this AS and another AS
BGP Nexthop self
• Helps to reduce # routes in the IGP
AS1
AS2
2001:222:11:13::33
AS3
Prefix: p
AS Path : AS3
BGP Nexhop : 2001:11:1001::1
Prefix: p
AS Path : AS1:AS3
BGP Nexhop : 2001:222:12::1234
2001:11:1001::2
Prefix: p
AS Path : AS3
BGP Nexhop : 2001:222:11:13::33
2001:11:1001::1
2001:222:12::1234
The BGP decision process
1. Ignore routes having an unreachable BGP
nexthop
2. Prefer routes having the highest local-pref
3. Prefer routes having the shortest AS-Path
4. Prefer routes having the smallest MED
5. Prefer routes learned via eBGP sessions over
routes learned via iBGP sessions
6. Prefer routes having the closest next-hop
7. Tie breaking rules : prefer route learned from
the router with lowest router id
1st step of BGP decision process
• 1. Ignore routes having an unreachable BGP
nexthop
– Why would a BGP route contain an unreachable
nexthop ?
Unreachable nexthop
• Usually a transient issue
AS1
AS3
AS2
2nd step of BGP decision process
• 2. Prefer routes having the highest local-pref
– Implement routing policies
• Prefer customer routes over shared-cost and provide
routers
– Support backup routes
• Local-pref attribute to added by the import
filter on eBGP session and distributed to all
routers over iBGP sessions
BGP routes towards prefix p on all
routers inside AS1
AS1
R1
AS4
R2
R3
R4
R5
R6
p
3rd step of BGP decision process
• 3. Prefer routes having the shortest AS-Path
– Some operators believe that a BGP route with a
long AS Path has a lower performance than a
route with a longer AS Path
• This is not always true…
5th step of BGP decision process
• 5. Prefer routes learned via eBGP sessions
over routes learned via iBGP sessions
– Motivation : Hot potato routing
• Routers should try to forward packets towards external
destinations to another AS a quickly as possible
6th step of BGP decision process
• 6. Prefer routes having the closest next-hop
– Motivation : Hot potato routing
• Routers should try to forward packets towards external
destinations to another AS a quickly as possible
BGP routes towards prefix p on all
routers inside AS1
AS1
R1
AS4
R2
R3
R4
R5
R6
p
BGP routes towards prefix p on all
routers inside AS1
AS1
R1
AS4
R2
R3
R4
R5
R6
p
AS2
AS3 AS5
4th step of BGP decision process
• Prefer routes having the smallest MED
• MED means Multi-Exit Discriminator
– Motivation : Cold potato routing
– Enable neighbour AS (usually customer) to
indicate the best peering link to reach a given
prefix
BGP routes towards prefix p on all
routers inside AS1
AS1
R1
AS4
R2
R3
R4
R5
R6
p
BGP routes towards prefix p on all
routers inside AS1
AS1
R1
AS4
R2
R3
R4
R5
R6
p
AS2
AS3
IGP=7
IGP=2
7th step of the BGP decision process
• 7. Tie breaking rules : prefer route learned from
the router with lowest router id
– Motivation : select a single best route towards each
destination prefix
• This best route is the route that can be advertised over eBGP
session
– Note that recent routers sometimes load balance
(BGP Multipath) the traffic towards a given prefix over
several routes (having the same BGP attributes)
Differences between
iBGP and eBGP
– Which routes are advertised by a router over iBGP
and eBGP sessions ?
• Over an eBGP session, a router advertises its best route
towards each destination prefix
– Provided this advertisement is allowed by the export filter
– At most one route per destination prefix
• Over an iBGP session, a router advertises its best route
towards each destination prefix provided that this best
route was learned over an eBGP session
– Since iBGP sessions are in full-mesh, there is no need to
readvertise a route learned over another iBGP session
Differences between
iBGP and eBGP
– Which filters are used over iBGP and eBGP sessions
?
• Import and export filters are used over all eBGP sessions
– Usually, there is a series of import filters attached to each
peering link
– Filters are usually implemented as modules that are combined
together and associated to similar peering links (e.g. customer
filter, provider filter, …)
• No filter is applied on iBGP sessions
Differences between
iBGP and eBGP
– What are the attributes carried by iBGP and eBGP
• Prefix : iBGP and eBGP
• AS Path : iBGP and eBGP
– AS Path is updated when a BGP message is sent over an eBGP
session
• Local-pref : iBGP
– Local-pref cannot be used on eBGP sessions
• MED : iBGP and eBGP
• Nexthop : iBGP and eBGP
– Nexthop is updated when a BGP message is sent over an eBGP
session
What happens if iBGP sessions are
missing ?
AS1
R1
AS4
R4
R5
R6
p
AS2
AS3 AS5
IGP=7
What happens if iBGP sessions are
missing ?
AS1
R1
AS4
R4
R5
R6
p
AS2
AS3 AS5
What happens if iBGP sessions are
missing ?
AS1
R1
AS4
R4
R5
R6
p
AS2
AS3 AS5
Conclusion
• BGP depends on the underlying intradomain
routing protocol
– Establishment of the iBGP sessions
– Resolution of the BGP nexthop
• iBGP and eBGP play different roles
– eBGP over sessions with routers in other ASes
– iBGP sessions (in full mesh) inside an AS
• The BGP decision process ranks routes
– Hot potato versus cold potato routing
Reading list
1st edition, BGP section
http://cnp3book.info.ucl.ac.be/network/networ
k/#the-border-gateway-protocol
J. Park et al, “BGP Route Reflection Revisited”,
IEEE Communications Magazine, June 2012,
http://irl.cs.ucla.edu/~j13park/rr-commag.pdf
Agenda
• iBGP and the BGP Decision process
• How to scale iBGP to large networks ?
• BGP traffic engineering
Interactions between IGP and iBGP
• What are the interactions between iBGP and
the intradomain routing protocol ?
– iBGP sessions are TCP connections whose
endpoints are reachable thanks to IGP
• Endpoints of iBGP sessions are usually loopback
interfaces advertised in IGP
– BGP Nexthops are reachable thanks to IGP
– BGP decision process uses reachability and IGP
cost towards BGP nexthop to rank routes
Creation of iBGP sessions
• How are iBGP sessions created on routers ?
– Usually by manual configuration on each router
group INTERNET2-IPv6 {
type internal;
local-address 2001:468:a::1;
family inet6 {
any;
}
export NEXT-HOP-SELF;
peer-as 11537;
neighbor 2001:468:1::1 {
description ATLA;
}
...
Scaling issues with iBGP
• In a network containing N routers
– N*(N-1)/2 iBGP sessions need to be manually
configured and maintained
• Scalability issues
– CPU usage to process and send iBGP messages
• About 600k routes on IPv4 Internet today
– Number of iBGP sessions on each router
• TCP state, BGP Keepalives, …
– Memory consumption
• ADJ-RIB-IN, ADJ-RIB-OUT, ...
Improving iBGP scaling
• Two approaches
– Route Reflectors
• A RR is a special iBGP router that is allowed, under
specific conditions, to advertise over iBGP sessions
routes learned over other iBGP sessions
– BGP confederations
• A large AS is divided in smaller (sub-)ASes containing a
few tens of routers in iBGP full mesh. The sub-ASes use
eBGP to exchange BGP routes
How to design an iBGP hierarchy
• A RR has two types of iBGP neighbours
RR1
R6R1
R8
R9
Client sessions
Non-Client
sessions
Operation of Route Reflectors
• Reception of a new route
– Run BGP decision process on RR
– If best route has changed
• If best route was learned from eBGP session
– Advertise the best route to all iBGP sessions
• If best route was learned from an iBGP client session
– Advertise the best route to all iBGP sessions (clients and non-
clients)
• If best route was learned from a non-client iBGP session
– Advertise the best route to all client iBGP sessions (non-client
sessions are assumed to be in full-mesh and will also receive the
new route from their own iBGP session)
Benefits of using RRs
• Simplified configuration
– A new router can be easily added to the network
• Reduced memory and CPU usage on routers
– Each router maintains fewer iBGP sessions
– Route Reflectors do not announce all routes to
their BGP clients, reducing their memory usage
– Route Reflectors are often specialised devices with
faster CPU and memory that only run BGP and IGP
but do not forward regular packets
Caveats with Route Reflectors
• Route reflectors hide routes to iBGP clients
– A RR only advertises its best route towards each
prefix over a given iBGP session
– A RR runs the BGP decision process on the basis of
its IGP routing table
• iBGP clients could select a different best route than
their RR
• Route reflectors can increase convergence
time after failures
Caveats with Route Reflectors
• Since RRs advertise iBGP learned routes over
iBGP sessions, a badly configured iBGP
topology may cause loops
RR1
R6R1
RR3
RR2
How to prevent loops
• BGP Route Reflection introduces two new
iBGP attributes
– ORIGINATOR_ID
• Set to the router id of the router that injects a route in
iBGP
– CLUSTER_LIST
• When a RR receives a route, it checks whether its
router id is included in the CLUSTER_LIST. If yes, the
route is rejected.
• When a RR sends a route over an iBGP session, it adds
its router id to the CLUSTER_LIST
Fault tolerance
• If a Route Reflector fails, a large number of
BGP routers will be affected and lose BGP
routes
• How to mitigate this problem ?
– Use redundant route reflectors that are deployed
in pairs
– Each BGP router is attached to at least two
different RRs
Fault tolerance
• In practice, each BGP router is usually
attached to two RRs that are close to itself in
the IGP topology
RR1
R6
R1
RR3
RR2
Route Reflectors
• What are the routes learned if R3 acts as RR
for the entire AS1 ?
AS1
R1
AS4
R2
R3
R4
R5
R6
p
Route Reflectors
• What are the routes learned if both R3 and R5
act as RR for the entire AS1 ?
AS1
R1
AS4
R2
R3
R4
R5
R6
p
Which routes are selected ?
AS1
R1
AS4
R2
R3
R4
R5
R6
p
AS2
AS3 AS5
What is the best place for a single RR ?
AS1
R1
AS4
R2
R3
R4
R5
R6
p
AS2
AS3 AS5
What is the best location for two RR ?
AS1
R1
AS4
R2
R3
R4
R5
R6
p
AS2
AS3 AS5
Hierarchy of Route Reflectors
AS1
R1
R2
R3
R4
R5
R6
R7
R8
R9
RA
RB
p
AS2
AS3 AS5
What are the forwarding paths
towards p advertised by AS6 ?
R5 R6
AS6
R1 R3
C=1C=1
C=1
C=5
Agenda
• iBGP and the BGP Decision process
• How to scale iBGP to large networks ?
• BGP traffic engineering
Prefer customer, ...
AS1
R1
R2
R3
R4
R5
R6
AS2 AS3
AS4
AS5
AS6
AS7
$
$
$
$ $
=
Forwarding paths from AS7 to AS8 and
vice-versa
AS1
R1
R2
R3
R4
R5
R6
AS7
AS8
Customer wants packets towards
p1 via R2 and p2 via R5
AS1
R1
R2
R3
R4
R5
R6
AS7
Customer
p1 p2
Fun with MED
• iBGP full mesh
R5 R6
AS4
AS5AS6
R1 R2 R3
C=4
C=2
C=1
C=1
MED=0MED=1
p
MED=0
Fun with MED (2)
• With RRs
R5 R6
AS4
AS5AS6
R1 R2 R3
C=4
C=2
C=1
C=1
MED=0MED=1MED=0
p
Incoming traffic engineering
• How can a customer distribute the load on its
links ?
– one third of traffic on each link ?
ISP
R1
R2
R3
R4
R5
R6
Customerp
More specific prefixes
AS1
R1
R2
R3
R4
R5
R6
AS7
AS9
p0/49
p1/49
p/48
p/48
More specific prefixes
AS1
R1
R2
R3
R4
R5
R6
AS7
AS9
p0/49
p1/49
p0/49 AS9
p1/49 AS9
More specific prefixes
AS1
R1
R2
R3
R4
R5
R6
AS7
AS9
p0/49
p1/49
p0/49 AS9
p/48 AS9 p1/49 AS9
p/48 AS9
AS Path prepending
AS1
R1
R2
R3
R4
R5
R6
AS7
AS9
p0/49
p1/49
p/48 AS9
p/48 AS9:AS9:AS9
Backup links
• How can an ISP provide backup services to its
customers ?
ISP
R1
R2
R3
R4
R5
R6
BGP Communities
• BGP Communities can be attached to BGP
routes in import filter
– To indicate geographical location
– To indicate type of BGP session
– …
• BGP Communities can be attached to BGP
routes in export filter
– To request neighbour AS to treat the route in a
specifix way
How to provide restricted transit ?
ISP
R1
R2
R3
R5
R6
Customer1 Customer3
Customer2
How to provide richer customer
policies ?
• Customer wants to receive packets from US
via AS1 and from Europe via AS2
R1
R2
R3
R5
R6
CustomerAS1
AS2
AS-Path length is not always a
synonym of path quality
• How to prefer AS1 in US, AS2 in Europe
ISP
R1
R2
R3
R5
R6
AS1
AS2
Things to remember
when defining BGP policies
• Any tweaking you do could affects scalability
Source http://bgp.potaroo.net/tools/asn32
Size of IPv6 routing tables
Source http://bgp.potaroo.net/v6/as6447/
Size of IPv4 BGP routing tables
Source http://bgp.potaroo.net/as6447/
BGP communities
• Are by default transitive..
• Any BGP community that you add when
receiving routes will be advertised all over the
Internet
– you should clean your BGP communities when
advertising routes over eBGP, but router
configuration languages do not always make this
easy
Existing BGP communities
• Sprint
– https://www.sprint.net/index.php?p=policy_bgp
– Looking glass https://www.sprint.net/lg/lg_start.php
• Level3
– http://www.scn.rain.com/~neighorn/PDF/Traffic_Engineeri
ng_with_BGP_and_Level3.pdf
• NTT America
– https://www.us.ntt.net/support/policy/routing.cfm
• Internet2
– https://noc.net.internet2.edu/i2network/maps-
documentation/documentation/bgp-communities.html
References
• K. Fster, Application of BGP Communities, The Internet
Protocol Journal - Volume 6, Number 2, July 2003
• B. Donnet and O. Bonaventure. On BGP Communities.
ACM SIGCOMM Computer Communication Review,
38(2):55-59, April 2008.
– http://inl.info.ucl.ac.be/publications/bgp-communities
• B. Quoitin, S. Uhlig, C. Pelsser, L. Swinnen and O.
Bonaventure. Interdomain traffic engineering with BGP.
IEEE Communications Magazine Internet Technology
Series, 41(5):122-128, May 2003.
– http://inl.info.ucl.ac.be/publications/interdomain-traffic-
engineering-bgp
1 of 78

Recommended

BGP by
BGP BGP
BGP Reza Farahani
547 views56 slides
MPLS L3 VPN Tutorial, by Nurul Islam Roman [APNIC 38] by
MPLS L3 VPN Tutorial, by Nurul Islam Roman [APNIC 38]MPLS L3 VPN Tutorial, by Nurul Islam Roman [APNIC 38]
MPLS L3 VPN Tutorial, by Nurul Islam Roman [APNIC 38]APNIC
10.5K views54 slides
MENOG-Segment Routing Introduction by
MENOG-Segment Routing IntroductionMENOG-Segment Routing Introduction
MENOG-Segment Routing IntroductionRasoul Mesghali, CCIE RS
395 views90 slides
Bgp tutorial for ISP by
Bgp tutorial for ISPBgp tutorial for ISP
Bgp tutorial for ISPWahyu Nasution
5.2K views213 slides
VTP by
VTPVTP
VTPHaidar-Mohammed
4.6K views24 slides
Inter-AS MPLS VPN Deployment by
Inter-AS MPLS VPN DeploymentInter-AS MPLS VPN Deployment
Inter-AS MPLS VPN DeploymentBangladesh Network Operators Group
3K views33 slides

More Related Content

What's hot

SEGMENT Routing by
SEGMENT RoutingSEGMENT Routing
SEGMENT RoutingBangladesh Network Operators Group
577 views46 slides
MPLS (Multi-Protocol Label Switching) by
MPLS  (Multi-Protocol Label Switching)MPLS  (Multi-Protocol Label Switching)
MPLS (Multi-Protocol Label Switching)NetProtocol Xpert
2K views21 slides
Bidirectional Forwarding Detection (BFD) by
Bidirectional Forwarding Detection (BFD) Bidirectional Forwarding Detection (BFD)
Bidirectional Forwarding Detection (BFD) KHNOG
2.9K views11 slides
VXLAN BGP EVPN: Technology Building Blocks by
VXLAN BGP EVPN: Technology Building BlocksVXLAN BGP EVPN: Technology Building Blocks
VXLAN BGP EVPN: Technology Building BlocksAPNIC
2.8K views71 slides
13. eigrp and ospf by
13. eigrp and ospf13. eigrp and ospf
13. eigrp and ospfSwarndeep Singh
1.5K views49 slides
Segment Routing by
Segment RoutingSegment Routing
Segment RoutingAPNIC
1.3K views13 slides

What's hot(20)

Bidirectional Forwarding Detection (BFD) by KHNOG
Bidirectional Forwarding Detection (BFD) Bidirectional Forwarding Detection (BFD)
Bidirectional Forwarding Detection (BFD)
KHNOG2.9K views
VXLAN BGP EVPN: Technology Building Blocks by APNIC
VXLAN BGP EVPN: Technology Building BlocksVXLAN BGP EVPN: Technology Building Blocks
VXLAN BGP EVPN: Technology Building Blocks
APNIC2.8K views
Segment Routing by APNIC
Segment RoutingSegment Routing
Segment Routing
APNIC1.3K views
Segment Routing: A Tutorial by APNIC
Segment Routing: A TutorialSegment Routing: A Tutorial
Segment Routing: A Tutorial
APNIC17K views
BGP (border gateway routing protocol) by Netwax Lab
BGP (border gateway routing protocol)BGP (border gateway routing protocol)
BGP (border gateway routing protocol)
Netwax Lab858 views
TechWiseTV Workshop: Segment Routing for the Datacenter by Robb Boyd
TechWiseTV Workshop: Segment Routing for the DatacenterTechWiseTV Workshop: Segment Routing for the Datacenter
TechWiseTV Workshop: Segment Routing for the Datacenter
Robb Boyd1.3K views
VoWifi 03 - vowifi epdg aaa and architecture (pdf ppt) by Vikas Shokeen
VoWifi 03 - vowifi epdg aaa and architecture (pdf ppt)VoWifi 03 - vowifi epdg aaa and architecture (pdf ppt)
VoWifi 03 - vowifi epdg aaa and architecture (pdf ppt)
Vikas Shokeen589 views
Building DataCenter networks with VXLAN BGP-EVPN by Cisco Canada
Building DataCenter networks with VXLAN BGP-EVPNBuilding DataCenter networks with VXLAN BGP-EVPN
Building DataCenter networks with VXLAN BGP-EVPN
Cisco Canada12.4K views
BGP Path Selection & Attributes BGP Weight & BGP AS-Path Prepending by Shawan Roy
BGP Path Selection & Attributes BGP Weight & BGP AS-Path PrependingBGP Path Selection & Attributes BGP Weight & BGP AS-Path Prepending
BGP Path Selection & Attributes BGP Weight & BGP AS-Path Prepending
Shawan Roy418 views
Segment Routing Advanced Use Cases - Cisco Live 2016 USA by Jose Liste
Segment Routing Advanced Use Cases - Cisco Live 2016 USASegment Routing Advanced Use Cases - Cisco Live 2016 USA
Segment Routing Advanced Use Cases - Cisco Live 2016 USA
Jose Liste3.6K views
PLNOG15: BGP New Advanced Features - Piotr Wojciechowski by PROIDEA
PLNOG15: BGP New Advanced Features - Piotr WojciechowskiPLNOG15: BGP New Advanced Features - Piotr Wojciechowski
PLNOG15: BGP New Advanced Features - Piotr Wojciechowski
PROIDEA183 views
MPLS Deployment Chapter 1 - Basic by Ericsson
MPLS Deployment Chapter 1 - BasicMPLS Deployment Chapter 1 - Basic
MPLS Deployment Chapter 1 - Basic
Ericsson4.3K views

Similar to BGP Advanced topics

Part8-ibgp.pptx by
Part8-ibgp.pptxPart8-ibgp.pptx
Part8-ibgp.pptxOlivier Bonaventure
10 views35 slides
Computer network (14) by
Computer network (14)Computer network (14)
Computer network (14)NYversity
249 views50 slides
PLNOG 6: Rafał Szarecki - Routing w Sieci - Praktyczne aspekty implementacji ... by
PLNOG 6: Rafał Szarecki - Routing w Sieci - Praktyczne aspekty implementacji ...PLNOG 6: Rafał Szarecki - Routing w Sieci - Praktyczne aspekty implementacji ...
PLNOG 6: Rafał Szarecki - Routing w Sieci - Praktyczne aspekty implementacji ...PROIDEA
60 views36 slides
Bgp 6 advanced transit as issues by
Bgp 6   advanced transit as issuesBgp 6   advanced transit as issues
Bgp 6 advanced transit as issuesAuguste Behe
860 views52 slides
Bgp by
BgpBgp
BgpRaghu Kiran
1.4K views63 slides
Part 10 : Routing in IP networks and interdomain routing with BGP by
Part 10 : Routing in IP networks and interdomain routing with BGPPart 10 : Routing in IP networks and interdomain routing with BGP
Part 10 : Routing in IP networks and interdomain routing with BGPOlivier Bonaventure
150 views82 slides

Similar to BGP Advanced topics(20)

Computer network (14) by NYversity
Computer network (14)Computer network (14)
Computer network (14)
NYversity249 views
PLNOG 6: Rafał Szarecki - Routing w Sieci - Praktyczne aspekty implementacji ... by PROIDEA
PLNOG 6: Rafał Szarecki - Routing w Sieci - Praktyczne aspekty implementacji ...PLNOG 6: Rafał Szarecki - Routing w Sieci - Praktyczne aspekty implementacji ...
PLNOG 6: Rafał Szarecki - Routing w Sieci - Praktyczne aspekty implementacji ...
PROIDEA60 views
Bgp 6 advanced transit as issues by Auguste Behe
Bgp 6   advanced transit as issuesBgp 6   advanced transit as issues
Bgp 6 advanced transit as issues
Auguste Behe860 views
Part 10 : Routing in IP networks and interdomain routing with BGP by Olivier Bonaventure
Part 10 : Routing in IP networks and interdomain routing with BGPPart 10 : Routing in IP networks and interdomain routing with BGP
Part 10 : Routing in IP networks and interdomain routing with BGP
presentation_7324_1581310668.pdf by Susanto AY
presentation_7324_1581310668.pdfpresentation_7324_1581310668.pdf
presentation_7324_1581310668.pdf
Susanto AY3 views
Interautonomous System PLS VPN Advanced Concepts by Brozaa
Interautonomous System PLS VPN Advanced ConceptsInterautonomous System PLS VPN Advanced Concepts
Interautonomous System PLS VPN Advanced Concepts
Brozaa273 views
Study Notes BGP Exam by Duane Bodle
Study Notes BGP ExamStudy Notes BGP Exam
Study Notes BGP Exam
Duane Bodle2.7K views
DEVNET-1191 BGP Enabled Application Development by Cisco DevNet
DEVNET-1191	BGP Enabled Application DevelopmentDEVNET-1191	BGP Enabled Application Development
DEVNET-1191 BGP Enabled Application Development
Cisco DevNet1.2K views
Bgp Toc by bigb0206
Bgp TocBgp Toc
Bgp Toc
bigb0206300 views
Bgp training by Aun Haider
Bgp trainingBgp training
Bgp training
Aun Haider321 views
Dynamic Routing with FRR - pfSense Hangout December 2017 by Netgate
Dynamic Routing with FRR - pfSense Hangout December 2017Dynamic Routing with FRR - pfSense Hangout December 2017
Dynamic Routing with FRR - pfSense Hangout December 2017
Netgate11.3K views

More from Olivier Bonaventure

Part3-reliable.pptx by
Part3-reliable.pptxPart3-reliable.pptx
Part3-reliable.pptxOlivier Bonaventure
10 views55 slides
Part10-router.pptx by
Part10-router.pptxPart10-router.pptx
Part10-router.pptxOlivier Bonaventure
10 views24 slides
Part1-Intro-Apps.pptx by
Part1-Intro-Apps.pptxPart1-Intro-Apps.pptx
Part1-Intro-Apps.pptxOlivier Bonaventure
21 views112 slides
Part9-congestion.pptx by
Part9-congestion.pptxPart9-congestion.pptx
Part9-congestion.pptxOlivier Bonaventure
13 views56 slides
Part2-Apps-Security.pptx by
Part2-Apps-Security.pptxPart2-Apps-Security.pptx
Part2-Apps-Security.pptxOlivier Bonaventure
14 views94 slides
Part11-lan.pptx by
Part11-lan.pptxPart11-lan.pptx
Part11-lan.pptxOlivier Bonaventure
8 views89 slides

More from Olivier Bonaventure(20)

A personal journey towards more reproducible networking research by Olivier Bonaventure
A personal journey towards more reproducible networking researchA personal journey towards more reproducible networking research
A personal journey towards more reproducible networking research

Recently uploaded

Vertical User Stories by
Vertical User StoriesVertical User Stories
Vertical User StoriesMoisés Armani Ramírez
14 views16 slides
TouchLog: Finger Micro Gesture Recognition Using Photo-Reflective Sensors by
TouchLog: Finger Micro Gesture Recognition  Using Photo-Reflective SensorsTouchLog: Finger Micro Gesture Recognition  Using Photo-Reflective Sensors
TouchLog: Finger Micro Gesture Recognition Using Photo-Reflective Sensorssugiuralab
21 views15 slides
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ... by
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...Jasper Oosterveld
19 views49 slides
virtual reality.pptx by
virtual reality.pptxvirtual reality.pptx
virtual reality.pptxG036GaikwadSnehal
14 views15 slides
Special_edition_innovator_2023.pdf by
Special_edition_innovator_2023.pdfSpecial_edition_innovator_2023.pdf
Special_edition_innovator_2023.pdfWillDavies22
18 views6 slides
HTTP headers that make your website go faster - devs.gent November 2023 by
HTTP headers that make your website go faster - devs.gent November 2023HTTP headers that make your website go faster - devs.gent November 2023
HTTP headers that make your website go faster - devs.gent November 2023Thijs Feryn
22 views151 slides

Recently uploaded(20)

TouchLog: Finger Micro Gesture Recognition Using Photo-Reflective Sensors by sugiuralab
TouchLog: Finger Micro Gesture Recognition  Using Photo-Reflective SensorsTouchLog: Finger Micro Gesture Recognition  Using Photo-Reflective Sensors
TouchLog: Finger Micro Gesture Recognition Using Photo-Reflective Sensors
sugiuralab21 views
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ... by Jasper Oosterveld
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...
Special_edition_innovator_2023.pdf by WillDavies22
Special_edition_innovator_2023.pdfSpecial_edition_innovator_2023.pdf
Special_edition_innovator_2023.pdf
WillDavies2218 views
HTTP headers that make your website go faster - devs.gent November 2023 by Thijs Feryn
HTTP headers that make your website go faster - devs.gent November 2023HTTP headers that make your website go faster - devs.gent November 2023
HTTP headers that make your website go faster - devs.gent November 2023
Thijs Feryn22 views
Igniting Next Level Productivity with AI-Infused Data Integration Workflows by Safe Software
Igniting Next Level Productivity with AI-Infused Data Integration Workflows Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Safe Software280 views
Piloting & Scaling Successfully With Microsoft Viva by Richard Harbridge
Piloting & Scaling Successfully With Microsoft VivaPiloting & Scaling Successfully With Microsoft Viva
Piloting & Scaling Successfully With Microsoft Viva
Powerful Google developer tools for immediate impact! (2023-24) by wesley chun
Powerful Google developer tools for immediate impact! (2023-24)Powerful Google developer tools for immediate impact! (2023-24)
Powerful Google developer tools for immediate impact! (2023-24)
wesley chun10 views
Future of AR - Facebook Presentation by ssuserb54b561
Future of AR - Facebook PresentationFuture of AR - Facebook Presentation
Future of AR - Facebook Presentation
ssuserb54b56115 views

BGP Advanced topics

  • 1. BGP : Advanced topics Olivier Bonaventure, UCLouvain, 2018
  • 2. Agenda • iBGP and the BGP Decision process • How to scale iBGP to large networks ? • BGP traffic engineering
  • 3. BGP in large networks • What happens when a network contains tens, hundreds or thousands of routers ? AS1 AS2 AS3 AS4 3
  • 4. How to distribute BGP routes in a large network ? AS1 AS2 AS3 eBGP iBGP
  • 5. IP addresses used on routers AS1 AS2 AS3 A /64 prefix belonging to the AS1, 2001:11:1:/64 A /64 prefix belonging to AS2, e.g. 2001:222:12:/64 A /64 prefix belonging to AS1, e.g. 2001:222:11:13:/64
  • 6. A closer look at the BGP messages AS1 AS2 2001:222:11:13::33 Prefix: p AS Path : AS3 BGP Nexhop : 2001:222:11:13::33 AS3 Prefix: p AS Path : AS3 BGP Nexhop : 2001:222:11:13::33 Prefix: p AS Path : AS1:AS3 BGP Nexhop : 2001:222:12::1234 2001:222:12::1234 p
  • 7. Endpoints of the eBGP sessions • eBGP sessions are TCP connections established between the IP addresses of the two routers on the peering link AS1 AS2 2001:222:11:13::33 AS3 2001:222:12::1234 2001:222:12::5678
  • 8. How to distribute BGP routes in a large network ? • Full mesh of iBGP sessions – Why ?
  • 9. Draw iBGP sessions in AS1 AS1 AS2 AS3 AS4
  • 10. Endpoints of the iBGP sessions • A router has several IP addresses, on which address should an iBGP session terminate ? – Any IP address belonging to the router • Address is associated to an interface, if the interface stops, iBGP session stops as well even if the router is still reachable over other interfaces – A loopback address • A software only interface that is always up and announced through the intradomain routing protocol so that it remains reachable as long as the router has one interface up • Best Current Practice
  • 11. How to deal with routers that are not connected to other ASes ? • Run BGP on these routers • Include them in iBGP full-mesh AS1 AS2 AS3
  • 12. How to deal with routers that are not connected to other ASes ? • Make sure that they wlll never have to forward a packet to an external destination • MPLS AS1 AS2 AS3
  • 13. What are the roles of the IGP ? • The intradomain routing protocol distributes information about the reachability of : – IP prefixes associated to internal links between routers of the AS – IP addresses associated to loopback interfaces or routers of the AS – IP prefixes associated to peering links between a router of this AS and another AS
  • 14. BGP Nexthop self • Helps to reduce # routes in the IGP AS1 AS2 2001:222:11:13::33 AS3 Prefix: p AS Path : AS3 BGP Nexhop : 2001:11:1001::1 Prefix: p AS Path : AS1:AS3 BGP Nexhop : 2001:222:12::1234 2001:11:1001::2 Prefix: p AS Path : AS3 BGP Nexhop : 2001:222:11:13::33 2001:11:1001::1 2001:222:12::1234
  • 15. The BGP decision process 1. Ignore routes having an unreachable BGP nexthop 2. Prefer routes having the highest local-pref 3. Prefer routes having the shortest AS-Path 4. Prefer routes having the smallest MED 5. Prefer routes learned via eBGP sessions over routes learned via iBGP sessions 6. Prefer routes having the closest next-hop 7. Tie breaking rules : prefer route learned from the router with lowest router id
  • 16. 1st step of BGP decision process • 1. Ignore routes having an unreachable BGP nexthop – Why would a BGP route contain an unreachable nexthop ?
  • 17. Unreachable nexthop • Usually a transient issue AS1 AS3 AS2
  • 18. 2nd step of BGP decision process • 2. Prefer routes having the highest local-pref – Implement routing policies • Prefer customer routes over shared-cost and provide routers – Support backup routes • Local-pref attribute to added by the import filter on eBGP session and distributed to all routers over iBGP sessions
  • 19. BGP routes towards prefix p on all routers inside AS1 AS1 R1 AS4 R2 R3 R4 R5 R6 p
  • 20. 3rd step of BGP decision process • 3. Prefer routes having the shortest AS-Path – Some operators believe that a BGP route with a long AS Path has a lower performance than a route with a longer AS Path • This is not always true…
  • 21. 5th step of BGP decision process • 5. Prefer routes learned via eBGP sessions over routes learned via iBGP sessions – Motivation : Hot potato routing • Routers should try to forward packets towards external destinations to another AS a quickly as possible
  • 22. 6th step of BGP decision process • 6. Prefer routes having the closest next-hop – Motivation : Hot potato routing • Routers should try to forward packets towards external destinations to another AS a quickly as possible
  • 23. BGP routes towards prefix p on all routers inside AS1 AS1 R1 AS4 R2 R3 R4 R5 R6 p
  • 24. BGP routes towards prefix p on all routers inside AS1 AS1 R1 AS4 R2 R3 R4 R5 R6 p AS2 AS3 AS5
  • 25. 4th step of BGP decision process • Prefer routes having the smallest MED • MED means Multi-Exit Discriminator – Motivation : Cold potato routing – Enable neighbour AS (usually customer) to indicate the best peering link to reach a given prefix
  • 26. BGP routes towards prefix p on all routers inside AS1 AS1 R1 AS4 R2 R3 R4 R5 R6 p
  • 27. BGP routes towards prefix p on all routers inside AS1 AS1 R1 AS4 R2 R3 R4 R5 R6 p AS2 AS3 IGP=7 IGP=2
  • 28. 7th step of the BGP decision process • 7. Tie breaking rules : prefer route learned from the router with lowest router id – Motivation : select a single best route towards each destination prefix • This best route is the route that can be advertised over eBGP session – Note that recent routers sometimes load balance (BGP Multipath) the traffic towards a given prefix over several routes (having the same BGP attributes)
  • 29. Differences between iBGP and eBGP – Which routes are advertised by a router over iBGP and eBGP sessions ? • Over an eBGP session, a router advertises its best route towards each destination prefix – Provided this advertisement is allowed by the export filter – At most one route per destination prefix • Over an iBGP session, a router advertises its best route towards each destination prefix provided that this best route was learned over an eBGP session – Since iBGP sessions are in full-mesh, there is no need to readvertise a route learned over another iBGP session
  • 30. Differences between iBGP and eBGP – Which filters are used over iBGP and eBGP sessions ? • Import and export filters are used over all eBGP sessions – Usually, there is a series of import filters attached to each peering link – Filters are usually implemented as modules that are combined together and associated to similar peering links (e.g. customer filter, provider filter, …) • No filter is applied on iBGP sessions
  • 31. Differences between iBGP and eBGP – What are the attributes carried by iBGP and eBGP • Prefix : iBGP and eBGP • AS Path : iBGP and eBGP – AS Path is updated when a BGP message is sent over an eBGP session • Local-pref : iBGP – Local-pref cannot be used on eBGP sessions • MED : iBGP and eBGP • Nexthop : iBGP and eBGP – Nexthop is updated when a BGP message is sent over an eBGP session
  • 32. What happens if iBGP sessions are missing ? AS1 R1 AS4 R4 R5 R6 p AS2 AS3 AS5 IGP=7
  • 33. What happens if iBGP sessions are missing ? AS1 R1 AS4 R4 R5 R6 p AS2 AS3 AS5
  • 34. What happens if iBGP sessions are missing ? AS1 R1 AS4 R4 R5 R6 p AS2 AS3 AS5
  • 35. Conclusion • BGP depends on the underlying intradomain routing protocol – Establishment of the iBGP sessions – Resolution of the BGP nexthop • iBGP and eBGP play different roles – eBGP over sessions with routers in other ASes – iBGP sessions (in full mesh) inside an AS • The BGP decision process ranks routes – Hot potato versus cold potato routing
  • 36. Reading list 1st edition, BGP section http://cnp3book.info.ucl.ac.be/network/networ k/#the-border-gateway-protocol J. Park et al, “BGP Route Reflection Revisited”, IEEE Communications Magazine, June 2012, http://irl.cs.ucla.edu/~j13park/rr-commag.pdf
  • 37. Agenda • iBGP and the BGP Decision process • How to scale iBGP to large networks ? • BGP traffic engineering
  • 38. Interactions between IGP and iBGP • What are the interactions between iBGP and the intradomain routing protocol ? – iBGP sessions are TCP connections whose endpoints are reachable thanks to IGP • Endpoints of iBGP sessions are usually loopback interfaces advertised in IGP – BGP Nexthops are reachable thanks to IGP – BGP decision process uses reachability and IGP cost towards BGP nexthop to rank routes
  • 39. Creation of iBGP sessions • How are iBGP sessions created on routers ? – Usually by manual configuration on each router group INTERNET2-IPv6 { type internal; local-address 2001:468:a::1; family inet6 { any; } export NEXT-HOP-SELF; peer-as 11537; neighbor 2001:468:1::1 { description ATLA; } ...
  • 40. Scaling issues with iBGP • In a network containing N routers – N*(N-1)/2 iBGP sessions need to be manually configured and maintained • Scalability issues – CPU usage to process and send iBGP messages • About 600k routes on IPv4 Internet today – Number of iBGP sessions on each router • TCP state, BGP Keepalives, … – Memory consumption • ADJ-RIB-IN, ADJ-RIB-OUT, ...
  • 41. Improving iBGP scaling • Two approaches – Route Reflectors • A RR is a special iBGP router that is allowed, under specific conditions, to advertise over iBGP sessions routes learned over other iBGP sessions – BGP confederations • A large AS is divided in smaller (sub-)ASes containing a few tens of routers in iBGP full mesh. The sub-ASes use eBGP to exchange BGP routes
  • 42. How to design an iBGP hierarchy • A RR has two types of iBGP neighbours RR1 R6R1 R8 R9 Client sessions Non-Client sessions
  • 43. Operation of Route Reflectors • Reception of a new route – Run BGP decision process on RR – If best route has changed • If best route was learned from eBGP session – Advertise the best route to all iBGP sessions • If best route was learned from an iBGP client session – Advertise the best route to all iBGP sessions (clients and non- clients) • If best route was learned from a non-client iBGP session – Advertise the best route to all client iBGP sessions (non-client sessions are assumed to be in full-mesh and will also receive the new route from their own iBGP session)
  • 44. Benefits of using RRs • Simplified configuration – A new router can be easily added to the network • Reduced memory and CPU usage on routers – Each router maintains fewer iBGP sessions – Route Reflectors do not announce all routes to their BGP clients, reducing their memory usage – Route Reflectors are often specialised devices with faster CPU and memory that only run BGP and IGP but do not forward regular packets
  • 45. Caveats with Route Reflectors • Route reflectors hide routes to iBGP clients – A RR only advertises its best route towards each prefix over a given iBGP session – A RR runs the BGP decision process on the basis of its IGP routing table • iBGP clients could select a different best route than their RR • Route reflectors can increase convergence time after failures
  • 46. Caveats with Route Reflectors • Since RRs advertise iBGP learned routes over iBGP sessions, a badly configured iBGP topology may cause loops RR1 R6R1 RR3 RR2
  • 47. How to prevent loops • BGP Route Reflection introduces two new iBGP attributes – ORIGINATOR_ID • Set to the router id of the router that injects a route in iBGP – CLUSTER_LIST • When a RR receives a route, it checks whether its router id is included in the CLUSTER_LIST. If yes, the route is rejected. • When a RR sends a route over an iBGP session, it adds its router id to the CLUSTER_LIST
  • 48. Fault tolerance • If a Route Reflector fails, a large number of BGP routers will be affected and lose BGP routes • How to mitigate this problem ? – Use redundant route reflectors that are deployed in pairs – Each BGP router is attached to at least two different RRs
  • 49. Fault tolerance • In practice, each BGP router is usually attached to two RRs that are close to itself in the IGP topology RR1 R6 R1 RR3 RR2
  • 50. Route Reflectors • What are the routes learned if R3 acts as RR for the entire AS1 ? AS1 R1 AS4 R2 R3 R4 R5 R6 p
  • 51. Route Reflectors • What are the routes learned if both R3 and R5 act as RR for the entire AS1 ? AS1 R1 AS4 R2 R3 R4 R5 R6 p
  • 52. Which routes are selected ? AS1 R1 AS4 R2 R3 R4 R5 R6 p AS2 AS3 AS5
  • 53. What is the best place for a single RR ? AS1 R1 AS4 R2 R3 R4 R5 R6 p AS2 AS3 AS5
  • 54. What is the best location for two RR ? AS1 R1 AS4 R2 R3 R4 R5 R6 p AS2 AS3 AS5
  • 55. Hierarchy of Route Reflectors AS1 R1 R2 R3 R4 R5 R6 R7 R8 R9 RA RB p AS2 AS3 AS5
  • 56. What are the forwarding paths towards p advertised by AS6 ? R5 R6 AS6 R1 R3 C=1C=1 C=1 C=5
  • 57. Agenda • iBGP and the BGP Decision process • How to scale iBGP to large networks ? • BGP traffic engineering
  • 58. Prefer customer, ... AS1 R1 R2 R3 R4 R5 R6 AS2 AS3 AS4 AS5 AS6 AS7 $ $ $ $ $ =
  • 59. Forwarding paths from AS7 to AS8 and vice-versa AS1 R1 R2 R3 R4 R5 R6 AS7 AS8
  • 60. Customer wants packets towards p1 via R2 and p2 via R5 AS1 R1 R2 R3 R4 R5 R6 AS7 Customer p1 p2
  • 61. Fun with MED • iBGP full mesh R5 R6 AS4 AS5AS6 R1 R2 R3 C=4 C=2 C=1 C=1 MED=0MED=1 p MED=0
  • 62. Fun with MED (2) • With RRs R5 R6 AS4 AS5AS6 R1 R2 R3 C=4 C=2 C=1 C=1 MED=0MED=1MED=0 p
  • 63. Incoming traffic engineering • How can a customer distribute the load on its links ? – one third of traffic on each link ? ISP R1 R2 R3 R4 R5 R6 Customerp
  • 68. Backup links • How can an ISP provide backup services to its customers ? ISP R1 R2 R3 R4 R5 R6
  • 69. BGP Communities • BGP Communities can be attached to BGP routes in import filter – To indicate geographical location – To indicate type of BGP session – … • BGP Communities can be attached to BGP routes in export filter – To request neighbour AS to treat the route in a specifix way
  • 70. How to provide restricted transit ? ISP R1 R2 R3 R5 R6 Customer1 Customer3 Customer2
  • 71. How to provide richer customer policies ? • Customer wants to receive packets from US via AS1 and from Europe via AS2 R1 R2 R3 R5 R6 CustomerAS1 AS2
  • 72. AS-Path length is not always a synonym of path quality • How to prefer AS1 in US, AS2 in Europe ISP R1 R2 R3 R5 R6 AS1 AS2
  • 73. Things to remember when defining BGP policies • Any tweaking you do could affects scalability Source http://bgp.potaroo.net/tools/asn32
  • 74. Size of IPv6 routing tables Source http://bgp.potaroo.net/v6/as6447/
  • 75. Size of IPv4 BGP routing tables Source http://bgp.potaroo.net/as6447/
  • 76. BGP communities • Are by default transitive.. • Any BGP community that you add when receiving routes will be advertised all over the Internet – you should clean your BGP communities when advertising routes over eBGP, but router configuration languages do not always make this easy
  • 77. Existing BGP communities • Sprint – https://www.sprint.net/index.php?p=policy_bgp – Looking glass https://www.sprint.net/lg/lg_start.php • Level3 – http://www.scn.rain.com/~neighorn/PDF/Traffic_Engineeri ng_with_BGP_and_Level3.pdf • NTT America – https://www.us.ntt.net/support/policy/routing.cfm • Internet2 – https://noc.net.internet2.edu/i2network/maps- documentation/documentation/bgp-communities.html
  • 78. References • K. Fster, Application of BGP Communities, The Internet Protocol Journal - Volume 6, Number 2, July 2003 • B. Donnet and O. Bonaventure. On BGP Communities. ACM SIGCOMM Computer Communication Review, 38(2):55-59, April 2008. – http://inl.info.ucl.ac.be/publications/bgp-communities • B. Quoitin, S. Uhlig, C. Pelsser, L. Swinnen and O. Bonaventure. Interdomain traffic engineering with BGP. IEEE Communications Magazine Internet Technology Series, 41(5):122-128, May 2003. – http://inl.info.ucl.ac.be/publications/interdomain-traffic- engineering-bgp