Transcript
How IP Addresses Relate to Physical Locations - Computerphile
From Computerphile · Episode page · Watch on YouTube
· 24 min · 3,403 words · 34 timestamped sections
This is the full, timestamped transcript of "How IP Addresses Relate to Physical Locations - Computerphile", an episode of Computerphile published October 30, 2025 (24 min, about 3,403 words). It mentions 7 people, works and ideas, including Amazon, Ruritania, Google LLC, Tower Hamlets, IPv4.
What is discussed, and when
- – 5:00: Amazon, Google LLC, Ruritania
- – 15:00: Tower Hamlets, Amazon, Queen Mary University
- – 20:00: Tower Hamlets
- – 23:42: Ruritania
Notable quotes from "How IP Addresses Relate to Physical Locations - Computerphile"
Now, let's say you're like Amazon or you're Google and you're serving a web page and you've learned that in Europe if you don't do the cookie consent, you're going to get some massive fines.
about Amazon · atWe're sitting right now. we're located in the east end of London in Tower Hamlets. So that block of addresses is in tower handlets. So if I contact something from my computer…
about Tower Hamlets · at
Who and what is mentioned in this episode?
Companies & orgs
- Amazon — Company · 4 mentions · first at
- Google LLC — Company · 3 mentions · first at
Now, let's say you're like Amazon or you're Google and you're serving a web page and you've learned that in Europe if you don't do the cookie consent, you're going to get some massive fines or be banned. And in Ruritania, if you.
- MaxMind — Company · 2 mentions
- Queen Mary University — Company · 1 mention · first at
Got a database which is saying this internet protocol address belongs to the lovely Queen Mary University where we're sitting right now. we're located in the east end of London…
Concepts & topics
- IPv4 — Concept · 3 mentions
Places & events
- Ruritania — Place · 3 mentions · first at
Congratulations for living in Ruritania.
- Tower Hamlets — Place · 3 mentions · first at
Full transcript with timestamps
Well, let me start with a with a with an unusual scenario. Let's imagine you've recently been elected as prime minister of the fictitious country of Ritania, right? You've wisely chosen me to be your internet zar. And I'm saying, you know what? We're going to do something to raise the morale of the people of Ritania. We're going to have a pop-up appear on every single website. Right. So, we have a screen here and uh I'm just going to write R for Ritania because I can't remember how to spell it. Um we're going to have a popup. Oh, what's it going to say?
Oh, congratulations. I don't know. Congratulations. Congratulations for living in Ruritania. Whereas like if you're So that's in Ruritania. And here, if you're in Europe, you're going to have a sort of similar popup, but it's going to say um
consent cookie. Consent to cookie. Yeah. Uh consent to cookie. Different nations have different laws like this. So in the UK, we've got the OSA, Europe, GDPR, Germany has some privacy laws which are pretty strict. Now, let's say you're like Amazon or you're Google and you're serving a web page and you've learned that in Europe if you don't do the cookie consent, you're going to get some massive fines or be banned. And in Ruritania, if you don't have congratulations on living in Ruritania again, you're going to get a huge fine. You're going to be banned from the vast Ritanian economy.
So the question is how do Amazon and Google work out that this computer is in Germany and this computer is in Ritania? Have a guess. What sort of things are you thinking about?
The the sort of modern phone type computers have got GPS and perhaps we could use that but usually it says will you let this website
ah right precisely that precisely that. So, so that's enhanced the user, right? In that instance,
it's your phone and to a lesser extent your laptop. There's a bunch of sensors on there, right? There's GPS. We actually we can tell where a computer is from Wi-Fi. When goo were driving around in her street cars making maps everywhere, they also took the opportunity and this was super controversial at the time. They took the opportunity to go, "All right, we are in Main Street and I can see it says Sha's Wi-Fi and now we're in the high street. It's Richard's Wi-Fi." By knowing what Wi-Fi signals they see, you can also have a good guess at where you are because they they've driven around. I've taken a survey about that. So, the Wi-Fi signals, you've got um you've got a magnetometer on there. It's detecting magnetic fields. Now, that's super useful if you're using Google Maps, right? Or or or Apple Maps, whatever. Um cuz you do want the exact location. You want to know you're going exactly to
your location. But as you say, you've got to click on yes, I actually want this website to really know my location because you just don't want any website knowing exactly and precisely where you are.
So if Amazon says, "Hey, you're going to consent to knowing exactly where you are." You're not going to say yes.
Yeah. I think a few people there were people who just click yes on everything. Oh, that's that's true. Okay, that's true. That is true. Some people are just going to click yes, but mostly they're not going to be able to find themselves able to comply with this cookie consent and with our new retaining legislation if we use that.
So it's it's got to be connection and IP related then. Ah yeah, you've got it. You've got it. So you're ahead of the game here. So one thing that we can't prevent them knowing is the internet protocol address. So we'll stick with IPv4 cuz it's simpler. It's not that different from IPv6. And let's have a little look at our our old friend, the IPv4 address. So that's 32 bits arranged as four lots of eight bits. So we're going to get in dotted the decimal as we call it 128.64. I'm giving myself easy numbers uh because if I want to write that out in binary, it's simple. So, so there's our IPv4 is four numbers. How are we going to turn that to a location in the planet? And there isn't some secret encoding.
In fact, one of the reasons I want to talk about this is it's almost an accident that we can do this at all. It's it was never the intention of the system that this IPv4 address would be a way that we could trace where somebody is. It was not its purpose. So this is 32 bits and we could write that out in binary. So 128 as I say I've given myself an easy one. uh one and then 64 is hopefully I'm going to get the right number of zeros here to self-doubt sets in and then I'm not going to write in the rest now to make internet networking the internet work we actually divide this IPv4 address into two separate parts.
So we have this left hand edge, the most significant part of it, the kind of high-end bits. We're going to call it the network part. Quite often it will split on these dot boundaries, but not always. So let's imagine we split it here and we're saying these first 12 bits if my counting is good. These first 12 bits are the network part and these 20 bits are the host part. So, everything on the planet that begins with this uh Why have I got a one there?
Goodness me. I mean, I gave myself an easy number and then messed it up. You were You were hoping for some comments on that.
Oh, yeah. That's it. I I was there. It's engagement. It's engagement. It's a deliberate mistake. Well done for spotting it. Oh my goodness. Oh dear. Getting back to what we were saying. Anything beginning with this bit pattern 1 0 0 0 0 0 1 0 0 0 whatever it is here that's going to belong to this same network. Okay. And that that's really useful. That's a useful property because we need to think now about how we navigate the internet. So, we need to think for a moment that all of this internet protocol V4 address, it's got to get us around an incredibly large network of routters or router if you're an American. So, some packet comes in here. Here's our packet. And here's its destination.
And this router here needs to know, do I want to go this way or do I want to go this way? Yeah, it's clearly impractical for it to have an entry on this router for every single IPv4 address. That's just not going to work. We need to collect them somehow. We need to group these addresses. We do what we call longest prefix matching. So we might say everything beginning with this pattern of 12 bits is going this way but everything beginning with I don't know let's say my original messed up version anything beginning with that goes this way. So we need this way of collecting together IP address prefixes in order to make this problem of rooting tractable. So we want the idea that IPv4 addresses somehow collected together owned by the same people. Now this falls under the the purview of uh several organizations ICN the internet corporation for assignment of names and numbers that's the global
but regionally we have the RIS the regional assignment people and I won't even try and remember what they all are there's around about five of them like there's one for Africa there's one for North America and Canada there's one for Europe, Russia, I think a bit of the Middle East. There's one for almost all of Asia and uh Australia. So, if you're a new internet company and you say, "I want some addresses, you need to pay these people. You need to cooperate with these people." And you'd say, "I'm having some uh I'm on a lovely Caribbean island. I need some IPv4 addresses for my new internet business.
So, can I have um 16,000 IPv4 addresses? And they'll almost certainly say, "No, oh my god, IPv4 address exhaustion. There isn't that many." But in theory, that's how it should work. So these RIS, these regionals, they are assigning the internet protocol V4 addresses and they're they're traded like anything because they're a valuable commodity, but they're traded in blocks with a prefix. Um, when we're specifying them, we will use a slash notation. So if we said something is a slash16 that means the first 16 bits or these first two numbers here are the network bits. So a slash16 is bigger than a slash17 which is bigger than a slash8 all the way down to a slash4 which is the first three numbers. You can divide it up fine than that. So this means these addresses are traded in blocks. They're registered with the RI IR and the R IR asks you, oh great, you're a company. You've got some internet addresses.
Where are you? Yeah. So, they've got a database now. They've got a database which is saying this internet protocol address uh belongs to the lovely Queen Mary University where we're sitting right now. Uh we're located in the east end of London in Tower Hamlets. So that block of addresses is in tower handlets. So if I contact something from my computer over in the corner over there, then the internet protocol address the regional registry has registered it to Queen Mary. We know Queen Mary is in Tower Hamlets and Queen Mary have correctly registered ourselves in the right position. So the database will come back with that as in tow hamlets.
So, how do we then if we are Amazon or whoever we're trying to locate it? There's companies that make this their business. There's various of them. I'm going to demonstrate one of them. Others are available. So, Max Mind is one I've used a little bit. Um, and their job is to just aggregate all of the databases. You throw them an IPv4 address and they've got the data of where all of these things are registered and they'll come back and say, "Ah, yes, that is in the east end of London. We're very confident about it."
One of our earlier videos was making a trace route map, wasn't it? It was. Yes.
Was it using some of this data? It was using this actually. Yes. So, that trace route video has got me using that in Python. It's maybe the first one I ever did with you. I think
one of the early ones certainly and that's that's got me doing that programmatically in Python. Okay. So, we've got this idea that um we can go from an IP address to a um to a location on the earth somehow using one of these databases. And the database is held by this regional registry, the RIIR. So, let's just test something. So, I'm working on my Windows machine today for reasons that are very annoying. Uh, I've not got my normal Linux machine. So, let's take a little path over to uh Beijing in China. So, I'm going to do a trace route. So, this is just a simple way of getting a path from here in the east end of London over to another university I sometimes teach at in the north of Beijing. What it's doing now, it's sending out a series of probe packets and it's giving us back a round trip time, three estimates of round trip time for each hop of that journey. So, it's it's producing a map of the way
through the network. And what we can see on screen here, we can see a timing in milliseconds. So, quite a short time span. We can also see the IP address. Um, so 138373 227. So there we've got a 10. A 10 is a local address, not a real address. So this is the first real internet protocol address. This 138373 227. And here between hop 10 and 11, we see quite a large jump. We see that it's gone up from 16 milliseconds to 236 milliseconds. So that's telling us things have suddenly got a lot longer in terms of time. I'll explain why that is in a minute. So let's start off and let's do something basic. So I'm I'm using Max Mind. Other geoloccation services are available and I've not got a paid account on here. So I'm um cuz I'm being cheap. So here we're asking what's my IP address? And we can see it's correctly given the IP address and it's telling us this is in Tower Hamlets in England. It's given us a
postcode and it's actually given us that it's within 5 km Queen Mary and Westfield College. That's our old name. Maybe we should update that. And it's given us a lat long. So we could plot that on a map. And you've seen me do that before in a video. Let's have a look at some of these other ones. So saying we can enter some IP addresses here. Let me type in some. So Janet J is the joint academic network and we had an address from Janet uh 6440 125.57. We have an address from Gant. So Gant is the European academic network. So clearly we've traveled over from Janet in the UK to Gant in Europe. So we've got 60 40 98 64 sorry 6240. I'm bound to mess one of these up, aren't I? Um now I said to you when I was doing my preamble that all of the things essentially with the same initial bits are likely to belong to the same organization. So you can see all of these things 6240 something seem to be J
gant seem to be belonging to the international the European academic network. We've got one where the label is Janet and Jant. So, we'd have to we're not quite certain who that belongs to, but when we pop them into the database, here is where we see this isn't always Hold on. Have I mistyped one? I have also mistyped one. Okay. 6240. Right. There we go. So, these addresses, these addresses beginning 6240, we can see all belong to Jant and they're being geollocated to the Netherlands. Hm. But we can also see one of them, the one ending in 57 is actually got a London in its address. So, we might be a little suspicious of that. It's belonging to that organization.
It's not necessarily where it actually is. So, I said there's this other one where it suddenly hops out to being 200 milliseconds and that's still the one ending in 102. And we can see that one is being uh geoloccated again in the Netherlands. But actually that one is terrifically further away. It's 200 milliseconds. 236 239 milliseconds. If we look back at our trace, we can see this hop. And it's also saying orient plus. So we suspect that might actually be a lot further away. Mostly this works fine. I've shown you some where it doesn't work, where it thinks something is in the Netherlands.
Actually, let's just do one or two more. So, we had that trace route and I said um that one of the addresses was a Janet address and it was 146.97.143.217. And that's saying it's part of Janet, the joint academic network in the UK. But Janet has registered itself in Birmingham. This thinks it's in Birmingham and it thinks it's within a radius of 20 km, but actually there's no way this traffic is rooted through Birmingham. It's it's just not happening. That's where that organization happens to be. So mostly this is good to the country level and you could see the Queen Mary actually put in our proper address and postcode and it got us pretty precisely got us um down to actually the the right location. Says we're in Tower Hamlets which is a fairly small area of London.
So you know where that one is pretty well. But some of the others we've seen it's getting the country right and others we suspect it's not even really getting a country right saying something's in the Netherlands and it probably isn't. Okay. Um now one thing a lot of people might say is okay um what if I want this not to be the case? It's locating me to um England and I want to pretend I'm somewhere else. Oo, that show on Netflix. I really want to watch it and it's not released in England. That's released in America. I want to pretend I'm in America. So, and a lot of people are already screaming the answer is a VPN. You've got a video on VPNs.
I don't really need to go too much into the detail of how that's working, but the basics the basics of it is we're creating a tunnel. We can do this in various ways, but remember I drew that diagram of the routters in the internet. What we do with a VPN is we create like a passageway. So the first router hop um the first router that our traffic pops out at is in a different country. So a company will buy hardware in lots of different countries and you select one thing I could do is just hotspot my phone and see what happens. So I've created a hotspot on my phone. I'm going to connect to that.
Now, if I ask the question, what's my IP address? Now, it's got somewhere completely different. It thinks I'm in Crawley because that's where this uh BT cellular. So, now it's saying my connection is cellular and we've got an IPv6 address. If we use a VPN, we could choose to locate ourselves in more or less any country. There's a lot of ways of doing that. that initial tunnel. You can hide an IP packet inside an IP packet. You can create an SSH tunnel, but in essence, it's all doing the same trick in different more or less secure ways of making sure that the rest of the internet thinks that your connection initiates your connection starts somewhere other than where it actually does start.
This geol location has some some strange properties because we've seen it is it's imperfect. It's pretty good. More than 90% of the time on IPv4 it will be getting you right I think. But it will give you a lat long. It will give you a precise location on the planet surface. Now maybe the company that put the details in, they didn't well they're certainly not giving a lat long. Maybe they only said hey well we're in America. So now where does it locate? It turns out that locates if you just say we're in America then this database will locate somewhere in Kansas. Um, and quite famously that that that the place where that locates to, people with not quite as much knowledge as they think they have think that they found the person who sent them the threatening email or the person who stole their mobile phone and they show up at some farmhouse in Canvas, Kansas demanding their mobile phone back because they've
located to a um latitude longitude. which is actually just the center of America and the location the geoloccation only got as far as America and no further. That's how us as the government of Ruritania is going to get a lovely popup saying congratulations and welcome to Iritania every time people browse to us
about here is what's called time to live. Every internet protocol packet when it's created is set up with this flag time to live. It's as if they've all got a doomsday clock on them. Um, we've got a little counter.
Questions about this episode
What is discussed in "How IP Addresses Relate to Physical Locations - Computerphile"?
In order: 0:00 Amazon, Google LLC, Ruritania; 10:00 Tower Hamlets, Amazon, Queen Mary University; 15:00 Tower Hamlets; 20:00 Ruritania.
What is mentioned in this Computerphile episode?
7 people, works and ideas are mentioned, including Amazon, Ruritania, Google LLC, Tower Hamlets, IPv4, MaxMind. Each one on this page links to its own page with every episode that mentions it.
How long is "How IP Addresses Relate to Physical Locations - Computerphile"?
The episode runs 24 min; the transcript is about 3,403 words in 34 timestamped sections.
More from Computerphile
About this transcript: the episode's spoken words as captioned on YouTube, split into timestamped sections. Reclip.Me locates every person, work and idea in the text, keeps the time it is first named, and quotes the words around it verbatim. Last updated January 24, 2026.