🧠 Understanding Subnet Masks
* Understanding Subnet Masks
A subnet mask divides an IP address into:
• Network bits (1s) — identify the network
• Host bits (0s) — identify the devices (hosts) within that network
Each octet (group of 8 bits) in an IP address has a total of 8 bits, and the decimal value of all 8 bits set to 1 is 255.
Binary to Decimal Reference Table
Binary Bit Value 2^n
2⁰ 1 1
2¹ 2 2
2² 4 4
2³ 8 8
2⁴ 16 16
2⁵ 32 32
2⁶ 64 64
2⁷ 128 128
When you sum all these up:
1 + 2 + 4 + 8 + 16 + 32 + 64 + 128 = 255
That’s why a full octet of 1s (11111111) equals 255 in decimal.
________________________________________
🌐 Example: 192.168.1.0 /24
• /24 means 24 bits are used for the network.
• This leaves 8 bits (since there are 32 total bits in IPv4) for hosts.
Subnet Mask
Binary: 11111111.11111111.11111111.00000000
Decimal: 255.255.255.0
Network and Host Bits
• Network bits: 24 (the first three octets)
• Host bits: 8 (the last octet)
________________________________________
🧮 Calculating the Number of IP Addresses
Number of host addresses = 2number of host bits2^ {\text {number of host bits}}2number of host bits
👉 28=2562^8 = 25628=256 total addresses
But two are reserved:
• Network address: 192.168.1.0
• Broadcast address: 192.168.1.255
✅ Usable IP addresses: 256−2=254256 - 2 = 254256−2=254
________________________________________
📋 Summary
Property Value
Network ID 192.168.1.0
Broadcast ID 192.168.1.255
Subnet Mask 255.255.255.0
CIDR Notation /24
Total Addresses 256
Usable Host Addresses 254
Host Range 192.168.1.1 → 192.168.1.254
________________________________________
Would you like me to include an example of subletting this /24 network further (like splitting it into /26 or /28 subnets)? That’s often the next step in learning subnet masks.
Comments
Post a Comment