Interactive BGP Learning Environment
BGP is often introduced as the protocol used to exchange routing information between Autonomous Systems. While that definition is correct, understanding BGP properly requires looking beyond the protocol itself and understanding the networks, routing domains, policies, and forwarding infrastructure in which it operates.–
The Internet is a network of independently operated Autonomous Systems, each with its own infrastructure, addressing, routing policies, and operational requirements. BGP provides the interdomain routing mechanism that allows these networks to exchange reachability information and apply policy when determining which routes to accept, prefer, and advertise.
The interactive components in this section build that understanding progressively.
The Internet: A Network of Networks establishes the foundation by introducing Autonomous Systems, ASNs, interconnection, and the role of BGP in exchanging reachability between independently operated routing domains. The objective is to understand why an interdomain routing protocol is required when no single organisation controls the entire Internet.
Inside an Autonomous System then moves inside an individual routing domain. An Autonomous System can contain many routers, links, and routing functions. The section shows how eBGP connects different Autonomous Systems, how iBGP distributes BGP information within an AS, and how an IGP provides the internal reachability required to reach routers and BGP next hops.
How BGP Routes Move Through the Network follows the routing information itself. A prefix can be originated, advertised in a BGP UPDATE, received by another BGP speaker, and propagated according to BGP rules and local routing policy. As the route crosses AS boundaries, attributes such as AS_PATH provide information about the route’s interdomain propagation, while other attributes influence how the route is evaluated and advertised.
How BGP Selects a Path brings these concepts together. A BGP speaker can learn multiple routes to the same destination and must evaluate those candidates using its configured decision process. Attributes such as LOCAL_PREF, AS_PATH, ORIGIN, MED, and platform-specific attributes such as Cisco Weight can influence the selection.NEXT_HOP and other attributes also contribute to route resolution and forwarding, while communities are commonly used to carry policy information between BGP speakers.
Together, these interactive components establish a visual foundation for understanding BGP:
The network → The Autonomous System → Route movement → Path selection
The goal is not to reproduce every detail of a production BGP implementation. Instead, the visualisations make the relationships between networks, BGP speakers, routing information, policy, path attributes, and forwarding easier to understand. This provides the foundation for the more detailed protocol concepts, configuration examples, and hands-on BGP labs that follow.
Interactive BGP Learning Environment
Understanding BGP requires more than knowing its commands or memorising the best-path sequence. BGP operates across interconnected Autonomous Systems, exchanges reachability information, applies routing policy and ultimately influences how traffic is forwarded through the network.
The Internet
Understand why the Internet is a collection of independently operated Autonomous Systems and why BGP is required between them.
Inside the AS
See how IGP, iBGP and eBGP divide the work of internal reachability, route distribution and interdomain connectivity.
Route Movement
Follow a prefix through BGP UPDATEs, route reception, policy processing, propagation and route installation.
Best Path
Examine how multiple valid candidates are compared using policy and BGP path attributes to determine the preferred route.
BGP is a control-plane decision system that determines how reachability information is learned, evaluated and propagated.
BGP Learning Path
Start with the structure of the Internet, move inside an Autonomous System, follow how BGP routes propagate, and finish with the logic behind best-path selection.
Take the BGP Concepts Into the Lab
Reading explains how BGP works. The simulator lets you observe the routing system as it operates. Explore BGP sessions, route propagation, attributes, best-path decisions and network behaviour through an interactive engineering environment.
Move from theory to hands-on BGP engineering. Explore the control plane, routing decisions and protocol behaviour in an interactive environment.
How the BGP Control Plane Fits Together
The Internet: A Network of Networks
FOUNDATION
Investigating Internet Reachability
Start from the enterprise router and investigate how BGP provides reachability to networks located in other Autonomous Systems. Use the simulated CLI to inspect neighbours, routes and routing state.
What You See
R1 has three established external BGP sessions, each connecting the enterprise to a different Autonomous System.
What It Means
BGP allows independently operated networks to exchange reachability information across AS boundaries.
Engineering Principle
The Internet is a network of independently operated Autonomous Systems connected through routing relationships.
The Internet Is a Network of Networks
BGP exists because the Internet is not one centrally operated network. It is a collection of independently managed Autonomous Systems that connect to one another and exchange reachability information.
Infrastructure, addressing, routing policy and operational decisions remain under the control of the organisation operating the AS.
BGP speakers exchange reachability information across AS boundaries so destinations can become reachable through neighbouring networks.
BGP advertises IP prefixes and associated path information rather than carrying the user packets themselves.
Networks can decide which routes to accept, prefer and advertise according to their own routing policies.
BGP exchanges reachability information between BGP speakers and provides the information used to evaluate and select routes.
Once routing information has been selected and resolved, the forwarding plane uses the resulting information to move packets toward their destinations.
The Internet is a vast “network of networks” — a global system of independently operated networks, including Internet service providers, enterprises, cloud providers, universities, and government organisations. These networks interconnect using shared protocols and standards, with BGP providing the primary mechanism for exchanging reachability information between Autonomous Systems. Each network manages its own infrastructure, routing policies, and operational requirements while participating in a larger, interconnected system.
Each Autonomous System contributes to the global routing system by originating or advertising IP prefixes that it is authorised to announce, while learning reachability to prefixes available through other networks. BGP allows these independently administered networks to exchange this information without requiring a central routing authority. As routes are learned and withdrawn, each network applies its own policies to determine which paths it will accept, prefer, and advertise to its neighbours.
This distributed model is fundamental to the resilience of the Internet. A network can have multiple connections to different providers or neighbouring Autonomous Systems, allowing alternative routes to exist when a link or routing path becomes unavailable. When a route is withdrawn or a topology changes, BGP can propagate the new reachability information so that affected networks can recalculate their available paths. The result is not a single global routing table controlled by one organisation, but a collection of interconnected routing domains making independent decisions based on shared protocols and local policy.
Because the Internet is composed of many independently operated networks, its topology and routing behaviour are constantly evolving. Links are added and removed, policies change, prefixes are originated or withdrawn, and business relationships influence how routes are exchanged. BGP provides the interdomain framework that allows these changes to propagate across the network while preserving the autonomy of each participating organisation.
Understanding this structure is essential to understanding BGP. Before examining how BGP selects between competing routes, it is important to understand what exists inside the Autonomous Systems that originate, receive, and propagate those routes.
How the Internet Connects
Before understanding BGP, understand the network it was designed for: an Internet made from thousands of independently operated Autonomous Systems that exchange reachability and carry traffic between one another.
Follow traffic across the Internet
Run the scenario to see how traffic moves between independently operated networks and where BGP fits into the process.
The Internet
The Internet is not one network. It is a collection of independently operated networks interconnected using common protocols.
Inside an Autonomous System
ARCHITECTURE
Inside an Autonomous System
BGP does not operate alone inside an enterprise network. Use this interactive view to see how eBGP, iBGP and the IGP work together to move routing information from an external network toward the routers that ultimately forward traffic.
What You See
R3 has both an external eBGP relationship and internal routing relationships within AS 65010.
What It Means
BGP exchanges external reachability while the IGP provides the internal reachability required to reach BGP next hops.
Engineering Principle
eBGP connects Autonomous Systems, iBGP distributes BGP information within an AS, and the IGP provides internal IP reachability.
Inside an Autonomous System
An Autonomous System does not use BGP for every routing function. Internal reachability, external route exchange, path selection and packet forwarding are separate engineering functions that work together.
BGP carries interdomain reachability information and applies routing policy to determine which available path should be used.
Answers the internal reachability question: How do I reach the next hop?
Distributes BGP reachability information between routers inside the same Autonomous System.
Exchanges routing information across an Autonomous System boundary.
Converts the selected routing decision into forwarding information used by the data plane.
BGP is the control-plane decision system, not the forwarding mechanism. The routing process selects a path; the FIB is then programmed so packets can actually follow that decision.
Inside an Autonomous System (AS), routers operate within a common administrative and routing-policy domain. The AS controls its internal topology, addressing, and routing decisions, allowing operators to engineer traffic, provide redundancy, and manage connectivity according to their own operational requirements. An AS may contain anything from a small collection of routers to thousands of devices spanning multiple regions, data centres, and network segments.
Internal routing is typically provided by an Interior Gateway Protocol (IGP) such as OSPF or IS-IS in service-provider environments, with protocols such as EIGRP also used in some enterprise networks. The IGP is responsible for providing reachability within the AS, while BGP handles the exchange of interdomain and, where required, internal BGP routing information. This distinction is important: BGP determines which route is preferred, while the IGP can provide the underlying reachability needed to reach the BGP next hop.
Because the routers within an AS are operated under a common administrative framework, the network can be engineered around its own requirements. Operators can use IGP metrics, areas or levels, summarisation, routing policy, redundancy mechanisms, and traffic-engineering techniques to influence how traffic moves through the network. The objective may be rapid convergence, efficient use of links, predictable forwarding, geographic resilience, or isolation of particular services and workloads.
The internal architecture of an AS varies considerably depending on its purpose and scale. Some networks use traditional core, distribution, and access layers, while others use provider backbones, regional architectures, data-centre fabrics, MPLS-based networks, or overlay technologies. These different designs can coexist within the same Autonomous System, with different routing protocols and mechanisms serving different roles.
From outside the AS, however, the internal topology is generally abstracted. External BGP peers do not normally need visibility into the AS’s complete internal IGP structure. Instead, the AS presents its external neighbours with BGP reachability information and applies its own policies to determine which routes are accepted, preferred, and advertised.
This separation between internal reachability and external routing policy is fundamental to understanding BGP. eBGP connects an AS to neighbouring Autonomous Systems, iBGP distributes BGP information within the AS, and the IGP provides the internal reachability required to support the resulting forwarding decisions.
Inside an Autonomous System
An autonomous system is not a single router. It is a collection of routers and links working together. IGP provides internal reachability, iBGP distributes BGP information, and eBGP connects the AS to other networks.
One AS, multiple routing roles
An autonomous system contains multiple routers. Different routing functions operate across those routers: IGP maintains internal reachability, iBGP distributes BGP information, and eBGP connects the AS to neighbouring autonomous systems.
How BGP Routes Move Through the Network
LIFECYCLE
Tracing a BGP Route Through the Network
Follow a BGP route from the moment an UPDATE is received through NLRI processing, RIB-IN, policy and routing state. The objective is to understand how BGP processes reachability information before the forwarding plane can use it.
What You See
The router has received a BGP UPDATE containing reachability information for 10.10.10.0/24.
What It Means
The UPDATE is control-plane information. It describes how the router can reach a destination prefix.
Engineering Principle
A BGP route is processed by the control plane before the resulting routing information can be used for forwarding.
How a BGP Route Moves Through the Network
A BGP route is not simply “sent” from one router to another. Reachability information is advertised, received, evaluated, stored and ultimately converted into a forwarding decision.
A network prefix represents a reachable destination.
BGP advertises the prefix together with path attributes.
The receiving router stores routes learned from its BGP peers.
Policy and BGP attributes determine which candidate wins.
The selected route becomes forwarding information for packets.
BGP carries reachability information, not user traffic. The UPDATE changes the control-plane view of the network. The resulting routing decision is then reflected in the forwarding plane through the FIB.
BGP routes are exchanged between BGP speakers and propagated according to the relationships between those speakers, their routing policies, and the rules of BGP. A route may enter an Autonomous System through an eBGP session, where the receiving router evaluates the advertisement and applies local policy before making the route available to its BGP process. The route may then be advertised to other BGP speakers within the AS using iBGP.
When a route is learned from an eBGP neighbour, its BGP attributes describe characteristics of the route and its path. Some attributes are received from the neighbour, while others may be modified or assigned through local policy before the route is advertised onward. For example, LOCAL_PREF can be set to influence the preferred exit point from the AS, while AS_PATH is modified when a route is advertised across an AS boundary. NEXT_HOP identifies the address that must be resolved to reach the destination, while MED can provide a neighbouring AS with information about a preferred entry point where the comparison is applicable.
Within an AS, iBGP can distribute BGP routes between internal speakers without adding the local AS to the AS_PATH. In common eBGP-to-iBGP propagation, the NEXT_HOP is preserved, meaning that internal routers may need the IGP to provide reachability to the BGP next hop. The IGP therefore plays a supporting role: it does not select the BGP route, but it provides the underlying IP reachability required to resolve the next hop and ultimately forward traffic.
The way routes propagate through an AS is also influenced by BGP policy and topology. Filtering can determine which routes are accepted or advertised, routing policy can modify attributes, and mechanisms such as route reflection can control how routes are distributed between iBGP speakers. As a result, not every BGP speaker necessarily receives every route, and different routers can have different sets of candidate paths from which to make their own best-path decisions.
Route reflectors are commonly used to scale iBGP deployments by reducing the number of individual peering relationships required. Rather than requiring every iBGP router to form a session with every other iBGP router, route reflectors can advertise routes between clients and other BGP speakers according to the route-reflection rules. Large networks may deploy multiple route reflectors for redundancy and operational resilience, with the design taking into account path visibility, loop prevention, policy, and convergence behaviour.
Once BGP selects a best path, that path becomes a candidate for installation into the router’s main routing table, subject to factors such as next-hop reachability, administrative preference, platform behaviour, and policy. If the route is installed, the forwarding plane can then use the resulting forwarding information to send packets toward the destination.
The key distinction is simple:
BGP determines which route is preferred. The IGP provides internal reachability to the required next hop. The forwarding plane moves the actual packet.
Understanding this separation is essential when following a BGP route from the moment it is advertised to the moment traffic is forwarded.
How BGP Routes Move Through the Network
A route begins as reachability information in one network. BGP carries that information between autonomous systems, adding context such as AS_PATH and other attributes as the advertisement moves through the Internet.
How BGP Selects a Path
PATH
How BGP Selects a Path
How BGP Selects a Path
A BGP router can learn multiple paths to the same destination. The router does not simply choose the shortest physical path. It evaluates policy and path attributes in a defined decision process.
BGP chooses a path according to routing policy and attributes, not simply according to distance. This is why two routers can see the same destination and legitimately select different paths.
BGP can learn multiple routes to the same destination and must evaluate those candidate paths to determine which route it prefers. The exact decision process varies by implementation and configuration, but common BGP implementations evaluate a sequence of attributes and tie-breakers. On platforms such as Cisco IOS, for example, Weight is considered first, followed by LOCAL_PREF and other criteria in the configured best-path process.
LOCAL_PREF is commonly used to express the preferred exit point from an Autonomous System, with higher values preferred. Other attributes can then influence the decision, including locally originated routes, AS_PATH length, the BGP ORIGIN attribute, and MED where the comparison is applicable. Additional criteria can include whether the route was learned through eBGP or iBGP and the IGP cost to reach the BGP NEXT_HOP. If multiple paths remain equivalent, implementation-specific tie-breakers such as router ID may be used. Some platforms also consider factors such as route age or neighbour address during the final stages of selection.
The important point is that BGP does not simply choose the route with the shortest AS_PATH. The decision process is policy-driven, and an earlier attribute can determine the preferred route before later attributes are ever considered. A route with a longer AS_PATH can therefore be preferred over a shorter path because of LOCAL_PREF, Weight, local origination, or another earlier decision criterion.
These attributes provide operators with mechanisms for influencing routing behaviour. LOCAL_PREF can be used to select preferred exits from an AS, AS_PATH manipulation can influence how routes are perceived by neighbouring networks, and MED can provide a neighbouring AS with information about a preferred entry point when the comparison applies. Communities can also be used to communicate policy information, allowing routers to apply consistent actions to groups of routes.
The result is a distributed routing system in which each BGP speaker makes its own decisions based on the routes it has learned, the policies applied to those routes, and the capabilities and configuration of the implementation. Different routers do not necessarily select the same path because they may have different candidate routes, policies, next-hop reachability, or points of attachment to the network.
When a route changes or becomes unavailable, BGP exchanges UPDATE messages to communicate new reachability information or withdrawals. Other BGP speakers then reevaluate their available paths and policies. This process allows routing decisions to adapt to topology changes while preserving the independent policy control of each Autonomous System.
The result is a routing system designed for policy, scale, and interdomain control rather than simply selecting the shortest physical or AS-level path. That distinction is central to understanding why BGP is used to connect independently operated networks across the Internet.
How BGP Chooses a Path
A BGP router can learn more than one route to the same destination. The best-path process compares route attributes in sequence until a preferred path is selected.
Compare the candidate routes
BGP does not simply choose the route with the shortest AS Path. It evaluates attributes in sequence.
Bringing the BGP Picture Together
BGP becomes much easier to understand when the individual pieces are viewed as parts of one complete routing system.
The Internet is a network of independently operated Autonomous Systems, and BGP provides the interdomain routing mechanism that allows those networks to exchange reachability information. Inside an Autonomous System, different routing functions work together: the IGP provides internal reachability, iBGP distributes BGP information between internal BGP speakers, eBGP exchanges routes between Autonomous Systems, and the forwarding plane ultimately moves the packets.
From there, a BGP route follows a lifecycle. A prefix is originated or learned, advertised through BGP UPDATE messages, propagated according to routing rules and policy, and stored as routing information on receiving routers. When multiple paths are available, BGP evaluates their attributes and applies its decision process to determine which path becomes the best path.
That distinction between route information and actual traffic is fundamental. BGP operates primarily in the control plane. It determines which reachability information should be preferred; the resulting routing information is then used by the forwarding plane to determine where packets should go.
The most important lesson is therefore not to think of BGP as simply finding the shortest path. BGP is a policy-driven path-selection system. Attributes such as Weight, Local Preference, AS_PATH, Origin and MED can influence the decision, while the surrounding topology, routing policy and internal reachability determine how those routes can actually be used.
Once these relationships are understood, BGP stops looking like a collection of individual commands and starts to become a coherent system:
Autonomous Systems → BGP Updates → Route Propagation → Path Selection → Forwarding
The interactive environments throughout this article are designed to make those relationships visible. Rather than only reading about BGP, you can observe the routing process, follow routes through the network, inspect path attributes and see how changing a routing decision affects the resulting path.
BGP Best-Path Cheat Sheet
The key BGP attributes to remember when comparing multiple routes to the same destination.
| Attribute | What it controls | Rule | Remember |
|---|---|---|---|
| 1 Weight | Preference on the local router | Higher wins | Cisco-specific |
| 2 Local Preference | Preferred exit point from the AS | Higher wins | Shared inside the AS |
| 3 Local Origin | Whether the route was originated locally | Preferred | Local route generation |
| 4 AS Path | Number of AS hops in the path | Shorter wins | Inter-AS path length |
| 5 Origin | How the route entered BGP | IGP preferred | IGP < EGP < Incomplete |
| 6 MED | Suggested entry point into an AS | Lower wins | Usually compared within the same neighboring AS |
| 7 eBGP vs iBGP | External versus internal path | eBGP preferred | Platform-dependent sequence |
| 8 Tie-breakers | Resolve routes still tied | Platform-specific | Router ID and other criteria |
BGP does not simply choose the shortest network path. It evaluates route attributes in sequence. Once an earlier attribute produces a clear winner, later attributes may never be considered.
The interactive labs below let you change these attributes and observe how the selected BGP route changes in the control plane.
You've Seen How BGP Works.
Now Explore It Yourself.
You have followed the journey from Autonomous Systems and BGP route propagation through to the best-path decision process. Now take those concepts into an interactive environment and see what happens when the routing conditions change.
Build, inspect and experiment with BGP routing behaviour in the interactive simulator.
Networking, BGP, infrastructure and interactive technical learning — combining practical engineering concepts with simulations, labs and real-world network design.
- BGP Solutions and Insights - October 8, 2026
- DMVPN - May 20, 2023
- Computer Networking: Building a Strong Foundation for Success - April 7, 2023
