3

I was reading How do you calculate the prefix, network, subnet, and host numbers?, and I noticed that he divided the network space into 4 subnetworks of 256 addresses, but he needed only 100 per subnet. If you have for example three contiguous static IP addresses, that means that you cannot separate them into different subnetworks considering also the broadcast and subnetwork IP addressess, right?

128.42.5.4/30
128.42.5.5/30
128.42.5.6/30
Ron Maupin
  • 99,565
  • 26
  • 120
  • 195
sotirios
  • 35
  • 4

2 Answers2

5

That depends. If you are looking for something like loopback addresses, you could have three /32 subnets. With point-to-point links, you could use /31 which is two addresses in the subnet. A /30 subnet also gives you two usable addresses, but you lose the subnet and broadcast from the four addresses.

Each one less in the CIDR notation gives you twice as many addresses in the host portion of the address. Except for /31 and /32, you lose two addresses from the number of addresses.

Edit:

Based on your edit to use /30, all three of the addresses you list, and 128.42.5.7/30, are in the subnet 128.42.5.4/30. The subnet address, 128.42.5.4/30, and the broadcast address, 128.42.5.7/30, are not usable for host addresses.

Ron Maupin
  • 99,565
  • 26
  • 120
  • 195
  • 1
    Hi, thank you for your answer, I was thinking about /30. So, If I wanted to divide the /30 subnet into two subnets , I lose the subnet and broadcast (2) addresses from the four. If I wanted to have three subnets, then I lose 4 addresses from the 6, right? But this is not possible for a network like a wifi home network? I mean, you cannot have a network without subnet and broadcast IP. – sotirios Dec 24 '15 at 21:51
  • 1
    You can have a subnet without the broadcast and subnet addresses reserved if you have a /31 or /32, but they are useful in limited circumstances. Any other subnet size, you do lose two addresses. This only applies to IPv4; with IPv6, all 18+ quintillion addresses in a subnet are usable. Questions about home networking are off-topic, and many vendors of home networking equipment do things in non-standard ways. – Ron Maupin Dec 24 '15 at 21:58
  • 1
    Excuse me, could you please tell me why the subnet address is 128.42.5.4/30 and not 128.42.5.0/30 ? – sotirios Dec 24 '15 at 23:21
  • Both are valid subnets. The subnet 128.42.5.0/30 includes .0 .1, .2, and .3. The subnet 128.42.5.4/30 includes .4 .5, .6, and .7. The subnet 128.42.5.8/30 includes .8 .9, .10, and .11. And so on. – Ron Maupin Dec 24 '15 at 23:24
3

If it's a Private Network, it's better to have proper subnets with network address, Gateway and Broadcast address. Makes the network easier to troubleshoot

  • 1
    Can two devices under the same router (Private Network) but in different subnetworks have the same IP address? – sotirios Dec 24 '15 at 23:24
  • 1
    What does that even mean? There is no difference in subnetting private or public IP addresses. The subnet, /30, in the question is a proper subnet, whether it is in privat or public address space. – Ron Maupin Dec 24 '15 at 23:26
  • 2
    @sotirios, the subnet dictates which addresses are contained in it. There are some real corner cases where what you ask may be possible, but where you are in the learning curve, no. – Ron Maupin Dec 24 '15 at 23:28
  • No Because the two subnetworks will be in communication with each other through the router and that's an ip conflict – Bella Spazwik Dec 25 '15 at 12:00