Free server network image

What is subnet and how VLSM works?

Understanding IPv4 subnetting:

Classful network design served its purpose in the startup stage of the Internet, but it lacked scalability in the face of the rapid expansion of the network in the 1990s. The class system of the address space was replaced with Classless Inter-Domain Routing (CIDR) in 1993. CIDR is based on variable-length subnet masking (VLSM) to allow allocation and routing based on arbitrary-length prefixes.

Variable-length subnet masking (VLSM)

It is the more realistic way of subnetting a network to make for the most efficient use of all of the bits. The classful (or classical) subnetting, all subnets have the same number of hosts because they all use the same subnet mask. This leads to inefficiencies.

VLSM is the process of “subnetting a subnet” and using different subnet masks for different networks in your IP plan. make sure that there is no overlap in any of the addresses.

* as per classical subnetting, you always have to eliminate the subnets that contain either all zeros or all ones in the subnet portion. Hence, you use 2nb-2 for network or 2hb-2 for host calculation.

But, Cisco devices can use those subnets if ip subnet-zero is in the configuration. This command is on by default in Cisco IOS Software Release 12.0 and later; if it was turned off we can re-enable it by using the following command:

Router Command to enable 0 subnet-

  • Router(config)#ip subnet-zero

Now you can use the formula 2nb rather than 2nb-2

Example of Subnetting / VLSM-

Q. You have a Class C address of /24. You need nine subnets. What is the IP

plan of network numbers, broadcast numbers, and valid host numbers? What is the subnet

mask needed for this plan?

N = Network bits

H = Host bits

All 0s in host portion = Network or subnetwork address

All 1s in host portion = Broadcast address

Combination of 1s and 0s in host portion = Valid host address

*You cannot use N bits, only H bits. Therefore, ignore 192.168.100. These numbers cannot change.

Step 1.  Determine how many N bits you need to borrow to create six valid subnets.

2nb-2>6.     or     23-2>6.    Or    8>6.

N = 3, so you need to borrow 3 H bits and turn them into N bits



Step 2.  Finish the IP plan table.

SubnetSubNetwork Address (0000)Range of Valid Hosts (0001–1110)Broadcast Address (1111)
0 (000) invalid192.168.100.0192.168.100.1 –
1 (001) –
2 (010) –
3 (011)–
4 (100) –
5 (101) –
6 (110) –
7 (111) invalid192.168.100.224                      256192.168.100.225 –

Step 3. Calculate Subnetmask

      Default subnetmask  =   /24 or 11111111.11111111.11111111.00000000

      New subnetmask      =   /27 or 11111111.11111111.11111111.11100000   

Example VLSM-

Q. You have been allocated a IP . required network content is- Net_A with 50 host, Net_B with 27 host, Net_C with 12 host, Net_D with 12 host, Net_E with 12, Net_F/G/H with 2 host.

Step1-  find out largest number of PC’s network & create subnet.

  (Net_A =  50 Host)

2hb-2>50   or 26-2>50   or 62>50.   so required HB= 6  remaining NB=2



SubnetSubNetwork Address (00)Range of Valid Hosts (000001–111110)Broadcast Address (111111)PrifixAsigned network
0 (00)  /26 
1 (01) –.126192.168.100.127/26For A
2 (10) been subnetted/26 
3 (11)  /26 

Step2. Pick the next largest network to work with  (Net_B = 27 Host)

2hb-2>27   or   25-2>27   or 32>27.   So   required HB= 5 

Pick one of the remaining /26 networks to work with Network B.

For the purposes of this example, select the .128/26 network:  =  10000000

But you need only 5 H bits, not 6. Therefore, you are left with = 10N00000

where10 represents the original subnetting. N = extra bit. 00000 = 5 H bits you need for Network B.

Because you have this extra bit, you can create two smaller subnets from the original subnet:



Converted to decimal, these subnets are as follows:

10000000 =.128

10100000 =.160

You have now subnetted a subnet! This is the basis of VLSM.

Picked subnet =

SubnetSubNetwork AddressRange of Valid Hosts (00001–11110)Broadcast Address (11111)PrifixAsigned network
0 (100) – .158192.168.100.159/27For B
1 (101)  /27 

Step3. Pick the next largest network to work with  (Net_C  = 12 Host)

2hb-2>12   or   24-2>12   or  16>12.   so required HB= 4

Now chose a /26network, or you could go to a /27 network and try to fit them into there.

select the remaining /27 network—.160/27

10100000 (The 1 in the third bit place is part of the N bits.)

But you only need 4 H bits, not 5. Therefore, you are left with 101N0000

where10 = original subnetting. N = extra bit you have. 00000 = 5 H bits for Network B.

Because of extra bit, you can create two smaller subnets from the original subnet:



Picked subnet =

SubnetSubNetwork AddressRange of Valid Hosts (0001–1110)Broadcast Address (1111)PrifixAsigned network
0 (1010) – .174192.168.100.175/28For C
1 (1011) – .190192.168.100.191/28For D

Step4. Pick the next largest network to work with  (Net_D  = 12 Host)

As it fit in earlier subnet so assign this network to

Step5. Pick the next largest network to work with  (Net_C  = 12 Host)

Determine Network Numbers for Serial Links (Net_E/F/G with 2 host.)

2hb-2>2   or   22-2>2   or  2>2.   so required HB= 2

As no subneted subnet remaining we have to chose .0/26 or .192/26 subnetwork to work with.

ID =


Extra bit for subnet =

SubnetSubNetwork Address (000000)Range of Valid Hosts (01–10)Broadcast Address (11)PrifixAsigned network
0 (000000) – 2192.168.100.3/30For E
1 (000001) – 6192.168.100.7/30For F
2 (000010) – 10192.168.100.11/30For G
3 (000011) – 14192.168.100.15/30 
 Calculation will be run till .64

Route Summarization :

Route summarization, or supernetting, is needed to reduce the number of routes that a

router advertises to its neighbor. with route summarization, you can advertise many routes with only one line in an update packet.This reduces the size of the update, allowing you more bandwidth for data transfer.

Leave a Reply

Our customer support team is here to answer your questions. Ask us anything!
👋 Hi, how can I help?
Scroll to Top

Institute Registration

National Program for Information Technology & Skill Development

Address of your academy:

Submit Documents

Documentation Fee