N
Naval Kishor Upadhyay
Guest
At first, IP addresses and subnetting look difficult, full of numbers and strange masks. But in reality, they are just a way to organize devices, like dividing houses into streets. Letβs go step by step with simple examples.
An IP address is like a digital house number for a device on a network.
Example:
It has two parts:
The subnet mask tells us how many bits belong to the network and how many are left for hosts.
Example:
So
Subnetting is like dividing a big apartment block into smaller buildings. Instead of one very large network, you create smaller, more organized networks.
Example:
You have
If everyone stays in one flat network, there will be chaos (too many devices shouting in the same broadcast domain).
By subnetting, you split into smaller groups.
Letβs take
So the mask is 255.255.255.128.
So now you can put HR in the first subnet and Sales in the second.
Now letβs cut
So the mask is 255.255.255.192.
Now each subnet can handle a small team of up to 62 devices.
Thatβs why from 256 addresses in a
This way, you can see how subnetting divides a big block into smaller chunks.
IP addressing is like giving houses numbers on streets. Subnetting is like dividing the city into districts. With just a few rules, you can design networks that are neat, scalable, and efficient.
Continue reading...
What Is an IP Address?
An IP address is like a digital house number for a device on a network.
Example:
Code:
192.168.1.10
It has two parts:
- Network part β like the street name.
- Host part β like the house number on that street.
Subnet Masks and CIDR
The subnet mask tells us how many bits belong to the network and how many are left for hosts.
Example:
Code:
IP Address: 192.168.1.10
Subnet Mask: 255.255.255.0
CIDR: /24
/24
means: first 24 bits are for the network.- This leaves 8 bits for hosts β 2^8 = 256 addresses.
- From those, 254 are usable (2 are reserved: network and broadcast).
So
192.168.1.0/24
can have 254 devices.Why Subnetting?
Subnetting is like dividing a big apartment block into smaller buildings. Instead of one very large network, you create smaller, more organized networks.
Example:
You have
192.168.1.0/24
(254 devices possible). But your company has three teams:- HR β needs 50 devices
- IT β needs 50 devices
- Sales β needs 100 devices
If everyone stays in one flat network, there will be chaos (too many devices shouting in the same broadcast domain).
By subnetting, you split into smaller groups.
Simple Subnet Example: /25
Letβs take
192.168.1.0/24
and cut it in half.- Subnet mask:
/25
=255.255.255.128
Why does /25 equal 255.255.255.128?
/25
means the first 25 bits of the 32-bit address are used for the network.- In binary, the mask looks like this:
Code:
11111111.11111111.11111111.10000000
- Convert each 8-bit block into decimal:
11111111
= 25511111111
= 25511111111
= 25510000000
= 128
So the mask is 255.255.255.128.
- The remaining 7 bits are for hosts β 2^7 = 128 addresses β 126 usable.
Subnetting Result
Subnet | Network Addr | Host Range | Broadcast Addr |
---|---|---|---|
192.168.1.0/25 | 192.168.1.0 | 192.168.1.1β126 | 192.168.1.127 |
192.168.1.128/25 | 192.168.1.128 | 192.168.1.129β254 | 192.168.1.255 |
So now you can put HR in the first subnet and Sales in the second.
Smaller Subnet Example: /26
Now letβs cut
/24
into 4 equal parts.- Subnet mask:
/26
=255.255.255.192
Why does /26 equal 255.255.255.192?
/26
means the first 26 bits are for the network.- In binary, the mask looks like this:
Code:
11111111.11111111.11111111.11000000
- Convert each 8-bit block into decimal:
11111111
= 25511111111
= 25511111111
= 25511000000
= 192
So the mask is 255.255.255.192.
- The remaining 6 bits are for hosts β 2^6 = 64 addresses β 62 usable.
Subnetting Result
Subnet | Host Range | Broadcast Addr |
---|---|---|
192.168.1.0/26 | 192.168.1.1β62 | 192.168.1.63 |
192.168.1.64/26 | 192.168.1.65β126 | 192.168.1.127 |
192.168.1.128/26 | 192.168.1.129β190 | 192.168.1.191 |
192.168.1.192/26 | 192.168.1.193β254 | 192.168.1.255 |
Now each subnet can handle a small team of up to 62 devices.
Shortcut Rules (No Math Needed)
/24
β 256 total β 254 usable/25
β 128 total β 126 usable/26
β 64 total β 62 usable/30
β 4 total β 2 usable (for point-to-point links)
Why 2 Addresses Are Reserved?
Network address β the first address in the subnet. It represents the subnet itself. Routers use it in routing tables.
- Example: in
192.168.1.0/24
, the first address (192.168.1.0
) is the network.
- Example: in
Broadcast address β the last address in the subnet. It is used to send a message to all devices in that subnet.
- Example: in
192.168.1.0/24
, the last address (192.168.1.255
) is the broadcast.
- Example: in
Thatβs why from 256 addresses in a
/24
, only 254 are usable for devices.Visual Diagram of Subnetting
/24
β One Big Subnet
Code:
192.168.1.0 ---------------------------- 192.168.1.255
(254 usable hosts in one network)
/25
β Two Subnets
Code:
192.168.1.0 -------- 192.168.1.127 | 192.168.1.128 -------- 192.168.1.255
(126 hosts) (126 hosts)
/26
β Four Subnets
Code:
192.168.1.0 -- 63 | 192.168.1.64 -- 127 | 192.168.1.128 -- 191 | 192.168.1.192 -- 255
(62 hosts) (62 hosts) (62 hosts) (62 hosts)
This way, you can see how subnetting divides a big block into smaller chunks.
Why It Matters
- Organizes networks β like splitting a big city into smaller neighborhoods.
- Improves performance β less βnoiseβ from broadcast traffic.
- Adds security β different teams/devices can be separated.
Conclusion
IP addressing is like giving houses numbers on streets. Subnetting is like dividing the city into districts. With just a few rules, you can design networks that are neat, scalable, and efficient.
Continue reading...