If a network address is subnetted, the first subnet obtained after subnetting the network address is called subnet zero and the last subnet obtained is called the all-ones subnet.
In your example:
Network: 192.168.5.0
Subnet Mask: 255.255.255.224
Subnets:
Subnet Broadcast
192.168.5.0 192.168.0.31 <-- subnet zero
192.168.5.32 192.168.0.63
192.168.5.64 192.168.0.95
192.168.5.96 192.168.0.127
192.168.5.128 192.168.0.159
192.168.5.160 192.168.0.191
192.168.5.192 192.168.0.223
192.168.5.224 192.168.0.255 <-- all ones
Traditionally, it was strongly recommended that subnet zero and the all-ones subnet not be used for addressing.
According to RFC 950 from 1985:
"It is useful to preserve and extend the interpretation of these
special (network and broadcast) addresses in subnetted networks. This
means the values of all zeros and all ones in the subnet field should
not be assigned to actual (physical) subnets."
Remember that this is a 1985 recommendation. More than 30 years have passed from then.
Using subnet zero for addressing is discouraged because of the confusion inherent in having a network (192.168.5.0)
and a subnet (192.169.5.0)
with indistinguishable addresses, and the all-ones subnet for the confusion inherent in having a network and a subnet with identical broadcast addresses (192.168.5.255)
.
This recommendation was overruled in 1995 by RFC-1878 and RFC-1812. So, nowadays we can use all the subnets and the devices' hardware /software support it.
Best Answer
First, classful routing is dead, and it has been for over 20 years, killed by VLSM and CIDR (see RFCs 1518 and 1519).
For IPv4 you cannot use the network or broadcast addresses as host address assignments. In your example,
192.168.1.0
is the network address, and192.168.1.255
is the broadcast address. Those addresses have special meaning to IPv4, and assigning them to hosts causes problems.There are a couple of exceptions to this:
/32
(255.255.255.255
) address only gives you one possible address. This is often used for loopback addresses, and the address must be routed./31
(255.255.255.254
) network has only two possible addresses, both of which can be used for host addresses. used for a point-to-point link. Meaning you can use both192.168.1.0
and192.168.1.1
(the only two available addresses) as host addresses. This is per RFC 3021 Using 31-Bit Prefixes on IPv4 Point-to-Point Links.So, Your example of increasing the number of networks using
/31
(255.255.255.254
) networks will work for point-to-point links.This only applies to IPv4, since IPv6 can use all the addresses in a subnet, even the first and last addresses.