If IP addresses are unique, why is it so many routers have the address 192.168.1.1?

7

5

I have a beginner's question. If the IP address is your identity on the Internet and it is unique. Then how come every router's IP address is 192.168.1.1 and PC1 is 192.168.1.2, PC2 is 192.168.1.3 and so on? How can I access a certain PCs and not others?

Aelgawad

Posted 2014-04-25T09:58:24.883

Reputation: 139

1@Ramhound But then again, maybe those of us who already know the answer to the question don't appreciate how confusing the concept is to those who are new to it. The first few hits on Google when searching for that IP address are not particular helpful in explaining it. And I also think a lot of those who already know the answer to how it technically works should read the question not just as asking for a technical explanation but also as questioning whether it is sensible in the first place to assign the same address to many devices. – kasperd – 2015-12-16T00:06:20.413

It still isn't a well researched question... – Ramhound – 2015-12-16T00:12:44.450

@Ramhound When I typed "IP address" and went through every single page on the search results, this is the first thing that even mentioned "local" IP addresses: https://simple.wikipedia.org/wiki/IP_address. And it wasn't on the first page. Or the second.

– wizzwizz4 – 2016-07-21T15:44:05.537

@wizzwizz4 - The question in my opinion still did not show very much research effort. The same Wikipedia article, you say is on the second page, is on the first page of my results. I checked Yahoo, DuckDuckGo, Bing, and Google to confirm my results. It actually is between the second and fifth result of every search engine I checked. Even if it was on the second page, that is witin the first 100 results, which I consider relevant research material Can you not, ping me, because of a 2 year old comment? – Ramhound – 2016-07-21T15:54:58.283

Oh, sorry. :-/ I thought I was still on the similar HNQ that I linked off. – wizzwizz4 – 2016-07-21T16:04:21.973

Your question is slightly confusing. You say an IP address if your identity on the internet [which is true], then go on to discuss LAN IP addresses. Do you know the difference between the two? – Matthew Williams – 2014-04-25T10:06:40.243

2https://www.grc.com/sn/past/2006.htm Episodes 25,26,27 and 42 – Jan Doggen – 2014-04-25T10:07:45.183

They are unqiue within your own intranet network There also are not enough IPv4 addresses to provide everyone their own address. – Ramhound – 2014-04-25T10:50:56.493

6@MatthewWilliams I would assume not since he is asking this question and I think it is good that he asked, only who asks can learn. – BadSnowflake – 2014-04-25T10:51:02.660

2

Maybe also interesting to read: http://superuser.com/questions/146194/why-are-home-networks-prefixed-with-192-168

– BadSnowflake – 2014-04-25T10:52:30.960

3@Assylum - Honestly. This question shows very little research effort. – Ramhound – 2014-04-25T10:52:35.230

Read more on private and public IP address – pulsarjune – 2014-04-25T11:21:52.153

Answers

20

An IP address is not necessarily an "identity on the internet", it is just a unique address assigned to a specific network card on an IP network. The internet is one big network, and so anything on it (that has an IP address) has a unique address, and so the IP address can be considered its identity.

Your router is on the internet, and so it has an IP address unique to it.

Anything on the inside of your network is not on the internet, it is on your LAN, an entirely separate network, with its own address space. Anything on your LAN must have a unique (within the LAN) IP address to participate properly with your local network.

Anyone else who has a LAN is also not part of the internet, and not part of your network, and so can use the same addresses you do.

In order for your LAN devices to talk to the internet, their outgoing traffic has the source address changed to match that of the internet IP address of the router. The router keeps track of this, and makes sure any response traffic gets sent to the right internal machine. This is called Network Address Translation.

Paul

Posted 2014-04-25T09:58:24.883

Reputation: 52 173

5It’s worth noting that this does not (well, should not) apply to IPv6. With IPv4, it’s (also) a way to reduce the need for addresses. It also violates the end-to-end principle. – Daniel B – 2014-04-25T10:47:08.000

6

Imagine that your router at home has the address 192.168.1.1 and your PC has the address 192.168.1.100. Then another router at your friend's house also has the address 192.168.1.1 and his PC has the address 192.168.1.100.

Addresses that begin with 10, 172.16 - 172.31 or 192.168 are referred to as private range addresses (class A, B and C). These addresses are used in a limited area of the Internet, namely within your own local network (LAN) at home which you have control over. They don't need to be registered. Internet service providers usually use different address range, and the addresses they use are registered with an Internet authority.

In the example above your public address might be 109.240.120.13 and your friends public address might be 83.42.112.110. These are the addresses that you and your friend use on the Internet, and they are unique.

Samir

Posted 2014-04-25T09:58:24.883

Reputation: 17 919

2

RFC 1918 defines 3 ranges of IP addresses that are "private", for use internally within any given organization. These ranges are 10.0.0.0/8, 172.16.0.0/16, and 192.168.0.0/16.

You will note that while many routers use these address ranges for their internal LAN networks, the router WAN interface is assigned a unique publically-routable IP address. when users of the internal network access the internet, they masquerade as the router's public address, using NAT.

Frank Thomas

Posted 2014-04-25T09:58:24.883

Reputation: 29 039

1

Every IP Address is accompanied with the subnet mask. This subnetmask determines how large your network is from ranges you can access to ranges you can't access.

Basically, the subnetmask in a home situation is 255.255.255.0 which means that with a 192.168.0.1-255 network, the first numbers must always be the same in order to access that portion of the network. So 192.168.0.1 can see 192.168.0.2 but not 192.168.1.1 because the 3rd octed of the subnetmask is 255, not anything else.

So your computer can only access addresses of 192.168.0.x

Your router is also in this range, so your computer can access this address as well. Your router however makes a 2nd connection through your modem to the internet, and gets an IP address from the internet, for example: 123.45.67.89 with subnetmask 255.255.254.0 which places your internet connection inside a group of computers on the internet. Your internet provider has a router just like you have at home (well they have more, but thats not the point) which connects their internet selection with hubs, and through hubs, the whole internet eventually reaches eachother.

So long story short, by how the subnetmask is set, it determines what you can access, but changing your subnetmask to 0.0.0.0 does not mean you can reach the internet without needing an internet provider. But given that this is an advanced topic, I tried to keep it as simple as possible.

LPChip

Posted 2014-04-25T09:58:24.883

Reputation: 42 190

1

Well, that's an interesting thing indeed. Let's go back from the 192.168.x.y for a while and back to the time when internet was mostly used by universities and institutes. There were unique ip addresses, like you said an "indentity". If you were the network admin of a university and though, "well, i think we should be part of the internet" then you could order some at the IANA (https://www.iana.org/). For example, a class-B-network, that means you get an address range like 34.172.0.0 to 34.172.255.255. Now you could assign them as you wished to the computers at your university and they could take part on the internet, everything was fine.

More and more people got access to the internet, for example some businesses. ISPs (internet service providers) came up. They buy a certain range of IPs and sell them to other people. Not long time ago, the common approach if you wanted your business to be connected to the internet was: "i need 20 ips for the marketing, 50 for r&d and 40 for the production, so let's order 110 ips". And this yet worked fine.

Okay, now let's say you have 4 computers at home. They create a small LocalAreaNetwork, a LAN. This is your personel network, and they are not yet connected to the internet whichs means they don't need world-wide unique addresses but local, unique addresses. There is a certain ip range for this purpose, and 192.168.x.y is commonly used for this. This means: In your own private network every pc has a local unique IP address. They now can communicate with each other, no problems. But now you'd like them to be connected to the internet. If we do it as described above, we would go to our ISP and order 4 world-wide unique IPs. Okay. But we have already our LAN and every computer there has its own local ip already. It would not be nice to change all these to world-wide ones. So there's a nice technique called "NAT", which means NetworkAddressTranslation. Every computer keeps his local ip. And in your router (which commonly also implements a NAT) you assign each local ip to a global ip in a NAT table. Now what is going on here? If PC1 with 192.168.0.101 would like to connect to google.com, it sends a request to its main gateway ("routing" is the keyword here, but i'll not explain this here) to be connected to that server. (Your router is connected to your local network with its LAN ip on the one side and to the internet with your 4 global IPs on the other side) Of course google.com is in the WAN, the internet. So the NAT now does the following: It takes the local ip and translates it to a global ip as once assinged in the NAT table. The translation could be like "192.168.0.101 <-> 33.134.10.51". So a request from 33.134.10.51 is sent to google.com. The answer comes back to 33.134.10.51 (to the NAT) and is translated back to 192.168.0.101 and thus sent to your computer. So now all your computers have local and a global IP (but this one is only stored in the NAT and used for world-wide communication).

But with more and more people getting internet access, the pool of free IPs decreased rapidely. There were too many computers for too less IPs. So what can we do? The answer is PAT (port and network translation). It works like an extended NAT. Nowadays, you go to your ISP and order one IP address, eg 90.80.70.10. You have your small LAN at home with 4 PCs. They all got their unique LAN address. Now the magic happens: Your router (with the NAT / PAT in it) is as before connected to the LAN, but to the WAN not longer with 4, but with only this one IP address.

You must know that most communication protocols nowadays use IPs and ports. A connection between a computer and a webserver over TCP ip is like the following: PC1:12345 -> Webserver:80 Webserver:80 -> PC1:12345

PC1:12346 -> Webserver2:80 Webserver2:80 -> PC1:12346 Note that through the use of ports two different connections can be managed (PC1 is connected to webserver one with port 12345 and to webserver2 with port 12346).

So now what happens in your network? Your pc sends a request like 192.168.0.101:12345 -> google.com:80. The NAT/PAT translates this to 90.80.70.10:10001 -> google.com:80. It saves the translation (192.168.0.101:12345 <-> 90.80.70.10:10001) in its memory. The answer comes back: google.com:80 -> 90.80.70.10:10001. The NAT knows how to translate this back and the packet google.com:80 -> 192.168.0.101:12345 comes to your computer. Works fine. But the interesting thing is: You have a second computer: 192.168.0.102. With this, you also like to connect to google. The process again is 192.168.0.102:12345 -> google.com:80 which is translated by the NAT/PAT now to 90.80.70.10:10002 -> google.com:80. This translation is also saved, note that another port was used so the NAT can distinguish the answers: google.com:80 -> 90.80.70.10:10002 goes back to google.com:80 -> 192.168.0.102:12345 and to your second PC.

To conclude, with this technique you can have a huge number of PC in your local network with 192.168.x.y - they can communicate in this LAN normally - and one external global unique IP used for the outer side of your router. And all of your PCs can communicate with the internet because their requests are seperately translated to different ports on the outer router side so the answer can be tranlated back.

I hope this helped you, feel free to ask more! :) This theme is indeed very interesting!

ju.kreber

Posted 2014-04-25T09:58:24.883

Reputation: 147

4This answer is extremely long difficult to read. – Ramhound – 2014-04-25T11:25:48.900

0

Most IP addresses identify a server or a computer somewhere on the internet. Most, but not all. Some have a special meaning.

127.0.0.1 means "this computer". If my computer sends a message to 127.0.0.1 it goes to my computer. If your computer sends a message to 127.0.0.1 it goes to your computer. The message actually never leaves your computer.

The range 192.168.x.y is reserved for "computer on your local network". Your router that runs your local network will have a list of which of your computers are at which one of these addresses. If you send a message say to 192.168.3.19 then it goes to your router, and your router sends it to one of the computers on your home network (or it fails, if your router didn't assign that number to any of your computers). The message actually never leaves your local network and never touches the internet itself.

The range 10.x.y.z is equally reserved. But because it has 16 million possible addresses, that range is usually used by large companies, while for example a small household would use the 192.168.x.y range with only 65,000 possible addresses. Most routers that you would buy for home use will only support 256 or 512 IP addresses in that range anyway. The 10.x.y.z range is useful if you think your organisation will have more than 65,000 computers one day.

gnasher729

Posted 2014-04-25T09:58:24.883

Reputation: 277