Sounds like you're getting a couple of things mixed up which might explain why this is confusing. Let's look at your first example where your assumptions were not correct:
Network: 150.1.0.0/255.255.240.0. The Network and Broadcasts are at the beginning and end of the subnet and do not fall on octet boundaries. So in this case the network we're talking about is this:
First IP is the Subnet ID: 150.1.0.0
Last IP is the Broadcast Address: 150.1.15.255
Everything in the middle is a usable/assignable IP address to hosts:
150.1.0.1 - 150.1.15.254
As long as the hosts have a 255.255.240 subnet mask then the following IP's are all valid for hosts: 150.1.0.255, 150.1.2.0, 150.1.2.255, 150.1.3.0, and so on. Those aren't reserved for Subnet ID's or Broadcasts because the Mask of 255.255.240 tells you that they are in the middle of the Subnet identified above.
In terms of the various boundaries you can get with a 255.255.240 mask for the 150.1.x.x example you get 16 (not 14). The subnets themselves are not unusable. Only the first/last IP's within the subnet are what can't be used for host assignments. So you get the following:
150.1.0.0/255.255.240.0:
150.1.16.0/255.255.240.0
150.1.32.0/255.255.240.0
150.1.48.0/255.255.240.0
150.1.64.0/255.255.240.0
150.1.80.0/255.255.240.0
150.1.96.0/255.255.240.0
150.1.112.0/255.255.240.0
150.1.128.0/255.255.240.0
150.1.144.0/255.255.240.0
150.1.160.0/255.255.240.0
150.1.176.0/255.255.240.0
150.1.192.0/255.255.240.0
150.1.208.0/255.255.240.0
150.1.224.0/255.255.240.0
150.1.240.0/255.255.240.0
Again, the first/last IP's within each subnet above is the Network ID and Broadcast Address. What is in between is all usable for hosts (each has 4094 assignable IP).
To break this down in terms of bits for an IPv4 (32 bits) you get this:
150.1.0.0/255.255.240.0:
_____150 . _______1 . _______0 . _______0 Subnet
10010110 . 00000001 . 00000000 . 00000000
_____255 . _____255 . _____240 . _______0 Mask
11111111 . 11111111 . 11110000 . 00000000
nnnnnnnn . nnnnnnnn . nnnnhhhh . hhhhhhhh
So looking at the 3rd octet only you have the following
nnnnhhhh
Your n's are these:
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
1100
1101
1110
1111
When you add the h's you get 4 zero's in front of the above as follows:
0000 0000 = 0
0001 0000 = 16
0010 0000 = 32
0011 0000 = 48
0100 0000 = 64
0101 0000 = 80
0110 0000 = 96
0111 0000 = 112
1000 0000 = 128
1001 0000 = 144
1010 0000 = 160
1011 0000 = 176
1100 0000 = 192
1101 0000 = 208
1110 0000 = 224
1111 0000 = 240
So anything in the h's will be assigned to hosts within that subnet and anything in the n's will be a different subnet.
Does that help?
|