Table of Contents

Overview

Business relationships between Autonomous Systems (ASes) are typically confidential, so they must be inferred from data that is publicly available. This page explains, step by step, the algorithm CAIDA uses to infer those relationships from public BGP paths, and how the inferred relationships are then used to compute each AS's customer cone and rank. This page focuses on the algorithm itself; for background on what relationships, degrees, and customer cones are, see the about page or the paper AS Relationships, Customer Cones, and Validation .

The algorithm classifies each observed link between two ASes as one of two relationship types:

The algorithm rests on three assumptions about the structure of the Internet:

  1. An AS enters into a provider relationship to become globally reachable. A provider announces its customers' routes to its own providers and peers, so at least one vantage point should observe a provider announcing its customer's routes.
  2. There exists a clique of large transit providers at the top of the hierarchy. These ASes peer with each other in a full mesh so that their customers (and their customers' customers) obtain global connectivity.

The full pipeline runs in the following stages, each explained in a section below:

  1. Collect BGP paths and clean them of loops, poisoned paths, unassigned ASes, and IXP route servers.
  2. Sort ASes into the top-down order in which their relationships will be inferred, with the clique at the top.
  3. Infer relationships in eight steps: the clique's peering mesh first, then c2p links from strongest to weakest evidence, and finally p2p for every link that remains.
  4. Compute each AS's customer cone from the inferred relationships and the observed paths.
  5. Rank ASes by the size of their customer cones.

Input Data and Path Cleaning

The input to the algorithm is the set of AS paths extracted from BGP routing table snapshots collected by the Route Views project and RIPE's Routing Information Service (RIS). Each BGP peer that supplies routes to a collector is a vantage point (VP): it shows an AS-level view of the Internet from that peer's perspective, and it appears as the first AS on the left of every path it supplies. Paths containing AS-sets are discarded, and path padding is compressed (a path "A B B C" becomes "A B C").

Raw BGP paths contain artifacts that would corrupt relationship inference, so paths are first cleaned:

After cleaning, the algorithm computes each AS's node degree and transit degree, and sorts all ASes into the order in which their relationships will be inferred: clique ASes first, then all other ASes by decreasing transit degree, breaking ties by node degree and then by AS number. Sorting by transit degree rather than node degree avoids mistaking high-degree ASes that provide no transit (for example, content providers with many peers) for transit providers. This top-down order matters: c2p relationships are inferred along the degree gradient, which is also what prevents cycles of c2p links from forming.

The Clique

The clique is the set of large transit providers at the top of the hierarchy. Clique ASes are transit-free: they have no providers, and instead maintain a full mesh of settlement-free peering with each other, which gives their customers global reachability. The clique anchors the whole inference: its members are placed at the top of the top-down order, its internal links are the first relationships assigned (Step 1), and paths crossing the clique provide the initial evidence from which c2p relationships propagate downward.

The algorithm uses the following set of settlement-free peers as the clique:

174, 209, 286, 701, 1239, 1299, 2828, 2914, 3257, 3320, 3356, 3491, 5511, 6453, 6461, 6762, 6830, 7018, 12956

Inferring Relationships: Steps 1–8

With clean paths, degrees, and the clique in hand, the algorithm infers a relationship for every observed link in eight steps. Steps 2 through 7 infer c2p links, ordered from the strongest evidence to the weakest; Step 8 classifies everything that remains as p2p. These are the same step numbers used in the per-link inference reports elsewhere on this site.

AS path triplets. Most steps make inferences using AS path triplets: three consecutive ASes in a path, i.e. an adjacent pair of links. Triplets provide the constraints needed to infer c2p relationships while allowing the algorithm to ignore non-hierarchical segments elsewhere in a path. For example, the path "1239 3356 9002 6846" contains two triplets: "1239 3356 9002" and "3356 9002 6846". A triplet "X Y Z" is read from the vantage point outward: the route was announced by Z to Y, and by Y onward to X. In other words, Y is forwarding Z's routes to X — and since an AS only announces its customers' routes to its providers and peers, seeing Y announce Z's routes to a known provider or peer of Y is evidence that Z is a customer of Y. This observation is the engine of the whole algorithm.

Notation. In the tables and text below, "X → Y" means X is inferred to be a provider of Y (a p2c link), and "X – Y" means X and Y are inferred to be peers (a p2p link).

Preventing cycles. Whenever a c2p relationship is inferred, the customer is recorded in the customer cone of the provider and of all the provider's upstream providers. The algorithm never infers a c2p relationship where the would-be provider is already in the would-be customer's cone, so no cycle of c2p links can form.

Step 1: Set peering in clique

Every pair of ASes in the clique is assigned a p2p relationship — a full mesh of settlement-free peering. This follows directly from the second assumption: clique members are transit-free and obtain connectivity to each other by peering. No paths are used by this step; it simply encodes the clique.

Step 2: Initial provider assignment

This is responsible for roughly 90% of all c2p inferences. ASes are visited in the top-down order established earlier, skipping clique ASes (which have no providers). When visiting AS Z, the algorithm examines each of Z's neighbors Y and infers Y → Z if it observes a triplet "X Y Z" where X is already known to be a provider or peer of Y. The reasoning: Y announced Z's routes upward to its provider or peer X, and an AS only announces customer routes upward, so Z must be Y's customer. Peer evidence that is not corroborated by upstream announcements is only trusted when observed repeatedly (more than twice).

The order of ASes within the triplet matters. To minimize false c2p inferences caused by route leaks (an AS mistakenly announcing provider or peer routes to a peer), the provider or peer must be observed closer to a vantage point than the customer in at least one triplet. This builds on the first assumption: an AS enters a provider relationship to become globally reachable, so at least one VP should see the provider announcing the customer's routes.

Because Z's inferred providers all have a larger transit degree than Z (they were visited earlier in the top-down order), c2p links are assigned along the degree gradient and no c2p cycle can form.

Step 3: Providers for stub ASes

Some vantage points supply routes to only a small fraction of the Internet. The algorithm treats VPs that provide routes to fewer than 2% of all ASes as partial VPs: they have either configured their BGP session with the collector as p2p (exporting only customer routes), or configured it as p2c while holding a default route to their provider. Either way, the routes they export are customer routes.

For each path of exactly three ASes "VP Y Z" supplied by a partial VP, where Z is a stub (an AS with transit degree zero) and the Y–Z link is still unresolved, the algorithm infers Y → Z. The link between the VP and Y may be either p2c or p2p, but in both cases Y would only announce Z's routes to the VP if Z were Y's customer.

Step 4: Provider to larger customer

Step 2 infers providers along the transit-degree gradient, so it misses c2p relationships where the provider has a smaller transit degree than its customer. These do occur — for example, a large content network obtaining transit from a small regional provider. Given an AS Y with a known provider X, and a neighbor Z of Y whose transit degree is at least as large as Y's, the algorithm infers Y → Z when both:

The second condition guards against path poisoning: poisoned path segments do not announce address space, so requiring Z to originate a prefix ensures the link is real. Because inferences against the degree gradient carry more risk, the evidence must be observed at least three times. After inferring Y → Z, the inference cascades: neighbors of Z observed downstream of "Y Z" become customers of Z under the same logic.

Step 5: Provider-less networks

Steps 2 and 4 both require an AS to already have a provider or peer before its customers can be identified. Some ASes have no providers at all yet are not in the clique — typically large regional or research networks. The algorithm visits each AS X that still has no inferred provider, is not in the clique, and has a transit degree of at least 10, and examines triplets "W X Y" with X in the middle:

Unlike step 2, this step does not require the peer to be observed closest to a VP, because provider-less ASes are mostly observed through downstream customers that provide a public BGP view.

Step 6: C2P for stub-clique relationships

If a link is observed between a stub AS (transit degree zero) and a clique AS and no relationship has been inferred for it, the clique AS is inferred to be the provider of the stub. Step 2 could only have classified this link if a route crossing it had been observed by another clique AS, which does not always happen — for example, when the link is a backup transit relationship. Stub networks are extremely unlikely to meet the peering requirements of clique members, so a customer relationship is by far the most likely explanation. No triplet is used; the inference is purely topological.

Step 7: Fold p2p links

At this point some triplets "X ? Y ? Z" remain in which neither link has a relationship. If both were left to become p2p in step 8, the result would be two adjacent p2p links — which implies anomalous behavior such as free transit or route leakage, since an AS does not announce routes learned from one peer to another peer. To avoid this, ASes are traversed top-down one final time, and for each unresolved triplet "X ? Y ? Z" the algorithm attempts to resolve one side as p2c, inferring Y → Z (with X – Y then following in step 8). If other triplets involving X and Y suggest a conflicting orientation (evidence that Y is instead X's provider, or that X is Y's customer via some other neighbor), the algorithm is no longer confident which side of the triplet is the p2c link and makes no inference, leaving both links to step 8.

Step 8: Everything else is p2p

Every link that still has no inferred relationship is classified as p2p. No triggering pattern is required — these are simply the links for which steps 1–7 found no evidence of a transit relationship.

Worked Example

The following example, adapted from our IMC 2013 paper, traces the algorithm over a small set of BGP paths. Four of the ASes involved (3356, 701, 6461, and 1239) are clique members. Three ASes provide the vantage points: 1239, 9002, and 15169; each appears as the leftmost AS of the paths it supplies. AS 15169 supplies routes to only a small fraction of ASes, so it is treated as a partial VP.

#BGP path
11239  3356  9002  6846
21239  13395
31239  15169  6432
43356  1239  721
51239  721  27065
61239  721  27065  2629
79002  3356  1239
89002  11164  2152  7377
915169  6432  36040

The ASes are sorted top-down: the clique members first, then the rest by decreasing transit degree:

3356, 701, 6461, 1239,  9002, 15169, 11164, 2152, 27065, 6846, 721, 7377, 6432, 2629, 13395, 36040

The algorithm then makes the following inferences. Recall that "X → Y" means X is inferred to be a provider of Y, and "X – Y" means X and Y are inferred to be peers.

StepInferenceWhy
1 3356 – 701 – 6461 – 1239 (full mesh) All four are clique members, so every pair is assigned p2p.
2 3356 → 9002 Triplet "1239 3356 9002" (path 1): 3356 announces 9002's routes to its peer 1239, so 9002 is 3356's customer. Note the algorithm uses path 1, where 3356 is closer to the VP than 9002, and not path 7, where the order is reversed.
2 9002 → 6846 Triplet "3356 9002 6846" (path 1): 9002 announces 6846's routes to its now-known provider 3356.
2 1239 → 721 Triplet "3356 1239 721" (path 4): 1239 announces 721's routes to its peer 3356.
3 6432 → 36040 Path 9 has exactly three ASes, its VP 15169 is a partial VP, and 36040 is a stub, so 6432 must be 36040's provider.
4 721 → 27065 721 (transit degree 6) has provider 1239, and its neighbor 27065 (transit degree 34) has the larger transit degree. Path 5 ends with "1239 721 27065", showing 27065 originating a prefix through 721, so the link is real and 27065 is 721's customer.
4 27065 → 2629 Cascade of the previous inference: path 6 shows 2629 downstream of "721 27065".
5 9002 – 11164 11164 has no inferred provider and is not in the clique. Triplet "9002 11164 2152" (path 8) has 11164 in the middle, and 9002 was never observed announcing 11164's routes upward, so they are peers.
5 11164 → 2152 Same triplet: 11164 announces 2152's routes to 9002, so 2152 is 11164's customer.
5 2152 → 7377 Cascade: triplet "11164 2152 7377" (path 8) shows 7377 downstream of the new p2c link.
6 1239 → 13395 Path 2 reveals a link between clique member 1239 and stub 13395, but no triplet contains that link (perhaps a backup transit relationship), so it survived to this step and is classified c2p.
7 15169 → 6432 In triplet "1239 15169 6432" (path 3), neither link has a relationship yet. To avoid two adjacent p2p links, the far side is resolved as p2c: 15169 is 6432's provider.
8 1239 – 9002,  1239 – 15169 The remaining unclassified links are assigned p2p.

Computing Customer Cones

With every link classified, the algorithm computes each AS's customer cone: the set of ASes it can reach by following only p2c (customer) links. This sounds simple, but there is more than one way to compute it, and the choice matters:

The provider/peer observed method can underestimate a cone, because public BGP data contains only the best path selected by each AS rather than all paths. We accept this limitation because the alternative methods systematically inflate cones, and inflated cones distort the comparison between ASes that host vantage points and the vast majority that do not.

Computing Rank

Finally, ASes are ranked by the size of their customer cones: an AS's rank is one greater than the number of ASes with larger customer cones, so ASes with equally large cones share the same rank. See the about page for a worked example of the ranking rule.

Learn More