×

Subnetting

Subnetting is the process of dividing a big network into many small networks.

Suppose there is a company which has four departments like Development, HR, Marketing, and Testing. We don't want that all departments access a shared server. The development department has a server, and we want to protect this server from other departments. In this case, we can’t leave the network easily, other things that maintenance and security are also big issues in the large networks, so for this, we use the concept of subnetting.

Advantages of Subnetting

  • Reduce Network traffic
  • Optimized network performance
  • Simplified management
  • Better Security
  • Smaller collision and broadcast domain

Subnet Masks

  • Every host on a network has subnet mask and IP address.
  • A subnet mask is a 32-bit binary string of 1’s followed by some numbers of 0’s. It defines a range of IP address available within a network.
  • It is used to identify the network and host portion of the IP address.
  • The subnet mask is made by setting network address bits to all 1s (11111111=255) and host address bits to all 0s (00000000=0)
  • In any Network, two address is reserved for a special purpose, and cannot be assigned to the hosts. All 0s (0.0.0.0) are assigned to a network address and all "255" (255.255.255.255) are assigned to a broadcast address.
  • The default subnet mask of class A, B, and C cannot be changed.

Default subnet mask

    Class Format Default Subnet Mask
        A network.host.host.host    255.0.0.0
       B network.network.host.host   255.255.0.0
       C network.network.network.host  255.255.255.0

How to get your Computer’s IP address and Subnet mask?

  • For Mac, you can open your terminal and, type                                “ipconfig-a” then hit Enter.
  • For windows, you can start your windows command prompt

and, type command “ipconfig/all” then hit Enter.

cidr2

Classless Inter-Domain Routing (CIDR)

  • It is also called as supernetting.
  • It is a method that ISPs (Internet Service Providers) use to allocate a number of addresses to a company, a home, and a customer.
  • It uses a number of binary bits set 1 (or on), in a subnet mask, preceded by a slash.

For Example, a subnet mask of 255.255.255.192 can be represented as follows in binary:

        11111111.11111111.11111111.11000000

In the above subnet mask, the first 26 bits are set to 1. The CIDR notation for this subnet mask would be /26.

Example 2:

A subnet mask of 255.255.192.0 can be represented as follows in binary:

        11111111.11111111.11000000.00000000

In the above subnet mask, the first 26 bits are set to 1. The CIDR notation for this subnet mask would be /26.

CIDR values      

    Subnet Mask  CIDR Value
255.0.0.0      /8
255.128.0.0  /9
    255.192.0.0     /10
    255.224.0.0     /11
    255.240.0.0     /12
    255.248.0.0     /13
    255.252.0.0     /14
    255.254.0.0     /15
    255.255.0.0     /16
  255.255.128.0     /17
  255.255.192.0     /18
  255.255.224.0     /19
  255.255.240.0     /20
  255.255.248.0     /21
  255.255.252.0     /22
  255.255.254.0     /23
  255.255.255.0     /24
 255.255.255.128     /25
 255.255.255.192     /26
 255.255.255.224     /27
 255.255.255.240     /28
 255.255.255.248     /29
 255.255.255.252     /30
  • /8 to /15 can only be used with Class A network addresses.
  • /16 to /23 can be used by Class A and Class B network addresses.
  • /24 to /30 can be used by Class A, B, and C network addresses.

How CIDR works?

CIDR assigns a numerical prefix [(/n), where n is the mask or number of bits to represent block/ network] to each IP address.

Example

An IP address using CIDR 177.67.5.44/13:

The prefix 13 indicates that the first 13 bits of IP address is used to identify the network, while the remaining 32-13 = 19 bits are used for identifying the host.

Some important formulas to create subnets

Block size = 256 – (a value from subnet mask)

No. of Subnets = 2n

Where,

N= number of ON bits, or the 1s.

No. of host = -2

No. of host = 2H-2

Where,

H = number of OFF bits, or the 0s.

Class C subnetting

Example:

In given class A, Address: 192.168.10.0/26, find the following:

  1. How many subnets?
  2. How many hosts per subnet?
  3. What are the valid subnets?
  4. What’s the broadcast address for each subnet?
  5. What is the valid host?

Solution:

As we know, in class C

Network ID = 8

Host ID = 24

Network address = 192.168.10.0

CIDR = 26

Since, 26 ON bits, so the subnet mask will be 255.255.255.192.

 In, 192 (11000000) Number of ON bits = 2

 Number of OFF bits = 6

  • No. of subnets =  22= 4
  • No. of hosts per subnet = 26-2 = 64-2=62
  • Valid subnets (Block size) = 256-192 = 64. We start at zero and count in our block size, so our subnets are 0, 64, 128, and 192.
  • For zero subnet, the next subnet is 64, so the broadcast of 0 subnet is 63.
  • Valid hosts are the numbers between the subnet and broadcast address.
cidr3

Class B Subnetting

Example:

In a given class A Address: 172.16.0.0/17, find the following:

  1. How many subnets?
  2. How many hosts per subnet?
  3. What are the valid subnets?
  4. What’s the broadcast address for each subnet?
  5. What is the valid host?

Solution:

As we know

In class B, Network ID = 16

Host ID = 16

Network address = 172.16.0.0

CIDR = 17

Since, 17 ON bits, so the subnet mask will be 255.255.128.0.

 In, 128 (10000000) Number of ON bits = 1

 Number of OFF bits = 7

  1. No. of subnets = 21=2
  2. No. of hosts per subnet = 215-2 = 32,766
  3. Valid subnets (Block size) = 256-128 = 128.
  4. For zero subnet, the next subnet is 128, so the broadcast of 0 subnet is 127.
  5. Valid hosts are the numbers between the subnet and broadcast address.

Class ASubnetting

Example:

In a given class B Address: 10.0.0.0/9, find the following:

  1. How many subnets?
  2. How many hosts per subnet?
  3. What are the valid subnets?
  4. What’s the broadcast address for each subnet?
  5. What is the valid host?

Solution:

As we know, in class A

Network ID = 24

Host Id = 8

Network address = 10.0.0.0

CIDR = 9

Since, 9 ON bits, so the subnet mask will be 255.128.0.0.

 In, 128 (10000000) Number of ON bits = 1

 Number of OFF bits = 23

  1. No. of subnets =  21= 8
  2. No. of hosts per subnet = 223-2
  3. Valid subnets (Block size) = 256-128 =128.
  4. For zero subnet, the next subnet is 128, so the broadcast of 0 subnet is 127.
  5. Valid hosts are the numbers between the subnet and broadcast address.

Related Topics

Routing Basics

Routing is the process of delivering a message across one or more networks by choosing the most appropriate path.It is performed by many kinds of networks like telephone network (Circuit Switching), electronic data networks...

2 minutes read.

Configure IP address to Router and PC in Packet Tracer

Configure IP address to Router and PC in Packet Tracer As a Network Engineer, it is compulsory to know how to configure an IP Address on networking devices like Router, Switch, PC, and Server.Assigning...

3 minutes read.

Saving, Erasing, and Verifying Configuration

Saving Configuration Cisco device store commands information into two configuration files: running configurationstartup configuration running configuration In the running configuration, you can manually save the data from RAM to NVRAM by typing the copy running-config startup-config command. When you...

3 minutes read.

Ethernet Networks in Review

Ethernet Networks in Review Today, Ethernet is the most used technology for the LANs. It is described as IEEE 802.3 standard. Ethernet is a connection-based media access method i.e., Carrier Sense...

2 minutes read.

Download and Install the Cisco Packet Tracer

Download and Install the Cisco Packet Tracer Step1: -Download Cisco Packet Tracer from the link given below: https://arief-jr.blogspot.com/2016/01/download-cisco-packet-tracer-62-for.html Here we will download Cisco packet tracer for Windows OS, so for Windows, go for...

1 minute read.

Verifying OSPF Configuration

There are several ways to verify OSPF configuration and operations, which are: show ip route commandshow ip ospf commandshow ip ospf database commandshow ip ospf interface commandshow ip protocol commandshow ip ospf neighbor commanddebugging ospf Consider the following topology –We...

2 minutes read.

Getting familiar with the IOS modes

  There are following primary modes of operation in IOS. Setup ModeUser Exec ModePrivileged Exec ModeGlobal Configuration ModeInterface Configuration ModeRommon Mode Setup Mode In router or switches, all configurations are saved in NVRAM.If there is no...

3 minutes read.

Components of a Cisco Router

The Internal Components of a Cisco Router Before troubleshoot and configure Cisco devices, it is necessary to know the major components of the Cisco routers. The given table shows all the internal components of...

2 minutes read.

The OSI Reference Model

OSI Reference Model OSI stands for Open System Interconnection. OSI provides a framework for creating and implementing networking standards, devices, and internetworking schemes. The following devices operate at the OSI model: Network...

6 minutes read.

VLAN Basics

VLAN stands for Virtual Local Area Network. It is a logical group of networking devices that allows a single extended LAN to be partitioned into several separate LANs. The important feature of...

4 minutes read.

Spanning Tree Protocol (STP)

Spanning Tree Protocol (STP) is a Data link layer (layer 2) protocol that is used to discover and maintain a valid loop-free path for the switched network. It is also used to analyze...

4 minutes read.

Configuring EIGRP

Consider the topology given below – The initial IP configuration table is given below: Devices Interface IP address Router1 ...

2 minutes read.

Static Routing

Static Routing Static Routing is the process in which static routes are manually added to the routing table through the direct configuration. Static routing is configured in the global configuration mode using syntax: Router(config)#ip route...

3 minutes read.

Configure IP Routing

IP Routing stands for “Internet Protocol Routing.”It is the process of sending packets (data) from a source network to a destination network.In IP Routing, routers select the best route for a data packet from the...

2 minutes read.

Switching

A switch is a network device which is used to connect multiple devices (routers, computers) inside the LAN (Local Area Network). It operates at Data Link Layer (Layer 2) of the OSI reference...

3 minutes read.

Configuring Catalyst Switches

When you power on a new purchased Switch for the first time, it runs a series of Power-On Self Tests (POSTs) operations. A  POST is designed to verify the basic operations of the...

3 minutes read.

Power on a Cisco device

Power on a Cisco device When you power on a new purchased Cisco device for the first time, it performs a power-on-self-test (POST) operation to identify the hardware components and to verify that all...

1 minute read.

Configure Password

Password configuration is an in-built feature of Cisco devices.Each Cisco device uses a password to authenticate users for accessing the device and also provides security to the Cisco devices. There are five types of the...

2 minutes read.

Configure DHCP

 DHCP DHCP stands for Dynamic Host Configuration Protocol.It is a client server-based architecture which involves DHCP client and DHCP server.It is a messaging system for the communication between the DHCP server and DHCP client.It...

3 minutes read.

Configuring IP Routing in Our Network

There are 3 types of IP routing that we can configure in our network. Default RoutingStatic RoutingDynamic Routing Default Routing Default Routing is used to configure unknown destination networks.It is used on stub networks. Stub networks are...

3 minutes read.