CCNA Routing and Switching
<< IP and Network Fundamentals Course
>> IPv4 Address System Section
Why Understanding Classless Subnet Mask is a key stone? In my previous articles, I mentioned about how it all started with One Big IP Space, then how the Engineers divided the IP space to Classes A, B, C, D, and E. Besides, how the Engineers identified each Classful Network by setting for each Class what is called Network Mask or for short Netmask. Why I am repeating all this?
Because Class A, B, and C default Masks (255.0.0.0, 255.255.0.0, 255.255.255.0) respectively were not an efficient approach to identify Network bits. So, in the the beginning of the 90’s, the default Netmask approach was not efficient due to releasing BIG Blocks of IP Addresses to the Public. Using just default Masks would have made the IP Space consumed long time ago. Therefore, Subnet Masks were evolved to distribute the IP space more efficiently, hence smaller Blocks can be released to save the rest of the IP Space, which made it possible to have the Internet available to everyone at that time.
Table of Contents
Subnet Mask Address
Everything seems to be good from year 1980 up to year 1990, however, the TCP/IP Engineers realized that IPv4 as they know it is getting consumed very quickly by public and private sectors. They must find a way to save whatever left from each Class, hence, they stopped releasing IP Addresses as Blocks of Classful Networks which use the default Masks method and they decided to divide the Classes further to what I called the “Second Division”. This division resulted in Subnet Masking which chopped the Classful IP Addresses for Sub Networks or for short subnets.
Distributing the rest of the IP Space based on Subnets made the internet available to all countries and not only USA Public and private sectors. I hope they had used the Subnet approach from the beginning; it would have made distributing the IP Address space more efficiently. However, it was not so late in the early 90’s.
Note: Network Address Translation (NAT) which would be beyond the scope of this article was a major player as well to save the IPv4 space; it is the thick Line between what is Called Public and Private IP Space.
NAT made it possible to share one public IP address as a relay for hundreds or even thousands of private network devices in order to access the Internet. I will talk about NAT in future articles.
Subnet Mask vs. Netmask Address
In the previous article, I have explained that Class A Networks were allowed to use either Class B or C default Mask, and Class B Networks were allowed to use Class C default Mask, but how about Class C Networks? Class C Networks were limited to only its default mask.
Besides, how about more granularity and precise Number of Networks distribution or precise number of Hosts distribution? As you can see, using Class C default mask 255.255.255.0 at Class A or B Networks reduced the usable IP addresses of Class A and B from massive number of IP addresses to only 254 usable IP addresses per network.
Moving default Netmasks between the Classful Networks was a good approach till the end of 80’s, (note that default masks still used today, but only on the Private Networks) yet was not efficient Masking technique for the Public Networks later on at beginning of the 90’s and especially after the Internet start to grow rapidly.
TIP: Subnet Masking method shrunk the Block of IP from 254 per Network, (that is the smallest Block of IP Addresses used when default Netmasks is being used) up to 2 usable IP Addresses per Network or Subnet! That is a precise granularity, instead of release Block of 254 usable IP addresses for a Serial Link connection, now, I can release a Block of only 2 usable IP addresses which suits the Serial link perfectly.
Imagine the number of serial links needed back then and the number of IP Addresses went to waste just to connect 2 points. Basically, from each Block of 254 IPs only 2 IP addresses were used.
Therefore, Engineers canceled the Classful approach that uses default Netmasks and came up with Classless approach that uses Subnet Masks which provided more granular way to distribute the IPv4 space.
Technically, they canceled the rules of Classful Networks and tuned it into what known as Classless approach (no more Bytes or Classful ruling). When Classless Subnet Masks are being used, you can go right or left at the 32bits string to generate precise number of Subnets, hence, precise number of Hosts.
As a result, Classful Networks were replaced by Classless Subnets across all Public Routers using a Classless Subnet Masks instead of Classful default Network Masks to save the IP Space.
Prefix by CIDR
Classless Inter Domain Routing (CIDR) introduced what is called prefix. Since with classless approach you can go right and left at the 32bits string, why not using the number of the the place value as Subnet Mask? Using a froward Slash / and the place value number, Prefix is more easier to set and reference than using the full subnet mask address.
E.g. Private Networks
- Class A provided 10.0.0.0/8 range as private Network where it can be divided to subnets.
- Class B provided 172.16.0.0/16 up to 172.31.0.0/16 ranges as private Networks where it can be divided to Subnets as well.
- Class C provided 192.168.0.0/24 range as private Network where it can be divided to subnets also.
It’s good to note that the private range of any class is free of charge for people to use. Companies and home networks are free to pick and choose for free their own private networks depends on their needs. Engineers still recommend using Subnet Masks as well as with the private networks to ease the Network management and reduce broadcast messaging, especially when a company got too many users and network devices.
So, Classless Subnets means dividing already the Divided Classful Networks, and as mentioned, the Public IP Space initially was divided to 5 Classes, A, B, C, D, and E. And the Classless approach divided these Unicast Classes further, therefore, when the Classless method is used at any Classful Network, the result is: smaller networks known by Subnets!
- n = Network
- S = Subnet
- s = Sub-Subnet
- h = Hosts
- When “Subnet Bit” words are used: I am referring to 1
- When “Host Bit” words are used: I am referring to 0
What does Subnetting Mean? Simply, dividing the Classful Networks A, B, and C to smaller Sub Networks results in Smaller Sub-Networks or Subnets.
Why we need Subnets? Subnets are meant to be smaller Networks created from the Classful Bigger Networks, the small Sub-Networks (Subnets) can be used for Local Area Network (LAN), Virtual Local Area Network (VLAN), or at Wide Area Network connection (WAN) between 2 Public Routers.
Subnets can ease the Management of Big Company’s Network that got tens or hundreds of offices or floors locally or worldwide. One of the benefits to use Subnets is: isolating the Network devices to stop Broadcast Messages.
Subnets will require Router in Stick or Layer 3 Switch to communicate with each other. Some people might ask: Why not using One Big Network Instead of all these small Subnets?
Simply, because of the Broadcast Messages, once the Network connects more than 510 network devices, broadcast messages can utilize all the network bandwidth and lower the performance to almost Zero, even collision might occur, especially if the Network uses 100Mb speed.
I am going to talk about increment numbers. The increment number is the division base which used to divide the whole Main Network to smaller Subnets.
Classful Default Netmasks vs. CIDR Subnet Masks
The 3 default Classful Masks are:
Class A netmask: 255.0.0.0 Binary Equivalent: 11111111.00000000.00000000.00000000 nnnnnnnn.hhhhhhhh.hhhhhhhh.hhhhhhhh
Class B netmask: 255.255.0.0 Binary Equivalent: 11111111.11111111.00000000.00000000 nnnnnnnn.nnnnnnnn.hhhhhhhh.hhhhhhhh
Class C netmask: 255.255.255.0 Binary Equivalent: 11111111.11111111.11111111.00000000 nnnnnnnn.nnnnnnnn.nnnnnnnn.hhhhhhhh
As you can see, the default Masks move by bytes base, and they are kind of fixed masks, rather, the subnet masks are dynamic, which move back and fourth based on bit base versus byte base.
Classful Network based on Bytes
If Class A used: the default Network bits represented by the first Byte:
Decimal: 255.0.0.0 Binary: 11111111.00000000.00000000.00000000
If Class B used: the default Network bits represented by the first and second Bytes:
Decimal: 255.255.0.0 Binary: 11111111.11111111.00000000.00000000
If Class C used: the default Network bits represented by the 1st, 2nd, and 3rd Bytes:
Decimal: 255.255.255.0 Binary: 11111111.11111111.11111111.00000000
Class A Default Netmask Vs. Subnet Mask
Class A Netmask: 255.0.0.0 Prefix: /8 bits Binary Equivalent: 11111111.00000000.00000000.00000000 Meaning: nnnnnnnn.hhhhhhhh.hhhhhhhh.hhhhhhhh Increment Number: 0
Subnets = 20 = 1 (There are Zero Subnets to count, so it’s a big One Network)
Hosts = 224 – 2 = 16,777,214 usable IP Addresses (that’s a Huge and not a practical number to be used in computer Networks)
Vs. Subnet Mask
Subnet Mask: 255.255.254.0 Prefix: /23 bits Binary Equivalent: 11111111.11111111.11111110.00000000 Meaning: nnnnnnnn.SSSSSSSS.SSSSSSSh.hhhhhhhh Increment Number: 2
Since the 3rd Byte got only 7 Network bits, it made the Byte 254 instead of 256, 256 – 254 = 2, therefore the increment is 2)
Subnets = 215 = 32,768 (As you can see, there are 15 S representing Subnets)
Hosts = 29 – 2 = 510 usable IP Addresses (we left with 9 places for the hosts)
As Prefix Base using the 32bits String
1 2 3 4 5 6 7 8.9 10 11 12 13 14 15 16.17 18 19 20 21 22 23 24.25 26 27 28 29 30 31 32 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 0
With Subnet Masks Introduction, another concept was introduced to help representing Subnet masks or the Network Portion. Classless Internet Domain Routing (CIDR) made it simpler to write down the subnet mask in a short way as prefix. 255.0.0.0 is equal to prefix /8.
Note: Class A with Prefix /8 give us Zero Subnets, Class B with Prefix /16 give us Zero Subnets, and Class C with Prefix /24 give us Zero Subnets as well. Meaning, 8/, /16, and /24 can be used to represent default Masks as well. But if prefix /16 used with Class A Network, then the Network will be divided to 256 Subnets, and if prefix /24 used with Class B network, then it will be divided to 256 Subnets as well.
Again, if prefix /24 used with Class A Networks, it will be divided to 216 = 65,536 Subnets! Each will carry 254 usable IP Addresses. Notice that 16 on top of the 2 represent the place value, which was counted from 8 up to 24, meaning we have 16 place values between 8 and 24, hence 216. Besides, we are left with 8 bits for the Hosts, then 28 – 2 = 254 usable IP addresses.
As mentioned, the subnet mask can move right or left per bit base (it can’t go below the main default network bits, which the Byte base), meaning, it is going to move from the left side to the right side turning the places value ON per bit base. Let’s look at our first subnet address which would be the 9th bit or mostly known by prefix /9.
Note: At Class A, the Subnet bit starts its counting from the 2nd byte. Note also the Capital S, meaning, the Network became Sub Networks. I will explain more about it while you reading.
Subnet Mask: 255.128.0.0 Prefix: /9 bits Binary Equivalent: 11111111.10000000.00000000.00000000 Meaning: nnnnnnnn.Shhhhhh.hhhhhhhh.hhhhhhhh Increment Number: 128
Subnets = 21 = 2
Hosts = 223 – 2 = 8,388,606 (Not a practical usable IP Address Range)
As Prefix Base using the 32bits String
1 2 3 4 5 6 7 8.9 10 11 12 13 14 15 16.17 18 19 20 21 22 23 24.25 26 27 28 29 30 31 32 1 1 1 1 1 1 1 1.1 0 0 0 0 0 0 0. 0 0 0 0 0 0 0 0. 0 0 0 0 0 0 0 0
The first 8bits (Byte) is turned ON at all it’s place values, however, the second byte got only 1 Bit of it Turned ON. Let’s look at it using the Binary chart:
128 64 32 16 8 4 2 1 1 1 1 1 1 1 1 1
128 64 32 16 8 4 2 1 1 0 0 0 0 0 0 0
So at the first Byte we got 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255, but notice the second Byte, it got only One bit turned ON, which is the 128th place, so 128 + 0 + 0 + 0 + 0 + 0 + 0 + 0 = 128. With this in mind, 255.128.0.0 Subnet Mask is used to divide a Network to 2 Sub Networks instead of the original Network Mask 255.0.0.0 that was used to represent one big Network.
Analyzing Prefix /9 Subnetting
If Class A Private Network 10.0.0.0/8 represents One big Network that carry 224 – 2 = 16,777,216 then prefix /9 means dividing 10.0.0.0/8 to 2 smaller networks. Meaning, by moving the Subnet bit one place to the right: 21 = 2 Subnets, hence the one network of 10.0.0.0/8 became 2 Subnets.
Using the Subnets as follows:
After the trunning 1 bit ON, 10.0.0.0 Network became 2 subnets using prefix /9.
- Subnet Zero: 10.0.0.0/9
- Subnet 128: 10.128.0.0/9
- Subnets = 21 = 2 Subnets
Hosts = 223 – 2 = 8,388,606 Usable IP Addresses for each Subnet.
Both subnets will use 255.128.0.0 Subnet Mask. Hence, the first Subnet would be like this 10.0.0.0/9, and the second subnet would be like this 10.128.0.0/9.
Q: How did we get here? How would you know that the second subnet starts at 10.128.0.0?
Ans: Since it’s only 1 bit, 21 = 2 which tell you that you are talking about 2 Subnets, why 2 subnets? Well, consider 256 (which would be the main base of measurement, since either a Network Byte or Host Byte is based on 28 = 256) 256 divided by 2 would be 128, meaning, we have 2 128th inside 256.
Therefore, the first subnet starts at 10.0.0.0/9 and its broadcast ends at 10.127.255.255, and the Second Subnet starts at 10.128.0.0 and its Broadcast ends at 10.255.255.255.
Notice that computers count from 0, so from 0 up to 127 equal 128, and from 128 to 255 equal 128. 128 + 128 = 256! Ask yourself, what goes inside 256 2 times equally? Isn’t 128th goes inside 256 2 times equally. So, that’s why the second subnet start at 10.128.0.0
If you pick a private Network such Class A 10.0.0.0 Network and decided to use a Netmask 255.0.0.0, or 255.255.0.0, or even 255.255.255.0, you still considered using the Classful method.
The moment you start Subnetting (Or Sometimes I call it Sub Masking) by using a Subnet Mask such 255.128.0.0, or 255.255.224.0, or even 255.255.255.240, then you start using the classless method instead of Classful static method.
Note: Besides, the Router OS and the Routing Protocol have to know what are you planning to accomplish, meaning, the Routing Protocols went through a major development in order to accommodate the new method of routing – Classless method of Routing!
Classful A private network 10.0.0.0 with a default Netmask of 255.0.0.0 is considered a One BIG Network with 224 – 2 usable IP Addresses. You will have 10.0.0.1 up to 10.255.255.254 as usable IP addresses – huge amount of IP addresses using One Network, therefore, not a practical approach.
On the other hand, if you use 255.128.0.0 subnet Mask instead of the default Netmask, then you have divided the 10.0.0.0 Classful Network to 2 Classless Subnets, but still the 2 subnets carries a lot of IP addresses.
Cisco Engineers recommend not more than 510 IP addresses per subnet (LAN or VLAN if you are on the private Network World), some administrators consider their design to not accommodate more than 254 IP addresses per subnet.
Therefore, most of the public side uses few number of IP addresses in the block, another word, short block of IP Addresses is more efficient. When I reach to Network and Subnetwork Design, I will explain more on this part.
On the next articles, I will explain further on the subject by going through most of the Subnetting Examples needed for the real world or the exam, Classless Subnet Masking, CIDR, Subnetting, and Variable Length Subnetting (VLSM) which is the Sub-Subnetting are all valuable skills to pass the Cisco Exams and be professional at the Network field as well.
By Wikipedia Subnetwork | Router Ally IPv4 | HighTech IPv4 Addressing | The TCP IP Guide | Cisco CCNA Simplified | Cisco CCNA in 60 Days | CCNA R&S Certification Kit | Subnetting Made Easy | Who is Running the Internet | IP Addressing and Subnetting | The Only IP Book You Will Ever Need!
CCNA Routing and Switching
<< IP and Network Fundamentals Course
>> IPv4 Address System Section
name author says
Eliminating grammar mistakes would make this essay better
Imad Daou author says
Thank you for the feedback