Use it when reading BGP UPDATE captures, or when a router drops, passes on or complains about an attribute it does not recognise.
BGP Path Attribute Flags Reference
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.
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.
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
Operational reference
Fast context before you go deeper.
show ip bgp 203.0.113.0/24Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
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 · 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.
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.
- 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
| Category | Optional | Transitive | Examples | If not recognised |
|---|---|---|---|---|
| Well-known mandatory | 0 | 1 | ORIGIN, AS_PATH, NEXT_HOP | Not possible: every BGP speaker must support them |
| Well-known discretionary | 0 | 1 | LOCAL_PREF, ATOMIC_AGGREGATE | Not possible |
| Optional transitive | 1 | 1 | AGGREGATOR, COMMUNITIES | Passed on with the Partial bit set |
| Optional non-transitive | 1 | 0 | MED, MP_REACH_NLRI | Quietly dropped |
Flag bytes you will see
| Byte | Bits set | Typical attribute |
|---|---|---|
| 0x40 | Transitive | ORIGIN, AS_PATH, NEXT_HOP, LOCAL_PREF |
| 0x50 | Transitive, Extended Length | Long AS_PATH |
| 0x80 | Optional | MED |
| 0x90 | Optional, Extended Length | MP_REACH_NLRI |
| 0xC0 | Optional, Transitive | COMMUNITIES, AGGREGATOR |
| 0xE0 | Optional, Transitive, Partial | Unknown 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.
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:
| Bit | Name | Set means |
|---|---|---|
| 0x80 | Optional | Not every router is required to understand this attribute. Clear means well-known |
| 0x40 | Transitive | Pass the attribute on, even if not understood |
| 0x20 | Partial | Some router along the path passed it on without understanding it |
| 0x10 | Extended length | The length field is two bytes |
That gives four classes, each with a fixed way to handle the attribute:
| Class | Flags | Examples (type code) | A router that does not know it |
|---|---|---|---|
| Well-known mandatory | 0x40 | ORIGIN (1), AS_PATH (2), NEXT_HOP (3) | Cannot happen; all routers know these |
| Well-known discretionary | 0x40 | LOCAL_PREF (5), ATOMIC_AGGREGATE (6) | Cannot happen |
| Optional transitive | 0xC0 | AGGREGATOR (7), COMMUNITIES (8), extended (16) and large (32) communities | Passes it on and sets Partial |
| Optional non-transitive | 0x80 | MED (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
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
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%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.
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 boundary | Known-good for BGP Path Attribute Flags Reference | Suspicious signature | Next proof |
|---|---|---|---|
| Identity/length | Exact object/peer and coherent structure | Wrong identity, type or boundary | Raw packet/LSDB object + peer state |
| Field semantics | Flags 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 design | reserved/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 rules | Compare same object across both sides |
| State consequence | Field predicts expected protocol/route transition | Object looks valid but local state disagrees | LSDB/SPF or BGP policy → RIB/FIB |
| Closure | Original workload succeeds for the explained reason | Protocol state recovered only transiently | Repeat state/capture + regression test |
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.