Network Analysis

Understanding ASN and geolocation

Identifying who hosts an IP and where it comes from using autonomous system numbers.

1 Introduction

When you send a letter, you write a postal code on the envelope. That code tells the postal service which area the recipient lives in, without giving the exact address. The internet has a similar idea: every connected device has an IP address, and that address belongs to a block managed by a network operator. Each operator's network is identified by an ASN (Autonomous System Number).

The ASN works a bit like the internet's postal code. It identifies the network (Comcast, AT&T, OVHcloud, Amazon AWS...) that is responsible for a group of IP addresses. In cybersecurity, knowing the ASN of an IP address tells you who operates that network and what kind of network it is. Geolocation databases then add an estimate of where the address is used.

In a nutshell

  • IP address = the mailing address of a device on the internet
  • ASN = the identifier of the network that manages that address
  • IP geolocation = an estimate of geographic position, not a GPS location

2 How It Works

Use the tool below to check an IP address. You will see its ASN, its internet provider and its estimated location.

How are ASNs assigned?

ASNs and IP address blocks are distributed by five RIRs (Regional Internet Registries): ARIN (North America), RIPE NCC (Europe, Middle East, Central Asia), APNIC (Asia-Pacific), LACNIC (Latin America) and AFRINIC (Africa). Each internet provider (like Comcast or AT&T) or host (like AWS or DigitalOcean) receives one or more ASNs along with its address blocks.

How does geolocation work?

IP geolocation does not rely on GPS. Commercial databases map blocks of IP addresses to places, using registry data, information published by operators, network measurements and user feedback. They are updated regularly but remain estimates: generally reliable at the country level, much less so at the city level.

The postal code analogy

Imagine that each internet operator is a post office with its own number: Comcast is AS7922, AT&T is AS7018, and so on. Each post office tells the others which address blocks it delivers to (this is done with a protocol called BGP). Data then travels from network to network until it reaches the one in charge of the destination. Just as a postal code does not give you the exact address of a house, an ASN does not tell you where a given computer is.

3 Detailed Analysis

The limits of IP geolocation

Many people believe IP geolocation works like GPS. It does not. Here is what to keep in mind:

  • 1. Country level: usually correct. If an IP is placed in the United States, it is very likely there, or at least routed through there.
  • 2. City level: often approximate. An IP shown in New York may actually be used in Newark, or in another state where the provider has its equipment.
  • 3. VPNs and proxies: a user behind a VPN appears at the location of the VPN server, not their real location.
  • 4. Mobile IPs: mobile carriers route traffic through a few central gateways, so a phone can appear in a city hundreds of miles away.
  • 5. Satellite and CGNAT: satellite internet users may appear far from their real location, and carrier-grade NAT shares one public IP between many subscribers.

Bottom line: use geolocation as a clue, never as proof of where a person is.

Internet providers and hosts

Each internet provider or cloud company operates one or more ASNs. By looking at the ASN of a suspicious IP address, you can quickly tell whether the traffic comes from a residential network, a datacenter or a cloud service. Combined with the IP's reputation, this often says a lot.

Type Example ASN Meaning
Residential ISP Comcast AS7922 Home user connection
Hosting provider OVHcloud AS16276 Hosted server (website, VPN...)
Cloud Amazon AWS AS16509 Cloud service (can hide an attacker)
Commercial VPN Servers rented from hosts Varies User masked behind a VPN, usually seen under a hosting provider's ASN

Try it on mlab.sh

Enter any IP address to instantly see its ASN, provider, organization and estimated location. Practice identifying who operates a network and where its traffic comes from.

Geolocate an IP on mlab.sh

4 Red Flags

Here are the warning signs to watch for when analyzing an IP address:

"Bulletproof" hosting ASN

Some hosts are known for tolerating malicious activity and ignoring abuse reports. If the IP belongs to an ASN frequently linked to spam or malware, that is a strong signal.

Inconsistent location

An email supposedly sent by your local bank whose sending IP is on another continent is suspicious. Be careful, though: VPNs, travel and mobile networks can explain some inconsistencies.

Residential IP for a "server"

If an alleged corporate server uses a home internet connection, it may be a compromised computer or router used as a relay. Criminals also rent "residential proxies" to blend in with normal users.

Recent change of ASN

If an address block has recently changed owner or ASN, it can indicate infrastructure freshly set up for a malicious campaign.

Several malicious IPs in the same ASN

If you observe several malicious IP addresses in the same ASN, it is probably one coordinated attack infrastructure. Watch the whole network, not just one IP.

Tor or anonymous proxy

IP addresses of Tor exit nodes or anonymous proxies are often used to hide the origin of an attack. In that case, the displayed location tells you nothing about the attacker.

Related Modules