BGP Fundamentals
Overview
Border Gateway Protocol (BGP) is the core inter-domain routing protocol that enables the exchange of routing information between autonomous systems (ASes) on the Internet. It is foundational for directing data traffic across diverse networks, ensuring global connectivity and routing policy enforcement.
Core Components
- Autonomous Systems (AS): Independent networks identified by unique AS numbers that participate in BGP routing.
- BGP Peers (Neighbors): Routers in different ASes or within the same AS that establish TCP sessions to exchange routing information.
- Routing Information Base (RIB): Data structures storing route information learned from BGP peers.
- Path Attributes: Metadata associated with routes, such as AS path, next hop, and local preference, used for route selection.
- Update Messages: BGP protocol messages that advertise or withdraw routes between peers.
How It Works
BGP operates over TCP sessions established between peers to exchange routing information. Each BGP speaker advertises reachable IP prefixes along with path attributes to influence routing decisions. Routing policies are applied based on these attributes to select optimal paths. Trust relationships are established between peers, typically within or between ASes, defining control boundaries. BGP does not inherently verify the authenticity of route announcements, relying on operational trust and external mechanisms.
Trust & Security Model
- Authentication is commonly limited to TCP MD5 or TCP-AO for session protection, with no built-in route origin validation.
- Trust assumptions rely on the integrity of peer relationships and the correctness of routing policies configured by network operators.
- Identity is based on AS numbers and IP addresses; cryptographic credentials for route validation are external to core BGP.
Common Misconfigurations & Weaknesses
- Improper filtering of route announcements leading to route leaks or prefix hijacking.
- Lack of authentication or weak session protection exposing BGP sessions to spoofing or hijacking.
- Default acceptance of all received routes without validation or policy enforcement.
Attack Surface & Abuse Scenarios
- Route hijacking through malicious or accidental advertisement of unauthorized prefixes.
- Session disruption via TCP session attacks or denial of service targeting BGP peers.
- Propagation of incorrect routing information causing traffic interception, blackholing, or man-in-the-middle attacks.
- Cross-domain risks arise from dependencies on upstream providers and transit ASes.
Visibility & Monitoring
- Logs of BGP session state changes and routing updates provide telemetry for operational monitoring.
- Challenges include detecting subtle route leaks or slow propagation of malicious routes.
- Observability requires correlation of routing data with network traffic and external route validation sources.
Hardening & Security Controls
- Implement prefix filtering and route validation to restrict accepted routes to authorized announcements.
- Use cryptographic session protection such as TCP MD5 or TCP-AO to secure BGP sessions.
- Deploy Resource Public Key Infrastructure (RPKI) and BGP Origin Validation to verify route origins.
- Architectural safeguards include route monitoring systems and automated alerting for anomalous routing events.
Operational Considerations
- Lifecycle management includes careful onboarding of peers, controlled policy changes, and secure decommissioning of sessions.
- High availability and resilience are critical due to BGP’s role in global routing; redundancy and failover mechanisms are standard.
- Scaling involves managing numerous peer sessions and large routing tables, requiring efficient policy and resource management.
Related Domains & Dependencies
- Upstream transit providers and downstream customers form the hierarchical AS relationships.
- Interacts with Interior Gateway Protocols (IGPs) for intra-AS routing and with DNS and IP addressing schemes.
- Shared responsibility exists between network operators and Internet registries for AS number and prefix allocation.
Standards & References
- RFC 4271: A Border Gateway Protocol 4 (BGP-4)
- RFC 2385: Protection of BGP Sessions via the TCP MD5 Signature Option
- RFC 8205: BGPsec Protocol Specification
- Resource Public Key Infrastructure (RPKI) standards and operational guidelines