Can someone explain why when you subnet you loose IPs?

TechBoyJK

Lifer
Oct 17, 2002
16,699
60
91
Hello,

I am studying IP. I am reading up on IP and it says that when you subnet, you loose IP addresses, but then it says its too complicated to explain. Anybody have any plain english answers on this? just curious.
 

gaidin123

Senior member
May 5, 2000
962
1
0
I'm not quite sure where you might "lose" IPs but it's pretty simple that if you subnet a class C into 16 subnets then you "lose" 32 IPs by having to make them the gateway and broadcast addresses of those subnets. You end up with having less IPs for workstations if you subnet, but on the flip side if you subnet you sometimes can retrieve otherwise wasted IPs. :)

Gaidin

Edit: I meant network address and broadcast address!
 

alrox

Member
Nov 17, 2002
175
0
0
take a normal class C range, 192.168.0.0/24, 192.168.0.0-192.168.0.255 256 total IP's.

192.168.0.0=the network address
192.168.0.255=the broadcast address
both of the 2 above IP's are not useable for a host address(address of a computer, router, whatever).
192.168.0.1-192.168.0.254 are 254 useable host IP's, 2 are 'wasted' on the network and broadcast addresses.

Now let's break that subnet in half, 192.168.0.0/25, and 192.168.0.128/25, 128 IP's each.
192.168.0.0=network address of subnet 1
192.168.0.127=broadcast address of subnet 1
192.168.0.128=network address of subnet 2
192.168.0.255=broadcast address of subnet 2
that leaves 192.168.0.1-192.168.0.126 for host IP's in subnet 1, 126 host IP's.
and 192.168.0.129-192.168.0.254 for host IP's in subnet 2, 126 host IP's here too.

That makes 4 'wasted' IP's from this class C by breaking it into smaller subnets.

 

TechBoyJK

Lifer
Oct 17, 2002
16,699
60
91
so, the farther you divide the subnet, the more gateway IPs and broadcast IPs you have to use. so if I am at /30, which is blocks of 4, and I have 62 blocks, I am going to loose 124 IP address because I need 62 gateway IPs and 62 broadcast IPs.

Is this right?
 

alrox

Member
Nov 17, 2002
175
0
0
'gateway' ip's have nothing to do with subnetting. As far as the rules of subnetting goes, a 'gateway' ip is a host IP. Typically, the first useable IP in the subnet is used as the default gateway for the machines on that subnet.

By using your example, a /30 would have:

192.168.0.0=network address
192.168.0.1=IP of machine 1
192.168.0.2=IP of machine 2
192.168.0.3=broadcast address

/30's are used in many back-to-back/point-to-point configurations.
 

Fatt

Senior member
Dec 6, 2001
339
0
0
Let me put this in simple terms.

Every valid range of IP addresses has an additional address at each end. One is the host address and one is the network address.

For an example, lets use the classic 192.168.0.0 network with it's default mask of 255.255.255.0

192.168.0.0 is the "network address" and 192.168.0.255 is the "broadcast" address.

Now say you use the mask 255.255.255.252 (yes, there is a reason to use that mask, but it's not important for this conversation.)

Now you have a little over 60 networks with 4 IP addresses in them each. BUT, since the first & last IP addresses are not valid host addresses you lose fully HALF of your addresses.

Having said all that, there are ways to get those addresses back in your router configuration, but that's not important.

What IS important is the way you REALLY lose IP addresses when subnetting. You don't actually lose them, you waste them.

See, you make a subnet and it has a certain number of IP addresses in it. Say you have a subnet with 16 IP addresses in it but you only have 11 hosts. Lets also pretend that you don't use the router config tricks to get your IP addresses back because that keeps the conversation simpler.

OK so 16 IP addresses, minus the network & broadcast address leaves 14 addresses and you use 11 of them. so now you have 3 addresses left over.

You can't use them anywhere else so they just sit there. sure, it's nice to have a cushion in case you add more hosts but in the meantime those addresses are wasted.


Which is why CIDR was invented. It lets you use different subnet masks for different portions of your network. But that's another story.