Loading content...
Once BGP sessions are established, the real work begins: exchanging routing information. Every prefix reachable on the Internet—from major cloud provider address blocks to small business networks—is advertised through BGP UPDATE messages that propagate across autonomous system boundaries.
Route advertisement in BGP is far more sophisticated than simple prefix announcements. Each route carries rich metadata in the form of path attributes that describe how the route was learned, what path it takes through the network, and how it should be treated. Understanding route advertisement mechanics is essential for anyone operating, designing, or troubleshooting inter-domain routing.
By the end of this page, you will understand UPDATE message structure in detail, master the complete set of BGP path attributes, comprehend NLRI encoding, understand route withdrawal mechanisms, grasp route aggregation concepts, and appreciate how BGP efficiently propagates routing information at Internet scale.
The BGP UPDATE message is the workhorse of inter-domain routing, carrying all routing information between BGP peers. Its structure is carefully designed to efficiently communicate route announcements and withdrawals.
UPDATE Message Format:
+----------------------------------------------+
| Withdrawn Routes Length (2 bytes) |
+----------------------------------------------+
| Withdrawn Routes (variable) |
| - Prefix length (1 byte) |
| - Prefix (variable, rounded up to bytes) |
+----------------------------------------------+
| Total Path Attribute Length (2 bytes) |
+----------------------------------------------+
| Path Attributes (variable) |
| - Attribute Type (2 bytes) |
| - Flags (1 byte) |
| - Type Code (1 byte) |
| - Attribute Length (1 or 2 bytes) |
| - Attribute Value (variable) |
+----------------------------------------------+
| Network Layer Reachability Information |
| (NLRI - variable) |
| - Prefix length (1 byte) |
| - Prefix (variable, rounded up to bytes) |
+----------------------------------------------+
Key Structural Observations:
Withdrawals First: Withdrawn routes are listed before new announcements, allowing receivers to process removals before additions
Shared Attributes: All prefixes in the NLRI section share the same path attributes—this enables batching of announcements with identical characteristics
Variable Length Encoding: Both prefixes and attribute values use variable-length encoding to minimize message size
Empty UPDATE Messages: An UPDATE with no withdrawn routes and no NLRI (just attributes, or completely empty) is valid and serves as a keepalive
| Field | Size | Purpose | Notes |
|---|---|---|---|
| Withdrawn Routes Length | 2 bytes | Total bytes in withdrawn routes | 0 if no withdrawals |
| Withdrawn Routes | Variable | Prefixes being removed | Encoded as length+prefix pairs |
| Total Path Attribute Length | 2 bytes | Total bytes in attributes | 0 if no announcements |
| Path Attributes | Variable | Route metadata | Applies to all NLRI in message |
| NLRI | Variable | Prefixes being announced | Encoded as length+prefix pairs |
NLRI Encoding Example:
Consider announcing the prefix 192.0.2.0/24:
Prefix Length: 24 (1 byte: 0x18)
Prefix: 192.0.2 (3 bytes: 0xC0 0x00 0x02)
Note that only the network portion is included—the host portion (trailing zeros) is omitted. A /24 requires 3 bytes, a /16 requires 2 bytes, and a /8 requires 1 byte.
For IPv6 with Multiprotocol BGP, NLRI is carried inside the MP_REACH_NLRI attribute rather than the main NLRI field.
Because all NLRI in an UPDATE share the same attributes, BGP implementations batch announcements with identical attributes into single messages. If you're announcing 1000 /24s that share the same AS_PATH, NEXT_HOP, and other attributes, they can be sent in one UPDATE rather than 1000 separate messages.
Path attributes are the metadata that BGP attaches to routes. They describe the route's origin, its path through the network, and how it should be handled. Attributes are classified by two independent criteria.
Attribute Flags (First Byte of Attribute Type):
| Bit | Name | Meaning |
|---|---|---|
| 7 | Optional | 0 = Well-known (must be recognized), 1 = Optional (may not be recognized) |
| 6 | Transitive | 0 = Non-transitive, 1 = Transitive (passed to neighbors) |
| 5 | Partial | 0 = Complete, 1 = Partial (set when unrecognized transitive attribute propagated) |
| 4 | Extended Length | 0 = 1-byte length, 1 = 2-byte length |
Attribute Classification Matrix:
| Category | Required to Support | Passed to Neighbors | Example Attributes |
|---|---|---|---|
| Well-known Mandatory | Yes | Yes | ORIGIN, AS_PATH, NEXT_HOP |
| Well-known Discretionary | Yes | Yes | LOCAL_PREF, ATOMIC_AGGREGATE |
| Optional Transitive | No | Yes | COMMUNITY, AGGREGATOR |
| Optional Non-Transitive | No | No | MED, ORIGINATOR_ID |
Handling Rules:
Well-known Mandatory: Must be present in every UPDATE with NLRI. If missing, the UPDATE is malformed.
Well-known Discretionary: Must be recognized by all implementations but may be absent.
Optional Transitive: If not recognized, passed to neighbors with the Partial bit set.
Optional Non-Transitive: If not recognized, silently discarded.
| Type Code | Attribute Name | Category | Primary Purpose |
|---|---|---|---|
| 1 | ORIGIN | Well-known Mandatory | How route entered BGP (IGP, EGP, Incomplete) |
| 2 | AS_PATH | Well-known Mandatory | List of ASes route traversed |
| 3 | NEXT_HOP | Well-known Mandatory | IP address to forward traffic to |
| 4 | MULTI_EXIT_DISC (MED) | Optional Non-Transitive | Preference hint to external neighbors |
| 5 | LOCAL_PREF | Well-known Discretionary | Internal preference for egress selection |
| 6 | ATOMIC_AGGREGATE | Well-known Discretionary | Indicates aggregation occurred |
| 7 | AGGREGATOR | Optional Transitive | AS and router that performed aggregation |
| 8 | COMMUNITY | Optional Transitive | Arbitrary tags for policy |
| 9 | ORIGINATOR_ID | Optional Non-Transitive | Loop prevention for route reflectors |
| 10 | CLUSTER_LIST | Optional Non-Transitive | Route reflector cluster path |
| 14 | MP_REACH_NLRI | Optional Non-Transitive | Multiprotocol reachable NLRI |
| 15 | MP_UNREACH_NLRI | Optional Non-Transitive | Multiprotocol unreachable NLRI |
The original BGP specification only supported IPv4 unicast routes. RFC 4760 (Multiprotocol BGP) added MP_REACH_NLRI and MP_UNREACH_NLRI attributes to carry routes for other address families: IPv6:unicast, IPv4:multicast, VPNv4, EVPN, and many others. These attributes encapsulate the NLRI and NEXT_HOP information for non-IPv4-unicast routes.
Every BGP UPDATE message with NLRI must include the three well-known mandatory attributes: ORIGIN, AS_PATH, and NEXT_HOP. Understanding these attributes is fundamental to BGP operation.
ORIGIN Attribute (Type 1)
The ORIGIN attribute indicates how the route was originally introduced into BGP:
| Value | Code | Meaning | Typical Source |
|---|---|---|---|
| 0 | IGP | Route originated from an IGP | network command, redistribution from OSPF/IS-IS |
| 1 | EGP | Route originated from EGP | Historic, rarely seen |
| 2 | INCOMPLETE | Route origin unknown | Redistribution from static/connected |
ORIGIN is used in route selection: IGP is preferred over EGP, which is preferred over INCOMPLETE.
AS_PATH Attribute (Type 2)
The AS_PATH is perhaps the most important BGP attribute. It records the sequence of ASes that a route has traversed, serving two critical functions:
AS_PATH consists of path segments, each with a type and list of AS numbers:
| Segment Type | Value | Purpose |
|---|---|---|
| AS_SET | 1 | Unordered set of ASes (used in aggregation) |
| AS_SEQUENCE | 2 | Ordered sequence of ASes (normal case) |
| AS_CONFED_SEQUENCE | 3 | Sequence within a confederation |
| AS_CONFED_SET | 4 | Set within a confederation |
Example AS_PATH:
AS_PATH: 65002 65005 65010
This indicates the route was received from AS 65002, which received it from AS 65005, which received it from AS 65010 (the origin).
NEXT_HOP Attribute (Type 3)
The NEXT_HOP attribute specifies the IP address that should be used to reach the advertised prefixes. Its handling differs significantly between eBGP and iBGP:
eBGP NEXT_HOP Behavior:
iBGP NEXT_HOP Behavior:
The NEXT_HOP Reachability Problem:
Consider this topology:
[AS 65001] [AS 65002]
10.0.0.1 10.0.0.2
R1 --------- R2 ===== R3
|
| iBGP
|
R4
Solutions:
neighbor x.x.x.x next-hop-self to force R2 to change NEXT_HOP to its own addressIn certain topologies (like IXP route servers), the NEXT_HOP may point to a third-party router—not the router advertising the route. This 'third-party next-hop' optimization reduces traffic tromboning but requires careful verification that the NEXT_HOP is reachable from the receiving router.
While mandatory attributes are essential for basic routing, optional attributes provide the control and flexibility needed for sophisticated routing policies.
LOCAL_PREF Attribute (Type 5)
LOCAL_PREF is used exclusively within an AS to influence outbound traffic. It's a 32-bit value; higher values are preferred.
Key characteristics:
Example Use Case:
AS 65001 has two connections to AS 65002:
- Primary via R1: Set LOCAL_PREF = 200
- Backup via R2: Set LOCAL_PREF = 50
All routers in AS 65001 will prefer routes learned via R1.
MED Attribute (Type 4 - Multi-Exit Discriminator)
MED is used to communicate preferences to external neighbors for inbound traffic. It's a 32-bit value; lower values are preferred.
Key characteristics:
Example Use Case:
AS 65002 advertises 192.0.2.0/24 via two links to AS 65001:
- Via R2: MED = 100
- Via R3: MED = 200
AS 65001 (if honoring MED) will prefer the path via R2.
COMMUNITY Attribute (Type 8)
Communities are 32-bit tags that enable flexible policy expression. Routes can carry multiple communities, and policies can match, add, or remove them.
Standard format: AS:value (e.g., 65001:100)
Well-Known Communities (RFC 1997):
| Community | Value | Action |
|---|---|---|
| NO_EXPORT | 0xFFFFFF01 | Don't advertise outside AS |
| NO_ADVERTISE | 0xFFFFFF02 | Don't advertise to any peer |
| NO_EXPORT_SUBCONFED | 0xFFFFFF03 | Don't advertise outside confederation |
Community Use Cases:
Extended Communities (Type 16):
Extended communities provide 8 bytes (versus 4 for standard) and support typed values:
Large Communities (Type 32):
Large communities (RFC 8092) provide 12 bytes, designed for 4-byte AS numbers:
Global Admin (4 bytes) : Local Data 1 (4 bytes) : Local Data 2 (4 bytes)Define and document your community scheme before deployment. Use consistent semantics (e.g., AS:1xxx for route types, AS:2xxx for geographic origin). Scrub unexpected communities on ingress from peers and customers. Many Internet routing problems have been caused by accidental community propagation.
Understanding how routes are announced and propagated is essential for predicting BGP behavior and troubleshooting routing issues.
Route Origination:
Routes enter BGP through several mechanisms:
router bgp 65001
network 192.0.2.0 mask 255.255.255.0
Requires a matching route in the routing table (exact match typically required).
router bgp 65001
redistribute ospf 1 route-map OSPF-TO-BGP
Use with caution—can create routing loops or table bloat.
router bgp 65001
aggregate-address 192.0.0.0 255.255.0.0 summary-only
Outbound Route Processing:
When advertising routes to a peer, BGP applies a sequence of operations:
| Step | Check/Action | Failure Result |
|---|---|---|
| 1 | Is route valid (best path, NH reachable)? | Don't advertise |
| 2 | Does outbound filter permit? | Don't advertise |
| 3 | Is peer's AS in AS_PATH? | Don't advertise (loop prevention) |
| 4 | Is this iBGP route to iBGP peer? (no RR) | Don't advertise |
| 5 | Apply attribute modifications | — |
| 6 | Update advertisements to neighbor | — |
Incremental Updates:
BGP uses incremental updates rather than periodic full table exchanges. After the initial table exchange when a session is established:
This incremental approach dramatically reduces bandwidth and processing overhead compared to link-state protocols that exchange complete databases.
Minimum Route Advertisement Interval (MRAI):
To prevent update storms, BGP limits how frequently routes can be advertised:
This means if a route changes multiple times within 30 seconds, only the final state is advertised, reducing update volume but increasing convergence time.
When BGP advertises a new path for an existing prefix, the previous path is implicitly withdrawn. The receiving router replaces the old route with the new one. Explicit withdrawal is only needed when the prefix becomes unreachable.
When a route is no longer valid, BGP must inform its peers to stop using it. Route withdrawal is a critical operation that directly impacts traffic forwarding.
Withdrawal Triggers:
Withdrawal Message Format:
Withdrawals are carried in the UPDATE message's Withdrawn Routes field:
+---------------------------+
| Withdrawn Routes Length | (e.g., 7 bytes)
+---------------------------+
| Withdrawn Routes |
| Length: 24, Prefix: 192.0.2.0 (4 bytes)
| Length: 16, Prefix: 10.0.0 (3 bytes)
+---------------------------+
Note: No path attributes are needed for withdrawals—just the prefix identification.
Withdrawal Propagation:
When a BGP router receives a withdrawal:
Convergence Time Considerations:
Withdrawals typically converge faster than announcements because:
However, path exploration (when multiple paths exist) can cause temporary routing instability:
This path exploration can generate many UPDATE messages as the network reconverges.
Route flap damping (RFC 2439) penalizes routes that repeatedly flip between available and unavailable. While intended to stabilize routing, operational experience showed it could delay convergence for legitimate events. RFC 7196 (2014) revised recommendations, suggesting damping be disabled or configured very conservatively. Modern networks often rely on fast reconvergence rather than damping.
Route aggregation (summarization) is essential for Internet scalability. Without aggregation, the global routing table would be unmanageable—every small network would require a separate entry in every router's memory.
Why Aggregate?
BGP Aggregation Commands:
router bgp 65001
! Basic aggregation - both aggregate and specifics advertised
aggregate-address 192.0.0.0 255.255.0.0
! Summary-only - suppress specific routes
aggregate-address 192.0.0.0 255.255.0.0 summary-only
! AS-SET - include contributing ASes in AS_PATH
aggregate-address 192.0.0.0 255.255.0.0 as-set
Aggregation Mechanics:
When BGP creates an aggregate:
| Option | Specifics Advertised? | AS_PATH | Use Case |
|---|---|---|---|
| No options | Yes | Local AS only | Provide backup paths via specifics |
| summary-only | No | Local AS only | Maximum table reduction |
| as-set | Yes | AS_SET of all contributors | Prevent routing loops, lost AS info |
| summary-only as-set | No | AS_SET of all contributors | Table reduction with loop prevention |
| suppress-map | Selective | Varies | Granular control of suppression |
The Aggregation Information Loss Problem:
Aggregation inherently loses information. When you aggregate 192.0.2.0/24 (AS 65001), 192.0.3.0/24 (AS 65002), and 192.0.4.0/24 (AS 65003) into 192.0.0.0/22:
Without AS-SET: The aggregate's AS_PATH shows only your AS. Routers can't detect loops if 65001, 65002, or 65003 receive the aggregate.
With AS-SET: The aggregate's AS_PATH includes {65001, 65002, 65003} as an unordered set. Loop detection works, but AS_PATH length calculation uses the set as length 1.
ATOMIC_AGGREGATE Attribute:
This well-known discretionary attribute indicates that:
AGGREGATOR Attribute:
This optional transitive attribute records:
Useful for troubleshooting—you can trace who created a suspicious aggregate.
Route filtering is the primary mechanism for implementing BGP policy. By controlling which routes are accepted and advertised, network operators shape traffic flow, enforce business relationships, and protect network security.
Filtering Directions:
| Direction | Purpose | Common Actions |
|---|---|---|
| Inbound | Control what routes are accepted from peers | Reject bogons, filter by prefix/AS, set attributes |
| Outbound | Control what routes are advertised to peers | Advertise only your routes, suppress specifics |
Filtering Mechanisms:
ip prefix-list CUSTOMER-IN seq 10 permit 192.0.2.0/24
ip prefix-list CUSTOMER-IN seq 20 permit 198.51.100.0/22 le 24
ip as-path access-list 1 permit ^65001$ ! Origin AS 65001
ip as-path access-list 2 deny _65002_ ! Transit via AS 65002
ip community-list standard BLACKHOLE permit 65001:666
ip community-list expanded CUSTOMER permit ^65001:1[0-9]{3}$
route-map CUSTOMER-IN permit 10
match ip address prefix-list CUSTOMER-PREFIXES
match as-path 1
set local-preference 150
set community 65001:1000 additive
Policy Application Order:
BGP applies policies at specific points in route processing:
This model means inbound filtering reduces memory usage (routes never stored) while outbound filtering only affects what's advertised.
For external peers, the safest approach is 'default deny'—explicitly permit only expected routes. An open filter that 'permits all except known bad' will inevitably miss something. Many Internet routing incidents result from missing or incomplete filters that allowed unexpected routes to propagate.
Route advertisement is the mechanism by which BGP propagates routing information across the Internet. Mastering UPDATE messages, path attributes, and advertisement behavior is essential for operating production BGP networks.
What's Next:
Now that you understand how routes are advertised, the next page explores route selection—the algorithm BGP uses to choose the best path when multiple paths exist to the same destination. You'll learn the complete best path selection algorithm and how various attributes influence the decision.
You now understand the complete mechanics of BGP route advertisement—from UPDATE message structure through path attributes to aggregation and filtering. This knowledge is essential for designing routing policies and troubleshooting route propagation issues.