• TechOps

    Need clarity?
    Chat with our experts now

    • Web Hosting SupportWeb Hosting Support
    • Helpdesk Support

      Skilled and professional 24/7 helpdesk support

    • Product Support

      Boost your product support with our expertise

    • Managed ServicesManaged Services
    • Server Management

      Don't let server issues slow you down. Let us manage them for you

    • Server Monitoring

      Safeguard your server health with our comprehensive monitoring solutions

    • Staff AugmentationStaff Augmentation
    • Hire an Admin

      Transform your business operations with our expert administrative support

    • Hire a Team

      Augment your workforce with highly skilled professional from our diverse talent pool

  • CloudOps

    Confused?
    Discuss with our sales team now.

    • Author ProfileAWS
      Well Architected Review
    • Author ProfileFinOps As a Service

      FinOps As a Service

    • Migrate

      Upgrade the journey: Migrate & Modernize seamlessly

    • Modernize

      Effortless CloudOps mastery for seamless cloud management

    • Optimize

      Efficient CloudOps: Boosting performance through optimization

    • Manage

      Simplify compliance complexities with our dedicated service

  • DevOps

    How Supportsages
    is creating an
    impact?

    View Casestudies
    • Author Profile24/7 DevOps As a Service

      Round-the-clock DevOps for uninterrupted efficiency

    • Author ProfileCI/CD Pipeline

      Automated CI/CD pipeline for seamless deployments

    • Author ProfileInfrastructure As a Code

      Crafting infrastructure with ingenious code

    • Author ProfileDevSecOps

      Integrated security in continuous DevOps practices

    • Author ProfileHire DevOps Engineers

      Level up your team with DevOps visionaries

    • Author ProfileConsulting Services

      Navigate success with expert DevOps consulting

  • SecOps

    Expert SecOps Services
    for any Scale

    • Author ProfileVAPT

      Vulnerability Assessment and Penetration Testing

    • Author ProfileSource Code Review

      Ensuring source code security and safe practices to reduce risks

    • Author ProfileSecurity Consultation

      On demand services for improving server security

    • Author ProfileSystem Hardening

      Reduced vulnerability and proactive protection

    • Author ProfileManaged SOC

      Monitors and maintains system security. Quick response on incidents

    • Author ProfileCompliance as a Service

      Regulatory compliance, reduced risk

  • Insights

    Explore our latest
    insights and resources

    Blog

    Explore our latest articles and insights

    Case Studies

    Read about our client success stories

  • Contact Us

  • About
  • Certifications
  • Life at Supportsages
  • Events
  • Contact
  • Careers
  • Blog

  • Dedicated Support Team
  • Quasi-dedicated Support Team
  • Hire a DevOps Engineer
  • Hire a Billing Support Staff
  • Per-ticket Support Plan
  • Managed Services

  • Microsoft Azure Expert
  • AWS Cloud Expert
  • Hire a developer
SS

SupportSages

Bites of wisdom @ work


Copyright © 2008 - 2026 SupportSages Pvt Ltd. All Rights Reserved.
Privacy PolicyLegal TermsData ProtectionCookie Policy

IP’s – The backbone of Internet Part 3 – Subnetting and Classless Addressing

Jithin Vijayan

  • 6 min read
IP’s – The backbone of Internet Part 3 – Subnetting and Classless Addressing

Generating audio, please wait...

IP Subnetting

Increasing growth of Internet created a high demand for IPs and made the job of IP allocation a tougher one. To avoid this situation of requesting additional IP addresses was avoided by the introduction of IP subnetting. The IP subnetting was introduced so that the local network will be more adaptable to changes when a new physical media is installed, when it has to be split into two or more networks. Say for example in an office if they needs a seperate network for the administrative purpose and which should not get interfered with the office purpose ones. But the main purpose of IP subnetting is to reduce the heavy traffic loads. Security can also be increased with subnetting by preventing access to a particular network from others. Basically it allows a single shared network to connect to the internet so that the organisation will have multiple connections without having any extra IP address space.

Though job of IP subnetting is done locally it still appears as one IP network for outside world. As said the subnetting is done locally, the part which is used for subnetting is the host part. It divides the host part again into subnetid and hosts which makes the IP format like

<Network part><subnet id><host part>

Process of subnetting a network

Subnetting a network in simple words is representing network bits by 1s and host bits by 0s. As mentioned earlier we divide host bits for subnetting so we are reducing the host ID for the subnet ID. Class A have 24 bits to split, Class B has 16 and Class C have only 8. Let’s take a Class B IP for instance.

172.16.5.1 here (172.16) is the network part and (5.1) represents host. IP’s are subnetted bitwise, one bit subnetting will have 1 bit for subnet id and rest 15 for host part. Let me explain this in figures

1 bit subnet – <1 subnet id > <15 host ids>

2 bit subnet – <2 subnet id > <14 host ids>

3 bit subnet – <3 subnet id > <13 host ids>

and so on. Here if we take 5 bit subnetting for this IP, subnetting will be done in

172.16.5.1 bitwise representation 10101100.00010000.00000101.00000001

subnetting 5 bits     –       10101100.00010000.00000|101.00000001

The number of sub-networks created will be equal to (2^n) where n is the number of bits borrowed to network portion. Here it is 5 so

2^5 = 32

Number of hosts per subnet is calculated by formula (2^n)-2 where n is the number in host bits.  (2 subtracted is for, one is the network id which is the first IP in the network and last one will be the broadcast ip). i.e All 1’s and all 0’s are not permitted for subnets.

(2^11)-2 =2046

A bit mask, known as the subnet mask, is used to identify which bits of the

original host address field indicate the subnet number. The number is calculated by representing the network part with ones and the rest with zeroes. The subnet mask for the above IP will be

10101100.00010000.00000|101.00000001

1-21 bits are the network part they will be represented in ones and rest 22-32 in zeroes

11111111.11111111.11111000.00000000

Decimal notation will be  255.255.248.0

255.255.248.0 is the subnet mask of the the subnetting we done for the IP 172.16.5.1.

The above case is just an example as subnetting is done for a required number of hosts per subnets.

We can calculate the network id by performing a bitwise logical AND operation between the IP address and the subnet mask, then setting all the host bits to 0s. Similarly, the Broadcast Address for a subnet by performing the same logical AND between the IP address and the subnet mask, then setting all the host bits to 1s.

11111111.11111111.11111000.00000000 –

10101100.00010000.00000101.00000001

——————————————————-

10101100.00010000.00000000.00000000

10101100.00010000.00011111.11111111

Decimal notation – 172.16.0.0 will be the network id and 172.16.31.255 will be the broadcast address.

Variable Subnetting

The above subnetting done is an example of static subnetting but there are some setbacks when the subnets are divided statically. Consider a corporation where a Class C network IP 165.214.32.0 is assigned and they have a requirement to split this into 5 separate networks. And let each network has a prerequisite of

Subnet 1 : 50 hosts

Subnet 2: 50 hosts

Subnet 3: 40 hosts

Subnet 4: 30 hosts

Subnet 5: 20 hosts

The above cannot be achieved with the subnetting which we done earlier. Static subnetting can divide network into four subnets each with 64 hosts or eight subnets each with 32 hosts. This doesn’t meet our prerequisite. Here the entire network cannot have same subnet mask . To avoid such situations we divide the network into different subnets according to the requirement. For the above it can be done

The first three subnets can be divided with a mask of 255.255.255.192 the network can be divided into four subnets each with 64 hosts. The last two can be divided into two subnets each with 32 hosts by using a mask of 255.255.255.224 . This satisfies the requirement also by eliminating the possibility of high number of wasted host addresses.

Classless Addressing: Classless Inter-Domain Routing

It is a methodology of allocating IP addresses and routing Internet Protocol packets. This method was introduced to keep Internet from running out of IP addresses. Though the concept of subnetting addressed a major difficulties in classful addressing they couldn’t tackle the problem in general terms. Anyone having a requirement of more than a 254 host addresses were given Class B address block which have 65534 host addresses. This is really unacceptable at this point of time where the requirement of Ips are on a high. The method of classless addressing was introduced to avoid the crisis.

Each CIDR routing table entry contains a 32-bit IP address and a 32-bit network mask, which together give the length and value of the IP prefix. This is represented as <IP_address network_mask>. For example, to address a block of eight Class C addresses with one single routing table entry, the following representation suffices: <192.32.136.0 255.255.248.0>.

i.e Class C network range from 192.32.136.0 to 192.32.143.0 is represented as one single network.

11000000 00100000 10001000 00000000 = 192.32.136.0 (Class C address)

11111111 11111111 11111— ——– = 255.255.248.0 (network mask)

===================================== logical_AND

11000000 00100000 10001— ——– = 192.32.136 (IP prefix)

11000000 00100000 10001111 00000000 = 192.32.143.0 (Class C address)

11111111 11111111 11111— ——– = 255.255.248.0 (network mask)

===================================== logical_AND

11000000 00100000 10001— ——– = 192.32.136 (same IP prefix)

The process of combining multiple entries into a single network is known as supernetting.

The above IP is also represented in another notation 192.32.136.0/21 where 21 means network has 21 bits for network id and 11 bits for host id. Perhaps this is the widely used notation better known as CIDR notation. The following figure will explain this better.

  • General
  • Linux
  • Training

Looking for AWS Experts?

We provide top-of-the-line custom AWS setup services tailored to your needs.

IP’s – The backbone of Internet Part 3 – Subnetting and Classless Addressing

Adjusting the language settings in spamassassin

SupportSages Logo
  • cPanel
  • Howtos
  • Linux
  • Snippets
logo

Error in Drupal while enabling clean URL

SupportSages Logo
  • General
  • Howtos
  • Linux
logo

How would I checkout a particular version from SVN

SupportSages Logo
  • Howtos
  • Snippets
  • Troubleshooting
logo

IP’s – The backbone of Internet Part 1 – OSI Layer

IP’s – The backbone of Internet Part 1 – OSI Layer
  • General
  • Linux
  • Special Offers
  • Training
logo
Posts by Jithin Vijayan

One of the most inquisitive person you may come across in your life :-). His enthusiasm to unearth the existing technologies and excellent comprehension skills makes him one of the most dependable admin during critical situations. Jithin loves trekking and photography.