Networking for Beginners – Tutorial 6
Subnetting Made Easy – Learn Binary, VLSM & Real-World Examples
Course: Networking for Beginners to Advanced
Lesson: 6 of 30
Introduction
Subnetting is one of the most important networking skills. It divides a large network into smaller, more manageable networks, improving performance, security, and efficient IP address usage.
Whether you're configuring a Cisco switch, router, firewall, or deploying a Hikvision CCTV system, understanding subnetting is essential.
What is Subnetting?
Subnetting is the process of dividing one large IP network into multiple smaller networks (subnets).
Why Use Subnetting?
- Improves network performance
- Reduces broadcast traffic
- Enhances security
- Organizes departments or floors
- Conserves IP addresses
Example Without Subnetting
One Large Network 192.168.10.0/24 ├── HR Department ├── Finance ├── Sales ├── IT ├── CCTV └── Guests
All devices share the same broadcast domain.
Example With Subnetting
192.168.10.0/24 ├── HR → 192.168.10.0/26 ├── Finance → 192.168.10.64/26 ├── Sales → 192.168.10.128/27 ├── IT → 192.168.10.160/27 ├── CCTV → 192.168.10.192/27 └── Guests → 192.168.10.224/27
Each department has its own subnet, reducing unnecessary traffic.
Understanding Binary Numbers
Computers use binary (0 and 1).
| Decimal | Binary |
|---|---|
| 0 | 00000000 |
| 1 | 00000001 |
| 2 | 00000010 |
| 4 | 00000100 |
| 8 | 00001000 |
| 16 | 00010000 |
| 32 | 00100000 |
| 64 | 01000000 |
| 128 | 10000000 |
Binary Place Values
128 64 32 16 8 4 2 1
Example:
Decimal 192
128 + 64 = 192 Binary 11000000
CIDR Notation
| CIDR | Subnet Mask | Hosts |
|---|---|---|
| /24 | 255.255.255.0 | 254 |
| /25 | 255.255.255.128 | 126 |
| /26 | 255.255.255.192 | 62 |
| /27 | 255.255.255.224 | 30 |
| /28 | 255.255.255.240 | 14 |
| /29 | 255.255.255.248 | 6 |
| /30 | 255.255.255.252 | 2 |
Subnetting Example 1 (/24)
Network:
192.168.1.0/24
Network Address:
192.168.1.0
Usable Hosts:
192.168.1.1 ↓ 192.168.1.254
Broadcast Address:
192.168.1.255
Total Addresses:
256
Usable Hosts:
254
Subnetting Example 2 (/25)
Subnet Mask:
255.255.255.128
Subnets:
Subnet 1
Network 192.168.1.0
Hosts
192.168.1.1 ↓ 192.168.1.126
Broadcast
192.168.1.127
Subnet 2
Network 192.168.1.128
Hosts
192.168.1.129 ↓ 192.168.1.254
Broadcast
192.168.1.255
What is VLSM?
VLSM (Variable Length Subnet Mask) allows different subnet sizes within the same network.
Instead of giving every department the same number of IP addresses, VLSM lets you allocate only what each department needs.
Why Use VLSM?
Suppose your company has:
| Department | Devices |
|---|---|
| CCTV | 120 |
| IT | 40 |
| HR | 20 |
| Reception | 10 |
Using VLSM:
| Department | Suggested Subnet |
|---|---|
| CCTV | /25 (126 hosts) |
| IT | /26 (62 hosts) |
| HR | /27 (30 hosts) |
| Reception | /28 (14 hosts) |
This avoids wasting IP addresses.
Enterprise CCTV Example
A building has 9 floors, each with 30 IP cameras.
Assign each floor its own subnet:
| Floor | VLAN | Network |
|---|---|---|
| Floor 1 | 101 | 192.168.101.0/26 |
| Floor 2 | 102 | 192.168.102.0/26 |
| Floor 3 | 103 | 192.168.103.0/26 |
| Floor 4 | 104 | 192.168.104.0/26 |
| Floor 5 | 105 | 192.168.105.0/26 |
| Floor 6 | 106 | 192.168.106.0/26 |
| Floor 7 | 107 | 192.168.107.0/26 |
| Floor 8 | 108 | 192.168.108.0/26 |
| Floor 9 | 109 | 192.168.109.0/26 |
A /26 subnet provides 62 usable IP addresses, which is enough for:
- 30 Cameras
- PoE Switch
- Maintenance Laptop
- Future Expansion
Cisco VLAN Example
configure terminal vlan 101 name Floor_1 interface vlan 101 ip address 192.168.101.1 255.255.255.192 no shutdown ip routing end write memory
Practical Subnetting Exercise
Question
You need a subnet for 50 devices.
Which subnet should you choose?
| Option | Usable Hosts |
|---|---|
| /27 | 30 |
| /26 | 62 |
| /25 | 126 |
Answer
/26 is the best choice because it supports 62 usable hosts, enough for 50 devices with room for future growth.
Common Subnetting Mistakes
- Using duplicate IP addresses
- Choosing a subnet that's too small
- Incorrect subnet mask
- Wrong default gateway
- Overlapping subnets
- Forgetting the broadcast address
- Mixing devices from different VLANs without routing
Tips for Enterprise Networks
- Use one VLAN per floor or department.
- Reserve IP addresses for future expansion.
- Document your IP addressing plan.
- Assign static IP addresses to network infrastructure (switches, routers, firewalls, NVRs, and cameras).
- Use DHCP for user devices where appropriate.
Summary
After completing this lesson, you should understand:
- ✅ What subnetting is
- ✅ Why subnetting is important
- ✅ Binary basics
- ✅ CIDR notation
- ✅ Network, usable host, and broadcast addresses
- ✅ VLSM (Variable Length Subnet Mask)
- ✅ Practical subnetting examples
- ✅ Enterprise CCTV IP planning
- ✅ Basic Cisco VLAN configuration
Next Tutorial (Lesson 7)
DHCP, DNS, NAT & PAT Explained
In the next lesson, you'll learn:
- What DHCP is and how it automatically assigns IP addresses
- What DNS is and how domain names are translated into IP addresses
- What NAT (Network Address Translation) is
- What PAT (Port Address Translation) is
- Static NAT vs Dynamic NAT
- DHCP configuration on Cisco devices
- Real-world enterprise and Hikvision CCTV networking examples
By the end of Lesson 7, you'll understand how devices obtain IP addresses, access the internet, and communicate with external networks securely.
0 Comments