BGP Mechanisms
Route Election · ECMP · Damping · Policy · Communities · Aggregation · MED Inbound · Inter-AS MPLS VPN
⚖️ Route Election
⚡ ECMP
📉 Damping
🔧 Route Policy
🏷️ Communities
🗜️ Aggregation
📥 MED Inbound
🔀 Inter-AS MPLS VPN
BGP Best Path Selection — step by step
Local AS 65000 Peer A eBGP AS 100 Peer B eBGP AS 200 Peer C iBGP AS 65000 10.0.0.0/8 destination STEP wins
PrefixPeerWeightLPAS_PATHMEDTypeIGPStatus
10.0.0.0/8Peer A 0150100 200 50eBGP10candidate
10.0.0.0/8Peer B 0150200 100eBGP20candidate
10.0.0.0/8Peer C 0100100 200 300 10iBGP5candidate
Ready to select
Three neighbors advertise the same network 10.0.0.0/8. BGP runs the Best Path Selection algorithm step by step until the first difference. Click Next step.
0 / 8
BGP ECMP — load balancing
Local AS 65000 ISP-A1 AS 100, NH .1 ISP-A2 AS 100, NH .2 ISP-B1 AS 200, NH .3 ISP-B2 AS 200, NH .4 198.51.0.0/16 destination LOAD 0% 0% 0% 0%
PrefixPeerAS_PATHNHLPMEDIn FIB
198.51.0.0/16ISP-A1100.110010
198.51.0.0/16ISP-A2100.210010
198.51.0.0/16ISP-B1200.310010
198.51.0.0/16ISP-B2200.410010
ECMP — Equal Cost Multi-Path
Four paths to one prefix from two ASes. Click Next step to see how maximum-paths and multipath-relax affect load balancing.
0 / 4
BGP Route Flap Damping — RFC 2439
Penalty0
Suppress limit2000
Reuse limit750
ParameterValue
Penalty per flap1000
Suppress limit2000
Reuse limit750
Half-life15 min
Max suppress60 min
Route stateActive
Route Damping
Damping protects against unstable routes (route flap). Each withdraw/readvertise adds penalty 1000. The penalty decays exponentially (half-life). When it exceeds the suppress limit 2000 the route is suppressed. It recovers once it drops below the reuse limit 750.
BGP Route Policy — filtering and modification
eBGP Peer AS 100 UPDATE Inbound Policy route-map IN Loc-RIB Best path selection Outbound Policy route-map OUT
UPDATE received
prefix-list check
as-path filter
route-map match
set attributes
→ Loc-RIB
PrefixFromActionModifiedResult
Click a step to simulate the policy →
Route Policy
BGP policy is applied when receiving (inbound) and sending (outbound) routes. Tools: prefix-list, as-path access-list, route-map, community-list. A route-map is evaluated sequentially — first match wins (permit/deny).
0 / 6
BGP Communities — route tagging
Standard Community (RFC 1997)
Format: AA:NN (32 bits = 16-bit ASN + 16-bit value)
CommunityNameAction
65535:65281NO_EXPORTDo not advertise outside the AS
65535:65282NO_ADVERTISEDo not advertise to anyone
65535:65283LOCAL_ASOnly within the sub-AS
65535:0GRACEFUL_SHUTDOWNDrain traffic (RFC 8326)
Extended Community (RFC 4360) — 64 bits
TypeUse
RT: 100:1Route Target — VRF import/export in MPLS L3VPN
RD: 100:10Route Distinguisher — makes prefixes unique
SoO: 100:5Site of Origin — loop prevention in the VPN
OSPF domain: …OSPF domain/area ID in BGP-OSPF redistribution
Large Community (RFC 8092) — 96 bits
Format: ASN:Value1:Value2 — solves the 4-byte AS problem
ExampleMeaning
64500:1:100AS64500 — region 1, customer 100
64500:2:0Do not advertise to region 2
64500:3:50Prepend 3 times toward AS 50
Community Traffic Engineering
Click Run simulation — see how a community steers traffic between two upstreams.
0 / 4
BGP Route Aggregation — route summarization
10.0.1.0/24 10.0.2.0/24 10.0.3.0/24 10.0.4.0/24 10.0.5.0/24 Specific routes (RIB) Aggregator
MethodCommand (Cisco)Suppress specific?AS_PATHATOMIC_AGGREGATE
Summary-onlyaggregate-address … summary-onlyYes (suppress)EmptyYes
Aggregate + specificaggregate-address … (no flags)NoEmptyYes
AS-SETaggregate-address … as-setNoAS_SET {all}No
Route Aggregation
Aggregation reduces the size of the global BGP table. aggregate-address creates a summary route from the specific ones. ATOMIC_AGGREGATE warns neighbors about the loss of information. AS_SET preserves origin information but increases CPU load.
0 / 3
MED — influencing inbound traffic from a neighboring AS
Internet customers of ISP ISP — AS 100 ISP-R1 peer to R1 ISP-R2 peer to R2 iBGP (ISP internal) Our AS 65001 — 203.0.113.0/24 R1 link-A R2 link-B route-map OUT route-map OUT
InterfaceRouterLP (local)MED (sent to ISP)ISP preferenceWinner
link-A R1 100 lower = preferred
link-B R2 100 lower = preferred
MED — affects INBOUND traffic
ParameterValue
AttributeMED / MULTI_EXIT_DISC
TypeOptional non-transitive
Logiclower = better
Sent toeBGP neighbors only
Limitationcompared within a single AS
Commandset metric <value>
LOCAL_PREF — affects OUTBOUND traffic
ParameterValue
AttributeLOCAL_PREF
TypeWell-known discretionary
Logichigher = better
Sent toiBGP neighbors only
Limitationdoes not leave the AS
Commandset local-preference <v>
MED — steering inbound traffic
MED (MULTI_EXIT_DISC) is the only BGP attribute for influencing inbound traffic from a neighboring AS. Click Next step.
0 / 7
Inter-AS MPLS L3VPN — Option A · B · C (RFC 4364)
AS 1 AS 2 CE1 site A PE1 ASBR1 ASBR2 PE2 CE2 site B RR1 AS1 RR2 AS2 multihop eBGP (VPNv4) Label Stack outer: transport inner: VPN label VRF: cust-A VRF: cust-A VRF: cust-A VRF: cust-A
#ElementRoleProtocolWhat is carried
Select an option above →
ParameterOption AOption BOption C
Method Back-to-Back VRF eBGP VPN labels Multihop eBGP
VRF on the ASBR Yes (per VPN) No No
What runs between the ASBRs Plain IP (per-VRF eBGP) VPN-IPv4 + MPLS label Transport LSP only
ASBR knows VPN routes Yes Yes (label binding) No (RRs only)
Scalability Low Medium High
Complexity Simple Medium High
VPN isolation at the border Full (VRF) Partial No (shared transport)
Label stack 1 label (or no MPLS) 2 labels (transport + VPN) 3 labels (AS1 transport + AS2 transport + VPN)
Use case Small number of VPNs, different providers Partner providers Single provider, multiple ASes
Inter-AS MPLS L3VPN
RFC 4364 defines three methods for interconnecting MPLS L3VPN between autonomous systems. Select an option above for an interactive walkthrough. The common goal: carry a customer packet (CE1 → CE2) across two providers while preserving VPN isolation.