Pcornel
Browse topics
Options
Recent
Favorites
Networking · Technical reference

BGP Protocol Reference

Direct answer

BGP exchanges routes between networks over TCP sessions that are configured by hand. Each route carries attributes, policy decides what is accepted and advertised, and one best path per prefix is chosen. The topics here cover its messages, attributes and decision process.

When to use this

Start here when a session is not Established, a prefix is missing or not advertised, or traffic takes the wrong exit.

First 30 seconds

1. show bgp ipv4 unicast summary — Established (a prefix count), or Idle/Active?

2. Not Established → show bgp ipv4 unicast neighbors <ip>: last reset reason; reachability of the peer address; AS numbers; update source.

3. Established, prefix missing → received at all? Dropped by inbound policy?

4. show bgp ipv4 unicast <prefix> — is there a best path? Next hop reachable?

5. Not advertised onwards → outbound policy, or the iBGP rule.

Operational verification

TCP to the peer → OPEN accepted → Established → UPDATE received → inbound policy → best path chosen → next hop reachable → installed in the routing table → outbound policy → advertised

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
Protocol behaviour per standard; Cisco IOS / IOS XE command examples.
Applicability is projected only from persisted Topic profile and Command metadata.
At a glance

Operational reference

Fast context before you go deeper.

PlatformProtocol behaviour per standard; Cisco IOS / IOS XE command examples.
Scope / prerequisiteStart here when a session is not Established, a prefix is missing or not advertised, or traffic takes the wrong exit.
What next?1 suggested next step
Child topics (this level)14
Evidence0
On this pageJump to a specific section
Command lookup Jump straight to Cisco syntax
Drill down

Subtopics

Go one level deeper into this subject.

Subtopic BGP Aggregation & Multipath Deep Reference

BGP Aggregation & Multipath Deep Reference explains the separate control-plane problems of BGP route aggregation and multipath installation: component-route eligibility, summary generation/suppression, aggregate attributes, multiple-path eligibility, maximum-path settings and actual RIB/FIB programming and the exact boundary between control-plane state and forwarding proof.

Subtopic BGP Messages & Capabilities Reference

BGP sessions use OPEN, UPDATE, NOTIFICATION and KEEPALIVE messages over TCP; capabilities are negotiated in OPEN messages to extend session behavior.

Subtopic BGP Notification Error Reference

BGP NOTIFICATION messages report a protocol error and close the BGP session, carrying an error code and subcode that sharply narrows the failure boundary.

Subtopic BGP Adj-RIB-In / Loc-RIB / Adj-RIB-Out Reference

BGP route processing can be reasoned as received routes entering Adj-RIB-In, policy/path selection producing Loc-RIB state, and outbound policy determining what is eligible for Adj-RIB-Out advertisement.

Subtopic BGP Route Refresh & Soft Policy Change Reference

BGP route refresh lets a peer request that routes be re-advertised so updated inbound policy can be applied without tearing down the TCP/BGP session.

Subtopic BGP Graceful Restart Reference

BGP Graceful Restart coordinates temporary preservation of forwarding state while a peer restarts its BGP control plane, subject to negotiated capability and stale-route timers.

Subtopic BGP Maximum-Prefix Protection Reference

Maximum-prefix protection limits how many prefixes a BGP neighbor/address family may contribute and can warn, restart or terminate the session depending on configuration.

Subtopic BGP UPDATE Message Field Reference

BGP UPDATE Message Field Reference maps BGP UPDATE framing for withdrawals, path attributes and reachable NLRI, including the distinction between classic IPv4-unicast NLRI fields and multiprotocol reachability attributes from decoded packet fields to the next protocol-state boundary.

Subtopic BGP Path Attribute Flags Reference

BGP Path Attribute Flags Reference maps the common BGP path-attribute header flags and length encoding that determine attribute class, propagation semantics and how the following type-specific value must be parsed from a decoded control-plane object to the next protocol and forwarding boundary.

Subtopic BGP Core Attribute Field Reference

ORIGIN, AS_PATH, NEXT_HOP, LOCAL_PREF, MED and communities carry the core path-selection and policy metadata for many IPv4 unicast routes.

Subtopic BGP OPEN & Capability Field Reference

BGP OPEN & Capability Field Reference maps BGP OPEN fixed fields and optional capability negotiation, separating successful TCP transport from BGP identity, timer and address-family feature agreement from decoded packet fields to the next protocol-state boundary.

Subtopic BGP NOTIFICATION Code & Subcode Reference

BGP NOTIFICATION Code & Subcode Reference maps BGP NOTIFICATION Error Code, Error Subcode and optional diagnostic Data as direct protocol evidence for why a peer intentionally closes a session from decoded packet fields to the next protocol-state boundary.

Subtopic BGP AS_PATH & Community Field Reference

BGP AS_PATH & Community Field Reference maps BGP path-attribute encoding for AS_PATH segment structure and community policy labels, including standard and large-community interpretation without collapsing them into one generic string from decoded packet fields to the next protocol-state boundary.

Subtopic BGP MP_REACH / MP_UNREACH Field Reference

BGP MP_REACH / MP_UNREACH Field Reference maps MP_REACH_NLRI and MP_UNREACH_NLRI attributes carrying AFI/SAFI-specific reachability, next-hop information and withdrawals for multiprotocol BGP families from decoded packet fields to the next protocol-state boundary.

Key points

Work through the pipeline: session, received, accepted by policy, best path, installed, advertised. A number under State/PfxRcd means Established. The next hop must be reachable or the path is unusable. Routes learned from one iBGP peer are not passed to another without a route reflector.

Key checks
  • show bgp ipv4 unicast summary — each neighbour with state or prefixes received.
  • show bgp ipv4 unicast neighbors <ip> — state, last reset reason, capabilities, timers.
  • show bgp ipv4 unicast <prefix> — all paths, attributes, and which is best and why not the others.
  • show bgp ipv4 unicast neighbors <ip> advertised-routes — what is sent.
  • show bgp ipv4 unicast neighbors <ip> routes — what was accepted.
  • show ip route bgp — what reached the routing table.
ReferenceWhat it is1 section · depth on demand

What this group covers

BGP messages and capabilities, UPDATE and path attribute fields, NOTIFICATION codes, the Adj-RIB-In/Loc-RIB/Adj-RIB-Out pipeline, route refresh, graceful restart, maximum-prefix and aggregation/multipath. Pair with Routing → BGP for configuration and best-path selection.

ReferenceImportant terms & boundaries2 sections · depth on demand

Where to look

QuestionReference
Why did the session reset?*BGP Notification Error Reference / NOTIFICATION Code & Subcode Reference*
Which capabilities were negotiated?*BGP Messages & Capabilities Reference*
Is the route received but not used?*BGP Adj-RIB-In / Loc-RIB / Adj-RIB-Out Reference*
How do I apply a new policy without reset?*BGP Route Refresh & Soft Policy Change Reference*
Why did the peer go down at a prefix limit?*BGP Maximum-Prefix Protection Reference*
What is in this UPDATE?*BGP UPDATE Message Field Reference*

BGP is the routing protocol between organisations and on the internet, and inside large enterprise and data-centre networks. Unlike interior protocols, it is built around policy: what each neighbour may advertise and which path is preferred are deliberate choices. Sessions must be established before any routes flow, and filtering what is sent and received is essential for safety.

BGP quick reference:

show bgp ipv4 unicast summary
show bgp ipv4 unicast 203.0.113.0/24
show bgp ipv4 unicast neighbors 198.51.100.1 advertised-routes
show bgp ipv4 unicast neighbors 198.51.100.1 routes

Session states: Idle → Connect/Active → OpenSent → OpenConfirm → Established. Prefixes must exist in the RIB to be advertised with network. Always filter eBGP with prefix lists and maximum-prefix.

In depth

BGP connects autonomous systems and implements routing policy at scale. It runs over TCP between configured peers, carries routes with attributes such as AS_PATH, NEXT_HOP and LOCAL_PREF, and selects one best path per prefix using an ordered list of attribute comparisons.

TopicKey idea
eBGP vs iBGPBetween ASes vs within an AS
Neighbor statesIdle → Active → Established
Path selectionWeight, LOCAL_PREF, AS_PATH, origin, MED...
PolicyPrefix lists, route maps, communities
ScalingRoute reflectors, confederations

Always filter what you send and accept; BGP will advertise and accept anything policy allows.

Confirmation

Confirm action

Continue?