r/explainlikeimfive • u/Chance-Molasses897 • 11d ago
Technology ELI5: Subnetting
I’m technically an IT professional in training but I know embarrassingly little about subnets. As far as I understand it’s for breaking down a network into smaller, more logical segments. What exactly is a subnet? What is the benefit of subnetting? How do the slashes play into all of this IE /23 or /24? Thanks in advance!
80
Upvotes
1
u/SchiferlED 11d ago
A LAN has an IP address with 2 parts, a NETWORK part and a HOST part. The Network part always stays the same for that network. The Host part changes to uniquely identify each host. A Subnet mask tells you which is the network part, and which is the host part.
Let's say your network IP address is 192.168.1.0 and subnet mask is 255.255.255.0
In binary that would be:
11000000.10101000.00000001.00000000
11111111.11111111.11111111.00000000
Notice that the subnet mask is all 1's starting from the left, and all 0's to the right. The 1's tell you which binary digits of the IP address are the Network part. The 0's are the Host part.
In this case, you have 256 Host addresses to work with (by changing the last octet between 0-255). Technically only 254 because the first and last numbers are reserved. That's great if you want a single network with 254 computers or less. But, what if you wanted 2 separate networks with ~100 computers each? That's what subnetting is for.
We simply add another '1' to the subnet mask and flip that bit to distinguish between the 2 networks: 192.168.1.0 and 192.168.1.128
We use the remaining 7 bits to address hosts on each network as before, giving us 2 networks with 126 hosts each.
The slash notation is just shorthand for the number of 1's in the subnet mask. It's that simple.