NETWORKING BASICS / READING GUIDE

ASN vs. IP address: what’s the difference?

An IP address tells traffic where to go; an ASN identifies a network that takes part in routing it there. The two are related, but they answer different questions.

Key takeaway

Address registration, route announcements and actual use are three different layers. “Who registered this IP?” and “Which ASN announces it?” can have different answers.

Two identifiers, two jobs

An IP address is used for addressing in internet communication. An IPv4 address is written as four numbers separated by dots; IPv6 uses a longer format. An ASN is the number of an autonomous system and identifies a network that exchanges routing information. One answers “where is this data going?”; the other helps answer “which networks offer a route to get there?”

Think of an IP address as a destination in an address book, and an ASN as the ID of a carrier that helps move things along. The analogy only separates the two roles: the internet has no single, central route map, and the actual path depends on each network’s policies and connections.

Why records talk about prefixes

Routing describes what is reachable in blocks of addresses called IP prefixes. For example, 192.0.2.0/24 is a block of 256 IPv4 addresses; the number after the slash is the prefix length. This block is reserved for documentation, so it’s only an illustration and doesn’t belong to a real network.

A prefix is a way of writing down a range of addresses. It doesn’t mean every address in it is in use, and the number of addresses is not a count of devices or users. A large range can be split into several smaller prefixes or aggregated into one announcement, so when you compare networks, first check whether a figure counts addresses or prefixes.

Read registration and routing separately

RIR registration data describes how number resources were allocated, to which organization and with which contacts. BGP observations describe the routes that certain vantage points received at a certain time. Seeing a prefix originated by an ASN doesn’t by itself prove that the ASN’s operator is the registered holder of those addresses.

For example, an organization can use address space registered to it while another network provides its connectivity or announces the prefix on its behalf. Conversely, a single infrastructure provider may carry many customers. Finding the ASN behind an IP is an important clue about routing, but it isn’t automatically evidence of ownership or of who the customer is.

Neither one is a precise location

A registered address, a country code and the location of network equipment are different things. A network that operates across regions can have facilities in many countries, and the contact address in a registration record may just be a head office. Even when a database has location fields, check what they mean, where they come from and when they were last updated.

The RIPE NCC notes that geolocation data in the RIPE Database is added by resource holders and is not verified by the RIPE NCC. An ASN or registered country alone can’t reliably tell you where a particular user is, or which city a request actually passed through.

Using them together: ask the right questions

When you look up an IP, first find the prefix it belongs to, then check the registered holder and the observed origin ASN separately. When you look up an ASN, go the other way: see which prefixes the network is observed announcing, then check the number’s registration and the operator’s own information. Splitting the question up leads to clearer answers.

  • Identity: who is the number resource registered to, and which registry maintains the original record?
  • Routing: which ASN’s announcement was seen, when, and from which vantage points?
  • Business: what services does the operator say it offers, and is there independent evidence to back that up?

References

This article draws on the primary sources below, where you can check definitions, registry details and protocol specifics for yourself.

  1. IANA: Number resource registries
  2. RFC 4632: Classless Inter-domain Routing (CIDR) and IP prefixes
  3. RFC 5737: IPv4 Address Blocks Reserved for Documentation
  4. RIPE Database: Geolocation in the RIPE Database
Check the data yourself

See which sources ASNBase uses and what each kind of record means.

Data sources
All articles