Pcornel
Browse topics
Options
Recent
Favorites
Networking · Technical reference

BGP Path Attribute Flags Reference

Direct answer

Each BGP path attribute has a flags byte saying whether it is optional or well-known, transitive or not, partial, and uses an extended length. These flags decide how routers handle attributes they do not recognise.

When to use this

Use it when reading BGP UPDATE captures, or when a router drops, passes on or complains about an attribute it does not recognise.

First 30 seconds

1. Capture the UPDATE: Wireshark bgp.type == 2.

2. For each attribute read Flags, Type Code and Length.

3. Well-known mandatory attributes present (ORIGIN, AS_PATH, NEXT_HOP for eBGP)?

4. Unknown optional transitive → Partial bit set on the way out.

5. Session resets → show ip bgp neighbors <ip> | include Last reset for the notification code.

Operational verification

UPDATE received → each attribute's flags and type parsed → known attributes applied → unknown optional transitive passed on with Partial → malformed attribute handled (treat-as-withdraw or reset)

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
Protocol standard + deployed implementation
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformProtocol standard
Key commandshow ip bgp 203.0.113.0/24
Scope / prerequisiteUse it when reading BGP UPDATE captures, or when a router drops, passes on or complains about an attribute it does not …
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

3 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Field/LSDB/capture verification and known-good sequence Verify boundary
show ip bgp 203.0.113.0/24
show ip bgp neighbors 192.0.2.2 | include Last reset|notification
show logging | include BGP

The prefix detail shows the attributes that were received and understood; an optional transitive attribute that passed through a router that did not understand it is shown as partial. The neighbour output and the log show whether a session was reset for a malformed attribute.

In a capture, each attribute is displayed with its flags decoded; check that the flags match the class of the type code.

Known-good: the attributes expected on the route are present, and the log has no UPDATE errors.

Step 2 Failure signatures and field-level troubleshooting Narrow the fault
  • The session resets with a NOTIFICATION 3/x (UPDATE message error). A received attribute had wrong flags or length, or a mandatory attribute was missing — usually a software fault at the sender or on the path.
  • A route is silently missing although the neighbour sends it. It was discarded as malformed while the session stayed up; check the log.
  • An attribute does not arrive. It is non-transitive (MED, for example, goes one AS only), or it was removed by policy.
  • An attribute is marked partial. A router on the path did not understand it; the value is intact.
  • A new attribute type is not passed on by one vendor's routers. It is optional non-transitive, or filtered deliberately.
Step 3 When the problem is really fixed Narrow the fault
  • The route carries the expected attributes on the receiving router.
  • The session stays up and the log shows no malformed-update messages.
  • If a session was reset, the code and subcode have been recorded and the sender identified.
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Command lookup Jump straight to Cisco syntax
Key points

Flag bits: Optional (1) / well-known (0), Transitive, Partial, Extended Length. Well-known mandatory: ORIGIN, AS_PATH, NEXT_HOP. An unknown optional transitive attribute is passed on with Partial set; an unknown optional non-transitive one is silently dropped. A malformed attribute can reset the session — RFC 7606 makes most errors "treat-as-withdraw" instead.

Key checks
  • Wireshark filter bgp.type == 2 — UPDATE messages; expand Path attributes → Flags, Type Code, Length.
  • show ip bgp <prefix> — attributes the router accepted (origin, AS path, next hop, communities).
  • show ip bgp neighbors <ip> | include error|Last reset — notifications and reset reasons.
  • debug ip bgp updates — attribute processing (lab or briefly).
ReferenceWhat it is1 section · depth on demand

Mechanics & mental model

Every path attribute in a BGP UPDATE starts with one byte of flags. The flags say what kind of attribute it is: whether every BGP router must understand it, and whether a router that does not understand it should pass it on anyway.

ReferenceWhy it matters1 section · depth on demand

Why it matters operationally

The flags are what let BGP gain new attributes without every router being upgraded at once. They also explain why some attributes — communities, for instance — cross networks that know nothing about them, while others stop at the first router.

ReferenceImportant terms & boundaries2 sections · depth on demand

In depth

Path attribute flags

Each path attribute in an UPDATE begins with a flags byte, a type code and a length. RFC 4271 defines the four high-order flag bits:

  • Optional (bit 0): 0 means well-known.
  • Transitive (bit 1): pass the attribute on even if it isn't understood.
  • Partial (bit 2): an optional transitive attribute was passed on by a router that didn't recognise it.
  • Extended Length (bit 3): a 2-byte length instead of 1.

The lower four bits must be zero when sent. Well-known attributes must always have the Transitive bit set.

The four attribute categories

CategoryOptionalTransitiveExamplesIf not recognised
Well-known mandatory01ORIGIN, AS_PATH, NEXT_HOPNot possible: every BGP speaker must support them
Well-known discretionary01LOCAL_PREF, ATOMIC_AGGREGATENot possible
Optional transitive11AGGREGATOR, COMMUNITIESPassed on with the Partial bit set
Optional non-transitive10MED, MP_REACH_NLRIQuietly dropped

Flag bytes you will see

ByteBits setTypical attribute
0x40TransitiveORIGIN, AS_PATH, NEXT_HOP, LOCAL_PREF
0x50Transitive, Extended LengthLong AS_PATH
0x80OptionalMED
0x90Optional, Extended LengthMP_REACH_NLRI
0xC0Optional, TransitiveCOMMUNITIES, AGGREGATOR
0xE0Optional, Transitive, PartialUnknown optional transitive passed on

Errors (RFC 4271)

Wrong flags for a known attribute produce UPDATE Message Error 3/4 (Attribute Flags Error). A wrong length produces 3/5. A missing well-known mandatory attribute produces 3/3. Modern implementations often handle many attribute errors by treating the route as withdrawn instead of resetting the session (RFC 7606).

host$ tshark -r bgp.pcap -Y "bgp.type == 2" -O bgp | grep -E "Flags: 0x|Type Code" | head -8
        Flags: 0x40, Transitive, Well-known, Complete
        Type Code: ORIGIN (1)
        Flags: 0x50, Transitive, Extended-Length, Well-known, Complete
        Type Code: AS_PATH (2)
        Flags: 0x80, Optional, Non-transitive, Complete
        Type Code: MULTI_EXIT_DISC (4)
R1# show bgp ipv4 unicast 192.0.2.0/24 | include unknown|Attr

A Partial bit (0xE0) shows that some router along the path didn't recognise the attribute. That is useful when tracing how new attributes propagate.

Documented example, not captured output.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

Field structure, identity and state ownership

Each attribute is encoded as flags (1 byte), type code (1 byte), length (1 or 2 bytes) and value. The flag bits:

BitNameSet means
0x80OptionalNot every router is required to understand this attribute. Clear means well-known
0x40TransitivePass the attribute on, even if not understood
0x20PartialSome router along the path passed it on without understanding it
0x10Extended lengthThe length field is two bytes

That gives four classes, each with a fixed way to handle the attribute:

ClassFlagsExamples (type code)A router that does not know it
Well-known mandatory0x40ORIGIN (1), AS_PATH (2), NEXT_HOP (3)Cannot happen; all routers know these
Well-known discretionary0x40LOCAL_PREF (5), ATOMIC_AGGREGATE (6)Cannot happen
Optional transitive0xC0AGGREGATOR (7), COMMUNITIES (8), extended (16) and large (32) communitiesPasses it on and sets Partial
Optional non-transitive0x80MED (4), ORIGINATOR_ID (9), CLUSTER_LIST (10), MP_REACH (14), MP_UNREACH (15)Drops it silently

The flags must fit the type code. An AS_PATH marked optional, or a missing mandatory attribute, is an error in the UPDATE. Older behaviour is to reset the session with a NOTIFICATION; current software treats most such errors by discarding the affected routes and keeping the session.

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docProtocol standard + deployed implementation RFC 4271

Authoritative/upstream documentation reviewed for bounded claims in Network & Protocols → BGP Path Attribute Flags Reference. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://www.rfc-editor.org/rfc/rfc4271.html · confidence 94%
Terminology layer

Terms & aliases

Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.

Aliases that resolve here
bgp attribute flagsoptional transitive partialextended length bgp
Embedded reference data

Quick lookup tables

BGP Path Attribute Flags Reference field-level operational reference

Identity-first field interpretation, suspicious signatures and the next protocol/forwarding proof boundary.

Field boundaryKnown-good for BGP Path Attribute Flags ReferenceSuspicious signatureNext proof
Identity/lengthExact object/peer and coherent structureWrong identity, type or boundaryRaw packet/LSDB object + peer state
Field semanticsFlags octet (Optional, Transitive, Partial, Extended Length), Type Code, one- or two-octet Attribute Length and the exact value boundary before interpreting AS_PATH, NEXT_HOP, communities or any other attribute payload match intended designreserved/illegal flag combinations, Partial used in an invalid context, wrong Extended Length interpretation, attribute length that overruns or truncates the UPDATE, unexpected optional-transitive propagation, an unknown optional non-transitive attribute treated as if it should propagate, or a malformed attribute whose handling differs by BGP implementation/error-handling rulesCompare same object across both sides
State consequenceField predicts expected protocol/route transitionObject looks valid but local state disagreesLSDB/SPF or BGP policy → RIB/FIB
ClosureOriginal workload succeeds for the explained reasonProtocol state recovered only transientlyRepeat state/capture + regression test
Embedded quick reference

Operational notes

Former standalone Cheat Sheet content now lives directly inside the Topic where it belongs.

BGP Attribute Flags

O/T/P/E quick decoder.

  • Optional
  • Transitive
  • Partial
  • Extended Length

Decode flags and length before interpreting the type-specific attribute.

Confirmation

Confirm action

Continue?