Home > Articles > Cisco > CCNA Routing and Switching

IP Subnetting Basics

One of the topics that seem to be the hardest for those entering the networking field is the concept of subnetting and addressing. This article is intended as an addressing and subnetting primer and will initially review what the Internet Protocol (IP) address is and how it is structured; it will then go over a number of the main IP concepts that are commonly referenced in subnetting documentation and guides.
Like this article? We recommend

Like this article? We recommend

One of the topics that seem to be the hardest for those entering the networking field is the concept of subnetting and addressing. There are a number of different techniques that can be used to explain how to subnet, many are good and greatly depend on the aptitude of the learner and whether the technique used works for that specific learner. This article is intended as an addressing and subnetting primer and will initially review what the Internet Protocol (IP) address is and how it is structured; it will then go over a number of the main IP concepts that are commonly referenced in subnetting documentation and guides. As the audience for this article is a reader with no previous subnetting experience, more advanced subnetting examples and the binary math behind subnetting be covered in the companion article “Advanced IPv4 Subnet Concepts and Examples.”

What is an IP Address Used For?

Most individuals entering into the networking field have at least heard of IP and know that it can be assigned to an end device. The question that is often asked by these individuals is “what is an IP address used for and why is it needed?” The IP address, unlike other addresses that exist on an end device, is used to communicate with it over an IP network; this network can be local (like a corporate network), global (like the Internet) or can be a combination of both. From an end user perspective, the only thing that is required is an IP address that is able to be assigned to their device (or devices) that enables them to speak with the intended destination.

For most home users, this is a single address that is given by an Internet Service Provider (ISP) that enables the user to speak with any destination that also exists on the Internet. In a corporate environment, each corporate device is assigned an address that at least enables it to speak with the required internal corporate resources (and typically also enables some amount of Internet access). The address is 32 bits long and is notated using 4 different octets (groups of 8), for example 00000001.00000010.00000011.00000100 (binary) or 1.2.3.4 (decimal).

How are IP Addresses Split Up?

So why would an IP address range need to be split up? Think of it this way: if all IP addresses existed without being split into smaller ranges, it would be almost impossible to assign them logically to the many different entities that exist on the Internet. As the Internet is a global network, there are a number of different entities that exist and want to use it; for example: ISPs, corporations, governments, educational institutions and end users.

So why assign an address to these different entities? If an IP addressing space was randomly assigned it would be impossible to efficiently route traffic from source to destination. Let’s use the US Postal Service as an example; what if postal address assignment was random? What if there were three houses on a block: house #1 had address 38748923, house#2 had address 83639567 and house #3 had address 53845284? In this scenario, how would the post office route mail to these addresses? They would have to individually route every parcel based on a specific address; even the mail distribution points would need to reference very specific addressing tables to ensure proper routing. The same is true for IP addresses. If the space was not split up logically, the Internet routers would need to have a table entry for every single IP address; and keep in mind that with IP version 4 there are over 3 billion total addresses used on the Internet. Imagine for a minute the amount of investment that would be required for each of these connected routers to hold this large of a table, even modern high speed routers would not be able to process this size of table.

The initial solution to this problem was to split the IP address space into classes, these included:

  • Class A—All addresses within this range begin with a binary ‘0’ in the first octet which results in addresses from 0.0.0.0 through 127.255.255.255. With the class A address space, the other 7 bits of the first octet are used to separate the space into different networks (and were assigned to different organizations), this allowed for a total of 128 (27) class A ranges that were available. Each of these assigned ranges could use the other 24 bits of the address and use them to assign to network hosts; this provided up to 16,777,216 (224) host addresses.
  • Figure 1 Class A Range (/8)

  • Class B—All address within this range begin with a binary ‘10’ in the first octet, which results in addresses from 128.0.0.0 through 191.255.255.255. With the class B address space, the other 6 bits of the first octet and the whole second octet are used to separate the space into different networks; this allowed for a total of 16,384 (214) class B ranges that were available. Each of these assigned ranges could use the other 16 bits of the address and use them to assign to network hosts; this provided up to 65,636 (216) host addresses.
  • Figure 2 Class B Range (/16)

  • Class C—All addresses within this range begin with a binary ‘110’ in the first octet, which results in addresses from 192.0.0.0 through 223.255.255.255. With the class C address space, the other 5 bits of the first octet and the whole second and third octets are used to separate the space into different networks; this allowed for a total of 2,097,152 (221) class C ranges that were available. Each of these assigned ranges could use the other 8 bits of the address and use them to assign to network hosts, this provided up to 256 (28) host addresses.
  • Figure 3 Class C Range (/24)

  • Class D—All addresses with this range begin with a binary ‘1110’ in the first octet, which results in addresses from 224.0.0.0 through 239.255.255.255.0. Unlike the previous classes of addresses, the class D range is used for multicast and does not have network and host bits defined.
  • Figure 4 Class D Range

  • Class E—All addresses with this range begin with a binary ‘1111’ in the first octet which results in addresses from 240.0.0.0 through 255.255.255.255. This range is reserved and is not used for network or host assignment.
  • Figure 5 Class E Range

CIDR and VLSM

This solution worked fine when the size of the Internet was rather small. However, once the size of the networks started to grow and the number of organizations and devices increased, it became clear that using only this mechanism the number of addresses would be exhausted quickly. Two different solutions were developed, Classless Inter-Domain Routing (CIDR—RFC 1518, 1519) and Variable Length Subnet Masking (VLSM—RFC 950). The CIDR standard developed a method of combining multiple classful networks to limit the size of the Internet routing tables. CIDR notation included a ‘/’ with a number following it that indicated the number of grouped non-host bits also refer to as the network prefix. For example, a classful class A address uses a total of 8 bits that are reserved, including the initial ‘0’ and the 7 bits for the network, this is noted in CIDR as /8. A classful class B address uses a total of 16 bits and is notated as /16 and so on. CIDR is not limited to only notating on a classful boundary, it can notate at any boundary from 0 through 32.

The next thing to discuss is why this is important to Internet routers. As the number of A and B class addresses were depleted, it became obvious that many organizations would need to have multiple blocks of addresses. To maintain an efficient routing table it was easier to assign these blocks consecutively, for example 128.0.0.0/16 and 128.1.0.0/16. Without CIDR it was necessary for there to be two separate routing entries for these networks. When these networks are looked at in binary it can be seen that the difference between the network bits is a single digit as shown in Figure 6:

With CIDR, instead of being represented in the routing table as 128.0.0.0/16 and 128.1.0.0/16, it could be combined to be 128.0.0.0/15; this is what is referred to as a supernet.

VLSM was defined to provide the ability to divide classful networks into smaller pieces. Using the classful model, addresses would have to be assigned in 256, 65,636 and 16,777,216 sized blocks; this is not an efficient method of address assignment or network routing. Just imagine if all of the devices in a class A network had to listen to all of the traffic from each of the other 16,777,215 devices; the network would never function. VLSM provided the ability to separate an assigned address space based on the requirements of the specific situation. For example, if a large organization was assigned a class A network, they had the ability to separate that network (via VLSM) into smaller blocks that they would assign to different divisions, locations and departments. A much more detailed description of this process will be discussed in “Advanced IPv4 Subnet Concepts and Examples.”

Summary

The concept of subnetting scares many new people entering into the network world, especially those who have issues with math. Keep in mind that the concepts can be learned by anyone and just need to be properly understood to be a good networking engineer. Take the time to understand the basics before moving forward, once this is complete the more advanced ideas can be picked up quicker and will continue to become easier to learn.

Pearson IT Certification Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from Pearson IT Certification and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about Pearson IT Certification products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites; develop new products and services; conduct educational research; and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by Adobe Press. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.pearsonitcertification.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020