BGP Overview
Basics
Read
https://www.catchpoint.com/bgp-monitoring/bgp-route-reflector and https://www.catchpoint.com/bgp-monitoring/bgp-troubleshooting-cheat-sheet
Port
TCP 179
Layer
4
Verbs
- IDLE
- CONNECT
- ACTIVE
- OPEN-SENT
- OPEN-CONFIRM
- ESTABLISHED
Overview of BGP Operations and Components
Border Gateway Protocol (BGP) is the backbone of the internet, responsible for routing traffic between autonomous systems (ASes) and managing how data packets navigate through the vast network of the internet. Here’s a concise overview of how BGP works, its key components, and operational aspects.
How BGP Works
BGP operates based on the exchange of routing information between BGP peers. These peers establish a TCP connection, typically on port 179, to exchange route information. BGP is unique because it allows for policy-based routing decisions, enabling networks to choose paths based on factors other than just the shortest path.
Peering
- BGP Peering: This is the process where two BGP routers (peers) directly connect and exchange routing information. Peering is established between routers in different ASes (External BGP or eBGP) or within the same AS (Internal BGP or iBGP).
Autonomous Systems and AS Numbers
- Autonomous System (AS): An AS is a collection of IP routing prefixes under the control of a single entity that presents a common routing policy to the internet.
- AS Numbers (ASN): ASNs are unique identifiers allocated to each AS for use in BGP routing. ASN allows BGP to distinguish between different routing domains and manage the routing policies accordingly.
Traffic Flow and Path Selection
- Path Selection: BGP routers use several attributes to decide the best path for routing traffic. These include AS_PATH, NEXT_HOP, LOCAL_PREF, and MULTI_EXIT_DISC (MED), among others. The decision process allows for sophisticated routing strategies beyond just the shortest path.
- Route Propagation: BGP routers advertise the best path to a destination to their peers. This process is recursive, with each router making its own decision on the best path based on the received path attributes.
Routing Information Base (RIB)
- RIB Table: The Routing Information Base is a database of routes learned from different routing protocols (including BGP). The RIB contains all the routes known to a router, with BGP selecting the best routes based on its path selection algorithm. These selected routes are then installed in the forwarding table of the router.
Key Components and Operational Aspects
- BGP Messages: BGP uses four types of messages for operation: OPEN, UPDATE, KEEPALIVE, and NOTIFICATION. These manage the session establishment, route advertisement, session maintenance, and error notification, respectively.
- Route Aggregation: BGP can summarize routes to reduce the number of routes advertised, improving scalability.
- Route Filtering: Through route maps, prefix lists, and filter lists, BGP can control which routes are advertised or accepted from peers, allowing for granular traffic flow management.
Problem Areas
- Peering Issues: Misconfigured neighbor relationships, blocked ports, mismatched BGP versions.
- Route Advertisement Problems: Incorrect network statements, route filtering, and route aggregation misconfigurations.
- Path Selection Issues: Misuse of attributes like AS_PATH, LOCAL_PREF, and MED can lead to suboptimal routing.
- Missing Routes: Routes not being advertised due to filtering, lack of redistribution, or misconfigurations in the RIB.