Home > Networking Tips > Network Engineering > IP addressing and subnetting: Calculate a subnet mask using the subnet's formula
Networking Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

NETWORK ENGINEERING

IP addressing and subnetting: Calculate a subnet mask using the subnet's formula


David Davis
11.20.2006
Rating: -4.53- (out of 5)


Routing and switching news, advice and technical information
Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


Now that you understand the host's formula, you should also know the subnet's formula, which will help you make sure you have the right subnet mask for the number of subnets that you have. Just because you determine that you have the right number of hosts for your LAN using the host's formula, doesn't mean that you will have enough subnets (networks) for your network. Let's see how the subnet's formula works.

The subnet's formula is 2n, where n is the number of 1s added to the subnet mask, from whatever the subnet mask was. Let's take the same example I had above but build on it.

Say that I have network 192.168.0.0 and want to subnet it to support all my networks and hosts, and say that I expect to have 100 remote sites with 300 PCs each. What subnet mask should I use? In our last example, we found that the 255.255.254.0 subnet mask provided me with 510 hosts per subnet. That was more than adequate to support my 300 PCs, but does that same subnet mask provide me with networks for at least 100 remote sites? Let's find out.

To apply the subnet's formula to our 192.168.0.0 network, we start with the current subnet mask. What is the current subnet mask? I'm not talking about the classful subnet mask, just the current subnet mask for that network, which is 255.255.0.0. I can't use that subnet mask because it provides me with 65,000 hosts but only one network. I need at least 100 networks and at least 300 hosts per network. I want to "add 1s" to that subnet mask and break it up into more networks with fewer hosts (fewer than 65,000).

To do this, let's convert the 255.255.0.0 subnet mask to binary.
255.255.0.0 =
11111111 11111111 00000000 00000000
(in binary)

I am going to add 1s right after the last 1 on the right (in the middle of the mask, between


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


RELATED CONTENT
Network Engineering
Understand Windows tracert output to troubleshoot network connectivity
Using tracert and TTL to troubleshoot network connectivity problems
10 Gigabit Ethernet interconnect solutions: Investigate carefully before choosing
Optimization of the data center with 10 Gigabit Ethernet
Converged Enhanced Ethernet: New protocols enhance data center Ethernet
Test your TCP/IP protocol stack to troubleshoot network connectivity
Checking IP configuration to troubleshoot Windows network connectivity
Using ping command for troubleshooting Windows network connectivity
Top Windows Management Instrumentation (WMI) scripting books, websites
HTTP error code troubleshooting, Part 3: Disabling IE friendly error messages

IP Networking
What is IP?
Connect your LAN to the Internet using static or dynamic NAT
Using tracert and TTL to troubleshoot network connectivity problems
Test your TCP/IP protocol stack to troubleshoot network connectivity
Checking IP configuration to troubleshoot Windows network connectivity
Does IPv6 abandon TCP/IP fragmentation?
VLANs versus IP subnets: Why use a VLAN over IP subnetting?
Difference between circuit-switching and packet-switching in examples
Can Network Address Translation work without static IP addresses?
Why are TCP/IP networks considered unsecured?

LANs (Local Area Networks)
Q&A: Jim Metzler previews the networking track at Interop
Extreme's port extender can replace consumer devices at network edge
VLANs versus IP subnets: Why use a VLAN over IP subnetting?
Troubleshooting VLANs: How to monitor 802.1q tagged traffic
Top 10 networking advice of 2008
During a recession, align the network with business priorities
LANs vs. WLANs: Which network designs are used for each company size?
Best practices for securing your wireless LAN
HTTP error code troubleshooting, Part 1: HTTP status codes defined
How do I set up multiple VLANs on a single switch?

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
32-bit IP addressing  (SearchNetworking.com)
fixed-length subnet mask  (SearchNetworking.com)
GARP (Generic Attribute Registration Protocol)  (SearchNetworking.com)
route aggregation  (SearchNetworking.com)
route summarization  (SearchNetworking.com)
routing table  (SearchNetworking.com)
subnet  (SearchNetworking.com)
subnet mask  (SearchNetworking.com)
variable-length subnet mask  (SearchNetworking.com)
wildcard mask  (SearchNetworking.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary


the 1s and 0s). So, how many 1s do I add?

Let's throw a number out there, and say that I add five 1s to make it look like this:
11111111 11111111 11111000 00000000

Using the subnet's formula, this would give us 25 = 32 networks.

Thirty-two networks aren't enough to support my 100 remote sites, no matter how many hosts are in each network.

Let's add two more 1s to make it look like this:
11111111 11111111 11111110 00000000

Using the subnet's formula, this would give us 27 = 128 networks

This is at least 100, so I have enough subnets for my 100 remote networks. Do I have enough hosts? Using the host's formula, we calculate 29 – 2 = 510 (which we had already calculated above). So, we have enough hosts for our 300 PCs at each remote site.

This means that we have found the right subnet mask for our network. We convert our subnet mask from binary back to decimal and get 255.255.254.0.

Here is a screenshot and text output from the Solarwinds subnet calculator that verifies our calculations and shows which IP addresses are in which network:

[IMAGE]

In the real world

In the real world, chances are that you may never have the opportunity to design a large network such as this from scratch. However, large-scale network design skills are valuable for a variety of reasons:

About the author:
David Davis (CCIE #9369, CWNA, MCSE, CISSP, Linux+, CEH) has been in the IT industry for 15 years. Currently, he manages a group of systems/network administrators for a privately owned retail company and authors IT-related material in his spare time. He has written more than 50 articles, eight practice tests and three video courses and has co-authored one book. His Web site is HappyRouter.com.

Rate this Tip
To rate tips, you must be a member of SearchNetworking.com.
Register now to start rating these tips. Log in if you are already a member.


Submit a Tip




DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



Networking Solutions for Business

Alcatel-Lucent Network Business Communications Solutions

About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2000 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts