Skip to main content

BGP Path Modeling

Infracast models BGP (Border Gateway Protocol) routing to give you accurate, path-level visibility into dynamic routing — not just what's in the RIB at scan time.

What we collect​

When scanning supported network devices, Infracast pulls the full BGP table (equivalent to show ip bgp on Cisco or show route protocol bgp on Juniper) and extracts:

AttributeDescription
PrefixDestination network
AS-pathSequence of AS numbers the route traversed
Next-hopIP address of the next-hop router
Local-prefPreference value (higher = preferred, default 100)
MEDMulti-Exit Discriminator (lower = preferred)
Originigp / egp / incomplete
WeightCisco-only, local to the router (higher = preferred)
CommunitiesBGP community tags
Statusbest / backup / invalid

For cloud BGP sessions (AWS Direct Connect VIFs, Azure ExpressRoute peerings, GCP Cloud Router), we pull advertised and received routes via cloud APIs.

Best-path selection​

Infracast implements standard BGP best-path selection (RFC 4271) with vendor extensions for Cisco, Juniper, and Palo Alto. The winning path is used for reachability computation; backup paths are retained for visibility.

Graph representation​

BGP paths are represented as typed edges in the topology graph, capturing prefix, AS-path, local preference, and path status. This enables reachability queries and finding rules to reason about BGP routing at the path level.

Path-tracer integration​

When the path-tracer walks a route, it annotates each hop with BGP status:

  • Best path: shown normally
  • Backup path: shown with a "failover" indicator
  • Failover paths are visible in the "Active Routing Paths" tab of path results

Finding rules​

Rule IDSeverityDescription
NETWORK-BGP-001MEDIUMBGP session established but no routes received
NETWORK-BGP-002MEDIUMAsymmetric routing detected (A→B path differs from B→A)
NETWORK-BGP-003LOWLong AS-path suggests unintended transit provider
NETWORK-BGP-004HIGHCustomer prefix received from unexpected peer (route hijack indicator)
NETWORK-BGP-005MEDIUMDefault route advertised by non-edge device

Supported vendors​

VendorCollection methodBGP attributes
Cisco IOS/IOS-XEshow ip bgp via SSHFull (weight, LP, MED, AS-path, community)
Juniper JunOSNETCONF RPC or show route protocol bgpFull (LP, MED, AS-path, community)
Palo AltoXML API Virtual Router BGP tableLP, MED, AS-path, community
AWS Direct ConnectDescribeVirtualInterfaces APIAdvertised/received prefixes, BGP ASN
Azure ExpressRouteARM API peering routesAdvertised/received prefixes, BGP peer ASN
GCP Cloud RouterCompute APIBGP session state, peer config

Limitations​

  • Convergence simulation is not performed — we model the current best-path state, not post-failure convergence
  • BGP communities are collected but not semantically interpreted (e.g., blackhole communities are noted but not acted upon)
  • Full-table routers (internet edge with 900K+ prefixes) are handled via prefix aggregation — /32s are collapsed under shorter covering prefixes for visualization