decoder.tools

BGP Attribute Decoder

Decode BGP path attributes from raw update-message bytes.

on the roadmapNetwork, System & Packetsfree · no sign-up

This bench is being wired up

The bgp-decoder decoder is on the roadmap. The heavier binary and cryptographic parsers ship after the core text and token decoders — all of which are already live and working.

Browse the live decoders

Input is processed on your device. Nothing you paste is sent anywhere.

What is the BGP Attribute Decoder?

A BGP decoder parses the path attributes carried in a BGP UPDATE message — AS_PATH, NEXT_HOP, ORIGIN, MED, LOCAL_PREF and communities — which together determine how the internet routes a prefix.

BGP is the protocol that glues autonomous systems together, and it makes decisions by comparing path attributes rather than by measuring anything. AS_PATH lists the autonomous systems a route has traversed and doubles as loop prevention; NEXT_HOP says where to send traffic; ORIGIN records how the prefix entered BGP.

Policy lives in the rest. LOCAL_PREF is the highest-weight tiebreaker inside your own AS, MED hints to a neighbour which of several links to prefer, and communities are tags — a 32-bit value like 65000:100 — that let operators signal 'prepend this', 'don't export that' or 'blackhole this prefix' to each other.

Reading attributes directly matters when a route is doing something unexpected: an AS_PATH longer than it should be, a community that triggered someone else's policy, or a NEXT_HOP that isn't reachable are all visible in the raw update.

BGP Attribute Decoder at a glance

Protocol
BGP-4 · RFC 4271, over TCP port 179
AS_PATH
AS sequence traversed; also loop prevention
Selection order
LOCAL_PREF, then AS_PATH length, then ORIGIN, then MED
Communities
32-bit tags, written ASN:value

How to use the BGP Attribute Decoder

  1. 1Paste the attribute bytes from a BGP UPDATE message as hex.
  2. 2Read the decoded attribute types, flags and values.
  3. 3Compare AS_PATH length and communities against the policy you expect.

When you would reach for it

  • Investigating why a prefix is preferred over an alternative path.
  • Confirming a customer's communities were received and acted on.
  • Studying BGP data from a route collector or looking glass.

BGP Attribute Decoder — frequently asked questions

Last reviewed · questions or corrections: contact@decoder.tools