0

This question already has an answer here:

I am new to networking, so I apologize is this question is naive. I understand that 2^32 = ~4 billion. However, if you add in subnet masks, won't this number increase? For example, let's say you have the IP address 1.2.3.4 /1. Why can't you also have 1.2.3.4/2. You know it is distinct from the former address because the subnet masks are different.

marked as duplicate by Ron Maupin ip Feb 3 at 19:40

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • No, masks only divide the 32-bit address into two parts: the network and the host. See this two-part answer for the full details. There is also this answer that explains about the IPv4 address shortage. – Ron Maupin Feb 3 at 19:39
  • Subnetting organizes IP addresses into networks. The addresses still need to be unique, so there's a total of 2^32. – Zac67 Feb 3 at 20:26
  • @Zac67 My question is basically asking why you need unique addresses. Why can't you have identical addresses with unique subnets? – Typical Highschooler Feb 3 at 20:50
  • @TypicalHighschooler That's not how TCP/IP works. Addresses need to be unique, subnets just group addresses into (local or remote) networks. 1.2.3.4 is always the same address, no matter if you look at the 1.0.0.0/8, the 1.2.0.0/16, the 1.2.3.0/24, or any other matching subnet. – Zac67 Feb 3 at 20:58
  • To get an idea about why the address is the address, regardless of mask, look at this answer. If you understand the information in the first answer I linked in the first comment, you will understand that an IP address is simply 32 bits. Packets have addresses, but no mask information. Routing table use the masks to determine where to send packets with an address. – Ron Maupin Feb 3 at 22:55

Browse other questions tagged or ask your own question.