Hello Sam7074,
Let's explain first what a Class B address is. Using
http://www.geocities.com/SiliconValley/Vista/8672/network/ipaddr.html
as a guide (#20 through #24), a Class B address has two parts
- Network ID - two bytes (up to 16384 possible networks)
- Host ID - two bytes (up to 65534 possible hosts)
Note that the number of hosts is 2^16-2 to account for reserved values
XXX.YYY.000.000
and
XXX.XXX.255.255
the first one is sometimes used to refer to the "local host" (though
127.0.0.1 is typical as well) and the latter one is a directed
broadcast (#31). This is based on RFC 950 at
http://www.faqs.org/rfcs/rfc950.html
which defines the Internet Standard Subnetting Procedure. Near the end
of section 2.1, it describes this assignment of these two values.
Other sites with basically the same answer include:
http://linux.cudeso.be/tcpip1.php
(see also the calculator link at the end of the page)
http://wks.uts.ohio-state.edu/sysadm_course/html/sysadm-341.html
or search with a phrase like
class b maximum hosts
If subnetting is allowed, you basically allocate additional bits to
the Network ID and fewer to the Host ID. With two subnets (0 and 1),
the number of bits available to the Host ID is 15, or 32768 possible
values for each subnet. Again, if you reserve two addresses per subnet
(000.000, and 127.255 in this case), you get 32766 possible hosts per
subnet or 65532 total hosts. If you do more subnets, the number of
reserved addresses increases (two per subnet), so the maximum number
of subnetted hosts is when a single bit is used for the subnet.
The calculator at
http://www.agt.net/public/sparkman/netcalc.htm
can be used to demonstrate that relationship. To use it, click on
Class B near the top, select 2 as the number of subnets and then click
on calculate to see the results below. Note this calculator gives you
the total number of addresses (assuming none are reserved). Follow
this link
http://www.agt.net/public/sparkman/network/netcalchelp.htm#allzeroes
to get an explanation of how more modern protocols and routers may
allow you to use all possible values. Note in particular the caution
about answering questions that may be on exams to be aware of the
differences with classless networks.
There is also a good reference at
http://www.redhat.com/advice/tips/ipnetworking.html
which has a table near the end showing six subnets allocated from a
class C address range with up to 30 hosts in each subnet.
The subnet mask is basically a bit pattern that can be used to extract
the Network ID from the IP address. Without subnetting, the class B
addresses has a subnet mask of
255.255.0.0
With two class B subnets, the subnet mask is
255.255.128.0
That represents the value at which the maximum number of subnetted
hosts is reached. This is sometimes referred to as a /17 subnet mask,
representing a 17 bit wide mask value.
To recap, a Class B without subnetting and with reserved addresses has
65534
host addresses. With two subnets (0 and 1), the maximum number of hosts drops to
65532
with half (32766) in each subnet. The subnet mask corresponding to this is
255.255.128.0 (or /17)
If any part of this answer is unclear or you need a more complete
explanation, please make a clarification request. I would be glad to
help you on this kind of research.
--Maniac |