This is an old revision of the document!
Table of Contents
It's not religion if it's true
Science
Objective inquiry
History
Philosophy
Inclusion
Doppler Effect
Falsified Hypotheses
Information Technology/Networking/
IP Address
An IP (Internet Protocol) address is a numerical identifier assigned to a network interface, allowing it to be identified and communicate with other devices over an IP network.
Any device that wants to communicate with other devices over an IP network (such as LAN, WLAN or even WAN) needs an appropriately configured IP address. IP addresses are used by other devices on the network as an identifier and is used for routing (ie. where to send data). In most cases, especially home networks, a central router provides a DHCP (Dynamic Host Configuration Protocol) server that allows automatic IP negotiation. Automatic IP negotiation means the DHCP server can assign IP addresses to newly connecting devices without requiring manual configuration each time a (new) device connects. However, both a router or a DHCP server aren't strictly necessary and manual configuration on the hosts can set them up with an IP address and enable communication between them (though it's a bog to deal with). The rest of this page will talk largely about DHCP setups.
Fundamentals
A classical IP address, as you might find in the wild, can look something like this:
217.154.217.127
This is a standard IPv4 address: A set of four numbers, each between 0 and 2551), seperated by a dot.
The reason this is so is because of math. As you may know, computers in the 21st century work with ones and zeroes. This is the binary system and individual ones and zeroes are called “bit”s. Eight of these in a row form a “byte”. The maximum number you can express in the decimal system with three digits is 999 (to get to 1000 you would need a fourth digit). In binary, the maximum number you can express with eight digits is 11111111. This number, converted to the decimal system, is 255, which is the reason numbers in IP addresses never exceed 255. Expressed in binary, the above IP address looks something like this:
11011001.10011010.11011001.01111111
An IPv4 address is a set of 32 bits, divided into four groups of bits called octets in networking (or they're just a Byte if you think about them in terms of data length). When your device wants to send data somewhere, it will send its data to your router with both the destination IP and the origin IP, like above, and the router will use IP tables to determine where to forward your data to.
IPv4 and IPv6
Before I move on, I need to touch on IPv4 and IPv6. As you may notice, there are a lot of internet-capable devices around us. Whether you connect to WLAN, or a cell tower, your device will be using IP for the connection, so all of them need an IP address when they're online. There are a few billion IP-capable devices out there, and the number 256 isn't quite a lot in comparison. Even the 256 * 256 * 256 * 256 = 4294967296 (4.29B, or 4.29Mlrd) is a bit tight in the calculation (also many of these addresses are reserved for special purposes and aren't available in many scenarios). Makers of the Internet Protocol back then couldn't feasibly have known how popular it was going to become, so they thought that an address range of some 4.3 billion addresses would surely be enough.
Well, it wasn't, and so eventually IPv6 was born, a new standard with a broader address range to fit more devices:
2a01:239:4e0:a500::1
It's beautiful, isn't it! Yeah, we all know it's not beautiful, but such is the reality of our times2). There are the two types of IP addresses in popular use: IPv4 and IPv6. IPv4, four groups with eight bits and IPv6, eight groups of (up to) four hexadecimal digits3). 32 bits versus 128 bits. IPv4 and IPv6 are not interoperable and function seperately from each other. The transition has been going on for a long time now, but the internet is reluctant to move away from IPv4, so network engineers have the very pretty task of making internet protocol services available to both using strategies with names like dual-stack, tunnelling and translation which I am unable to explain. Nevertheless, it largely works and you have probably already used IPv6 without knowing it.
IP Assignment
The IP address a DHCP server assigns to a device isn't (entirely) random. For home networks, three different reserved address spaces exist that routers may use to assign IP addresses. These begin with 10.0.0.0, 172.16.0.0 and 192.168.0.0. For example, my network at home is administered by a FritzBox router. This FritzBox has the address 192.168.172.1. If I now logged onto that router's WLAN with my phone, the FritzBox will assign my phone the address 192.168.172.2. Any subsequent devices registering on the network will get the next highest available IP (If I power on my PC now it will be assigned .3). This assignment is called a lease, because the IP address isn't permanently assigned. Every lease has an expiry time and if the lease isn't renewed before it expires, the IP is recycled.
The reason IP addresses are leased is for the sake of recyling. Imagine we continue the example from above: My router is .1, my phone is .2 and my PC logs is .3. Now imagine I leave the house and the lease expires in the meantime. The router can then reclaim the leased IP and assign it to new devices logging on. So if for example my roommate was to log on her phone after mine disconnected, her phone could get .2. This means that when I come back and my phone logs onto the WLAN, .2 and .3 are now in use. My phone will now be assigned .4, even though it was previously .2.
Furthermore, I have actually set my router to reserve .2, .3 and .4. I have set it up that it assigns .2 exclusively to my main computer. Even if it is not logged onto the network (when shut down, for example), my router will not hand out that address even though it is technically available. When my PC logs on, the router will recognize the device and give it that .2. This is called a “static DHCP assignment”, because the assignment for that particular address is static. Other devices get IP addresses dynamically (That's why it's called DHCP “Dynamic Host Configuration Protocol”). Of course your IP doesn't have to change, it depends on whether the lease has expired and, if so, which IPs have been handed out/recycled since your device last logged on. All of this can be configured.
On my network, .1 is the router, .2 is my main computer, .3 is my old computer and .4 is my phone. These addresses are reserved and not given out to any other device. So if I open Command Prompt on my main PC, type in ping 192.168.172.1 I know I will arrive at my router. If I type ping 192.168.172.2 I will literally be pinging myself. With ping 192.168.172.3 I arrive at the other computer and with ping 192.168.172.4 I am pinging my phone (though it doesn't respond to ping requests, and neither does yours unless you configured it otherwise).
Anyone else logging on my WLAN will receive an address from 192.168.172.5 or up. Their device will never get any one of the earlier addresses. Again, configurations can differ, and a router might actually be set up to hand out IPs randomly instead of incrementally, so it might just give you .183 instead of the next available.
The range of addresses a router can assign is limited. Routers are given ranges (see Table below) in which they can assign addresses. For example, in the 192.168.0.0/16 range, the router can freely decide over the last two blocks, ie. it can assign anything bewteen 192.168.0.0 and 192.168.255.255. The ranges are as follows:
| Range | Start | End |
|---|---|---|
| 10.0.0.0/8 | 10.0.0.0 | 10.255.255.255 |
| 172.16.0.0/12 | 172.16.0.0 | 172.31.255.255 |
| 192.168.0.0/16 | 192.168.0.0 | 192.168.255.255 |
As established, 192.168.0.0/16 has a range from 192.168.0.0 to 192.168.255.255, so the range of available addresses spans a total of 256 * 256 = 65536 possible addresses a DHCP server could potentially assign, though in many cases routers will only be using 192.168.0.xxx, handing out .0 - .255 which makes it 256 available address4) even though it technically could assign .xxx.xxx). Going beyond this, say, 192.169.0.0, would be an address outside of the router's local range and would point outside of private address range and might be globally routable over the internet. Addresses within private address range do not connect to the internet. These addresses are not globally routable over the internet.
Private Addresses
What you just learned is what is called a “private address”. Private addresses are addresses used inside a local network, like your home network. The idea here is that there can be multiple networks with addresses starting with 192.168.172.xxx. For example, if you bought your own FritzBox, that FritzBox would assign IP's in 192.168.172.xxx as well. On a global scale, 192.168.172.1 (for example) could potentially point to millions of devices because there's millions of FritzBoxes in operation using these addresses privately. You can think of it like numbering your rooms. You could go into all houses in the world and number the rooms, “Room 1”, “Room 2”, “Room 3”, etc..
Each house would have its own Room 1's and Room 2's and so on, so if you now sent a letter with the destination “Room 3”, the mailman would have absolutely no clue where they're meant to go because there are billions of “Room 3”'s in the world. Of course, if you had a mail system inside your own house and sent mail to room 3 using that, that's when this system becomes useful, and it's exactly what Private Addresses are used for. They have nothing to do with the internet and are used solely by devices on a particular network (like my WLAN) to communicate to other devices on the same or interconnected networks (but not the internet). In that case it is completely irrelevant that there are other networks out there in the world with similar Private Addresses, because that's not who you're talking to anyway.
For this reason, if you tried to ping 192.168.172.2 from your own computer, you would not be reaching my computer in my network. If your router assigns 192.168.xxx.xxx then a device on your network might be assigned 192.168.172.2 and you will be reaching that device, not mine, even if they have the same IP address. **It is crucial to understand that IP addresses do not uniquely identify a device because the IP address assigned to a device can change. Additionally, even the IP addresses assigned in a private network aren't unique and devices in other private networks can have the same addresses as yours.
Public Addresses
As established, private IP addresses are not useful for talking to other devices across the internet. They are useful within a home network or an intranet (internal network, businesses/companies use these often), but they don't mean the same thing for devices outside of your home network/intranet.
In the case of your home network, your modem (often also built into your router) is assigned its own IP address. For example, when your router is powered on it will negotiate an IP address with your Internet Service Provider (ISP). While I am writing this website, my public IP address is 176.5.60.56. This is my router's Public IP Address and it is used whenever my router sends out data to the internet. So, when I on my phone connect to my router via WLAN, my phone will get to know the router as 192.168.172.1 and itself get the address 192.168.172.4. When I now, on my phone open the website ultracomfy.net (which resides on 217.154.217.127) it will send the following to the router:
Source IP: 192.168.172.4
Destination: 217.154.217.127
Basically, “this is me, and this is where I want to go”. The router itself will now pass this information to its gateway using its public IP address. Remember that the router will use the public IP address to send data towards the internet:
Source IP: 176.5.60.56
Destination IP: 217.154.217.127
Note how devices on the internet don't even see 192.168.172.4. The router specified 176.5.60.56 as the Source IP, even though originally the source IP was the phone's private IP address. So when you google for something like “What is my IP?” what you will see is the IP of your router's public IP address. Whether you open that site from your phone, your PC, laptop, gaming console or a second phone, if they're connected to the same router, the router will always send out data as 176.5.60.56 regardless of which device inside the home network actually dispatched the request, and websites will show you 176.5.60.56 on every device you checked. Seriously, you can check that right now, they'll all be the same. You can even try disconnecting from WLAN on your phone, turn on mobile data and reload the page, it will now show you a different IP because you're now accessing the internet via a cell tower and not the router at home you used previously.
Anyway, when ultracomfy.net (217.154.217.127) responds, it will send information back towards your router's public IP address:
Source IP: 217.154.217.127
Destination IP: 176.5.60.56
Once the response reaches your router, your router needs to know which of the devices in the home network actually first contacted ultracomfy.net. This process is called Network Address Translation and it's the process of mediating the public address and the private network. Servers online only see your router's public IP address and will send data to it. The router needs to do the work of figuring out who exactly the response actually is for. This is done by storing which device made a request (192.168.172.4 in this case) and to whom (ultracomfy.net), along a few other indicators. Using NAT, once a response from ultracomfy.net comes back, the router knows to send that response forward to 192.168.172.4, this time using the private address:
From: 192.168.172.1
To: 192.168.172.4
:: [is really just 0000] or :1 [is really just 0001].