IP subnetting is the process of dividing a large IP network into smaller, more manageable subnetworks or subnet
IP subnetting involves partitioning the IP address space to create multiple logical networks within a single physical network. This is done by borrowing bits from the host portion of the IP address to create the subnet portion.
Why Subnetting is Important
- Optimizing IP Address Allocation With the rapid growth of the internet and connected devices, conserving IP addresses has become crucial. Subnetting allows you to use IP address space more efficiently by assigning smaller blocks of addresses to individual subnets, preventing wastage.
- Efficient Network Management Smaller subnets make it easier to manage and troubleshoot network issues. It helps in localizing problems within specific segments of the network, reducing the scope of network-wide outages.
- Reducing Broadcast Traffic In a flat network (no subnets), broadcast messages are sent to all devices in the network. As the network grows, this broadcast traffic can become overwhelming. Subnetting breaks the network into smaller broadcast domains, reducing the number of devices that receive broadcast messages.
- Enhancing Security Subnets create natural boundaries that can act as security perimeters. By controlling the flow of traffic between subnets, you can implement security measures and restrict communication between different parts of the network.
IP Address Classes and Reservations
IP address classes were a way of categorizing IP addresses into different ranges to accommodate varying sizes of networks. However, it’s important to note that the classful IP addressing system is now considered deprecated, and CIDR (Classless Inter-Domain Routing) is used for IP addressing and subnetting instead. Still, it’s useful to understand the concept.
Private IP addresses are non-routable addresses used within private networks and are not meant to be used on the public internet. These addresses are defined in RFC 1918 and are used to allow multiple devices within a private network to share a single public IP address.
Devices within a private network can communicate with each other using these private IP addresses, and a router with Network Address Translation (NAT) capability allows these devices to access the internet using a single public IP address. This helps conserve public IP addresses and ensures better security for internal networks. See the table below for IP address classes and reserved private IP addresses:
IP Address Classes and Range
Class | Format | IP Range | Default Subnet Mask |
---|---|---|---|
A | network.host.host.host | 0.0.0.0 - 127.255.255.255 | 255.0.0.0 |
B | network.network.host.host | 128.0.0.0 - 191.255.255.255 | 255.255.0.0 |
C | network.network.network.host | 192.0.0.0 - 223.255.255.255 | 255.255.255.0 |
D | Multicast | 224.0.0.0 - 239.255.255.255 | None |
E | Research | 240.0.0.0 - 255.255.255.255 | None |
Reserved Private IP Address Space
Class A | 10.0.0.0 - 10.255.255.255 |
---|---|
Class B | 172.16.0.0 - 172.31.255.255 |
Class C | 192.168 - 192.168.255.255 |
LocalHost | 127.0.0.0 - 127.255.255.255 |
ZeroConf. | 169.254 - 169.254.255.255 |
Subnet Mask
The subnet mask is a critical component of IP subnetting. It helps devices determine which part of an IP address belongs to the network, which part belongs to the subnet, and which part is for the host (specific device). The subnet mask is expressed in the same format as an IP address (e.g., 255.255.255.0). It has ones (1) in the bit positions corresponding to the network and subnet parts, and zeros (0) in the bit positions corresponding to the host part.
Word Notation | Decimal Notation | Binary Notation |
---|---|---|
IP Address | 192.168.1.10 | 11000000.10101000.00000001.00001010 |
Subnet Mask | 255.255.255.0 | 11111111.11111111.11111111.00000000 |
For example, in the IP address 192.168.1.10 with a subnet mask of 255.255.255.0 (or /24 in CIDR notation), the first 24 bits represent the network and subnet, while the remaining 8 bits represent the host part.
Subnet Mask | Wildcard | ||
---|---|---|---|
0 | 00000000 | 255 | 11111111 |
128 | 10000000 | 127 | 01111111 |
192 | 11000000 | 63 | 00111111 |
224 | 11100000 | 31 | 00011111 |
240 | 11110000 | 15 | 00001111 |
248 | 11111000 | 7 | 00000111 |
252 | 11111100 | 3 | 00000011 |
254 | 11111110 | 1 | 00000001 |
255 | 11111111 | 0 | 00000000 |
Classless Inter-Domain Routing (CIDR)
CIDR is a notation used to represent the subnet mask and IP address together. It helps simplify the representation of subnet masks. In CIDR notation, the subnet mask is represented as a forward slash followed by the number of bits set to 1 in the mask. For example, /24 represents a subnet mask of 255.255.255.0.
CIDR Chart
CIDR | Subnet Mask | No. of Addresses | Wildcard |
---|---|---|---|
/32 | 255.255.255.255 | 1 | 0.0.0.0 |
/31 | 255.255.255.254 | 2 | 0.0.0.1 |
/30 | 255.255.255.252 | 4 | 0.0.0.3 |
/29 | 255.255.255.248 | 8 | 0.0.0.7 |
/28 | 255.255.255.240 | 16 | 0.0.0.15 |
/27 | 255.255.255.224 | 32 | 0.0.0.31 |
/26 | 255.255.255.192 | 64 | 0.0.0.63 |
/25 | 255.255.255.128 | 128 | 0.0.0.127 |
/24 | 255.255.255.0 | 256 | 0.0.0.255 |
/23 | 255.255.254.0 | 512 | 0.0.1.255 |
/22 | 255.255.252.0 | 1024 | 0.0.3.255 |
/21 | 255.255.248.0 | 2048 | 0.0.7.255 |
/20 | 255.255.240.0 | 4096 | 0.0.15.255 |
/19 | 255.255.224.0 | 8192 | 0.0.31.255 |
/18 | 255.255.192.0 | 16384 | 0.0.63.255 |
/17 | 255.255.128.0 | 32768 | 0.0.127.255 |
/16 | 255.255.0.0 | 65536 | 0.0.255.255 |
/15 | 255.254.0.0 | 131072 | 0.1.255.255 |
/14 | 255.252.0.0 | 262144 | 0.3.255.255 |
/13 | 255.248.0.0 | 524288 | 0.7.255.255 |
/12 | 255.240.0.0 | 1048576 | 0.15.255.255 |
/11 | 255.224.0.0 | 2097152 | 0.31.255.255 |
/10 | 255.192.0.0 | 4194304 | 0.63.255.255 |
/9 | 255.128.0.0 | 8388608 | 0.127.255.255 |
/8 | 255.0.0.0 | 16777216 | 0.255.255.255 |
/7 | 254.0.0.0 | 33554432 | 1.255.255.255 |
/6 | 252.0.0.0 | 67108864 | 3.255.255.255 |
/5 | 248.0.0.0 | 134217728 | 7.255.255.255 |
/4 | 240.0.0.0 | 268435456 | 15.255.255.255 |
/3 | 224.0.0.0 | 536870912 | 31.255.255.255 |
/2 | 192.0.0.0 | 1073741824 | 63.255.255.255 |
/1 | 128.0.0.0 | 2147483648 | 127.255.255.255 |
/0 | 0.0.0.0 | 4294967296 | 255.255.255.255 |
IP Block Sizes
Prefix | Mask | Host | Block Size |
---|---|---|---|
/25 | 128 | 126 | 128 |
/26 | 192 | 62 | 64 |
/27 | 224 | 30 | 32 |
/28 | 240 | 14 | 16 |
/29 | 248 | 6 | 8 |
/30 | 252 | 2 | 4 |
Subnetting Process
The subnetting process involves determining the number of subnets required and the number of hosts in each subnet. It’s essential to strike a balance between the number of subnets and the number of hosts needed in each subnet. You must also consider future growth when designing subnets.
There are various subnetting methods, such as fixed length, variable length, and subnetting using VLSM (Variable Length Subnet Masking), which allows subnets to have different sizes based on their specific requirements. Understanding subnet masks and CIDR notation is essential for proper IP subnetting design.
Brief VLSM Subnetting Chart
Subnet | 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128 | 256 |
---|---|---|---|---|---|---|---|---|---|
Host | 256 | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
Subnet Mask | /24 | /25 | /26 | /27 | /28 | /29 | /30 | /31 | /32 |