Subject: Mini-infodump incoming
Author:
Posted on: 2017-03-22 04:27:00 UTC

This is probably one of the more relevant times y'all could be talking about this, given that I've got an ethical hacking midterm tomorrow, and IP address stuff is important for that.

So, IP addresses. The general point is that computers need a way to refer to other computers located on a network. A name is nice for humans but rather useless for network people, because there's basically no correlation between how similar two names are and how to get to them. So, everyone on the public Internet gets a number to identify them so they can talk and be talked to called an IP address. Every computer keeps some notion of how to reach any other IP address (your machine knows that it can get to anywhere from your router, your router knows that either your ISP can do it or you're looking for another device on the network, and your ISP has a big routing table of IP address ranges and who it has to go through to reach them)

There's two versions of the Internet Protocol (IP), and I'll discuss IPv4 first. With IPv4, your number is 32 bits long, and usually written aaa.bbb.ccc.ddd, where the individual fields are 8 bits long (because four numbers between 0 and 255 are easier to remember than one really big number.

When folks were first designing the Internet, they sure weren't expecting there to be 2^32 (minus a bit) computers on it. Problems were beginning to arise a while back, so a "solution" was devised. Your ISP only gives you one IPv4 address. "But, Tomash!" you object, "I have a computer and a phone and a smart microwave all on the same connection." This is where the nasty evil hack comes in. Your router only gives you a private IP address, usually of the form 192.168.X.Y. When your computer sends out data labeled "From: 192.168.1.5, port [high number], To: 45.56.119.192, port 80" (that'll hit the Board's server), your router secretly rewrites that to say "From: [your public IP address], port [other high number], To: 45.56.119.192, port 80". Then, when the Board sends back its reply labeled "From: 45.56.119.192, port 80, To: [your public IP address], port [other high number]", your router remembers that [other high number] corresponds to [high number] on 192.168.1.5 (that'd be your computer), and so it re-writes the packet back so your computer never notices the deception. This has the drawback (and, if you're a person who writes terrible insecure code I'm looking at you device manufacturers, feature) that your computer can't have a conversation initiated with it, which is a bit annoying for, among other things, multiplayer games and voice calling. For practical purposes, this means that sharing an IPv4 address with someone means you're in the same house or coffeeshop (unless you count, say, all the mobile phones in Qatar, which all share an IP)

Mostly, people didn't mind this packet re-writing business, even though it causes annoying problems. But the Internet kept growing. Several other things were done to save on IPv4 addresses (a big one is that, when you connect to a website, you have to tell the website its own name, so that the same server/IP can serve multiple domain names). However, we're still running out of IPv4 addresses, and in fact, we're more or less out at this point.

Because 32 bits wasn't enough, we moved to 128 bits. Sort of. An IPv6 address, unless it's abbreviated, is aaaa:bbbb:cccc:dddd:eeee:ffff:gggg:hhhh, where each of the alphabet groups is written in base 16. This is more than enough addresses, we swear. This is even expected to be true once it gets mentioned that, right now, you don't get one IPv6 address from your ISP, you get 2^64 of them! (like, you, personally, if your ISP is with the program, can hand out an IPv4 Internet's worth of IPv4 Internets). There's a nice fiddly mechanism for how the eeee through hhhh bits get determined, but suffice to say, if it has an IPv6 address, it's directly on the Internet again. No more connection rewriting. Yay!

For practical purposes, two IPv6 address are in the same house/coffeeshop/... if the first four groups of numbers (and A through F are numbers, whoever told you otherwise?) match.

Reply Return to messages