CCNA Routing and Switching
<< IP and Network Fundamentals Course
>> IPv4 Address System Section
Understanding Classful Network Mask explains why every Network IP device must belong to a Network Address, and how every Network Address must have Netmask Address. Therefore, to communicate with ccnahub.com’s web server, PC1 or its Gateway must know the Web Server’s IP Address, Network Address, and the Netmask which will point to the Network Portion of the Web Server’s IP Address.
Table of Contents
After A, B, and C Classful Networks have been created from the One Big Pie of IPv4 Space, the IP Address in each Class needed 2 logical portions to work:
- Network Portion
- Hosts Portion
For an IPv4 Network Device to function properly, 6 things needed:
- IP Address
- Netmask Address
- Network Address
- Broadcast Address
- Gateway Address
- DNS Address
Note: Mainly, the minimum 4 pieces required for IPv4 TCP/IP to function are: IP, Netmask, Network, and Broadcast Addresses. If you are using Windows Machine, Network and Broadcast Addresses configured Automatically for you.
If an IP Address meant to identify a Network device on a particular Network, then the Netmask is meant to identify the Network’s portion of this device. TIP: Identifying the network’s portion will automatically identify the host portion as well.
Network Mask or Netmask for short, helps Computers locate and identify where the network portion is, hence, the Host’s portion at this IP could be located as well.
- n = Network Portion
- h = Hosts Portion
Presenting Class A Network and its Mask
Class A Network: 220.127.116.11 Class A Netmask: 255.0.0.0
Class A Network: 00000001.00000000.00000000.00000000 Class A Netmask: 11111111.00000000.00000000.00000000 nnnnnnnn.hhhhhhhh.hhhhhhhh.hhhhhhhh
Presenting Class B Network and its Mask
Class B Network: 18.104.22.168 Class B Netmask: 255.255.0.0
Class B Network: 10000010.00000001.00000000.00000000 Class B Netmask: 11111111.11111111.00000000.00000000 nnnnnnnn.nnnnnnnn.hhhhhhhh.hhhhhhhh
Presenting Class C Network and its Mask
Class C Network: 22.214.171.124 Class C Netmask: 255.255.255.0
Class C Network: 11000011.00000011.10000000.00000000 Class C Netmask: 11111111.11111111.11111111.00000000 nnnnnnnn.nnnnnnnn.nnnnnnnn.hhhhhhhh
Identifying Network Portion
Therefore, if a Class A IP Address such 126.96.36.199 used by itself without Network Mask, how the computer would locate or identify its network portion?
And where this IP Address might be located in the world if the network portion can’t be identified? Hence, even Routers that use Internet Routing Protocols won’t be able to route without knowing the Network portion.
Some people believe that it is very similar to a home address system. How you would identify a home on a map without knowing first the its geographical portion (Network Portion) such country, city, postal code, and finally, you can point to the home address.
Of course, neither countries nor cities exist in IPv4, but the concept is almost the same. With this in mind, the Engineers must come up with 3 Network Masks Addresses to identify the Classes or to distinguish between the Classes Network portions.
Remember: Once you nail the Network portion you automatically nailed the Hosts portion.
The 3 Default Network Masks
Class A Default Network Mask: 255.0.0.0 is known by its first byte ruling, which will be able to locate all the Networks that fall at the first byte. This Mask locates Classful A Networks starting from 188.8.131.52 up to 184.108.40.206 Networks, therefore, the hosts portion can be identified or located at the rest of the 3 bytes.
Class B Default Network Mask: 255.255.0.0 is known by its first and second bytes ruling, which will be able locate all the Networks that fall at first and second Bytes. This Mask locates Classful B networks starting from 220.127.116.11 up to 18.104.22.168 Networks, therefore, the hosts portion can be identified or located at the third and fourth bytes.
Class C Default Network mask: 255.255.255.0 is known by its first, second, and third Bytes ruling, which be able to locate all the Networks that fall at the first, second, and third Bytes. This mask locates Classful C Networks starting from 192.0.0.0 up to 22.214.171.124 Networks, therefore, the hosts portion can be identified or located at the fourth byte.
Flipping between Network Masks
- Class A Networks can use Class A, B, C Network Masks, but Class A Netmask 255.0.0.0 can be used ONLY with Class A Networks.
- Class B Networks can utilize Class B and C Network Masks, but Class B Netmask 255.255.0.0 can be used with Class A and B Networks.
- Class C Networks utilize Only Class C Network Mask, but Class C Netmask 255.255.255.0 can be used with Class A, B, and C Networks.
Analyzing IPv4 Settings
If you open Ubuntu /etc/network/interface config file, you can view or configure the network settings. A Class A Public IP Address Settings would be as follows:
Assuming we have Ubuntu1 Linux interface using Class A Public IP Address.
Iface eth0 inet static address 126.96.36.199 netmask 255.0.0.0 network 188.8.131.52 broadcast 184.108.40.206 gateway 220.127.116.11 dns-nameservers 18.104.22.168
Breaking Pieces Down
The first thing to note that any TCP/IP setting at any network device should make sense, meaning, the IP address should fall under the range of its network 22.214.171.124. The network mask serves the network ID and helps the other network devices to locate this Ubuntu machine.
Second, if happens that you have another Ubuntu (as Virtual Machines) and you want to communicate with the upper machine settings directly without using a gateway (Gateway needed to cross Networks), your second Ubuntu machine must have IP Address 126.96.36.199 with the same netmask, network, broadcast, gateway, and dns-nameserver address of Ubuntu1.
TIP: You can set a Host Network at your VirtualBox and practice the different Classes between 2 Ubuntu Machines.
Finally, notice how the DNS server IP doesn’t really matter if it falls under Class A, B, or C Network, any Network device (Windows or Linux) will be able to use any DNS settings from any Unicast Class Network, whether A, B, or C DNS address, since it is used primarily to resolve names and got nothing to do with locating IP Address or Network Portion.
Keep in Mind
Network Engineers discussed the netmask ahead of time, netmask determines the network portion and how many hosts the network portion can hold.
Therefore, the 4 sections: address, network, broadcast, and gateway should belong to the same Network as the netmask dictated. At the upper Ubuntu Network setting example, netmask 255.0.0.0 was chosen, so the IP setting must be from Class A networks range, besides, the address, network, broadcast, and gateway should all fall under Class A.
It happens that I used 188.8.131.52 network, you can pick any Class A range such 184.108.40.206. up to 220.127.116.11 that can be used with Class A Netmask 255.0.0.0
Class A Private IP Address Settings
Iface eth0 inet static address 10.0.0.2 netmask 255.0.0.0 network 10.0.0.0 broadcast 10.255.255.255 gateway 10.0.0.1 dns-nameservers 18.104.22.168
Class B Network IP Address Settings
Public IP Address
Iface eth0 inet static address 22.214.171.124 netmask 255.255.0.0 network 126.96.36.199 broadcast 188.8.131.52 gateway 184.108.40.206 dns-nameservers 220.127.116.11
Private IP Address
Iface eth0 inet static address 172.16.0.2 netmask 255.255.0.0 network 172.16.0.0 broadcast 172.16.255.255 gateway 172.16.0.1 dns-nameservers 18.104.22.168
Class C Network IP Address Settings
Iface eth0 inet static address 22.214.171.124 netmask 255.255.255.0 network 126.96.36.199 broadcast 188.8.131.52 gateway 184.108.40.206 dns-nameservers 220.127.116.11
Private IP Address
Iface eth0 inet static address 192.168.0.1 netmask 255.255.255.0 network 192.168.0.0 broadcast 192.168.0.255 gateway 192.168.0.1 dns-nameservers 18.104.22.168
Masking Class A Networks
Netmasking: Most of the time, administrators at the Enterprise or small businesses need to Mask tweak the Network’s portion to reduce the Host’s portion, especially when dealing with Local Area Networks.
Assuming you have 100 computers at your company and you want to connect them using a Class A private IP Address (10.0.0.0 Network), after some analyzing of your Network device requirements, you have determined that the most needed now, and in the future at this network, would be no more than 200 Network devices.
Therefore, you can Mask tweak a Class A Private IP Address Range that can accommodate 200 computers. As you probably know, that Class A Private Address 10.0.0.0 with its netmask 255.0.0.0 gives you 3 bytes for Hosts.
However, doing the Math: 24 places for the hosts: 224 = 16,777,216 – 2 = 16,777,216 usable IP Addresses for Hosts. WOW! That’s a lot more than the 200 needed.
Is it possible to use Class A Private Network with less Hosts bits based only on your needs? Yes!, It is possible by using Class B or Class C Netmask instead to reduce the Host’s bit.
As you guessed, Network Mask or Netmasking has one job to do (either by using Class A, B, or C Netmask) to identify Network portion, hence, identifying Hosts portion and hosts number of devices.
Choosing the Right Mask
Having said this, Class A Private IP Network 10.0.0.0 can utilize 3 of the Network Masks:
Default Class C Mask 255.255.255.0 can be used by Class A Private Network 10.0.0.0, which will reduce the Class A Network 10.0.0.0 hosts from 16,777,216 up to 254 usable IP Addresses, hence, close to your needs of 200 network devices.
Private A Network 10.0.0.0 using Class C Network Mask
Class A Network: 10.0.0.0 Class C Netmask: 255.255.255.0
Class A Network: 00001010.00000000.00000000.00000000 Class C netmask: 11111111.11111111.11111111.00000000 nnnnnnnn.nnnnnnnn.nnnnnnnn.hhhhhhhh
As you can see, we have reduced the hosts portion from Millions of IP address to just 8 bits hosts places, which would be 28 = 256 – 2 = 254 usable IP Addresses using 255.255.255.0 netmask.
Growing more than 254 Network Devices
After few years, you might face that you are running out of IP addresses and almost all the 254 IP Addresses were consumed. You might be telling yourself; man I wish I have used the Class B Netmask to accommodate more machines.
Well, this is not a good strategy to use Class B Netmask to accommodate more machines. Any Network that hold more than 510 devices, might face deadly broadcast storm.
Believe it or not, when machines cross 510 devices at one Network, it can consume more than 50% of a network performance due to just normal broadcast messages. Some administrators won’t even use more than 100 machines per network to reduce Broadcast Messages.
What is a Broadcast Storm?
Broadcast is a TCP/IP message, used between or among the Network devices to communicate about certain things, it is the natural way of TCP/IP communication; it is crucial for TCP/IP to function, but before you know it, it might got worse than gossip 🙂
Each machine has its TCP/IP stack configured, therefore, this network device is capable to send and receive TCP/IP messages, and among them the Broadcast, Unicast, and Multicast messages.
However, broadcast can be dangerous when there are a lot of devices connected all together using one Network, usually more than 510 devices will cause broadcast storm.
Why a broadcast can be a dangerous? Broadcast storm can be caused with too many devices inside the One Network, however, faulty Network card, bad switch port, or bad cable end are all can cause broadcast storm as well.
Let’s assume you are ridding the Subway from Brooklyn to New York City, on the way, someone all of sudden got sick, the conductor has been informed and the train stopped at the next station for 911 help. Now, the train will never move before 911 come and check the sick customer in order to decide whether to leave the customer inside the train or take the customer to the hospital.
Now, can you just imagine for how many minutes the train might wait. First, all customers got delayed for their work, second and worse, if you are riding the train behind the waiting train.
Deadly Broadcast Message
Faulty NIC is an example where the broadcast storm could evolve and will utilize the whole bandwidth of a Network; therefore, no other useful messages or communication can be used among the Network devices.
Imagine that one of the machines got faulty Network Card, how you would easily spot a Faulty NIC among hundred of machines? And if you decided to use Class B Netmask which will carry thousands of Machines, how for God sack you would spot this bad NIC? So, you got the image.
It’s impossible to spot a bad NIC among hundreds of machines more than 510 connected all together using one network address, although theoretically possible, but because of broadcast deadly messages and even a regular broadcast massages among the machines, this would be impractical to connect hundreds and hundreds of network devices altogether using one Network.
So, sick NIC that all of sudden is sending thousands of broadcast messages inside the one network is capable to stop the whole network (the way a sick customer had stopped the whole train and all the trains behind it), whether you have 2 network devices or hundreds of Network devices connected together, a bad NIC, bad switch’s port, or bad cable’s end, could storm the Network with deadly broadcast messages and bring the whole Network down!
Virtual Local Area Network (VLAN) is blessing solution to reduce broadcast messages. It controls Broadcast messages and limit the connected Network devices to desired number of network virtually.
VLANs stops broadcast hitting all machines in the network, hence, using smaller portion of Hosts bits is a must design to reduce and control broadcast messages and storms.
Running Out of Private IP Addresses
If you ran out of IP addresses when using 10.0.0.0 Network with Netmask 255.255.255.0, then use the next network 10.1.0.0 and the next Network 10.2.0.0 and so on, instead of using Class B Netmask.
Using 255.255.255.0 with different Class A Private Networks, each network will provide 254 usable IP addresses. Finally, you can use either a Router in a Stick or Layer 3 Switch to route communication among the different networks.
Masking Class B Networks
Class B includes 16 Private Networks which can use Class B Netmask or Class C Netmask. The Networks can be laid as follows:
Private Class B Networks 172.16.0.0 up to 172.31.0.0
Class B or C default Netmasks can be used with Class B Private Networks
255.255.0.0 or 255.255.255.0
Note: 255.0.0.0 mask is not meant for Class B Networks or Class C Networks.
All together, there are 172 networks between 172.16.0.0 and 172.31.0.0 for private use. Using netmask 255.255.0.0 will provide you with 216 – 2 = 65, 534 usable IP Addresses, however, use 255.255.255.0 to reduce hosts bits instead.
It all depends on the Network Design, Class A or Class B Private Networks can do the job, and Class C default Netmask 255.255.255.0 should be always your choice to reduce Hosts bits and prevent broadcast problems.
Masking Private Class B Networks
Class B Network: 172.16.0.0 Class C Netmask: 255.255.255.0
Class B Network: 10101100.00000000.00000000.00000000 Class C Netmask: 11111111.11111111.11111111.00000000 nnnnnnnn.nnnnnnnn.nnnnnnnn.hhhhhhhh
Since Class default Netmask is used, the third byte at 172.16.0.0 Network becomes part of the network. Using 255.255.255.0 will leave you with only 254 usable IP Addresses.
Use the Next Class B Private Network for more usable IP Addresses, 172.16.1.0 Network or 172.16.2.0 can be used for the next 254 usable IP Addresses, up to the 172.16.255.0 Class B Private Network
Note: keep in mind that Classful Netmask Addresses are not used anymore in Public Networks (The Internet) since the beginning of the 90’s, therefore; Classful A, B, and C default Netmasks can be used only in Private Networks.
Instead, public IPv4 Networks use Classless Subnet Masks (CIDR) since 1993 to utilize the IPv4 Address Space more efficiently.
Next articles will explain how Classless Network and Subnet Mask (Sub Network Mask) extended the life of IPv4 Public IP Addresses, and instead of dealing with Netmasking, you will deal with Subnet Masking, or for short Subnetting!
By Wikipedia Classful Networks | 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!"Understanding Classful Network Mask",
CCNA Routing and Switching
<< IP and Network Fundamentals Course
>> IPv4 Address System Section