SUBNETTING A NETWORk
SUBNETTING A NETWORk
Subnetting is the process of dividing a larger network into smaller, manageable sub-networks
(subnets).
Purpose:
Key Concepts
IP Address Structure:
An IP address consists of two parts: the network portion and the host portion.
Example (IPv4): 192.168.1.0/24 (the /24 indicates that the first 24 bits are the network part).
Subnet Mask:
A subnet mask defines the boundary between the network and host portions.
You should now be able to give IP addresses to 254 hosts. It works fine if all 150 computers
are on a single network. However, your 150 computers are on three separate physical
networks. Instead of requesting more address blocks for each network, you divide your
network into subnets that enable you to use one block of addresses on multiple physical
networks.
In this case, you divide your network into four subnets by using a subnet mask that makes the
network address larger and the possible range of host addresses smaller. In other words, you
are 'borrowing' some of the bits used for the host address, and using them for the network
portion of the address. The subnet mask 255.255.255.192 gives you four networks of 62 hosts
each. It works because in binary notation, 255.255.255.192 is the same as
1111111.11111111.1111111.11000000. The first two digits of the last octet become network
addresses, so you get the additional networks 00000000 (0), 01000000 (64), 10000000 (128)
and 11000000 (192). (Some administrators will only use two of the subnetworks using
255.255.255.192 as a subnet mask. In these four networks, the last six binary digits can be
used for host addresses.
Using a subnet mask of 255.255.255.192, your 192.168.123.0 network then becomes the four
networks 192.168.123.0, 192.168.123.64, 192.168.123.128 and 192.168.123.
192. These four networks would have as valid host addresses:
Remember, again, that binary host addresses with all ones or all zeros are invalid, so you
can't use addresses with the last octet of 0, 63, 64, 127, 128, 191, 192, or 255.
You can see how it works by looking at two host addresses, 192.168.123.71 and
192.168.123.133. If you used the default Class C subnet mask of 255.255.255.0, both
addresses are on the 192.168.123.0 network. However, if you use the subnet mask of
255.255.255.192, they are on different networks; 192.168.123.71 is on the 192.168.123.64
network, 192.168.123.133 is on the 192.168.123.128 network.
Default gateways
If a TCP/IP computer needs to communicate with a host on another network, it will usually
communicate through a device called a router. In TCP/IP terms, a router that is specified on a
host, which links the host's subnet to other networks, is called a default gateway. This section
explains how TCP/IP determines whether or not to send packets to its default gateway to
reach another computer or device on the network.
When a host attempts to communicate with another device using TCP/IP, it performs a
comparison process using the defined subnet mask and the destination IP address versus the
subnet mask and its own IP address. The result of this comparison tells the computer whether
the destination is a local host or a remote host.
If the result of this process determines the destination to be a local host, then the computer
will send the packet on the local subnet. If the result of the comparison determines the
destination to be a remote host, then the computer will forward the packet to the default
gateway defined in its TCP/IP properties. It's then the responsibility of the router to forward
the packet to the correct subnet.