Network administrators sometimes need to divide networks, especially large ones, into smaller networks.These smaller divisions are called subnetworks and provide addressing flexibility. Most of the time subnetworks are simply referred to as subnets each subnet address is unique. Subnet addresses include the Class A, Class B, or Class C network portion, plus a subnet field and a host field.
The subnet field and the host field are created from the original host portion for the entire network.To create a subnet address, a network administrator borrows bits from the original host portion and designates them as the subnet field. The minimum number of bits that can be borrowed is 2.
Why Subnetting Is Used ?
A primary reason for using subnets is to reduce the size of a broadcast domain.When broadcast traffic begins to consume too much of the available bandwidth, network administrators may choose to reduce the size of the broadcast domain.
The subnet mask (formal term: extended network prefix), is not an address, but determines which part of an IP address is the network field and which part is the host field. A subnet mask is 32 bits long and has 4 octets, just like an IP address. To determine the subnet mask for a particular subnetwork IP address follow these steps:
- Express the subnetwork IP address in binary form
- Replace the network and subnet portion of the address with all 1s
- Replace the host portion of the address with all 0s
- As the last step convert the binary expression back to dotted-decimal notation.
The term “operations” in mathematics refers to rules that define how one number combines with other numbers. The basic Boolean operations are AND, OR, and NOT.
In order to route a data packet, the router must first determine the destination network/subnet address by performing a logical AND using the destination host’s IP address and the subnet mask.The result will be the network/subnet address.The router has received a packet for host 18.104.22.168 – it uses the AND operation to learn that this packet should be routed to subnet 22.214.171.124. The process used to apply the subnet mask involves Boolean Algebra to filter out non-matching bits to identify the network address.Boolean Algebra is a process that applies binary logic to yield binary results. Working with subnet masks, you need only 4 basic principles of Boolean Algebra:
- 1 and 1 = 1
- 1 and 0 = 0
- 0 and 1 = 0
- 0 and 0 = 0.
In another words, the only way you can get a result of a 1 is to combine 1 & 1. Everything else will end up as a 0. The process of combining binary values with Boolean Algebra is called Anding.
Default Subnet Masks
There are default standard subnet masks for IP Address Classes (Class A, B and C addresses):
Subnet masks apply only to Class A, B or C IP addresses. The subnet mask is like a filter that is applied to a message’s destination IP address. Its objective is to determine if the local network is the destination network.
The subnet mask goes like this: If a destination IP address is 126.96.36.199, we know that it is a Class C address & that its binary equivalent is: 11001110.10101111.10100010.00010101
We also know that the default standard Class C subnet mask is: 255.255.255.0 and that its binary equivalent is: 11111111.11111111.11111111.00000000
When these two binary numbers (the IP address & the subnet mask) are combined using Boolean Algebra, the Network ID of the destination network is the result: