Subnetting and Supernetting

 

Subnetting and Supernetting 

In classful addressing, IPv4 addresses were divided into Classes A, B, and C.

ClassDefault 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:

28=2562^8=256

addresses are available in the block.

Traditionally, two addresses are reserved:

  • Network address
  • Broadcast address

So there are:

256−2=254256-2=254

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:

2n≥42^n \geq 4

Therefore:

22=42^2=4

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:

24+2=2624+2=26

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 AddressHost RangeBroadcast
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:

26=642^6=64

addresses.

Usable host addresses:

64−2=6264-2=62

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:

23=82^3=8

Therefore, borrow 3 host bits.

Original:

Network | Host
16      | 16


After subnetting:

Network | Subnet | Host
16      | 3      | 13

New prefix:

16+3=1916+3=19

Therefore:

New prefix = /19
New mask   = 255.255.224.0

Each subnet contains:

213=81922^{13}=8192

addresses, or traditionally:

8192−2=81908192-2=8190

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:

4=224=2^2

we can combine them by reducing the prefix by 2 bits.

Original:

/24

New:

24−2=2224-2=22

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:

32−22=1032-22=10

host bits.

Therefore:

210=10242^{10}=1024

addresses are represented by the supernet.

Traditionally, the usable host count would be:

1024−2=10221024-2=1022

So:

4 × Class C networks
       ↓
4 × 256 = 1024 addresses
       ↓
One /22 supernet

Subnetting vs Supernetting

This is the most important comparison for students:

FeatureSubnettingSupernetting
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 benefitBetter network organizationReduce 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:

  1. Number of bits to borrow
  2. New subnet mask
  3. Number of subnets
  4. Number of hosts per subnet
  5. Network address of each subnet
  6. Broadcast address of each subnet

Answer

Need 4 subnets:

22=42^2=4

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

Popular posts from this blog

Computer Networks PCCST501 Semester 5 KTU CS 2024 Scheme - Dr Binu V P

Introduction to Computer Networks

TCP/IP Protocol Suite