TTR Networks

Intermediate · BGP Fundamentals · section 4 of 9

Messages and path attributes

✓ Lab-tested 17 October 2026 on FRR 10.2.1

The five message types

MessagePurpose
OPENFirst message after TCP comes up: version, ASN, hold time, router ID, capabilities.
KEEPALIVEConfirms an OPEN and keeps the session alive when idle.
UPDATEAdvertises new paths (NLRI + path attributes) and/or withdraws old ones.
NOTIFICATIONReports an error and closes the session.
ROUTE-REFRESHAsks the peer to resend its routes so new inbound policy can be applied without a reset (RFC 2918).

Path attributes

An UPDATE carries a set of path attributes that describe the route. These are what policy matches on and what the best-path algorithm compares.

AttributeCategoryWhat it does
ORIGINwell-known mandatoryHow the route entered BGP: i IGP (network statement), e EGP (historic), ? incomplete (redistributed).
AS_PATHwell-known mandatoryThe ordered list of ASes the route has traversed. Used for loop prevention and as a path-length metric.
NEXT_HOPwell-known mandatoryThe IP address to forward traffic to for this prefix.
LOCAL_PREFwell-known discretionaryiBGP only. Higher wins. The primary tool for choosing your outbound exit.
MEDoptional non-transitive"Multi-Exit Discriminator". A hint to a neighbouring AS about which of your entry points to use. Lower wins.
COMMUNITYoptional transitive32-bit tags (ASN:value) used to signal policy, e.g. "do not export" or "prepend toward peers". Large communities (RFC 8092) extend this for 32-bit ASNs.

AS_PATH is the loop-prevention mechanism. When a router receives an UPDATE whose AS_PATH already contains its own ASN, it discards it. Follow a prefix across the internet below.

Diagram: Propagating 203.0.113.0/24 — Follow 203.0.113.0/24 as it is advertised across the internet and watch the AS_PATH grow.
  1. Origination. AS 64499 originates 203.0.113.0/24. Inside its own AS the AS_PATH is empty; ORIGIN is set to IGP (i) because it came from a network statement.
  2. First hop: prepend the origin AS. When sending to an eBGP peer, a router prepends its own ASN. Both ISPs receive AS_PATH "64499" and NEXT_HOP set to the content network's link address.
  3. Second hop: the path grows. Each ISP prepends its own ASN when advertising to you. You now hold two paths, both two ASes long.
  4. ISPs peer with each other. ISP A also advertises to ISP B. ISP B now has two paths: direct (64499) and via A (64497 64499). The direct path is shorter, so it stays best.
  5. Loop prevention. Suppose ISP B's link to the origin fails and it now uses the path via A. B would advertise "64498 64497 64499" back to A. A sees its own ASN in the path and drops the UPDATE — no loop.

Check your understanding

AS 64497 receives an UPDATE for 203.0.113.0/24 with AS_PATH "64498 64497 64499". What does it do?

  • Installs it, because a longer AS_PATH is only a tie-breaker
  • Discards it, because its own ASN appears in the AS_PATH
  • Strips its own ASN and re-advertises the route
  • Sends a NOTIFICATION and resets the session