What is an AS path?
The AS path is the part of a BGP route that lists the networks the route has passed through. It is short, usually three to six numbers, and it does more work than its size suggests.
Which way it is written
Every network that passes a route to a neighbour in another AS adds its own number to the front of the path. A path such as 3356 13335 therefore reads from right to left in time. AS13335 announced the prefix, AS3356 received it and passed it on, and the router that shows you the path learned it from AS3356. The last number is always the origin.
BGP Map draws paths in the order traffic travels, from the collector peer at the top to the origin at the bottom, and the paths table on a prefix page lists them the same way.
Loops
A router throws away any route whose AS path already contains its own AS number. Without that rule a route could circle a ring of networks for ever. The same rule is why a network whose sites share one AS number but are not connected to each other has to tell its routers to accept their own number, with a setting such as allowas-in, or use a separate number for each site.
How the length affects route choice
When a router has several routes to the same prefix, it goes through a fixed list of tie breakers. The ones a network sets for itself come first. The most important is local preference, which is how a network says it would rather send traffic to customers than to peers, and to peers rather than to paid transit. Only when those settings are equal does the router compare AS path lengths, and then the shorter path wins.
So a shorter path is more attractive, but any network along the way can overrule it with its own policy. That is one reason the most common path on a map is often not the shortest one.
Prepending
A network can make a path through one of its links look longer by adding its own number more than once, for example 64500 64500 64500. Networks that receive the longer path, and have no policy reason to prefer it, pick a shorter route instead. Operators use this to pull incoming traffic toward a preferred provider while keeping another one as backup.
It is a blunt tool. A network that prefers its customer routes through local preference ignores the extra length completely, and heavy prepending can make a backup path so unattractive that parts of the Internet only use it after the main link fails. On BGP Map a prepended number is drawn once, and the paths table on a prefix page collapses it too.
AS sets
Some old routes carry an AS_SET, a group of AS numbers in braces left over from route aggregation. RFC 6472 recommends against using them. BGP Map leaves them out of the drawing, because a set is not a single hop between two networks.
See some real ones
Every prefix page lists its distinct AS paths, most common first, with how many collector peers use each. 1.1.1.0/24 has a few hundred of them, and 62.60.213.0/24 shows how long paths can get when a route crosses several transit networks. How to read a BGP map explains the drawing itself.
More guides
- How to read a BGP mapWhat the boxes, arrows, numbers and colours on a map mean.
- How to find the upstream providers of a networkReading transit providers from AS paths, and what the shares mean.
- Which network announces an IP address?From an address to its prefix and origin AS, and when whois disagrees.
- Tier 1 networksThe transit-free networks, with a link to each one's map.