IPv4 Subnetting Explained Deeply — CIDR, Subnet Masks, Binary, Block Size & Full Subnetting Examples

Hacking Truth
0

 

IPv4 Subnetting Explained Deeply — CIDR, Subnet Masks, Binary, Block Size & Full Subnetting Examples



IPv4 Subnetting Explained Deeply — CIDR, Subnet Masks, Binary, Block Size & Full Subnetting Examples


Subnetting is one of the most important concepts in computer networking. Whether you are preparing for CCNA, working as a System Administrator, learning DevOps, configuring routers, or building enterprise networks, understanding IPv4 subnetting is mandatory.

At first, subnetting looks confusing because it involves binary calculations, CIDR notation, subnet masks, network IDs, broadcast addresses, and block sizes. But once you understand the logic behind bits and binary conversion, subnetting becomes much easier.

An IPv4 address consists of 32 bits divided into 4 octets. Each octet contains 8 bits.



Example:

192.168.1.10

4 octets

8 bits per octet

8 × 4 = 32 bits


The binary representation of the IPv4 address is:

11000000.10101000.00000001.00001010


In subnetting, we divide the IP address into two parts:

  • Network portion
  • Host portion


This separation is controlled by the subnet mask or CIDR notation.


Understanding CIDR Notation

CIDR stands for Classless Inter-Domain Routing.

Example:

192.168.1.10/29

The /29 means:

29 bits belong to the network

3 bits belong to hosts


Because IPv4 total bits are 32:

32−29=3

That means only 3 bits are available for host addresses.



How to Convert CIDR into Binary Subnet Mask

Subnet masks use:

  • 1 for network bits
  • 0 for host bits

For /29:

First 29 bits = 1

Remaining 3 bits = 0

Binary subnet mask becomes:

11111111.11111111.11111111.11111000

Now count all the 1s:

8+8+8+5=29

Therefore this is a /29 subnet mask.

Converting Binary to Decimal

The last octet is:

11111000


Each binary position has a decimal value.




Now apply the binary digits:


1×128
1×64
1×32
1×16
1×8
0×4
0×2
0×1



Now add active values:

128+64+32+16+8=248

So:

11111000 = 248

Therefore:

/29 = 255.255.255.248



Common CIDR to Subnet Mask Table





These subnet masks are heavily used in real enterprise networks, VLANs, WAN links, cloud networking, and routing.

Understanding Block Size

To calculate subnet ranges, we use block size.


Formula:

256 - subnet value

For /29:

255.255.255.248

Interesting octet:

248

Now calculate:

256−248=8

Therefore block size is:

8

This means subnet ranges increase by 8.


Full Subnetting Example — 192.168.1.10/29

Now let’s subnet the address completely.


Given:

192.168.1.10/29

Subnet mask:

255.255.255.248

Block size:

8


Subnet ranges become:




The IP address:

192.168.1.10

falls between:

8–15

Therefore the subnet is:

192.168.1.8/29


Final Subnetting Result




How Many Hosts in /29?


We already know:

  • Total bits = 32
  • Network bits = 29
  • Host bits = 3


Formula for usable hosts:

2

h

−2

Where h = host bits.

For /29:

2

3

−2=6

Therefore /29 provides:

6 usable hosts


Understanding Network ID and Broadcast Address


Every subnet contains:

  • One Network ID
  • One Broadcast Address
  • Remaining usable host addresses


For subnet:

192.168.1.8/29





Why Subnetting is Important


Subnetting is used everywhere in networking because it:


  • Reduces broadcast traffic
  • Improves network performance
  • Provides better IP management
  • Increases security segmentation
  • Helps VLAN and routing design
  • Optimizes enterprise networks

Without subnetting, networks become inefficient and difficult to manage.


Final Thoughts


Subnetting becomes easy once you understand three core concepts:


  • Binary conversion
  • CIDR notation
  • Block size calculation


The biggest key is understanding that subnet masks are simply binary numbers where:


  • 1 = Network bit
  • 0 = Host bit


Once you master binary math and subnet ranges, you can solve subnetting problems mentally within seconds.

The best way to improve is continuous practice with:


/24
/25
/26
/27
/28
/29
/30


These are the most commonly used subnet sizes in real-world networking environments.




Disclaimer


This was written for educational purpose and pentest only.
The author will not be responsible for any damage ..!
The author of this tool is not responsible for any misuse of the information.
You will not misuse the information to gain unauthorized access.
This information shall only be used to expand knowledge and not for causing  malicious or damaging attacks. Performing any hacks without written permission is illegal ..!


All video’s and tutorials are for informational and educational purposes only. We believe that ethical hacking, information security and cyber security should be familiar subjects to anyone using digital information and computers. We believe that it is impossible to defend yourself from hackers without knowing how hacking is done. The tutorials and videos provided on www.hackingtruth.in is only for those who are interested to learn about Ethical Hacking, Security, Penetration Testing and malware analysis. Hacking tutorials is against misuse of the information and we strongly suggest against it. Please regard the word hacking as ethical hacking or penetration testing every time this word is used.


All tutorials and videos have been made using our own routers, servers, websites and other resources, they do not contain any illegal activity. We do not promote, encourage, support or excite any illegal activity or hacking without written permission in general. We want to raise security awareness and inform our readers on how to prevent themselves from being a victim of hackers. If you plan to use the information for illegal purposes, please leave this website now. We cannot be held responsible for any misuse of the given information.



- Hacking Truth by Kumar Atul Jaiswal




I hope you liked this post, then you should not forget to share this post at all.
Thank you so much :-)





Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.
Post a Comment (0)
Our website uses cookies to enhance your experience. Learn More
Accept !