Welcome! I’m going to assume that you are here because you’ve read Part 1 – (The primer) and are considered by anyone’s measure a binary black belt :D. If you’re asking yourself “huh.. what the funk is binary?” then you are not yet worthy greenhorn. Click here now.
So moving forward… every IP address we deal with comes in a pair – IP and subnet mask. If the IP address is was the coordinates to a location – – the subnet mask might be the specific map. The purpose of the subnet mask is to identify the portion of the IP describes the network, and you can determine the part that is used to assign to PCs, Servers and Interfaces on network devices. One can be sort of significant without the other, but when you have the pair you are in business.
If you open up your command prompt and run the ipconfig command , you will see your private IP assigned your router.
In my home LAN, I was assigned IP address 192.168.0.56 with a subnet mask of 255.255.255.0. So what does that mean? when does subnetting happen? Hold your horses cowboy I’m getting there :D. Know that like in my home network, and in business networks, routers are the hard physical segmentation of a broadcast domain. Put this thought away for now though, we need to discuss IP further.
Recall the binary from part 1. The subnet mask 255.255.255.0 means the first three octets define the network (specifically the broadcast network), and the final octet is mostly assignable. Lets break down the IP and SM into the binary equivalents:
SM in decimal = Binary equivalent
255.255.255.0 = 1 1 1 1☺ 1 1 1 1 . 1 1 1 1 ☺ 1 1 1 1 . 1 1 1 1 ☺ 1 1 1 1 . 0 0 0 0 ☺ 0 0 0 0
255.255.255.0 = 24 bits from the left = /24
The smileys are just there to help you process the ones.. they’re not significant. The notation /24 and the subnet 255.255.255.0 are absolutely and totally interchangeable. Some will call the notation /24 the prefix notation, the “slash notation” (yuck), or the CIDR notation… CIDR probably being the most popular, any is fine as long as you know what we’re talking about. I call it the prefix notation.
Network Classes (Classful subnet masks)
The 255.255.255.0 is also a special subnet mask as it defines a “classful” class C network. Just so I don’t throw you off… know that classful networks using a classful subnet mask like 255.255.255.0 or /24 are what we have to work with if a subnetting technique is not applied. These are easy to remember, there are only three.
Classful Class C = 255.255.255.0 = /24
Classful Class B = 255.255.0.0 = /16
Classful Class A = 255. 0 . 0 . 0 = /8
To further analyze our home network example. My IP address 192.168.0.56 with the subnet mask 255.255.255.0 is a class C address and a single node that’s part of a bigger group. The subnet mask 255.255.255.0 lets me know that the first three numbers 192.168.0 identify the network.
Breakdown for network 192.168.0.0/24 or 192.168.0.0 255.255.255.0
192.168.0.0 First IP identifies the network segment – known as the network IP, the wire address. Not assignable.192.168.0.1 First usable IP address.. often assigned to the gateway, or routing interface. This one is assigned to my home router.
192.168.0.56 This IP is assigned to my computer on this network
192.168.0.255 The broadcast IP address is the last IP of the network segment is also not assignable.
There are 256 IP addresses total if you count all IP addresses from 0 to 255. One to 255 = 255, and the zero counts as the first one, so total is 256. Of the 256 you can only use 254 since one IP is reserved for the wire address, and one IP is reserved for the broadcast address. This is a characteristic of a classful class C network. It’s useful to slowly get to know the characteristics about classful networks:
Class Subnet Mask = Prefix Total IP Usable Binary Representation of subnet mask
C 255.255.255. 0 = /24 256 254 1111 1111 . 1111 1111 . 1111 1111. 0000 0000
B 255.255. 0 . 0 = /16 65,536 65,534 1111 1111 . 1111 1111 . 0000 0000 . 0000 0000
A 255. 0 . 0 . 0 = /8 16,777,216 16,777,214 1111 1111 . 0000 0000. 0000 . 0000 0000 . 0000 0000
For the sake of the concept let us only concern ourselves with a class C address for now. So at this point we need to understand that a network with prefix /24 or subnet mask of 255.255.255.0 represents a classful class C network, one that has 256 IP addresses total. You can say that the range of IPs from 0 to 255 represents the full IP space.
With this IP space you could easily design a valid small network and have valid IPs , here is what this may look like:
At this point, your noggin should hold a pretty rock solid idea of what the segment looks like BEFORE we apply subnetting. If you’ve fallen off the bus, go find yourself and meet us up here once you’ve caught up… otherwise I would find myself leading you into confusion.
Like we briefly mentioned earlier on, the router, or router interface will segregate a broadcast domain or network segment… meaning that when designing a new network segment you cannot use IP addresses belonging to an IP space that has already been allocated. Let me illustrate what would be the effect of this rule on a growing network:
In the scenario the original network is still there, a /24 class C network segment with 100 users. So knowing what you know at this point you know the following facts about the 192.168.0.0 /24 network:
256 Total IP addressses 192.168.0.0 – 192.168.0.255
-100 IPs alloted to the users.
-1 IP assigned to the Router1 Interface connected to Switch1.
155 IP’s remaining
Enough for the rest of the network right? Well… actually not so fast Sancho Panza. The interface on Router1 delineates the physical end of the 192.168.0.0 /24 LAN. The 50 users connected to Switch2 cannot use the IPs allocated to the 192.168.0.0/24 network.
You can solve this without subnetting by using the next available subnet 192.168.1.0 /24. This allocates another 256 IP addresses, of which only 254 are assignable. In this network segment 50 are assigned to users, 1 to the router interface, and 203 are left unused. Lastly – what about the single user directly attached to Router1 on the far left? You guessed it! You have to allocate yet another /24 network.. that means 254 more allocated IPs, and only 3 used (1 user, 1 wire, 1 broadcast).
Anyone doing the math? When all is said and done, we’ve allocated 768 IP addresses for 151 users, 3 router interfaces and 6 required wire/broadcast IPs. Can anyone else see a problem with this? Designing networks using classful boundaries results in very large IP addressing inefficiencies. To mitigate this problem, RFC 1519 was written in September 1993 introducing subnetting and classless IP routing. RFCs are dense reading, they are very informative but can be confusing to someone trying to learn a concept.
When you subnet an IP space you’re dividing the original IP space into distinct logical networks – each one with its own wire and broadcast address. This is accomplished by turning on additional bits on the classful subnet mask. I’ll wrap up this post with a small taste…enough to whet the appetite.
/24 = 255.255.255.0 192.168.0.0 ~ 255
If you turn on 1 more bit on the subnet mask we end up with the following 2 distinct networks. Not quite enough to solve our problem above, but getting much closer
/25 = 255.255.255.128 192.168.0.0 ~ 127 Wire IP 0, broadcast IP 127
192.168.0.128 ~ 255 Wire IP 128 broadcast IP 255
Grats if you’re still following along, I realize it gets real ugly real quick. If you’re still on the bus please continue to Part 3. (Hopefully coming real soon :D) If you’ve fallen off, use this time to catch up or ask questions.
Thanks for reading!