Step
1 - IP
Address Basics
If
your organization has a /8 (class "A") IP network address, the first
octet
(8 bits) is assigned by InterNIC
and your organization can use the remaining 24 bits to define up to
16,777,214
hosts on your network. This is a lot of hosts! It is not possible to
put all of
these hosts on one physical network without separating them with
routers and
subnets. A workstation may be on one network or subnet and a server may
be on
another network or subnet. When the workstation needs to retrieve a
file from
the server it will need to use its subnet mask to determine the network
or
subnet that the server is on. The purpose of a subnet mask is to help
hosts and
routers determine the network location where a destination host can be
found.
Refer to the following table to review IP address classes, default
subnet masks
and the number of networks and hosts that can be created with each
class of
network address.
|
Cls |
1st |
1st Octet High Order Bits |
Network / Host ID (N=Network, H=Host) |
Default Subnet Mask |
Number of Networks |
Hosts per Network (usable addresses) |
|
A |
1 - 126* |
0 |
N.H.H.H |
255.0.0.0 |
126 (27 - 2) |
16,777,214 (2 24 - 2) |
|
B |
128 - 191 |
1 0 |
N.N.H.H |
255.255.0.0 |
16,384 (214) |
65,534 (2 16 - 2) |
|
C |
192 - 223 |
1 1
0 |
N.N.N.H |
255.255.255.0 |
2,097,152 (221) |
254 (2 8 - 2) |
|
D |
224 - 239 |
1 1
1 0 |
Reserved for Multicasting |
|||
|
E |
240 - 254 |
1 1
1 1 0 |
Experimental, used for research |
|||
Step 2 - The "ANDing"
process.
Step 3 - Two /24 (Class C) networks
using the default subnet mask.
This example will show how a /24 subnet mask can be used to determine which network a host is on. A subnet mask does not break an address into subnets. If the given subnet mask is used then the network is not being "subnetted".
Host X (source) on network 200.1.1.0 has an IP address of 200.1.1.5 and wants to send a packet to host Z (destination) on network 200.1.2.0 and has an IP address of 200.1.2.8. All hosts on each network are connected to hubs or switches and then to a router.
Remember
that with a /24 (Class C) network address
your Regional Internet Registry (RIR) assigns the first 3 octets (24
bits) as the network address so these are two different class C
networks. This
leaves one octet (8 bits) for hosts so each class C network could have
up to
254 hosts (28 = 256 - 2 = 254).

The ANDing
process will help the packet get from host 200.1.1.5 on network
200.1.1.0 to host 200.1.2.8 on network 200.1.2.0 using the following
steps.
|
Host
X IP address 200.1.1.5 |
11001000.00000001.00000001.00000101 |
|
Subnet
Mask 255.255.255.0 |
11111111.11111111.11111111.00000000 |
|
ANDing
Result (200.1.1.0) |
11001000.00000001.00000001.00000000 |
|
|
||
|
|
Host
Z IP address 200.1.2.8 |
11001000.00000001.00000010.00001000 |
|
Subnet
Mask 255.255.255.0 |
11111111.11111111.11111111.00000000 |
|
ANDing
Result (200.1.2.0) |
11001000.00000001.00000010.00000000 |
|
|
||
|
Step 4 - One /24 (Class C) network
using a Custom subnet mask.
This
example uses a single /24 network address (200.1.1.0) and will show how
a /24 subnet mask can be used to determine which subnetwork (or subnet)
a host is on and to route packets from one subnetwork to another.
Remember that with a /24 network address your RIR assigns the first 3
octets (24 bits) as the network address. This leaves 8 bits (one octet)
for hosts so each class C network could have up to 254 hosts (28
= 256 - 2 = 254).
Perhaps you want less than 254 host (workstations and servers) all on
one network and you want to create 2 sub-networks and separate them
with a router for security reason or to reduce traffic. This will
create smaller independent broadcast domains and can improve network
performance and increase security since these subnetworks will be
separated by a router. Assume you will need at least 2 subnetworks and
at least 50 hosts per subnetwork. Since you only have one Class C
network address you have only 8 bits in the fourth octet available for
a total of 254 possible hosts, you must create a Custom Subnet mask.
You will use the custom subnet mask to "BORROW" bits from the host
portion of the address. The following steps will help accomplish this:
|
Network
address: 200.1.1.0 |
|
|
|
|
|
|
|
|
|
4th
octet Host address bits: |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
|
Host
address bit values (from right) |
128 |
64 |
32 |
16 |
8 |
4 |
2
|
1
|
|
4th
Octet borrowed bits for subnet: |
1
|
1
|
1 |
1 |
1 |
1 |
1 |
1 |
|
Subnet
bit values: (from left side) |
128
|
64
|
32 |
16 |
8 |
4 |
2 |
1 |
|
Subnet
No. |
Subnet
bits borrowed Binary value |
Subnet
bits Decimal Value |
Host
bits possible binary values (range) (6 bits) |
Subnet
/ Host Decimal range |
Useable? |
|
Subnet
#0 |
00 |
0 |
000000
- 111111 |
0
- 63 |
YES |
|
Subnet
#1 |
01 |
|
64
000000 - 111111 |
64
- 127 |
YES |
|
Subnet #2 |
10 |
|
128
000000 - 111111 |
128
- 191 |
YES |
|
Subnet
#3 |
11 |
|
192
000000 - 111111 |
192
- 254 |
YES |
Step 5 - One /24 (Class C) network
using a Custom Subnet Mask.
|
Subnet
No. |
Subnet
bits borrowed (Binary value) |
Subnet
bits (Decimal value) |
Host bits possible binary values range |
Subnet
/ Host Decimal range |
Broadcast Address |
|
Subnet #0 |
|
|
|
|
|
|
Subnet #1 |
|
|
|
|
|
|
Subnet
#2 |
|
|
|
|
|
|
Subnet
#3 |
|
|
|
|
|
|
Subnet
#4 |
|
|
|
|
|
|
Subnet #5 |
|
|
|
|
|
|
Subnet
#6 |
|
|
|
|
|
|
Subnet
#7 |
|
|
|
|
|
Notes:
QUESTIONS: Use the table you just
developed above to
help answer the following questions:
![]()
![]()
How
many high-order bits were borrowed from the host bits in the fourth
octet?
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()