Subnetting and Supernetting
Subnetting and Supernetting
In classful addressing, IPv4 addresses were divided into Classes A, B, and C.
| Class | Default prefix | Default subnet mask | Network bits | Host bits |
|---|---|---|---|---|
| A | /8 | 255.0.0.0 | 8 | 24 |
| B | /16 | 255.255.0.0 | 16 | 16 |
| C | /24 | 255.255.255.0 | 24 | 8 |
The basic idea is:
- Subnetting: Divide one large network into several smaller networks.
- Supernetting: Combine several smaller networks into one larger logical network.
Subnetting
Definition
Subnetting is the process of dividing a single network into multiple smaller networks called subnets.
The important point is:
Subnetting borrows some bits from the host portion and uses them as subnet bits.
So:
Original: Network bits | Host bits After subnetting: Network bits | Subnet bits | Host bits
The total number of network + subnet bits becomes the new network prefix.
Example of Subnetting a Class C Network
Suppose an organization has:
Network: 192.168.10.0
Since it is a Class C address:
Default mask = 255.255.255.0 Prefix = /24
Binary representation:
192.168.10.0 11000000.10101000.00001010.00000000 |--------- Network ---------|--Host--| 24 bits 8 bits
A Class C network has 8 host bits.
Therefore, without subnetting:
addresses are available in the block.
Traditionally, two addresses are reserved:
- Network address
- Broadcast address
So there are:
usable host addresses.
Suppose We Need 4 Subnets
Assume the organization has four departments:
- Computer Science
- Mechanical
- Electrical
- Civil
Instead of putting all computers into one large network, we want 4 smaller networks.
We need to borrow bits from the host portion.
We need:
Therefore:
So we borrow 2 host bits.
The original structure was:
Network Host 24 bits 8 bits
After borrowing 2 bits:
Network Subnet Host 24 bits 2 bits 6 bits
The new prefix is:
So the new subnet mask is:
/26
or
255.255.255.192
Finding the Four Subnets
The last octet of the mask is:
192 = 11000000
Therefore:
Subnet bits = 11 10 01 00
The four subnets are:
| Subnet | Network Address | Host Range | Broadcast |
|---|---|---|---|
| 1 | 192.168.10.0/26 | 192.168.10.1 – 192.168.10.62 | 192.168.10.63 |
| 2 | 192.168.10.64/26 | 192.168.10.65 – 192.168.10.126 | 192.168.10.127 |
| 3 | 192.168.10.128/26 | 192.168.10.129 – 192.168.10.190 | 192.168.10.191 |
| 4 | 192.168.10.192/26 | 192.168.10.193 – 192.168.10.254 | 192.168.10.255 |
Each subnet has:
addresses.
Usable host addresses:
So we have transformed:
One Class C network ↓ 192.168.10.0/24 ↓ Four smaller subnets ↓ /26 /26 /26 /26
Why is this useful?
For example:
192.168.10.0/26 Computer Science 192.168.10.64/26 Mechanical 192.168.10.128/26 Electrical 192.168.10.192/26 Civil
Each department gets its own subnet.
Another Simple Subnetting Example
Suppose we have:
172.16.0.0
This is a Class B network.
Default:
Network = 16 bits Host = 16 bits Default prefix = /16 Mask = 255.255.0.0
Suppose we need 8 subnets.
We need:
Therefore, borrow 3 host bits.
Original: Network | Host 16 | 16 After subnetting: Network | Subnet | Host 16 | 3 | 13
New prefix:
Therefore:
New prefix = /19 New mask = 255.255.224.0
Each subnet contains:
addresses, or traditionally:
usable host addresses.
So subnetting allows a Class B network to be divided into 8 smaller networks.
What Exactly Happens During Subnetting?
This is the key concept students should remember.
Before subnetting
For Class C:
192.168.10.0/24 11000000.10101000.00001010.XXXXXXXX |------------- Network -------------|Host| 24 8
After borrowing 2 bits
11000000.10101000.00001010.SSXXXXXX |------------- Network -------------| | | 2 subnet bits | 6 host bits
So:
Subnetting = borrowing host bits to create additional subnetworks.
Supernetting
Now let's look at the opposite concept.
Definition
Supernetting is the process of combining multiple smaller networks into one larger logical network.
So instead of:
One large network ↓ Many smaller networks
we do:
Many smaller networks ↓ One larger network
Supernetting is therefore sometimes called route aggregation or route summarization.
Supernetting Example with Class C Networks
Suppose an organization has four Class C networks:
192.168.0.0/24 192.168.1.0/24 192.168.2.0/24 192.168.3.0/24
Instead of advertising four separate networks to a router, we want to combine them into one larger network.
There are 4 networks.
Since:
we can combine them by reducing the prefix by 2 bits.
Original:
/24
New:
Therefore, these four networks can be represented by:
192.168.0.0/22
The corresponding subnet mask is:
255.255.252.0
Why /22?
Let's look at the third octet.
The four networks are:
192.168.0.0 192.168.1.0 192.168.2.0 192.168.3.0
Their third octets in binary are:
0 = 00000000 1 = 00000001 2 = 00000010 3 = 00000011
The first 6 bits are common:
000000
The last 2 bits vary.
Therefore, those 2 bits can be used to represent the four /24 networks.
192.168.0.0/24 192.168.1.0/24 192.168.2.0/24 192.168.3.0/24 ↓ 192.168.0.0/22
How Many Addresses Does the Supernet Have?
A /22 leaves:
host bits.
Therefore:
addresses are represented by the supernet.
Traditionally, the usable host count would be:
So:
4 × Class C networks ↓ 4 × 256 = 1024 addresses ↓ One /22 supernet
Subnetting vs Supernetting
This is the most important comparison for students:
| Feature | Subnetting | Supernetting |
|---|---|---|
| Purpose | Divide a large network | Combine smaller networks |
| Direction | One → many | Many → one |
| Bits | Borrow host bits | Give up/reduce network bits |
| Prefix | Becomes longer | Becomes shorter |
| Example | /24 → /26 | /24 + /24 + /24 + /24 → /22 |
| Main benefit | Better network organization | Reduce routing-table entries |
Easy memory trick
Subnetting = Split
Supernetting = Combine
Very Important: Classful vs Classless Addressing
There is an important historical point here.
Classful addressing originally used fixed prefixes:
Class A → /8 Class B → /16 Class C → /24
Subnetting allowed an organization to borrow bits from the host portion.
For example:
Class C /24 → /26
The organization still has a Class C network, but it has been divided into smaller subnets.
Supernetting goes in the opposite direction:
Several Class C /24 networks ↓ /22
However, supernetting is fundamentally associated with CIDR/classless addressing, which was introduced to overcome the limitations of the old classful system.
Subnetting can be demonstrated within classful networks, whereas supernetting became an important feature of classless addressing/CIDR, where multiple contiguous network blocks can be aggregated.
Subnetting and Classless Addressing
There is a useful connection with what we discussed earlier.
In subnetting, we make the prefix longer:
192.168.10.0/24 ↓ 192.168.10.0/26
One larger network is divided into smaller networks.
In classless addressing, the /26 does not need to be thought of as a "Class C subnet"—it is simply a CIDR block with a 26-bit prefix.
Similarly, supernetting/route aggregation can combine contiguous blocks:
192.168.0.0/24 192.168.1.0/24 192.168.2.0/24 192.168.3.0/24 ↓ 192.168.0.0/22
Thus CIDR provides a much more flexible addressing system.
A Good Classroom Example
Problem
An organization has the Class C network:
192.168.50.0/24
It has four departments and wants a separate subnet for each department.
Ask students to find:
- Number of bits to borrow
- New subnet mask
- Number of subnets
- Number of hosts per subnet
- Network address of each subnet
- Broadcast address of each subnet
Answer
Need 4 subnets:
Borrow 2 bits.
Old prefix = /24 New prefix = /26
Mask:
255.255.255.192
Result:
192.168.50.0/26 192.168.50.64/26 192.168.50.128/26 192.168.50.192/26
Each subnet has 64 addresses and 62 traditionally usable host addresses.
Summary
Subnetting:
Divide one network into smaller networks by borrowing host bits.
Supernetting:
Combine multiple contiguous smaller networks into one larger address block by reducing the network prefix.
Comments
Post a Comment