How to read BGP AS paths and communities
Two attributes carry most of the information in a BGP route. Neither means quite what it first appears to.
The AS path
A list of the autonomous systems a route has crossed, most recent first. The rightmost ASN is where it originated. It exists for loop prevention — a router drops any route whose path already contains its own AS — and it doubles as a rough distance metric.
Length is not the number of ASNs written
A sequence contributes one per ASN. An AS_SET, written in braces, counts as one however many it holds. It records an unordered set produced by route aggregation rather than a series of hops, so counting its members would overstate the distance.
This matters because AS path length decides routes. Getting it wrong changes which path you expect to win.
Prepending
Repeating your own ASN makes the path look longer so other networks prefer a different route. It is the standard way to make one link less attractive without withdrawing anything.
Two things to know. Repetition is therefore normal and not a fault. And prepending only influences networks that get as far as the AS-path step — anyone who set local preference decided before AS path was considered, so prepending has no effect on them however many times you do it.
Private ASNs
64512–65534 and 4200000000–4294967294 are private. They should not appear in paths on the public internet; seeing one usually means a provider forgot to strip it.
Communities
A community is a tag carried with a route. Almost none of them mean anything universally. 65000:100 means whatever AS 65000 published that it means, usually in a document on their website.
A standard community is 32 bits written as two 16-bit halves, conventionally ASN then value. A large community is three 32-bit parts, and exists because a 32-bit ASN does not fit in a 16-bit half.
The ones that are standardised
- no-export (65535:65281) — do not advertise outside the receiving AS.
- no-advertise (65535:65282) — do not advertise to any peer.
Both are honoured broadly, and honouring them is still each network's policy decision.
Frequently asked questions
Why is my AS path length different from the ASN count?
An AS_SET counts as one entry however many ASNs it contains, because it comes from aggregation and records a set rather than a sequence of hops.
Does prepending more times always help?
It has diminishing returns and no effect at all on networks that decided at an earlier step, such as anyone who set local preference. Beyond a few prepends you are mostly adding noise.
What does a community like 65000:100 mean?
Whatever AS 65000 says it means. Apart from a handful of standardised values, communities are private conventions each network publishes.
Why do large communities exist?
A standard community splits 32 bits into two 16-bit halves, so a 32-bit ASN will not fit. Large communities use three 32-bit parts instead.
Open the AS-path visualizer →