Houses have street addresses, and computers have IP addresses.
IP addresses are the way that computers on a network know who’s who, just like on your block at home
IP addresses are usually only unique within a local network, but there are tons of networks out there
IP addresses are mostly IPv4 (32 bits), but the internet is outgrowing that standard into IPv6 (128 bits)
IP addresses are a central tenet of how computers communicate over TCP/IP, and understanding them can even help you troubleshoot day to day. So read this!
Usually I’ll spend a bunch of time (mostly procrastinating) before writing an issue of Technically trying to figure out which analogies will make things clearest. For IP addresses it was a piece of cake, because they’re pretty much exactly like home addresses. If you think about it, here’s what your address is all about:
You use it to identify where something is going or coming from: it could be a package, or even you
IP addresses are almost the same exact thing, but they’re for computers. When devices want to communicate and share data over a network, they need addresses to send communications to; so when you load a web page or sent an email, behind the scenes your computer is finding out which IP addresses you’re trying to get in contact with, and sending traffic to them.
(Computers rarely actually communicate peer to peer without a server, but it’s just a diagram)
There are a lot of Main Streets out there, and home addresses aren’t unique: 322 Elizabeth St. is unique in Manhattan, but not in the state of New York. Most IP addresses are the same: you’ll find multiple computers with the same IP address in the universe, but not in the same network (there are exceptions!).
The comparison isn’t perfect thought: there’s one big difference between IP addresses and regular home addresses. IP addresses are network position based, not device based: your computer’s IP address can change all the time depending on time and location. Your apartment, on the other hand, only changes addresses when you get transported to Munchkinland (sorry).
IPs are pretty simple overall, but where things get kind of complicated is their relationship to networks. When we covered the internet, we saw that computers are networked together through wireless signals and cables: but the world isn’t just one giant network, in the same sense that the world isn’t one giant town. It’s made up of tons of little local area networks (LANs), and the easiest example to walk through is your house or apartment.
When you sign up for WiFi, your internet service provider (Verizon, Spectrum, you know, our favorite brands) runs a cable into your crib. That cable connects you to the ISP’s giant network of all of the places they provide internet to (and their data centers). But you connect a router to that cable to generate wireless, and that actually creates a mini, local network for your apartment (a LAN). It kind of looks like this:
Here’s where things get tricky: your computer’s IP address is dependent on which network it’s in. When your laptop is at home, your local network will assign it some IP address – but if you head over to a coffee shop, that’s a completely different network, and you’ll probably receive a different IP address. In addition to that, sometimes your ISP will change your LAN’s IP address randomly. Moral of the story: your computer’s IP is dynamic (it works through a protocol called DHCP).
Networking is notoriously difficult and complex. If you’re unsure about WANs and LANs and the like, don’t worry: just try to think of it like a city vs. a state. Your address is unique within your local area, but not within the broader one.
All of that being said, there are some IP addresses that actually are universally unique. These are mostly called Class A, and there’s a whole hierarchy of different IP address classes.
The mechanics of exactly how IP addresses work are beyond the fray, but here are a few simple, useful details that might help.
There are actually two different types of IP addresses: short ones and longer ones. IPv4, the original and shorter format, is 32 bit and has four separate dots: you’re probably used to something like 192.168.1.102. IPv4 is kind of like the good old days of Twitter or Gmail when all of the good usernames were still available. As the internet kept growing and adding more networked computers, we started to run out of these. IPv6 is 128 bit, so it has six separate dots and allows for a lot more possible IP addresses. Maybe one day we’ll hit IPv8 or something.
If you’ve ever tried troubleshooting your WiFi connection issues, there are a few common IPs you might recognize:
0.0.0.0 – the default network (no computers will have this)
255.255.255.255 – represents all computers on the network (if you need to send a message to everyone)
127.0.0.1 – the “loopback address” or your computer’s method for identifying itself
Otherwise, things are pretty much all over the place. If you ever need to figure out what your computer’s IP address is at any given point in time, you can use whatismyipaddress.com.
If you’re wondering how all of this IP stuff gets managed and allocated, you’re in good company (I’ve always imagined some reserved undertaker with dark eyelids, but that’s neither here nor there). There’s a non-profit organization called ICANN that takes care of a lot of the logistics, and they’re based in Los Angeles.
ICANN doesn’t only take care of IP addresses: they also manage the infrastructure for our DNS, or domain name system. We’ll cover domains and how they relate to IP addresses in another post.
Terms and concepts covered
Local area network (LAN)
If you spin up a virtual machine on a cloud, the IP address changes all the time: you can provision a floating IP that stays the same all the time
Firewalls let you control which IP addresses can communicate with your computer, and which get blocked
In addition to ICANN, there’s an Internet Engineering Task Force that worries about these kinds of internet standards