Posts Tagged ‘IP Subnet’
Understanding IP Subnetting
July 1st, 2008 No Comments Posted in IP Address
IP Address Classes There are 5 different IP Address classes. By looking at the first 4 bits of IP address, it will determine which IP address class this belong:
Class A IP Address: Begin with bits pattern 0xxx, or 1 to 126 decimal.
Class B IP Address: Begin with bit pattern 10xx, or 128 to 191 decimal.
Class C IP Address: Begin with bit pattern 110x, or 192 to 223 decimal.
Class D IP Address: Begin with bit pattern 1110, or 224 to 239 decimal. It is reserved for multicasting
Class E IP Address: Begin with bit pattern 1111, or 240 to 254 decimal. It is reserved for future use.

Loopback Address Addresses beginning with 01111111, or 127 decimal, are reserved for loopback and for internal testing on a local machine.
Subnet Mask
A subnet mask is a 32-bit value that when compared with an IP address it distinguishes the network ID portion of the IP address from the host ID portion of the IP address. The network administrator creates a 32-bit subnet mask composed of 1s and 0s. The 1s in the subnet mask represent the positions that refer to the network or subnet addresses. Were as 0 portions in the subnet mask represent hosts or node addresses. Not all networks need subnets, meaning they use the default subnet mask. Another way, it is saying like a network does not have a subnet address. Here is IP Classes with their default subnet mask. As shown in the table below.
| IP Class | Default Subnet Mask | Subnet Mask(Binary) | No of Host Bits | No of Subnet Bits |
| Class A | 255.0.0.0 | 11111111.00000000.00000000.00000000 | 8 | 24 |
| Class B | 255.255.0.0 | 11111111.11111111.00000000.00000000 | 16 | 16 |
| Class C | 255.255.255.0 | 11111111.11111111.11111111.00000000 | 24 | 8 |
Note that default subnet masks for Classes A, B and C cannot change, that mean class C cannot have default subnet mask of Class A. For a Class A network, you can not change the first byte in a subnet mask; it must read 255.0.0.0 at a minimum. Similarly, you cannot assign 255.255.255.255, as this is all 1s a broadcast address. A Class B address must start with 255.255.0.0, and a Class C has to start with 255.255.255.0.
Subnetting IP Address
Subnetting allows you to create multiple logical networks that exist within a single Class A, B, or C network. If you do not subnet, you are only able to use one network from your Class A, B, or C network, which is unrealistic. Thus you can break a large network into smaller network called them subnet. Each network must have unique network ID. Every computer having same network ID belong to one network. If you break a major network (Class A, B, or C) into smaller subnetworks, it allows you to create a network of interconnecting subnetworks. Each data link on this network would then have a unique network/subnetwork ID. Any device, or gateway, connecting n networks/subnetworks has n distinct IP addresses, one for each network / subnetwork that it interconnects.
Lets look at the example:
As you see in the example above. The given subnet mask 255.255.255.224 is compared with class C default subnet mask 255.255.255.0 and it is found that three bits are 1s and five bits are 0s. So according to formula number of subnet =2n-2, which in this case give 23-2=6 subnets. Similarly number of host bits is 5. So number of hosts per subnet is =25-2=30 hosts. After doing AND operation with IP address and Subnet mask, as mentioned earlier gives subnet IP address that is 198.53.147.32
There are two ways to denote these masks. First, since you are using three bits more than the "natural" Class C mask, you can denote these addresses as having a 3-bit subnet mask. Or, secondly, the mask of 255.255.255.224 can also be denoted as /27 as there are 27 bits that are set in the mask. This second method is used with CIDR. Using this method, one of these networks can be described with the notation prefix/length. For example, 204.17.5.32/27 denotes the network 204.17.5.32 255.255.255.224. When appropriate the prefix/length notation is used to denote the mask throughout the rest of this document.
