What is an autonomous system number (ASN)?
A globally unique identifier for a network under a single routing policy — an ISP, a large hosting company, a university, a bank. It is the unit in which the internet's routing table is expressed, and it is how one network refers to another.
What an autonomous system is. A collection of IP address ranges administered by one organisation that presents a consistent routing policy to the outside world. Internally it may be enormously complex; externally it appears as a single entity making one set of decisions about which traffic it will carry.
What the number does. BGP — the protocol networks use to tell each other which addresses they can reach — describes every route as an AS path: the sequence of autonomous systems a packet would traverse. A route advertisement effectively says "to reach these addresses, send traffic through AS 1, then AS 2, then AS 3."
This makes the AS path the internet's map. It is how routers choose between paths, how loops are prevented — a network rejects any route that already contains its own number — and how operators diagnose where traffic is actually going.
Who gets one. Any organisation that connects to more than one provider and wants to control its own routing, or that operates address space independently. You apply to your regional internet registry, justify the need, and pay a membership fee.
Numbers were originally 16-bit, giving roughly 65,000, which ran out; 32-bit ASNs are now standard.
Why it matters practically:
Multi-homing. Having your own ASN and address space is what lets you change provider without renumbering, and stay up when one provider fails.
Diagnostics. Looking up which AS an address belongs to tells you whose network you are actually dealing with.
Security. Route hijacks are described in terms of the wrong AS announcing someone else's prefixes, and RPKI binds prefixes to the ASNs authorised to announce them.