Ramblings

Introspective narcissism since the 2000s.

User Tools

Site Tools


ip_address

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
ip_address [2026/11/10 12:23] – ultracomfyip_address [2026/11/17 15:56] (current) – ultracomfy
Line 1: Line 1:
 <WRAP column 18% right> <WRAP column 18% right>
-{{page>Templates:Science}}+{{page>Templates:Technology}}
 </WRAP> </WRAP>
  
Line 6: Line 6:
 <WRAP centeralign>Information Technology/Networking/\\ <WRAP centeralign>Information Technology/Networking/\\
 <fs xx-large>IP Address</fs></WRAP> <fs xx-large>IP Address</fs></WRAP>
 +
 +<WRAP center round info 60%>
 +While IP addresses aren't necessarily connected to the internet, much of what you are about to read might make more sense to you if you read about the internet first. See: [[:internet|Internet (>click<)]].
 +</WRAP>
 +
  
 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. 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. This can be your phone, your Laptop, PC, console, your printer, perhaps your smart lights or smart fridge, but also servers on the internet, serving websites (like this one!) or otherwise, use IP addresses to communicate. 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.+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. This can be your phone, your Laptop, PC, console, your printer, perhaps your smart lights or smart fridge. However, even servers on the internet, serving websites (like this one!) or otherwise, use IP addresses to communicate. While you may be used to opening websites in your browser by entering a domain (such as ultracomfy.net), this domain really just resolves to an IP address in a process called a [[:IP Address#DNS|DNS Lookup]]. 
 + 
 +IP addresses are used by other devices for routing (ie. deciding 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, neither a router nor a DHCP server are 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 ====== ====== Fundamentals ======
Line 15: Line 22:
  
 <fs xx-large>''217.154.217.127''</fs>\\ <fs xx-large>''217.154.217.127''</fs>\\
-This is a standard IPv4 address: A set of four numbers, each between 0 and 255((Creating a range of 256 total possible values, if you include 0 as a number; ie. 1 - 255 is 255 possible values, plus 0 is another possible value, so 256.)), separated by a dot. The lowest possible IP Address therefore is ''0.0.0.0'', and the highest is ''255.255.255.255''((These are just the theoretical minimum and maximum. Both of these, specifically, are actually reserved for special purposes though and will never be assigned to an individual device.)).\\ +In fact, this is the IP address that the domain ultracomfy.net resolves to. A very nice example of a standard IPv4 address: A set of four numbers, each between 0 and 255((Creating a range of 256 total possible values, if you include 0 as a number; ie. 1 - 255 is 255 possible values, plus 0 is another possible value, so 256.)), separated by a dot. The lowest possible IP Address therefore is ''0.0.0.0'', and the highest is ''255.255.255.255''((These are just the theoretical minimum and maximum. Both of these, specifically, are actually reserved for special purposes though and will never be assigned to an individual device.)).\\ 
-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 "bits" (or one "bit"). 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, ''217.154.217.127'' looks something like this:+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 "bits" (or one "bit"). Eight of these in a row form a "byte". As an example in the decimal system, given 8 digits the biggest number you can express is 99999999 (to get to 100000000 you would need another digit). In **binary**, the maximum number you can express with eight digits is 11111111 (to get to 100000000 you would need another digit). This number, converted to the decimal system, is 255, which is the reason numbers in IP addresses never exceed 255. Expressed in binary, ''217.154.217.127'' looks something like this:
  
 ''11011001.10011010.11011001.01111111''\\ ''11011001.10011010.11011001.01111111''\\
-An IPv4 address is a set of 32 bits (32 ones or zeroes), 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.+This is the binary notation (as opposed to the dot-decimal notation we're used to seeing) that shows us what an IP address really is: A set of 32 bits (32 ones or zeroes), divided into four groups of bits called octets (...in networking. We can just think of them as Bytes). 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. The computer sends addresses in binary, we humans typically read them as dot-decimal, they're the same thing.
  
 <WRAP box> <WRAP box>
 ++++ Advanced Reading: IPv6 | ++++ Advanced Reading: IPv6 |
-For comprehensiveness' sake, 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.+Most communication between electronic devices uses IP to facilitate communication. Telephone had a different system but even they are switching to VoIP now. This means that a lot of IP devices will need an IP address at any given time. Now when we make the calculation, <wrap lo>256 * 256 * 256 * 256</wrap> = 4294967296 (4.29B, or 4.29Mlrd) it becomes quickly apparent that there actually aren't all that many available addresses that can be assigned. Even from these 4.29B, many are reserved and cannot ordinarily be used. 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. Here is an IPv6 IP address:\\+It turns out that it wasn't, and so they eventually invented IPv6, a new standard with a broader address range to fit more devices. Here is an IPv6 IP address:\\
 <fs xx-large>''2a01:239:4e0:a500::1''</fs> <fs xx-large>''2a01:239:4e0:a500::1''</fs>
  
-It's beautiful, isn't it! Yeah, we all know it's not beautiful, but such is the reality of our times((See [[:quotes#reality_of_our_times|Quote: Reality of our Times]])). These are the two types of IP addresses in popular use: IPv4 and IPv6.\\ +It's beautiful, isn't it! Yeah... we all know it's not beautiful, but unfortunately that is the reality of our times((See [[:quotes#reality_of_our_times|Quote: Reality of our Times]])). These are the two types of IP addresses in popular use: IPv4 and IPv6.\\ 
-IPv4 has four groups of eight bits. IPv6 has eight groups of (up to) four **hexadecimal** digits((Leading zeroes, or full zero groups are shortened away, which creates some funniness like ''::'' [is really just 0000] or '':1'' [is really just 0001].)). 32 bits versus 128 bits. IPv4 and IPv6 are not interoperable and function separately 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.+IPv4 has four groups of eight bits. IPv6 has eight groups of (up to) four **hexadecimal** digits((Leading zeroes, or full zero groups are shortened away, which creates some funniness like ''::'' [is really just 0000] or '':1'' [is really just 0001].)). 32 bits versus 128 bits. 4.29 Billion possible addresses versus 340 Undecillion addresses. IPv4 and IPv6 are not interoperable and function separately 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. In fact, you might even be using it right now.
 ++++ ++++
 </WRAP> </WRAP>
  
 ====== IP Assignment ====== ====== 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 (ie. if I power on my PC now it will be assigned .3, and so on). These assignments, however, are only //leased// and a connected device needs to refresh a lease((ie. Check in with the router/DHCP server and request a lease extension.)) every once in a while if it wants to keep it. If the lease runs out, the IP will be recycled.+The IP address a DHCP server assigns to a device isn't (entirely) random. For example, my network at home is administered by a FritzBox router. Most FritzBoxes come out of the factory configured to assign themselves the address ''192.168.172.1'' and then to count upward: 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 lowest available IP that isn't currently assigned (ie. if I power on my PC now it will be assigned .3, and so on). These assignments, however, are only //leased// and a connected device needs to refresh a lease((ie. Check in with the router/DHCP server and request a lease extension.)) every once in a while if it wants to keep it.
  
-The reason IP addresses are leased is for the sake of recycling. If every device got a new IP address every time it logged on, the router/DHCP server would eventually run out of IP addresses it can assign. 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, because my phone is disconnected from the WLAN, its 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 even though that was previously assigned to my phone. It was able to recycle .2 and use it for my roommate's phone instead of using up another IP address (.4). Leasing and recycling let the router use less IP addresses while serving the same number of devices. Only if I now came back into the house with my phone, and it tried to log onto the WLAN, the router would see that both .2 and .3 are now in use and will give my phone .4.+The reason IP addresses are leased is for the sake of recycling. If every device got a new IP address every time it logged on, the router/DHCP server would eventually run out of IP addresses it can assign. By tying addresses to a lease, an IP address is in use only for as long as it is actively used and can be re-assigned if and when the lease runs out.
  
 <WRAP box> <WRAP box>
Line 47: Line 54:
 ++++ ++++
 </WRAP> </WRAP>
 +
 <WRAP box> <WRAP box>
 ++++ Advanced Reading: Private Address Ranges | ++++ Advanced Reading: Private Address Ranges |
  
-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 between 192.168.0.0 and 192.168.255.255. The ranges are as follows:+There are multiple ranges that have been specifically reserved for use in local networks. 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 between 192.168.0.0 and 192.168.255.255. The ranges are as follows:
  
 ^ Range           ^ Start        ^ End              ^ ^ Range           ^ Start        ^ End              ^
Line 57: Line 65:
 | 192.168.0.0/16  | 192.168.0.0  | 192.168.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 address((Minus two that are otherwise reserved, too.)) 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 never point to the internet and cannot be routed on the internet.+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 address((Minus two that are otherwise reserved, too.)) 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 never point to the internet and cannot be routed on the internet.
 ++++ ++++
 </WRAP> </WRAP>
  
 ===== Private Addresses ===== ===== 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..+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.xxx.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.+Each house would have its own Room 1's and Room 2's and so on. Think of all the different offices in which the room number 501 might exist. So if you now sent a letter with the destination "Room 503", the mailman would have absolutely no clue where they're meant to go because there are billions of "Room 503"'s in the world. Of course, if you had a mail system inside your //own// office space and sent mail to room 503 using that, that's when this system becomes useful, and it's exactly what Private Addresses are used for. My router //is// the mail system inside your own office. Theses addresses, 192.168.172.1 and so on, are used by my router at home exlusively to speak to devices inside my home, not to the outside.
  
-For this reason, if you tried to ''ping 192.168.172.2'' from your own computer, you would not be reaching my personal computer in my particular home 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.+For this reason, if you tried to ''ping 192.168.172.2'' from your own computer, you would not be reaching my personal computer in my particular home 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 and the same private IP addresses may and in most cases are used in other local networks.** 
  
 ===== Public Addresses ===== ===== 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. 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 built into your router) is assigned its own IP address. Whereas devices on your home network turn to your router for IP assignment, your router is connected to the internet and will turn to your Internet Service Provider (ISP) for IP assignment. 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 (my private IP address, useful only for the router and other devices on the network). 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:+In the case of your home network, your modem (often built into your router) is assigned its own IP address. 
 + 
 +<WRAP box> 
 +++++ Advanced Reading: Modems and Routers | 
 +While I will be using the term router to refer to the device you will in fact most likely be thinking of, routers and modems are not the same. Modern devices sold as "routers" actually often come with the capabilities of a modem (ie. modern routers have a modem built into them), but routers and modems are different devices doing different things. 
 + 
 +A router, fundamentally, doesn't care about the internet and does only a few things: In our case, it acts as a DHCP server to assign IP addresses to devices connecting to it and //routes// traffic between connected devices. Basically, a router is what you used to run LAN parties back then. Entirely offline, just a bunch of computers connected to one central router, communicating with each other via IP. 
 + 
 +The modem is the device that actually connects you to the internet. Back in the day, routers and modems were separate machines and you would plug the modem into the wall, and then plug your router in front of it. Modern "routers" have the modem built into them, but they're still separate parts just in the same housing. For the rest of the article, I will be referring to the device in question as "router" for simplicity sake but, between you and me, we now know that I really mean modem (though anything happening on the local network, for example IP leasing or communication with private addresses, is actually done by the router part of the router, not the modem). 
 +++++ 
 +</WRAP> 
 + 
 +Whereas devices on your home network turn to your router for IP assignment, your router is connected to the internet and will turn to your Internet Service Provider (ISP) for IP assignment itself. This gives the router **two** effective IP addresses: One used inside the network, locally (the Private IP address), and one address the router uses when talking to the internet (called the Public IP address). While I am writing this website, my **public** IP address is ''176.5.60.56''. This is my router's Public IP Address which it got from ths ISP and it's the address the router will uses whenever my router sends out data to the internet. So, when I on my phone connect to my router via WLAN, my phone is inside the local network and will get to know the router's private IP address (''192.168.172.1'') and the phone itself will be given a private IP address as well (''192.168.172.4''). Only the router has a public IP address, and it is not used in the communication between my phone and the router. 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:
  
 <WRAP round box 60%> <WRAP round box 60%>
Line 99: Line 119:
 3) A public IP address //does// give an attacker an approximate geographical information about your location (except in exceptions). That's how Google knows where you are (coarsely) when using their service. Attackers can also scan your router for vulnerabilities. For example, a router lets the owner set up port forwarding, which can be a vulnerability. Unless you configured the router otherwise, it comes shipped with a secure-by-default configuration. In any case, your public IP address is **not** equivalent to a password or direct access to a computer. Someone cannot just infect your computer with malware by knowing the public IP address of your router. 3) A public IP address //does// give an attacker an approximate geographical information about your location (except in exceptions). That's how Google knows where you are (coarsely) when using their service. Attackers can also scan your router for vulnerabilities. For example, a router lets the owner set up port forwarding, which can be a vulnerability. Unless you configured the router otherwise, it comes shipped with a secure-by-default configuration. In any case, your public IP address is **not** equivalent to a password or direct access to a computer. Someone cannot just infect your computer with malware by knowing the public IP address of your router.
  
-4) Just being exposed to the internet isn't unnormal. Your router is exposed to the internet all the time, as well as every other router on the world used in the same manner as yours. Similarly, internet servers like webservers (such as this website!) go out of their way to be exposed to the internet and even broadcast their IP address publicly for anyone to see. It's about the configuration of your firewall and the service you're providing (HTTP/S in the case of this server, among others) as well as being to date. If you leave your network configurations mostly alone and stay up to date then you'll be just fine, like the other billions of devices exposed to the internet.+4) Just being exposed to the internet isn't unnormal. Your router is exposed to the internet all the time, as well as every other router on the world used in the same manner as yours. Similarly, internet servers like webservers (such as this website!) go out of their way to be exposed to the internet and even broadcast their IP address publicly for anyone to see. It's about the configuration of your firewall and the service you're providing (HTTP/S in the case of this server, among others) as well as being up to date. If you leave your network configurations mostly alone and stay up to date then you'll be just fine, like the other billions of devices exposed to the internet.
 </WRAP> </WRAP>
  
-When ultracomfy.net (217.154.217.127) receives the data, it will take note of the Source IP (176.5.60.56) for later. That's where the message it was sent originally came from and, when it responds, that will be where it sends its response to. Additionally, it will now set the Source IP of its response to itself:+When ultracomfy.net (still 217.154.217.127, remember that you connect to devices with their IP) receives the data, it will take note of the Source IP (176.5.60.56) for later. That's where the message was sent from and, when ultracomfy.net responds, that will be where ultracomfy.net sends its response to. It will prepare the response and send it off, this time it itself is the Source IP:
  
 <WRAP round box 60%> <WRAP round box 60%>
Line 110: Line 130:
 </WRAP> </WRAP>
  
-On the way back, the message will again have to travel through various junctions. It will eventually arrive at my router, and the router now has a problem: The message is addressed to it (176.5.60.56), but it isn't the one who actually made the request. One of the devices in the network (in this case 192.168.172.4) made the request, and the router needs to forward it to them. To figure out who made the request (and therefore who to forward the message to) the router uses a system called Network Address Translation.+When it arrives at my router, the router will run into a problem: The message is addressed to the router (176.5.60.56), but it isn't the one who actually made the request. One of the devices in the network (in this case 192.168.172.4) made the request, and the router needs to forward it to them. To figure out who made the request (and therefore who to forward the message to) the router uses a system called Network Address Translation.
  
 <WRAP round box 60%> <WRAP round box 60%>
Line 123: Line 143:
 Network Address Translation (NAT) is the process of mediating between public addresses and private addresses. Your router dispatches information with its own public address, and responses from servers (like 217.154.217.127) will be sent back to your router's public address. But, of course, your router isn't the one who really wants the data, it's my phone that wants it. The router is just an intermediary. Back when my phone contacted the router asking for ultracomfy.net, my router noted down who that request was from, what they requested and a few other indicators. When the response comes back in, it contains extra information that the router can use to determine who the response is really addressed to. Network Address Translation (NAT) is the process of mediating between public addresses and private addresses. Your router dispatches information with its own public address, and responses from servers (like 217.154.217.127) will be sent back to your router's public address. But, of course, your router isn't the one who really wants the data, it's my phone that wants it. The router is just an intermediary. Back when my phone contacted the router asking for ultracomfy.net, my router noted down who that request was from, what they requested and a few other indicators. When the response comes back in, it contains extra information that the router can use to determine who the response is really addressed to.
  
-You can think of it as Room 3 sending a letter to, say, Company HQ. Room 3 gives its message to the mailman and the mailman replaces the envelope's Source location (currently "Room 3") to Residential Road 10, and notes down that Room 3 of your house sent a message to Company HQ. When Company HQ sends a message back, it will be addressed to Residential Road 10. The mailman will arrive at Residential Road 10 and look into his notes, where he will find that it was Room 3 that sent a message to Company HQ. In the real world, of course, we write envelopes with something like "To the hands of" or "to the attention of" if we want someone particular at an address to receive the message. In private/public network communication this doesn't work, though, because everything behind your router never sees the private address of your device, so they cannot address to it. NAT is a bit more complicated than this because it needs to distinguish in cases where, for example, two rooms send messages to Company HQ at the same time. This can be solved, but the solution (NAPT) exceeds the scope of this page about IP Addresses.+You can think of it as Room 3 sending a letter to, say, Company HQ. Room 3 gives its message to the mailman and the mailman replaces the envelope's Source location (currently "Room 3") to Residential Road 10 (because that's where you really live), and notes down that Room 3 of your house sent a message to Company HQ. When Company HQ sends a message back, it will be addressed to Residential Road 10. The mailman will arrive at Residential Road 10 and look into his notes, where he will find that it was Room 3 that sent a message to Company HQ. In the real world, of course, we write envelopes with something like "To the hands of" or "to the attention of" if we want someone particular at an address to receive the message. In private/public network communication this doesn't work, though, because devices on the internet never see devices in your router's local network. They don't have the private IP's of these devices and cannot address to it. NAT is a bit more complicated than this because it needs to distinguish in cases where, for example, two rooms send messages to Company HQ at the same time. This can be solved, but the solution (NAPT) exceeds the scope of this page about IP Addresses. 
 + 
 +<WRAP box> 
 +++++ Advanced Reading: CGNAT | 
 +Internet Service Providers and other carriers on the way themselves have limited ranges to hand out IP addresses. If your ISP has been allocated 100000 IPv4 addresses but you have 150000 customers, you will quickly exhaust your available addresses. So, in the same way that home networks can use NAT to independently use the same IP addresses (ie. my computer can have 192.168.172.2 in my local network and your computer can have 192.168.172.2 in your network without them conflicting with each other), your carrier might employ NAT at their level to reuse IP addresses "locally" without them conflicting with each other. 
 + 
 +This is called "Carrier Grade Network Address Translation", ie. NAT at the carrier level, ie. CGNAT. CGNAT is the best friend of anyone who's ever tried to do something cool with their internet devices at home (like hosting a web or gameserver) because it, in all likelihood, did not work((I have personal, painful experience)). Exactly why it doesn't work is related to the P part in NAPT, which I'd prefer to avoid for now... but if you really have to know: CGNAT, like NAPT, introduces port mappings (ie. the port determines where the carrier will send them to) so that you, at home, can no longer meaningfully use incoming ports. Your carrier already uses the ports for their own purposes and if you tried to set up a service that requires a particular port (like the aforementioned web- or gameserver), the incoming traffic will end up in the carrier's port mapping and 1) be dropped entirely or 2) routed to the wrong IP address (ie. not you). Exceptions exist, and methods for workarounds exist too, but not all carriers cooperate (most don't). 
 +++++ 
 +</WRAP>
  
 ====== DNS ====== ====== DNS ======
-Numbers are hard to memorize. For example, ultracomfy.net is served to you by a server in Karlsruhe that has the IP ''217.154.217.127''. Could you memorize that? I certainly can't, and I've been actively trying to for a good while now. And it's a particularly easy one to memorize, too. Wouldn't it be nice if instead of a bunch of random numbers, we could use easily memorizable names instead? And thus, Domain Names were born. Instead of typing out the number, the owner of a server can register a domain, like ultracomfy.net, and point it to the desired IP address.+Numbers are hard to memorize. For example, ultracomfy.net is served to you by a server in Karlsruhe that has the IP ''217.154.217.127''. Could you memorize that? I certainly can't, and I've been actively trying to for a good while now. In fact, this particular address is actually a particularly easy one to memorize, too. But wouldn't it be nice if, instead of a bunch of random numbers, we could use easily memorizable names instead? This lead to the creation of Domain Names: Instead of typing out IP addresses, the owner of a server can register a domain, like ultracomfy.net, and point it to the desired IP address.
  
-In the case of ultracomfy.net, the domain points at 217.154.217.127. So, you can type the domain into the browser, ''ultracomfy.net'', hit Enter, and you'll arrive at 217.154.217.127 without memorizing the number. It might be the only way you've ever known browsing websites. Don't believe me? You can actually do the reverse, you can copy 217.154.217.127 and paste it into your URL bar directly, then hit Enter. It will take you directly to the ultracomfy.net homepage without you ever seeing the domain name. Every website online has an IP address and you can enter it directly into your browser if you want to.+In the case of ultracomfy.net, the domain points at 217.154.217.127. So, you can type the domain into the browser, ''ultracomfy.net'', hit Enter, and you'll arrive at 217.154.217.127 without memorizing the number. It might be the only way you've ever known browsing websites. But, you don't need domains. You can just enter the IP address of a server directly into your browser's URL bar and it will work just like entering the domain. Try copying [[http://217.154.217.127|217.154.217.127]] and paste it into your URL bar directly, then hit Enter. It will take you directly to the ultracomfy.net homepage without you ever seeing the domain name. Every website online has an IP address and you can enter it directly into your browser if you want to. You can even try [[http://217.154.217.127/ip_address#dns|217.154.217.127/ip_address#dns]] which will take you directly to the DNS section of this particular page, instead of just the homepage.
  
-The reason we use DNS is because, for one, domain names are easier to remember, but also because, as discussed, IP addresses change. The IP address(es) under which to reach google.com have changed many a times over the years but google.com has never.+The reason we use DNS is because, for one, domain names are easier to remember, but also because, as discussed, IP addresses change. The IP address(es) under which to reach google.com have changed many a times over the years, but the domain google.com has never changed.
  
 ====== What We've Learned ====== ====== What We've Learned ======
-To sum it all up, we have learned that IP addresses numbers given to network-capable devices by devices higher up in the chain to enable communication between them. These numbers are handed out temporarily and become invalid after some time unless renewed. When a lease runs out, a device can request a new lease which may or may not be for a different IP address. A router in the home network is assigned an IP from the ISP (Internet Service Provider) which it uses to communicate upwards, ie. with the internet. Devices below it (ie. connected to it on the local network) use their own IP addresses which are used only within those devices to communicate amongst each other, never to the internet. If a device on the network wants to contact a device on the internet, it makes a request to the router, which will use it's Public IP (the one assigned by the ISP), instead of the private IP addresses, to speak to the internet. When a response comes back, the router uses checks its notes to see which device on the local network originally made the outbound connection. This is called NAT, though this concept is a bit more complicated than just this and if you really want to know more, look up NPAT. Domain names like ultracomfy.net are used to substitute IP addresses with human-readable text, but underneath it's always IP addresses.+To sum it all up, we have learned that IP addresses are numbers given to network-capable devices by devices higher up in the chain to enable communication between them. These numbers are handed out temporarily and become invalid after some time unless renewed. This concept is known as "leasing", and when a lease runs out, a device can request a new lease which may or may not be for a different IP address. A router in the home network is assigned an IP from the ISP (Internet Service Provider) which it uses to communicate upwards, ie. with the internet. Devices below it (ie. connected to it on the local network) use their own IP addresses which are used only amongst those devices to communicate with each other, never to the internet. If a device on the network wants to contact a device on the internet, it makes a request to the router, which will use its Public IP (the one assigned to it by the ISP), instead of the private IP address, to speak to the internet. When a response comes back, the router checks its notes to see which device on the local network originally made the outbound connection. This is called NAT (though this concept is a bit more complicated than just this and if you really want to know more, look up something like [[https://www.google.com/search?q=NAPT+Networking|Google: NAPT networking]]). Domain names like ultracomfy.net are used to substitute IP addresses with human-readable text, but underneath it's always IP addresses.
ip_address.1794313387.txt.gz · Last modified: by ultracomfy

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki