How are IP addresses mapped to Autonomous System Numbers (ASNs)? Is there a reference database for it? Then how are these Autonomous Systems geographically located?
How are IP addresses mapped to Autonomous System Numbers (ASNs)? Is there a reference database for it? Then how are these Autonomous Systems geographically located?
Note: This information is kind of RIPE-centric because that's the RIR I deal with most.
The relationships between IPs (
inet-num
) and ASNs (aut-num
) are documented in public Internet Routing Registries (IRR) using Routing Policy Specification Language (RPSL). IRRs are simply whois databases which provide additional object types (route
,route-set
,aut-num
,as-set
, etc) to store the RPSL information. IRRs are operated by all Regional Internet Registries (RIRs such as RIPE, ARIN, etc) as well as some other parties such as RADB.RPSL can define not just which
aut-num
relates to whichinet-num
objects but also the transit and peering arrangements of a givenaut-num
. This information can be used to build router configurations such as with the utility RtConfig. Additionally some LIRs document their policies for accepting new peering requests and the BGP communities they make available to their peers here.It's important to note that besides automatically configuring routers with RPSL there isn't any "magic glue" between the IRR data and what is actually happening in the wild. RPSL is a best effort practice, which should be kept up to date, but doesn't mean there's any technical barrier to announcing a route without first publicising it in RPSL.
As an example, let's see what routes are documented for the BBC website:
This indicates that their website will be available from three routes of increasing size (/19, /20 and /22 to the same prefix) via AS2818. Querying that ASN will then give us some additional information about their peers and policies (snipped for brevity):
There is no static mapping between IPs and AS and an AS don't have a location.
An AS is a number assigned to a company to identify them on Internet. It's used for the BGP routing protocol.
The company tell with BGP that some network IPs (let's say network Y) are reachable inside of his AS (let's say AS X). Then others companies know that to reach network Y they must talk to AS X, with this information others company routers look for the best path to reach AS X.
Nothing prevent some networks to be advertised on many AS (and this is used in some particular case). To see a dynamic mapping of what is announced on Internet in 'real time', you can use this website. This how ATT AS information, by looking in the Prefixes IPv4 tab you will see what network they advertise. But there is no official mapping as anyone can announce anything.
The RIRs publish a lot of information updated daily and offer APIs for querying that information. For example, sticking with AS2818 and RIPE:
There are many other endpoints with related information on stat.ripe.net.