0% found this document useful (0 votes)
4 views

TCP - IP Reference Model Explained

Tcp ip explanatiin
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

TCP - IP Reference Model Explained

Tcp ip explanatiin
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 86

TCP/IP Reference Model Explained

This tutorial explains five layers of the TCP/IP model (Application, Transport, Internet
or Network, Data Link, and Physical) and their functionalities.

Application Layer
This layer defines the protocols and standards that an application requires to
connect to the network. For example, an application layer protocol HTTP defines
how a web browser can fetch a web page from a web server.

The following image shows an example of the HTTP protocol.

The HTTP protocol manages the communication between the web browser and the
webserver. It is a language that web browsers and web servers understand and use
to provide the necessary information.

When we type a URL in the address bar of a web browser and press the Enter key,
the HTTP protocol finds the destination address, gets the requested content from the
destination host, and displays the received content. If the requested content is not
available, it displays an error message.

The Application layer does not define any application. It only defines the standards,
services, and protocols that an application needs to connect to a remote computer.
HTTP, HTTPS, SNMP, NTP, SSH, FTP, TFTP, Telnet, DHCP, and DNS are
examples of application layer protocols.

This tutorial is the fourth part of the article "Networking reference models explained in detail with
examples.". Other parts of this article are the following.

OSI Model Advantages and Basic Purpose Explained

This tutorial is the first part of the article. It briefly explains why the OSI model was created and what the
advantages of the OSI model are.

OSI Seven Layers Model Explained with Examples

This tutorial is the second part of the article. It explains the seven layers of the OSI model in detail.
Similarities and Differences between OSI and TCP/IP Model

This tutorial is the third part of the article. It compares the OSI reference model with the TCP/IP model and
lists the similarities and differences between both.

Data Encapsulation and De-encapsulation Explained

This tutorial is the fifth part of the article. It explains how data is encapsulated and de-encapsulated when it
passes through the layers.

Transport layer
This layer is also known as the host-to-host layer. It provides a logical connection
between two hosts. The main functions of this layer are the following: -

 Segmentation
 Reliability
 Flow control
 Connection multiplexing

Let’s understand each of these functions in detail.

Segmentation

The process of breaking up a large data file into smaller and identifiable pieces is
known as segmentation. Each piece produced in the segmentation process is
known as a segment. Let's take an example.

A host wants to send a 100Mb file over a 1Mbps connection. Since the host cannot
transfer a 100Mb file over a 1Mbps connection, it breaks the file into 100 or more
pieces. It sets the size of each piece to less than or equal to the size of the
connection. This process is known as segmentation, and each piece produced in this
process is known as a segment.

Since the size of a segment is less than or equal to the size of the connection, it can
easily travel across the connection. The destination host, upon receiving all pieces,
reassembles them back in the original file. Segmentation allows a host to send and
receive any size of data file over any size of the connection.

Reliability

A connection is considered as a reliable connection when it provides the following


services: -

 Recognize and resend the lost segments.


 Recognize the segment order and arrange segments in the correct order.
 Detect the duplicate segments and drop the extra segments.

TCP protocol provides all the above services. It assigns a unique number to each
segment in a sequence. By using the sequence numbers, the remote host can
rearrange all the segments in the original order. After transmitting the segments, it
waits for an acknowledgment from the remote host. If it doesn’t receive an
acknowledgment, it retransmits the segments.

Some applications such as DHCP and DNS do not require reliability. If an application
doesn’t require reliability, it usually uses UDP protocol to transmit the data. Since
UDP doesn’t use a reliable connection, it doesn’t insert the information in each
segment header that is required in a reliable connection. Without this information, the
header becomes much lighter than the header with this information. A segment with
a lightweight header moves faster in the network than a segment with a heavy
header.

Flow control

Flow control ensures that the remote host does not become overwhelmed by the
source host sending too many segments at once. There are two types of flow
control; ready /not-ready signals and windowing.

Ready/not-ready signals

In this method, the destination host sends ready and not-ready signals to the source
host. Based on these signals, the source host controls the flow. The destination host
sends a not-ready signal when its buffer fills up. Upon receiving the not-ready signal,
the source host stops sending more segments and waits for a ready signal. Once the
destination host is ready to receive more segments, it sends a ready signal to the
source host. Upon receiving the ready signal, the source host resumes data sending.

Windowing

In this method, the source host and destination host first define the window size.
Window size is the number of segments that the source host can send before
receiving an acknowledgment from the destination host. Once the acknowledgment
is received, the source host can send the next batch of segments.

Connection multiplexing

Multiplexing allows a host to initiate multiple connections with one or many hosts
simultaneously. When a source host opens a connection, a session occurs. A
session can be reliable or unreliable. To distinguish each session, the source host
uses port numbers. It assigns a unique source port number to each segment which
it sends in the session.

Internet or Network Layer


In the original TCP/IP model, this layer is defined as the Internet layer. In the
updated version, it is renamed to the Network layer. The main functions of this layer
are addressing and routing. For these functions, it uses IP protocol.

Addressing
To communicate with other hosts, every host in a network needs a unique address.
A unique address is the combination of two types of addresses; software address
and hardware address. This layer assigns software addresses. A software address is
also known as an IP address.

Routing

Just like postal service delivers packages in the real world, routing service delivers
data packets in the network. Routers provide the routing service. Routers receive
data packets from source hosts and use certain logic to filter, forward, and deliver
packets. A router reads the destination address of the incoming packet, finds the
destination address, and delivers the packet to the destination host.

Just as the post office filters and reroutes the package based on the destination
address, a router checks the destination address in the data packet and routes it
through the best and the shortest path.

Link Layer (Data Link and Physical Layer)


This layer defines standards and protocols for data transmission and physical
connectivity. It also provides hardware addressing that is used to locate a device in
the local network. Switching and connecting devices are the two main functions of
this layer.

Broadly, switching is just like routing, but it works with the hardware address instead
of the software address. Switches are used for switching. Besides switching, it also
defines standards and protocols which are used for physical connectivity.

In the original TCP/IP model, both functions are defined in the Link layer. In the
updated version, both functions are defined separately. Functions and standards
which are directly related to the physical transmission are defined in the Physical
layer. Functions and standards which are indirectly related to physical transmission
are defined in the Data link layer.

In the updated version, switching is defined in the Data link layer while standards
and protocols related to the physical transmission are defined in the Physical layer.
Reference to other networking models

When the TCP/IP model was in the development phase, many standards and
protocols had already been defined in other networking models. Developers of the
TCP/IP model, instead of defining these standards and protocols again, referenced
them in the TCP/IP model with their respective model names such as Ethernet
standards and IEEE standards.

Whenever you see a standard mentioned with its model-name such as Ethernet
standard or IEEE standard in TCP/IP model, you should consider it as a referenced
standard. A referenced standard or protocol is a standard or protocol that is originally
defined in another networking model.

Similarities and Differences between OSI


and TCP/IP model
This tutorial compares the OSI reference model with the TCP/IP model. Learn the
similarities and differences between the OSI reference model and the TCP/IP model.

The TCP/IP and OSI are network reference models. The process of developing both
models began in the early 1970s and ended in the late 1970s. Both models were
published in the early 1980s. Manufacturers manufactured devices to support one
model or both models in the 1990s. By the late 1990s, the TCP/IP model became a
common option and the OSI model was rejected due to a slower formal
standardization process than the TCP/IP model. Leading manufacturers abandoned
their proprietary networking model in favor of the TCP/IP model in the 2000s.
Nowadays, only the TCP/IP model is used. Almost all modern computer networks
are built using the TCP/IP model. All modern networking devices support the TCP/IP
model.

Why is the OSI model still taught in networking courses?

In terms of explanation and documentation, the TCP/IP model stands nowhere near
the OSI model. The OSI model is one of the best explained and well-documented
models ever created. It describes complex networking concepts, protocols, and
terms in such a manner that is not only easy to understand but also easier to
remember.

Since both models were built to achieve the same goal, they both use the same set
of standard protocols and similarly describe networking concepts. By learning one
model, you can easily learn another model.

For this reason, even though the OSI model is not supported and used by hardware
manufacturers, it is still taught in almost all networking courses. Once students learn
the OSI model, they are introduced to the TCP/IP model. Since they have already
learned the foundation topics and the layered approach from the OSI model, learning
the TCP/IP model becomes easier for them.

This article also follows the same approach. The first two parts of this article explain
the OSI model and its layers. This part explains the differences and similarities
between the TCP/IP model and the OSI model. And the next two parts explain the
TCP/IP model and its layers.

This tutorial is the third part of the article "Networking reference models explained in detail with
examples". Other parts of this article are the following.

OSI Model Advantages and Basic Purpose Explained

This tutorial is the first part of the article. It briefly explains why the OSI model created was and what the
advantages of the OSI model are.

OSI Seven Layers Model Explained with Examples

This tutorial is the second part of the article. It explains the seven layers of the OSI model in detail.

TCP/IP Reference Model Explained

This tutorial is the fourth part of the article. It explains the five layers of the TCP/IP model in detail.

Data Encapsulation and De-encapsulation Explained

This tutorial is the fifth part of the article. It explains how data is encapsulated and de-encapsulated when it
passes through the layers.

Similarities between the TCP/IP model and the OSI model


 Both are logical models.
 Both define standards for networking.
 Both provide a framework for creating and implementing networking standards and
devices.
 Both divide the network communication process into layers.
 In both models, a single layer defines a particular functionality and sets standards for
that functionality only.
 Both models allow a manufacturer to make devices and network components that
can coexist and work with the devices and components made by other
manufacturers.
 Both models simplify the troubleshooting process by dividing complex functions into
simpler components.
 Instead of defining the already defined standards and protocols, both models
referenced them. For example, the Ethernet standards were already defined by IEEE
before the creation of these models. So instead of defining them again both models
used them as IEEE Ethernet standards.

Differences between the OSI model and the TCP/IP model

 The OSI Layer model has seven layers while the TCP/IP model has four layers.
 The OSI Layer model is no longer used while the TCP/IP is still used in computer
networking.
 To define the functionalities of upper layers, the OSI model uses three separate
layers (Application, Presentation, and Session) while the TCP/IP model uses a single
layer (Application).
 Just like the upper layers, the OSI model uses two separate layers (Physical and
Data-link) to define the functionalities of the bottom layers while the TCP/IP uses a
single layer (Link layer) for the same.
 To define the routing protocols and standards, the OSI model uses the Network layer
while the TCP/IP model uses the Internet layer.
 The OSI model is well documented than the TCP/IP model.
 The OSI model explains every standard and protocol in detail while the TCP/IP
model provides a summarized version of the same.

Differences between the original TCP/IP model and the updated TCP/IP model
The TCP/IP model which we use nowadays is slightly different from the original
TCP/IP model. The original TCP/IP model has four layers while the updated TCP/IP
model has five layers.

The original version uses a single layer (Link layer) to define the functionalities and
components that are responsible for data transmission. The updated version uses
two layers (Data Link and Physical) for the same.

It defines the functions that are directly related to the data transmission in the
Physical layer and defines the functions that are indirectly related to the data
transmission in the Data-link layer.

In the updated version, the name of the Internet layer is changed to the Network
layer.

The following figure compares the OSI reference model, the original TCP/IP model,
and the updated TCP/IP model.
No matter which model you study or learn first, once you learned one, you can easily
correlate it with another. In general comparison, the updated TCP/IP model is much
or less similar to the OSI model except for the Application layer. For learning, you
can think that the Application layer of the TCP/IP model does what the top three
layers (Application, Presentation, and Session) of the OSI model do.

OSI Seven Layers Model Explained with


Examples
This tutorial explains the OSI reference model. Learn the seven layers of the OSI
model and the functions of each layer in detail through examples.

The OSI (Open System Interconnection) reference model is a comprehensive set of


standards and rules for hardware manufacturers and software developers. By
following these standards, they can build networking components and software
applications that work in any environment. It was published in 1984 by ISO
(International Organization for Standardization).
It provides a framework for creating and implementing networking standards,
devices, and internetworking schemes. It explains the networking from a modular
perspective, making it easier to understand and troubleshoot.

Seven layers of the OSI Model

The OSI model has seven different layers, which are divided into two groups. The
following table lists all the layers with their names and numbers.

Group Layer Number Layer Name Description

Top Layers 7 Application Provide a user interface for sending and receiving data

6 Presentation Encrypt, format, and compress data for transmission

5 Session Initiate and terminate a session with the remote system

Bottom Layers 4 Transport Break the data stream into smaller segments and provide re

3 Network Provide logical addressing

2 Data Link Prepare data for transmission

1 Physical Move data between devices

Let’s understand each layer in detail.


This tutorial is the second part of the article "Networking reference models explained in detail with
examples.". Other parts of this article are the following.

OSI Model Advantages and Basic Purpose Explained

This tutorial is the first part of the article. It summarizes why the OSI model was created and what
advantages it has.

Similarities and Differences between OSI and TCP/IP Model

This tutorial is the third part of the article. It compares the OSI reference model with the TCP/IP model and
lists the similarities and differences between both.

TCP/IP Reference Model Explained

This tutorial is the fourth part of the article. It explains the five layers of the TCP/IP model in detail.

Data Encapsulation and De-encapsulation Explained

This tutorial is the fifth part of the article. It explains how data is encapsulated and de-encapsulated when it
passes through the layers.

The Application Layer

This is the last and topmost layer of the OSI model. This layer provides an interface
between the local system and the application program running on the network. If an
application wants to use the resources available on the remote system, it interacts
with this layer. Then, this layer provides the protocols and services that the
application needs to access those resources.

There are two types of application programs: Network-aware and Network-


unaware. An application program is considered a Network-aware application if it can
make any type of network request. If an application program cannot make any type
of network request, it is considered a Network-unaware program.

Network-aware programs are further divided into two types.

1. Programs that are mainly built to work on a local system. This type of program
occasionally accesses the network for particular reasons such as updates,
documentation, and troubleshooting. MS-Word, Adobe-Photoshop, and VLC
Player are examples of this type of program.

2. Programs that are mainly built to work with a remote system. This type of
program provides a platform to access resources available on a remote
system. This type of program only works if the system is connected to the
network. SSH, FTP, and TFTP are examples of this type of program.

The Application layer describes only the programs which fall in the second type. But
it doesn’t mean that the first type of programs can’t take the advantage of the
Application layer. It simply means that they are not documented in the Application
layer. But if required, they can also connect to the network through the Application
layer.
The Top layer of the OSI model is the application layer. It provides the protocols and
services that are required by the network-aware applications to connect to the
network. FTP, TFTP, POP3, SMTP, and HTTP are examples of standards and
protocols used in this layer.

The Presentation Layer

The sixth layer of the OSI model is the Presentation layer. Applications running on
the local system may or may not understand the format that is used to transmit the
data over the network. The presentation layer works as a translator. When receiving
data from the Application layer, it converts that data in such a format that can be sent
over the network. When receiving data from the Session layer, it reconverts the data
in such a format that the application, which will use it, can understand.

Conversion, compression, and encryption are the main functions that the
Presentation layer performs on the sending computer while on the receiving
computer these functions are reconversion, decompression, and decryption. ASCII,
BMP, GIF, JPEG, WAV, AVI, and MPEG are examples of standards and protocols
that work in this layer.

The Session Layer

The session layer is the fifth layer of the OSI model. It is responsible for setting up,
managing, and dismantling sessions between presentation layer entities and
providing dialogs between computers.

When an application makes a network request, this layer checks whether the
requested resource is available on the local system or on a remote system. If the
requested resource is available on a remote system, it tests whether a network
connection to access that resource is available or not. If a network connection is not
available, it sends an error message back to the application informing that the
connection is not available.

If a network connection is available, it establishes a session with the remote system.


For each request, it uses a separate session. This allows multiple applications to
send or receive data simultaneously. When data transmission is completed, it
terminates the session.

The session layer is responsible for establishing, managing, and terminating


communications between two computers. RPCs and NFS are examples of the
session layer.

The Transport Layer

The transport layer is the fourth layer of the OSI model. It provides the following
functionalities: -

Segmentation
On the sending computer, it breaks the data stream into smaller pieces. Each piece
is known as a segment and the process of breaking the data stream into smaller
pieces is known as the segmentation. On the receiving computer, it joins all
segments to recreate the original data stream.

Data transportation
This layer establishes a logical connection between the sending system and
receiving system and uses that connection to provide end-to-end data transportation.
This process uses two protocols: TCP and UDP.

The TCP protocol is used for reliable data transportation. TCP is a connection-
oriented protocol. UDP protocol is used for unreliable data transportation. UDP is a
connection-less protocol.

The main difference between a connection-less and connection-oriented protocol is


that a connection-oriented protocol provides reliable data delivery. For reliable data
delivery, it uses several mechanisms such as the three-way handshake process,
acknowledgments, sequencing, and flow control.

Multiplexing
Through the use of port numbers, this layer also provides connection multiplexing.
Connection multiplexing allows multiple applications to send and receive data
simultaneously.

The main functionalities of the Transport layer are segmentation, data transportation,
and connection multiplexing. For data transportation, it uses TCP and UDP
protocols. TCP is a connection-oriented protocol. It provides reliable data delivery.

The Network Layer

The third layer of the OSI model is the Network Layer. This layer takes the data
segment from the Transport layer and adds a logical address to it. A logical address
has two components; network partition and host partition. The Network partition is
used to group networking components while the host partition is used to uniquely
identify a system on the network. A logical address is known as the IP address.
Once the logical address and other related information are added to the segment, it
becomes the packet.

This layer decides whether the packet is intended for the local system or a remote
system. It also specifies the standards and protocols which are used to move data
packets over networks.

To move data packets between two different networks, a device known as the router
is used. Routers use the logical address to make the routing decision. Routing is the
process of forwarding data packets to their destination.

Defining logical addresses and finding the best path to reach the destination address
are the main functions of this layer. Routers work in this layer. Routing also takes
place in this layer. IP, IPX, and AppleTalk are examples of this layer.

The Data Link Layer


The Data Link Layer is the second layer of the OSI model. This layer defines how
networking components access the media and what transmission methods they use.
This layer has two sub-layers: MAC and LLC.

MAC (Media Access Control)


This sub-layer defines how the data packets are placed in media. It also provides
physical addressing. The physical address is known as the MAC address. Unlike
logical addresses that need to be configured, physical addresses are pre-configured
in NIC. The MAC address is used to uniquely identify a host in the local network.

LLC (Logical Link Control)


This sub-layer identifies the network layer protocol. On the sending computer, it
encapsulates the information of the Network Layer protocol in the LLC header from
which the Data Link layer receives the data packet. On the receiving computer, it
checks the LLC header to get the information about the network layer protocol. This
way, a data packet is always delivered to the same network layer protocol from
which it was sent.

Defining physical addresses, finding hosts in the local network, specifying standards
and methods to access the media are the primary functions of this layer. Switching
takes place in this layer. Switches and Bridges work in this layer. HDLC, PPP, and
Frame Relay are examples of this layer.

The Physical Layer

The Physical Layer is the first layer of the OSI model. This layer specifies the
standards for devices, media, and technologies that are used in moving the data
across the network such as:-

 Type of cable used in connecting the devices


 Patterns of pins used in both sides of the cable
 Type of interface-card used in the networking device
 Type of connector used to connect the cable with the network interface
 Encoding of digital signals received from the Data Link layer based on the attached
media type such as electrical for copper, light for fiber, or a radio wave for wireless.

On the sending computer, it converts digital signals received from the Data Link
layer, into analog signals and loads them on the physical media. On the receiving
computer, it picks analog signals from the media and converts them into digital
signals, and transfers them to the Data Link layer for further processing.

The Physical Layer mainly defines standards for media and devices that are used to
move data across the network. 10BaseT, 10Base100, CSU/DSU, DCE, and DTE are
examples of the standards used in this layer.
OSI Model Advantages and Basic
Purpose Explained
This tutorial explains the advantages, disadvantages, and basic purposes of the OSI
model in detail. Learn why the OSI Model was created along with the purposes and
benefits of the OSI model.

A networking model describes how information is transferred from one networking


component to another. Just like a house blueprint defines the materials and
technologies that are used in constructing the house, a networking model defines the
protocols and devices that are required in building the network.

Technically, a networking model is a comprehensive set of documents that describes


how everything should happen in the network. Individually, each document describes
a functionality, protocol, or device that is required by a small portion of the network.

Why was the OSI Model created?

In starting days of computer networking, vendors created proprietary networking


models to support their products. The biggest problem with these models was that
they allowed communication only between the devices that were manufactured by
the same vendor. For example, a computer manufactured by IBM was able to
communicate only with the computer or networking device that was also
manufactured by IBM.

This situation was neither good nor profitable for both manufacturers and
consumers. It not only forced manufacturers to make all essential networking
devices but also forced consumers to buy all devices from the same manufacturer.

To break this barrier, leading hardware manufactures agreed to use or support a


vendor-neutral networking model along with their proprietary networking model. To
create a vendor-neutral networking model, two major efforts were made.

The first one was made by ISO, and the second one was made by DoD. ISO (The
International Organization for Standardization) created the OSI (Open Systems
Interconnection) model and DoD (U.S. Department of Defense) created the TCP/IP
model.

This tutorial is the first part of the article "Networking reference models explained in detail with
examples". Other parts of this article are the following.

OSI Seven Layers Model Explained with Examples

This tutorial is the second part of the article. It explains the seven layers of the OSI model in detail.

Similarities and Differences between OSI and TCP/IP Model

This tutorial is the third part of the article. It compares the OSI reference model with the TCP/IP model and
lists the similarities and differences between both models.
TCP/IP Reference Model Explained

This tutorial is the fourth part of the article. It explains the five layers of the TCP/IP model in detail.

Data Encapsulation and De-encapsulation Explained

This tutorial is the fifth part of the article. It explains how data is encapsulated and de-encapsulated when it
passes through the layers.

Purposes of OSI model

OSI model was created for the following purposes:-

 To standardize data networking protocols to allow communication between all


networking devices across the entire planet.
 To create a common platform for software developers and hardware
manufactures that encourage the creation of networking products that can
communicate with each other over the network.
 To help network administrators by dividing large data exchange process into
smaller segments. Smaller segments are easier to understand, manage and
troubleshoot.

The layered approach

A layered approach is a hierarchical way to address all required technologies and


devices in communication. It allows vendors and manufactures to build and design
specific applications and hardware into one layer for a particular purpose without
affecting the entire network protocol stack.

OSI model uses this approach. It divides the entire communication process into
seven layers. Each layer describes a particular functionality along with the protocols
and devices which are required to perform that functionality.

Advantages of the OSI Model


The advantages of the OSI Model are the following: -

 Help network administrators in determining the required hardware and


software to build their network.
 Encourage hardware manufacturers to create networking products that can
communicate with each other over the network.
 Provide a teaching tool to understand the communication process used
between networking components.
 Separate a complex function into simpler components.
 Make troubleshooting easier, as network administrators can troubleshoot
issues more quickly and effectively by looking in a layer that is causing the
issue rather than finding it in the entire network.
Disadvantages of OSI Model
 It defines various services multiple times. For example, the error control
service is defined in both Transport and Data Link layers.
 It does not allow layers to work parallel. A layer has to wait till it gets data from
its predecessor layer.
 Instead of defining similar functions in the same layer, it defines them in
different layers that add additional complexity.
 Instead of providing a summary of rarely used protocols and functions, it
defines every protocol and function in detail that makes the model lengthy and
less useful for administrators.

OSI Model in modern networks

Modern computer networks do not use the OSI model. They use the TCP/IP model.
Despite this, almost all popular networking courses include the OSI model. There are
two main reasons behind this. First, during the years in which many people thought
the OSI model would become commonplace in the world of networking, many
vendors, administrators, networking courses, and documents began to use
terminology from the OSI model. That terminology remains today. Second, the OSI
model describes every concept, function, and protocol in detail. Once you learn this
model, you can easily learn the TCP/IP model by learning the difference between the
two models.
In this tutorial, we will also follow the same path. First, we will understand the OSI
model, and then we will understand how the TCP/IP model is different from the OSI
model, and then we will understand the TCP/IP model in detail.

Basic Subnetting in Computer Networks


Explained
This tutorial explains basic concepts of Subnetting in Computer Networks with
examples. Learn what Subnetting is and why we do Subnetting in computer
networks along with advantages and disadvantages of Subnetting in detail.

What is Subnetting?
Subnetting is a process of dividing a single large network in multiple smaller
networks. A single large network is just like a town without any sector and street
address. In such a town, a postman may take 3 to 4 days in finding a single address.
While if town is divided in sectors and streets, he can easily find any address in less
than one hour.

Let’s take another example. Due to maintenance there is a scheduled power cut. If
town is divided in sectors, electric department can make a local announcement for
the affected sector rather than making an announcement for the whole town.
Besides these two examples, you can take several other examples from real life
where large objects are divided in smaller sections.

Computer networks also follow the same concept. In computer networking,


Subnetting is used to divide a large IP network in smaller IP networks known as
subnets.

A default class A, B and C network provides 16777214, 65534, 254 hosts


respectively. Having so many hosts in a single network always creates several
issues such as broadcast, collision, congestion, etc.

Let’s take a simple example. In a company there are four departments; sales,
production, development and management. In each department there are 50 users.
Company used a private class C IP network. Without any Subnetting, all computers
will work in a single large network.
Computers use broadcast messages to access and provide information in network. A
broadcast message is an announcement message in computer network which is
received by all hosts in network.

Earlier in this tutorial we discussed an example of electric announcement. You can


relate that example with this example. In that example we learned how dividing a
town in sectors can reduce announcement area.

In this example since all computers belong to same network, they will receive all
broadcast messages regardless the broadcast messages which they are receiving
are relevant to them or not.

Just like town is divided in sectors, this network can also be divided in subnets. Once
network is divided in subnets, computers will receive only the broadcasts which
belong to them.

Since company has four departments, it can divide its network in four subnets.
Following figure shows same network after Subnetting.

Subnetting table
Description Network 1 Network 2 Network 3
Network address 192.168.1.0 192.168.1.64 192.168.1.128

valid hosts 192.168.1.1 to 192.168.1.62 192.168.1.65 to 192.168.1.126 192.168.1.129 to

Broadcast address 192.168.1.63 192.168.1.127 192.168.1.191

To learn how this table is prepared or how Subnetting is done, please see the next parts of this tutorial.

This tutorial is the second part of the article “IP Subnetting in Computer Network
Step by Step Explained with Examples”. Other parts of this article are following.

Network Address Broadcast Address and IP Address Explained

This tutorial is the first part of the article. It explains IP addressing and network addressing such as IP
address, subnet mask, IP address types and IP classes in detail.

Subnetting Tutorial - Subnetting Explained with Examples

This tutorial is the third part of the article. It explains the Subnetting concepts and terms such as network
id, broadcast id, total hosts, valid hosts, power of 2, block size and CIDR in detail.

Subnetting Tricks Subnetting Made Easy with Examples

This tutorial is the fourth part of the article. It explains how to solve or answer any Subnetting related
question in less than a minute with 50+ Subnetting examples.

VLSM Subnetting Explained with Examples

This tutorial is the fifth part of the article. It explains what VLSM Subnetting is and how it is done step by
step including differences between FLSM Subnetting and VLSM Subnetting.

VLSM Subnetting Examples and Calculation Explained

This tutorial is the sixth part of the article. It explains VLSM Subnetting examples for Cisco exams and
interviews.

Supernetting Tutorial: - Supernetting Explained with Examples

This tutorial is the last part of the article. It explains Supernetting in detail with examples.
Advantage of Subnetting

 Subnetting allows us to break a single large network in smaller networks. Small


networks are easy to manage.
 Subnetting reduces network traffic by allowing only the broadcast traffic which is
relevant to the subnet.
 By reducing unnecessary traffic, Subnetting improves overall performance of the
network.
 By blocking a subnet’ traffic in subnet, Subnetting increases security of the network.
 Subnetting reduces the requirement of IP range.

Disadvantage of Subnetting

 Different subnets need an intermediate device known as router to communicate with


each other.
 Since each subnet uses its own network address and broadcast address, more
subnets mean more wastage of IP addresses.
 Subnetting ads complexity in network. An experienced network administrator is
required to manage the subnetted network.

Subnetting Tutorial - Subnetting Explained


with Examples
This tutorial explains Subnetting step by step with examples. Learn what IP
Subnetting is, Subnetting components such as Network ID, Broadcast ID, network
portion, host portion, FLSM, VLSM, Subnetting eligible bits, reserved network bits
and host bits including Subnetting rules in detail.

What is IP Subnetting?

IP Subnetting is a process of dividing a large IP network in smaller IP networks. In


Subnetting we create multiple small manageable networks from a single large IP
network.

Let’s take an example.

To best utilize available addresses if we put more than 16000000 hosts in a single
network, due to broadcast and collision, that network will never work. If we put less
hosts then remaining addresses will be wasted.

Subnetting provides a better way to deal with this situation. Subnetting allows us to
create smaller networks from a single large network which not only fulfill our hosts’
requirement but also offer several other networking benefits.

I have already explained the advantages of Subnetting along with why Subnetting is
necessary in previous parts of this tutorial. In this part, I will mainly focus on
Subnetting components and terminology.

This tutorial is the third part of the article “IP Subnetting in Computer Network
Step by Step Explained with Examples”. Other parts of this article are following.

Network Address Broadcast Address and IP Address Explained

This tutorial is the first part of the article. It explains IP addressing and network addressing such as IP
address, subnet mask, IP address types and IP classes in detail.

Basic Subnetting in Computer Networks Explained

This tutorial is the second part of the article. It explains what Subnetting is and why it is necessary in
computer network along with the advantages of Subnetting.

Subnetting Tricks Subnetting Made Easy with Examples


This tutorial is the fourth part of the article. It explains how to solve or answer any Subnetting related
question in less than a minute with 50+ Subnetting examples.

VLSM Subnetting Explained with Examples

This tutorial is the fifth part of the article. It explains what VLSM Subnetting is and how it is done step by
step including differences between FLSM Subnetting and VLSM Subnetting.

VLSM Subnetting Examples and Calculation Explained

This tutorial is the sixth part of the article. It explains VLSM Subnetting examples for Cisco exams and
interviews.

Supernetting Tutorial: - Supernetting Explained with Examples

This tutorial is the last part of the article. It explains Supernetting in detail with examples.

Network portion vs Host portion

Identifying network portion and host portion in an IP address is the first step of
Subnetting. Subnetting can only be done in host portion. Subnet mask is used to
distinguish the network portion from host portion in an IP address.

An IP address and a subnet mask both collectively provide a numeric identity to an


interface. Both addresses are always used together. Without subnet mask, an IP
address is an ambiguous address and without IP address a subnet mask is just a
number.

Both addresses are 32 bits in length. These bits are divided in four parts. Each part
is known as octet and contains 8 bits. Octets are separated by periods and written in
a sequence.

Subnet mask assigns an individual bit for each bit of IP address. If IP bit belongs to
network portion, assigned subnet mask bit will be turned on. If IP bit belongs to host
portion, assigned subnet mask bit will be turned off.

There are two popular notations to write the IP address and Subnet mask; Decimal
notation and Binary notation.
In decimal notation, a value range 1 to 255 represents a turned on bit while a value 0
(zero) represents a turned off bit.

In binary notation, 1 (one) represents a turned on bit while 0 (zero) represents a


turned off bit.
Examples of IP address with subnet mask in binary format

00001010.00001010.00001010.00001010
11111111.00000000.00000000.00000000

10101100.10101000.00000001.00000001
11111111.11111111.00000000.00000000

11000000.10101000.00000001.00000001
11111111.11111111.11111111.00000000
Examples of IP address with subnet mask in decimal format

10.10.10.10
255.0.0.0

172.168.1.1
255.255.0.0

192.168.1.1
255.255.255.0
In above examples network portion is formatted in bold text.

Reserve IP classes, network bits and host bits

Each IP address belongs to a predefined IP class. There are five predefined IP


classes; A, B, C, D and E. From these classes, class D and E are reserved and
cannot be used in Subnetting.

To learn more about IP address and its classes, you can see this tutorial.

IP Address Classes and Definition Explained


It explains IP address, IP classes, Types of IP address, Private IP address, Public IP address and much
more in detail.

In class A, B and C: -

 First 8, 16 and 24 bits are reserved for network portion respectively.


 Last 2 bits (31 & 32) are reserved for host portion.

Reserved network bits and host bits cannot be used in Subnetting.

IP Class First IP Address of class Last IP Address of class Default Subnet Mask Def
A 0.0.0.0 127.255.255.255 255.0.0.0 Firs
B 128.0.0.0 191.255.255.255 255.255.0.0 Firs
C 192.0.0.0 223.255.255.255 255.255.255.0 Firs
Subnetting eligible host bits

After excluding reserved network bits and host bits, remaining bits are considered as
Subnetting eligible host bits.

Subnetting can be done only in Subnetting eligible bits.


Subnet

A subnet is a single small network created from a large network. In Subnetting we


break a single large network in multiple small networks. These networks are known
as subnets.

Network address and Broadcast address

In each network there are two special addresses; network address and broadcast
address. Network address represents the network itself while broadcast address
represents all the hosts which belong to it. These two addresses can’t be assigned to
any individual host in network. Since each subnet represents an individual network, it
also uses these two addresses.

In simple language, in a single network only two IP addresses will be used for these
addresses. But if we breaks this network in two small networks then four IP
addressed will be used for these addresses.

Network address and broadcast address are also known as Network ID and
broadcast ID respectively.

Valid host addresses

All addresses between Network address and Broadcast address are known as valid
host addresses. Only valid host addresses can be assigned to the devices in a
network. These devices include end user devices such as computes, laptops,
tablets, smartphones, IP phones, servers, printers, terminals, IP camera and
networking devices such switches, routers, firewalls and proxy servers. In short, any
device that uses IP protocol for data transferring needs a valid host address.
Block Size

Block size is the sum of network address, valid host addresses and broadcast
address. For example, if in a network there are 6 valid hosts than block size of that
network is 8 (1 network address + 6 valid hosts + 1 broadcast address).

Power of 2

An IP address is built from the various combinations of IP bits. Understanding how


many combinations the number of bits provides or to get the number of combinations
how many bits we need is the second essential step of Subnetting.

 A combination of all 32 represents a unique IP address.


 A combination of network bits in IP address represents the number of
networks or subnets.
 A combination of host bits in IP address represents the number of total hosts.

To know how many combinations the number of bits provides or to get the number of
combinations how many bits are required, we use the power of 2.

For example, to break a single large network in 4 subnets, we need 2 (22 = 4)


Subnetting bits. This way if we have 3 Subnetting bits, we can make 8 (23 = 8)
additional networks.

Following table lists the power of 2 till 32.

2X Value 2X Value 2X Value


1 2 9 512 17 131072
2 4 10 1024 18 262144
3 8 11 2048 19 524288
4 16 12 4096 20 1048576
5 32 13 8192 21 2097152
6 64 14 16384 22 4194304
7 128 15 32768 23 8388608
8 256 16 65536 24 16777216
In 2 the X is the number of bits.
X

Subnetting Direction

Subnetting always flows in single direction (left to right) without skipping any bit. This
simple rule gives us the exact location of Subnetting bits in an address space. Let’s
take an example.

A class C network is subnetted in 4 subnets. Find the number of host bits used in
Subnetting and their location in address space.

To create 4 subnets we need to 2 (22 = 4) Subnetting eligible host bits.


Since in class C network space Subnetting eligible bits starts from 25 and Subnetting
always goes from left to right without skipping any bit, the bits used in this network
are 25 and 26.

Slash Notation

It’s a compact representation of Subnet mask. In this notation a slash (/) sign and
total number of the on bits in subnet mask are written with IP address instead of full
Subnet mask.

Following table lists some examples of IP addresses with Subnet mask in all three
notations.

In Slash notation In binary notation


10.10.10.10/8 00001010.00001010.00001010.00001010
11111111.00000000.00000000.00000000
172.168.1.1/16 10101100.10101000.00000001.00000001
11111111.11111111.00000000.00000000
192.168.1.1/24 11000000.10101000.00000001.00000001
11111111.11111111.11111111.00000000
192.168.1.1/28 11000000.10101000.00000001.00000001
11111111.11111111.11111111.11110000
Type of Subnetting

There are two types of Subnetting FLSM and VLSM. In FLSM, all subnets have
equal number of host addresses and use same Subnet mask. In VLSM, subnets
have flexible number of host addresses and use different subnet mask.

Following figure shows an example of FLSM and VLSM.

FLSM is easy in implementation and simple in operation but wastes a lot of IP


addresses. VLSM is hard in implementation and complex in operation but utilizes
maximum IP addresses.

Subnetting Tricks Subnetting Made Easy


with Examples
This tutorial explains Subnetting tricks in detail with 50+ Subnetting examples.
Subnetting tricks explained in this tutorial not only make Subnetting easier but also
allow you to answer any Subnetting related question in less than a minute. Learn
Subnetting with examples in easy language.
Subnetting is one of the most complex and highly tested topics in any Cisco entry
level exam and interview. In other situation, you may use any regular method of
Subnetting. But in exam and interview, where time and accuracy matter, you should
always use the easiest and the fastest methods of Subnetting such as explained in
this tutorial.

This tutorial is the fourth part of the article “IP Subnetting in Computer Network
Step by Step Explained with Examples”. Other parts of this article are following.

Network Address Broadcast Address and IP Address Explained

This tutorial is the first part of the article. It explains IP addressing and network addressing such as IP
address, subnet mask, IP address types and IP classes in detail.

Basic Subnetting in Computer Networks Explained

This tutorial is the second part of the article. It explains what Subnetting is and why it is necessary in
computer network along with the advantages of Subnetting.

Subnetting Tutorial - Subnetting Explained with Examples

This tutorial is the third part of the article. It explains the Subnetting concepts and terms such as network
id, broadcast id, total hosts, valid hosts, power of 2, block size and CIDR in detail.

VLSM Subnetting Explained with Examples

This tutorial is the fifth part of the article. It explains what VLSM Subnetting is and how it is done step by
step including differences between FLSM Subnetting and VLSM Subnetting.

VLSM Subnetting Examples and Calculation Explained

This tutorial is the sixth part of the article. It explains VLSM Subnetting examples for Cisco exams and
interviews.

Supernetting Tutorial: - Supernetting Explained with Examples

This tutorial is the last part of the article. It explains Supernetting in detail with examples.
Key points of Subnetting
Before we start working with Subnetting examples, let’s have a quick recap of
important Subnetting concepts and terms from previous parts of this tutorial.

An IP address is the combination of two addresses; network address and host


address. Network address is always written first in sequence. While reading an IP
address how much portion should be treated as network address and how much
portion should be treated as host address is decided by an another address known
as Subnet mask.

An IP address is always used with Subnet mask. Without subnet mask an IP address
is an ambiguous address and vice versa.

Both IP address and Subnet mask consists 32 bits. These bits are divided in four
octets. Octets are separated by periods and written in a sequence.
A Subnet mask can be written in two ways; in full form and in abbreviated form. In
full form a decimal value of each octet is written along with IP address. In
abbreviated form only the number of network bits are written along with IP address.
Following table lists some examples of both types.

IP address with full subnet mask IP address with abbreviated subnet

10.0.0.0 10.0.0.0/8
255.0.0.0

172.168.1.0 172.168.1.0/16
255.255.0.0

192.168.1.0 192.198.1.0/24
255.255.255.0

In Subnetting questions, mostly second type is used.

There are five IP classes A, B, C, D and E. From these, only first three classes A, B
and C are used in Subnetting. Subnetting cannot be done in class D and E.

In class A, B and C first 8, 16 and 24 bits are reserved for network address
respectively. In all three classes last 2 bits are reserved for host addresses.

If we exclude reserved network bits and host bits from total IP bits, we will get
Subnetting eligible host bits.

Subnetting can be done only in Subnetting eligible host bits.


To know how many Subnetting bits are required to create how many networks, we
use power of 2.

For example if we want to know many networks can be created from 3 Subnetting
bits, we will use power 2 three times.

23 = 8

We can create 8 networks from 3 Subnetting host bits.

Power of 2
2X Value 2X Value 2X Value

1 2 9 512 17 131072

2 4 10 1024 18 262144

3 8 11 2048 19 524288

4 16 12 4096 20 1048576

5 32 13 8192 21 2097152

6 64 14 16384 22 4194304

7 128 15 32768 23 8388608

8 256 16 65536 24 16777216

In each network first address and last address are always reserved for network
address and broadcast address respectively. Besides these two addresses, all
remaining addresses are considered as valid host addresses.

Subnetting Questions
A Subnetting question can be asked in three ways.
1. Find the number of networks and number of host addresses in each network
2. Find the type of given address, network ID and broadcast ID
3. Build the Subnet mask

Let’s understand the each type of Subnetting question in detail with examples.

Finding the number of networks and host addresses in each network

In this type of questions, we are asked to find the number of networks and host
addresses in each network from a given address space. Let’s take some examples.

Following table lists 15 imaginary networks. Find the number of networks, total hosts
and valid hosts in each network.

Example Subnetting Questions

10.0.0.0/10 130.0.0.0/18

20.12.0.0/13 140.50.60.0/20

78.59.12.0/16 172.168.1.0/24

112.15.0.0/24 180.10.20.0/28

122.14.25.0/28 185.0.0.0/30

Step 1
Determine the class of the given address space.

If the value of first octet is in range 0-127, 128-191, 192-223 then it belongs to class
A, B and C respectively.

Subtract the given network bits from the reserved network bits. This will give us the
number of host bits used as network bits in Subnetting.

Number of host bits used in Subnetting = Total bits used in network portion –
reserved bits for network portion

Subtract the given network bits from 32 (total IP bits). This will give us the number of
the host bits remaining in host portion.

Remaining host bits in host portion = 32 – Total bits used in network portion

Given Address space Total bits used IP Class Reserved network bits Number of host bits use
in network portion
(Value after slash)

10.0.0.0/10 10 A 8 10 - 8 = 2

20.12.0.0/13 13 A 8 13 – 8 = 5
78.59.12.0/16 16 A 8 16 – 8 = 8

112.15.0.0/24 24 A 8 24 – 8 = 16

122.14.25.0/28 28 A 8 28 – 8 = 20

130.0.0.0/18 18 B 16 18 – 16 = 2

140.50.60.0/20 20 B 16 20 – 16 = 4

172.168.1.0/24 24 B 16 24 – 16 = 8

180.10.20.0/28 28 B 16 28 – 16 = 12

185.0.0.0/30 30 B 16 30 – 16 = 14

192.168.1.0/26 26 C 24 26 - 24 = 2

200.0.0.0/27 27 C 24 27 – 24 = 3

210.200.0.0/28 28 C 24 28 – 24 = 4

215.0.0.0/29 29 C 24 29 – 24 = 5

220.220.10.0/30 30 C 24 30 – 24 = 6

Once we know how many bits are used in Subnetting to create the additional
networks, we can use following formulas to calculate number of networks, total hosts
and valid hosts.

Number of networks (subnet) = 2N


Number of total host addresses in each network = 2H
Number of valid host addresses in each network = 2H – 2
Here N is the number of host bits used in Subnetting and H is the available host bits.

Given Address Host bits used Available host bits Networks (Subnets)
in Subnetting

10.0.0.0/10 2 22 4 (22)

20.12.0.0/13 5 19 32 (25)

78.59.12.0/16 8 16 256 (28)

112.15.0.0/24 16 8 65536 (216)

122.14.25.0/28 20 4 1048576 (220)

130.0.0.0/18 2 14 4 (22)

140.50.60.0/20 4 12 16 (24)

172.168.1.0/24 8 8 256 (28)


180.10.20.0/28 12 4 4096 (212)

185.0.0.0/30 14 2 16384 (214)

192.168.1.0/26 2 6 4 (22)

200.0.0.0/27 3 5 8 (23)

210.200.0.0/28 4 4 16 (24)

215.0.0.0/29 5 3 32 (25)

220.220.10.0/30 6 2 64 (26)

Finding address type, network ID and broadcast ID


In this type of questions, we are asked to figure out the address type, network ID and
broadcast ID from a given address. Let’s take some examples.

Find the address type, network ID and broadcast ID of following addresses.

Example Subnetting Questions

10.0.0.0/8 50.100.255.255/20 150.60.180.0/19

10.48.0.0/12 1.1.8.255/23 160.0.39.255/21

20.42.255.255/13 100.100.100.110/25 172.168.8.0/24

30.6.1.0/16 110.80.20.128/27 180.78.0.64/28

40.60.240.0/17 120.20.30.15/30 185.0.0.26/29

Step 1
Find the interesting octet and make two new addresses from the given address in
rough area of worksheet as explained following: -

 If octet comes before the interesting octet, write it as it is.


 If octet comes after the interesting octet, in first address write 0 and in second
address write 255.
 In interesting octet write a placeholder character “X”.

Interesting octet is the octet in which given network bits separate from host bits. To
find it, see the value after slash. If value is in range 1-8, 9-16, 17-24 and 25-32 then
the interesting octet is first octet, second octet, third octet and fourth octet
respectively.
Given Address Value after slash Interesting octet First address Second Ad

10.0.0.0/8 /8 First (1-8) X.0.0.0 X.255.255

10.48.0.0/12 /12 Second (9-16) 10.X.0.0 10.X.255.2

20.42.255.255/13 /13 Second (9-16) 20.X.0.0 20.X.255.2

30.6.1.0/16 /16 Second (9-16) 30.X.0.0 30.X.255.2

40.60.240.0/17 /17 Third (17-24) 40.60.X.0 40.60.X.25

50.100.255.255/20 /20 Third (17 -24) 50.100.X.0 50.100.X.2

1.1.8.255/23 /23 Third (17-24) 1.1.X.0 1.1.X.255

100.100.100.110/25 /25 Fourth (25 -32) 100.100.100.X 100.100.1

110.80.20.128/27 /27 Fourth (25-32) 110.80.20.X 110.80.20

120.20.30.15/30 /30 Fourth (25-32) 120.20.30.X 120.20.30

150.60.180.0/19 /19 Third (17-24) 150.60.X.0 150.60.X.2

160.0.39.255/21 /21 Third (17-24) 160.0.X.0 160.0.X.25

172.168.8.0/24 /24 Third (17-24) 172.168.X.0 172.168.X


180.78.0.64/28 /28 Fourth (25-32) 180.78.0.X 180.78.0.X

185.0.0.26/29 /29 Fourth (25-32) 185.0.0.X 185.0.0.X

192.168.1.240/25 /25 Fourth (25-32) 192.168.1.X 192.168.1

200.20.10.191/26 /26 Fourth (25-32) 200.20.10.X 200.20.10

210.200.20.100/27 /27 Fourth (25-32) 210.200.20.X 210.200.2

215.0.0.47/28 /28 Fourth (25-32) 215.0.0.X 215.0.0.X

220.10.10.50/29 /29 Fourth (25-32) 220.10.10.X 220.10.10

Step 2
Based on interesting octet, subtract after slash value form the upper value of octet
range.

 Subtract it from 8 if interesting octet is the first octet.


 Subtract it from 16 if interesting octet is the second octet.
 Subtract it from 24 if interesting octet is the third octet.
 Subtract it from 32 if interesting octet is the fourth octet.

Given Address Value after slash Interesting octet Upper value of range Subtraction

10.0.0.0/8 /8 First(1-8) 8 8–8=0

10.48.0.0/12 /12 Second (9-16) 16 16 – 12 = 4

20.42.255.255/13 /13 Second (9-16) 16 16 – 13 = 3

30.6.1.0/16 /16 Second (9-16) 16 16 – 16 = 0

40.60.240.0/17 /17 Third (17-24) 24 24 – 17 = 7

50.100.255.255/20 /20 Third (17 -24) 24 24 - 20 = 4

1.1.8.255/23 /23 Third (17-24) 24 24 – 23 = 1

100.100.100.110/25 /25 Fourth (25 -32) 32 32 – 25 = 7

110.80.20.128/27 /27 Fourth (25-32) 32 32 – 27= 5

120.20.30.15/30 /30 Fourth (25-32) 32 32 – 30 = 2

150.60.180.0/19 /19 Third (17-24) 24 24 – 19 = 5

160.0.39.255/21 /21 Third (17-24) 24 24 – 21 = 3

172.168.8.0/24 /24 Third (17-24) 24 24 – 24 = 0

180.78.0.64/28 /28 Fourth (25-32) 32 32 – 28 = 4


185.0.0.26/29 /29 Fourth (25-32) 32 32 – 29 = 3

192.168.1.240/25 /25 Fourth (25-32) 32 32 – 25 = 7

200.20.10.191/26 /26 Fourth (25-32) 32 32 – 26 = 6

210.200.20.100/27 /27 Fourth (25-32) 32 32 – 27 = 5

215.0.0.47/28 /28 Fourth (25-32) 32 32 – 28 = 4

220.10.10.50/29 /29 Fourth (25-32) 32 32 – 29 = 3

Step 3
Use the result of subtraction in following formula to calculate the block size

Block size = 2result of subtraction


Given Address Interesting octet Result of subtraction Block Size

10.0.0.0/8 First 0 (20) = 1

10.48.0.0/12 Second 4 (24) = 16

20.42.255.255/13 Second 3 (23) = 8

30.6.1.0/16 Second 0 (20) = 1

40.60.240.0/17 Third 7 (27) = 128

50.100.255.255/20 Third 6 (24) = 16

1.1.8.255/23 Third 1 (21) = 2

100.100.100.110/25 Fourth 7 (27) = 128

110.80.20.128/27 Fourth 5 (25) = 32

120.20.30.15/30 Fourth 2 (22) = 4

150.60.180.0/19 Third 5 (25) = 32

160.0.39.255/21 Third 3 (23) = 8

172.168.8.0/24 Third 0 (20) = 1

180.78.0.64/28 Fourth 4 (24 ) = 16

185.0.0.26/29 Fourth 3 (23) = 8

192.168.1.240/25 Fourth 7 (27) = 128

200.20.10.191/26 Fourth 6 (26) = 64

210.200.20.100/27 Fourth 5 (25) = 32

215.0.0.47/28 Fourth 4 (24) = 16


220.10.10.50/29 Fourth 3 (23) = 8

Step 4
Starting from 0, calculate the block size until the value given in interesting octet does
not come in the range.

In calculation the number 0 is used as the first number. For example if we are
calculating block size 4 then it would be calculated as 0,1,2,3 instead of 1,2,3,4.

Once you got the range in block size which cover the given value in interesting octet,
stop the calculation. For example value in interesting octet is 27 and block size is 8
then the range will be 24-31 (0-7, 8-15, 16-23, 24-31).

Given Address Interesting octet Interesting octet value Block Size Range in block size which cover the value of interesting octet

10.0.0.0/8 First 10 1 0-0, 1-1, 2-2, 3-3, 4-4, 5-5, 6-6, 7-7, 8-8, 9-9, 10-10

10.48.0.0/12 Second 48 16 0-15, 16-31, 32-47, 48-63

20.42.255.255/13 Second 42 8 0-7, 8-15, 16-23, 24-31, 32-39, 40-47

30.6.1.0/16 Second 6 1 0-0, 1-1, 2-2, 3-3, 4-4, 5-5, 6-6

40.60.240.0/17 Third 240 128 0-127, 128-255

50.100.255.255/20 Third 255 16 0-15, 16-31, 32-47,..... 224-239, 240-255

1.1.8.255/23 Third 8 2 0-1, 2-3, 4-5, 6-7, 8-9

100.100.100.110/25 Fourth 110 128 0-127,128-255

110.80.20.128/27 Fourth 128 32 0-31, 32-63, 64-95, 96 -127, 128-159

120.20.30.15/30 Fourth 15 4 0-3, 4-7, 8-11, 12-15

150.60.180.0/19 Third 180 32 0-31, 32-63, 64-95, 96 -127, 128-159, 160 - 191

160.0.39.255/21 Third 39 8 0-7, 8-15, 16-23, 24-31, 32-39

172.168.8.0/24 Third 8 1 0-0, 1-1, 2-2, 3-3, 4-4, 5-5, 6-6, 7-7, 8-8

180.78.0.64/28 Fourth 64 16 0-15, 16-31, 32-47, 48-63, 64-79

185.0.0.26/29 Fourth 26 8 0-7, 8-15, 16-23, 24-31

192.168.1.240/25 Fourth 240 128 0-127, 128-255

200.20.10.191/26 Fourth 191 64 0-63, 64-127, 128- 191

210.200.20.100/27 Fourth 100 32 0-31, 32-63, 64-95, 96 -127

215.0.0.47/28 Fourth 47 16 0-15, 16-31, 32-47


220.10.10.50/29 Fourth 50 8 0-7, 8-15, 16-23, 24-31, 32-39, 40-47, 48- 55

Step 5
Update the temporary addresses written in first step as following: -

 In first address, replace the placeholder character “X” with the starting value of the
range.
 In second address, replace the placeholder character “X” with the ending value of the
range.

After this update first address and second address will become the network address
and broadcast address of the given address respectively.

Once it’s done, you can easily determine the type of the given address.

 If given address exactly matches with the network address then it’s a network
address.
 If given address exactly matches with the broadcast address then it’s a broadcast
address.
 If given address is neither a network address nor a broadcast address then it’s a
valid host address.

Given Address Interesting octet Interesting Block range Network add


octet value

10.0.0.0/8 First 10 10-10 10.0.0.0

10.48.0.0/12 Second 48 48-63 10.48.0.0

20.42.255.255/13 Second 42 40-47 20.40.0.0

30.6.1.0/16 Second 6 6-6 30.6.0.0

40.60.240.0/17 Third 240 128-255 40.60.128.0

50.100.255.255/20 Third 255 240-255 50.100.240.0

1.1.8.255/23 Third 8 8-9 1.1.8.0

100.100.100.110/25 Fourth 110 0-127 100.100.100

110.80.20.128/27 Fourth 128 128-159 110.80.20.12

120.20.30.15/30 Fourth 15 12-15 120.20.30.12

150.60.180.0/19 Third 180 160 - 191 150.60.160.0

160.0.39.255/21 Third 39 32-39 160.0.32.0

172.168.8.0/24 Third 8 8-8 172.168.8.0

180.78.0.64/28 Fourth 64 64-79 180.78.0.64

185.0.0.26/29 Fourth 26 24-31 185.0.0.24


192.168.1.240/25 Fourth 240 128-255 192.168.1.12

200.20.10.191/26 Fourth 191 128- 191 200.20.10.12

210.200.20.100/27 Fourth 100 96 -127 210.200.20.9

215.0.0.47/28 Fourth 47 32-47 215.0.0.32

220.10.10.50/29 Fourth 50 48- 55 220.10.10.48

Building the Subnet mask value


In this type of questions, we are asked to build the full subnet mask from an
abbreviated subnet mask. Let’s take some examples.

Find the full subnet mask of following networks.

20.10.30.0/8, 111.187.45.34/14, 162.160.46.24/20, 202.100.20.50/27

Step 1
Find the interesting octet as explained above.

Given network Value after slash

20.10.30.0/8 8

111.187.45.34/14 14

162.160.46.24/20 20

202.100.20.50/27 27

Step2
In rough area of worksheet, write a temporary subnet mask as following: -

 If octet comes before the interesting octet, write 255.


 In interesting octet, write “X”.
 If octet comes after the interesting octet, write 0.

Given network Value after slash Interesting octet

20.10.30.0/8 8 First

111.187.45.34/14 14 Second

162.160.46.24/20 20 Third

202.100.20.50/27 27 Fourth
Step 3
Just like we did above, based on interesting octet, subtract the given value from the
upper value of interesting octet range.

Given network Value after slash Interesting octet Interes

20.10.30.0/8 8 First 1–8

111.187.45.34/14 14 Second 9 – 16

162.160.46.24/20 20 Third 17 – 24

202.100.20.50/27 27 Fourth 25 – 32

Step 4
Use the result of subtraction in following formula to get the octet value

Octet value = 256 - 2 Remainder

Given network Value after slash Subtraction result Calculati

20.10.30.0/8 8 0 20 = 1

111.187.45.34/14 14 2 22 = 4

162.160.46.24/20 20 4 24 = 16

202.100.20.50/27 27 5 25 = 32

Step 5
Replace the “X” with octet value in interesting octet to build the full subnet mask

Given network Value after slash Temporary mask

20.10.30.0/8 8 X.0.0.0

111.187.45.34/14 14 255.X.0.0

162.160.46.24/20 20 255.255.X.0

202.100.20.50/27 27 255.255.255.X

VLSM Subnetting Explained with


Examples
This tutorial explains VLSM Subnetting in detail with practical examples. Learn what
VLSM (Variable Length Subnet Masks) Subnetting is and how it is done step by step
including the advantages of VLSM Subnetting and the differences between FLSM
Subnetting and VLSM Subnetting.

Subnetting is the process of dividing a single large network in multiple small


networks known as subnets. There are two types of Subnetting; FLSM Subnetting
and VLSM Subnetting.

Differences between FLSM Subnetting and VLSM Subnetting

FLSM (Fixed Length Subnet Masks) Subnetting VLSM (Variable Len

All subnets are equal in size. Subnets are variabl

All subnets have equal number of hosts. Subnets have varia

All subnets use same subnet mask. Subnets use differe

It is easy in configuration and administration. It is complex in con

It wastes a lot of IP addresses. It wastes minimum

It is also known as classfull Subnetting. It is also known as

It supports both classfull and classless routing protocols. It supports only cla

Which Subnetting should be used is depend on objectives and type of addresses


used in network. FLSM provides easier Subnetting at the cost of IP addresses while
VLSM best utilizes IP addresses at the cost of simplicity. For private IP addresses,
FLSM is the best choice. For public IP addresses, VLSM is the best option.

This tutorial is the fifth part of the article “IP Subnetting in Computer Network Step
by Step Explained with Examples”. Other parts of this article are following.

Network Address Broadcast Address and IP Address Explained

This tutorial is the first part of the article. It explains IP addressing and network addressing such as IP
address, subnet mask, IP address types and IP classes in detail.

Basic Subnetting in Computer Networks Explained

This tutorial is the second part of the article. It explains what Subnetting is and why it is necessary in
computer network along with the advantages of Subnetting.

Subnetting Tutorial - Subnetting Explained with Examples

This tutorial is the third part of the article. It explains the Subnetting concepts and terms such as network
id, broadcast id, total hosts, valid hosts, power of 2, block size and CIDR in detail.

Subnetting Tricks Subnetting Made Easy with Examples

This tutorial is the fourth part of the article. It explains how to solve or answer any Subnetting related
question in less than a minute with 50+ Subnetting examples.
VLSM Subnetting Examples and Calculation Explained

This tutorial is the sixth part of the article. It explains VLSM Subnetting examples for Cisco exams and
interviews.

Supernetting Tutorial: - Supernetting Explained with Examples

This tutorial is the last part of the article. It explains Supernetting in detail with examples.
Since I have already explained FLSM Subnetting with examples in previous parts of
this tutorial, instead of repeating it again, in this part I will focus on VLSM Subnetting.

If you don’t know what FLSM is and how it is done, I highly recommend you take a
pause here and learn FLSM Subnetting from the previous parts of this tutorial. For
this part I assume that you have sound knowledge of FLSM Subnetting.

VLSM Subnetting
The biggest advantage of VLSM Subnetting is that, instead of forcing us to use a
fixed size for all segments, it allows us to choose the individual size for each
segment. This flexibility reduces the IP wastage. We can choose the size of subnet
which closely matches with our requirement. Let’s understand it with an example.

VLSM Example
Do the VLSM Subnetting of following network.

In this network: -

 Development department has 74 computers.


 Production department has 52 computers.
 Administration department has 28 computers.
 All departments are connected with each other via wan links.
 Each wan link requires two IP addresses.
 The given address space is 192.168.1.0/24.

Before we perform VLSM Subnetting for this network, let’s understand how VLSM
Subnetting actually works.

Basic concepts of VLSM Subnetting

VLSM Subnetting is the extended version of FLSM Subnetting. If you know how
FLSM Subnetting works and how it is done, you already know the 90% of VLSM
Subnetting. In FLSM, all subnets use same block size, thus Subnetting is required
only one time. In VLSM, subnets use block size based on requirement, thus
Subnetting is required multiple times.

The concept of VLSM Subnetting is relatively simple.

 Select block size for each segment. Block size must be greater than or equal to the
actual requirement. Actual requirement is the sum of host addresses, network
address and broadcast address.
 Based on block size arrange all segments in descending order.
 Do FLSM Subnetting for the block size of the first segment.
 Assign first subnet from subnetted subnets to the first segment.
 If next segment has similar block size, assign next subnet to it.
 If next segment has lower block size, do FLSM Subnetting again for the block size of
this segment.
 From subnetted subnets exclude the occupied subnets. Occupied subnets are the
subnets which provide the addresses which are already assigned.
 From available subnets, assign the first available subnet to this segment.
 Repeat above steps till the last segment of the network.

Let’s implement above steps in our example network.

Step by step VLSM Subnetting


The first step of VLSM Subnetting is selecting the appropriate block size for each
segment. Following table lists all available block sizes.

2 4 8 16 32 64

512 1024 2048 4096 8192 16384

131072 262144 524288 1048576 2097152 419430

To learn how block size is calculated, please see the third part of this tutorial.

While selecting appropriate block size for a given segment, always select a size
which is adequate for host addresses plus two additional addresses; network
address and broadcast address.
Identity of a subnet and certain networking services depend on network address and
broadcast address. In each subnet, the first address and the last address are always
reserved for network address and broadcast address respectively.

Regardless the information about these two addresses is provided or not in question;
always add these addresses in requirement while selecting the block size for a
segment.

Actual requirement = Host requirement + Network address +


broadcast address
Block Size >= Actual requirement
Following table shows the selection of block size in our example.

Segment Host requirement Actual requirement

Production 52 54

Wan link 1 2 4

Development 74 76

Wan link 2 2 4

Administration 28 30

Wan link 3 2 4

The next step of VLSM Subnetting is arranging segments in descending order.


Based on block size, following table arranges all segments in descending order.

Segment Block size Descendin

Development 128 1

Production 64 2

Administration 32 3

Wan link 1 4 4

Wan link 2 4 5

Wan link 3 4 6

The next step of VLSM Subnetting is doing FLSM Subnetting and selecting
appropriate subnets for segments from the subnetted subnets.

A single FLSM Subnetting provides a single block size for all of its subnets. If
different block size is required, we have to perform the FLSM Subnetting again for
that block size. How many times we have to perform the FLSM Subnetting is depend
on how many unique block sizes we need. For instance, our example network
requires four unique block sizes 128, 64, 32 and 4. For four block sizes, we have to
perform FLSM Subnetting four times.
FLSM Subnetting is always performed in descending order. For ordering, block size
is used. In our example, first we have to perform FLSM Subnetting for block size 128
then for block size 64 then for block size 32 and finally for block size 4.

Following figure shows the FLSM Subnetting for all four block sizes and selected
subnets for segments from each FLSM Subnetting.

Let’s understand above process in more detail.

First largest segment (Block size 128)


Our first segment needs a block size of 128. The FLSM Subnetting of /25 provides
us two subnets with the block size 128.

FLSM Subnetting of 192.168.1.0/25

Subnet Subnet1
Network ID 192.168.1.0

First host address 192.168.1.1

Last host address 192.168.1.126

Broadcast ID 192.168.1.127

From Subnetted subnets assign first subnet to this segment.

Segment Development

Requirement 74

CIDR /25

Subnet mask 255.255.255.128

Network ID 192.168.1.0

First hosts 192.168.1.1

Last hosts 192.168.1.126

Broadcast ID 192.168.1.127

Since our second segment (Production) needs different block size (64), instead of
using second subnet (Subnet2) for it, let’s do Subnetting again.

Second largest segment (Block size 64)


The Subnetting of /26 provide us 4 subnets with block size 64.

Subnetting of 192.168.1.0/26

Subnet Subnet 1 Subnet 2 S

Network ID 0 64 1

First address 1 65 1

Last address 62 126 1

Broadcast ID 63 127 1

From this Subnetting, we cannot use subnet 1 and subnet 2 as they are already
occupied.

Subnet 1 and Subnet 2 provide addresses from 0 to 127 which are already assigned
in the development department.

We can use subnet 3 for this segment (production).


Segment Production

Requirement 52

CIDR /26

Subnet mask 255.255.255.192

Network ID 192.168.1.128

First hosts 192.168.1.129

Last hosts 192.168.1.190

Broadcast ID 192.168.1.191

Third largest segment (block size 32)


The Subnetting of /27 provides us 8 network and 32 hosts.

Subnetting of 192.168.1.0/27

Subnet Sub 1 Sub 2 Sub 3 Sub 4 Sub 5

Net ID 0 32 64 96 128

First Host 1 33 65 95 129

Last Host 30 62 94 126 158

Broadcast ID 31 63 95 127 159

Exclude the already occupied subnets (Sub1 to Sub6) and assign the first available
subnet (Sub7) to this segment.

Segment Administration

Requirement 28

CIDR /27

Subnet mask 255.255.255.224

Network ID 192.168.1.192

First hosts 192.168.1.193

Last hosts 192.168.1.222

Broadcast ID 192.168.1.223

WAN Links (Block Size 4)


Last three segments require the block size of 4. The Subnetting of /30 gives us 64
subnets of block size 4.
Subnets of /30 Subnetting:-

0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64, 68, 72, 76, 80, 84, 88,
92, 96, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 144, 148, 152, 156,
160, 164, 168, 172, 176, 180, 184, 188, 192, 196, 200, 204, 208, 212, 216, 220, 224,
228, 232, 236, 240, 244, 248, 252, 256

Exclude already occupied subnets (0-56) and use first three available subnets 57, 58
and 59 for WAN links.

Subnet Subnet 57 Subnet 58 Subnet 59

Network ID 224 228 232

First host 225 229 233

Last host 226 230 234

Broadcast ID 227 231 235

Assign subnet 57 to the WAN link 1.

Subnet Subnet 57

Segments Wan Link 1

Requirement 2

CIDR /30

Subnet mask 255.255.255.252

Network ID 192.168.1.224

First hosts 192.168.1.225

Last hosts 192.168.1.226

Broadcast ID 192.168.1.227

Assign subnet 58 to the WAN link 2.

Subnet Subnet 58

Segments Wan Link 2

Requirement 2

CIDR /30

Subnet mask 255.255.255.252

Network ID 192.168.1.228
First hosts 192.168.1.229

Last hosts 192.168.1.230

Broadcast ID 192.168.1.231

Assign subnet 59 to the WAN link 3.

Subnet Subnet 59

Segments Wan Link 3

Requirement 2

CIDR /30

Subnet mask 255.255.255.252

Network ID 192.168.1.232

First hosts 192.168.1.233

Last hosts 192.168.1.234

Broadcast ID 192.168.1.235

We have assigned IP addresses to all segments. The subnets 60, 61, 62, 63 and 64
are still available for further use.

Following figure shows a summarize allocation of all addresses in given network.


VLSM Subnetting Examples and
Calculation Explained
Looking for VLSM Subnetting examples or want to understand the complex VLSM
calculation through the examples, then this tutorial is the prefect resource for you. It
provides VLSM Subnetting examples which not only help you in learning the VLSM
Subnetting but also assist you in performing the VLSM calculation.

For this tutorial I assume that you know what VLSM Subnetting is and how it is done.
Since I have already explained VLSM Subnetting and its procedure in previous parts
of this tutorial, in this part I will focus on VLSM examples.

This tutorial is the sixth part of the article “IP Subnetting in Computer Network
Step by Step Explained with Examples”. Other parts of this article are following.

Network Address Broadcast Address and IP Address Explained


This tutorial is the first part of the article. It explains IP addressing and network addressing such as IP
address, subnet mask, IP address types and IP classes in detail.

Basic Subnetting in Computer Networks Explained

This tutorial is the second part of the article. It explains what Subnetting is and why it is necessary in
computer network along with the advantages of Subnetting.

Subnetting Tutorial - Subnetting Explained with Examples

This tutorial is the third part of the article. It explains the Subnetting concepts and terms such as network
id, broadcast id, total hosts, valid hosts, power of 2, block size and CIDR in detail.

Subnetting Tricks Subnetting Made Easy with Examples

This tutorial is the fourth part of the article. It explains how to solve or answer any Subnetting related
question in less than a minute with 50+ Subnetting examples.

VLSM Subnetting Explained with Examples

This tutorial is the fifth part of the article. It explains what VLSM Subnetting is and how it is done step by
step including differences between FLSM Subnetting and VLSM Subnetting.

Supernetting Tutorial: - Supernetting Explained with Examples

This tutorial is the last part of the article. It explains Supernetting in detail with examples.
Subnetting charts
Before we take the examples of VLSM Subnetting, let’s build Subnetting chart for
each IP class. Subnetting charts summarize all possible combinations of all
Subnetting bits in all IP classes.

In VLSM Subnetting, we calculate how many networks and hosts the given
Subnetting bits provide. Subnetting charts not only provide this information but also
help us in selecting appropriate block sizes and subnet masks for segments.

Class A Subnetting chart


CIDR Subnet mask Network bits Host bits Networks Block

/8 255.0.0.0 0 24 1 16777

/9 255.128.0.0 1 23 2 83886

/10 255.192.0.0 2 22 4 41943

/11 255.224.0.0 3 21 8 20971

/12 255.240.0.0 4 20 16 10485

/13 255.248.0.0 5 19 32 52428

/14 255.252.0.0 6 18 64 26214


/15 255.254.0.0 7 17 128 13107

/16 255.255.0.0 8 16 256 65536

/17 255.255.128.0 9 15 512 32768

/18 255.255.192.0 10 14 1024 16384

/19 255.255.224.0 11 13 2048 8192

/20 255.255.240.0 12 12 4096 4096

/21 255.255.248.0 13 11 8192 2048

/22 255.255.252.0 14 10 16384 1024

/23 255.255.254.0 15 9 32768 512

/24 255.255.255.0 16 8 65536 256

/25 255.255.255.128 17 7 131072 128

/26 255.255.255.192 18 6 262144 64

/27 255.255.255.224 19 5 524288 32

/28 255.255.255.240 20 4 1048576 16

/29 255.255.255.248 21 3 2097152 8

/30 255.255.255.252 22 2 4194304 4

Class B Subnetting chart


CIDR Subnet mask Network bits Host bits Networks Bloc

/16 255.255.0.0 0 16 1 655

/17 255.255.128.0 1 15 2 327

/18 255.255.192.0 2 14 4 163

/19 255.255.224.0 3 13 8 819

/20 255.255.240.0 4 12 16 409

/21 255.255.248.0 5 11 32 204

/22 255.255.252.0 6 10 64 102

/23 255.255.254.0 7 9 128 512

/24 255.255.255.0 8 8 256 256

/25 255.255.255.128 9 7 512 128

/26 255.255.255.192 10 6 1024 64


/27 255.255.255.224 11 5 2048 32

/28 255.255.255.240 12 4 4096 16

/29 255.255.255.248 13 3 8192 8

/30 255.255.255.252 14 2 16384 4

Class C Subnetting chart


CIDR Subnet mask Network bits Host bits Networks Bloc

/24 255.255.255.0 0 8 1 256

/25 255.255.255.128 1 7 2 128

/26 255.255.255.192 2 6 4 64

/27 255.255.255.224 3 5 8 32

/28 255.255.255.240 4 4 16 16

/29 255.255.255.248 5 3 32 8

/30 255.255.255.252 6 2 64 4

To learn how to build the Subnetting charts, please see the previous parts of this tutorial.

Examples of VLSM Subnetting


There are five IP classes; A, B, C, D and E. From there classes Subnetting can be
done only in first three classes; A, B and C. To understand VLSM Subnetting in
detail, let’s take one example from each class.

VLSM Example 1 (Class C Network)


VLSM Example 2 (Class B Network)

VLSM Example 3 (Class A Network)


Step by step VLSM calculation
Based on hosts’ requirement, arrange all segments in descending order and select
appropriate block size for each segment.

VLSM Example 1
No. Segment Host requirement Nearest block size

1 LAN Segment1 29 32

2 LAN Segment 2 21 32

3 LAN Segment 3 12 16

4 LAN Segment 4 8 16

5 WAN Link 1 2 4

6 WAN Link 2 2 4

7 WAN Link 3 2 4

8 WAN Link 4 2 4

While selecting the nearest block size, compare the host requirement with valid host
instead of the block size itself. For example, LAN segment 4 needs 8 hosts, but we
can’t use the block size 8 for it. As block size 8 offers only 6 valid hosts (8 -2) while
we need 8 valid hosts for this segment. For this segment, we have to use the block
size which provides 8 or more valid hosts such as block size 16. Same way for WAN
links which need 2 hosts, we have to use the block size 4.

VLSM Example 2
No. Segment Host requirement Nearest block size

1 VLAN1 240 256

2 VLAN2 200 256

3 LAN Segment 1 150 256

4 LAN Segment 2 50 64

5 WAN Link 1 2 4

6 WAN Link 2 2 4

VLSM Example 3
No. Segment Host requirement Nearest block

1 LAN Segment 3 350 512

2 LAN Segment 4 250 256

3 LAN Segment 1 80 128

4 LAN Segment 5 50 64

5 LAN Segment 2 20 32

6 WAN Link1 2 4

7 WAN Link2 2 4

8 WAN Link3 2 4

9 WAN Link4 2 4

10 WAN Link5 2 4

11 WAN Link6 2 4

Once segments are arranged based on hosts’ requirement and host requirements
are converted in nearest block size, use following steps.

 Do Subnetting for the largest segment. From subnetted subnets, assign first subnet
to it.
 If next segment has similar block size, assign next subnet to it.
 Repeat this process till the requirements are same.
 If next segment requires different block size, do Subnetting again for the block size of
that segment and pick the subnet which comes after the occupied subnets. Occupied
subnets are the subnets which provide the IP addresses which are already used.
 Just like above step, if next segment requires similar block size, use next subnet for it
otherwise do Subnetting again.
 Repeat same steps till the last segment of the network.

Let’s implement above steps in our examples.

VLSM Example 1

The first largest segment (LAN Segment1) requires the block size 32. For 32 block
size, we use the Subnetting of /27.

In class C, Subnetting of /27 provides us 8 networks (subnets) of block size 32.

0-31, 32-63, 64-95, 96-127, 128-159, 160-191, 192-223, 224-255

Let’s use the first subnet 0-31 for it.

Since second segment (LAN Segment2) also has the similar requirement, use the
second subnet 32-63 for it.

Third segment (LAN Segment3) requires the block size 16 which is different from the
second segment, so instead of using the subnet which provides block size 32, we
will do the Subnetting again and use the subnet which provides block size 16.

In class C, Subnetting of /28 provides 16 networks of block size 16.

0-15, 16-31, 32-47, 48-63, 64-79, 80-95, 96-111, 112-127, 128-143, 144-159, 160-
175, 176-191, 192-207, 208-223, 224-239, 240-255

If we exclude the occupied subnets, we will get the available subnets for this
segment and next segments.

The subnets which provide the addresses which are already assigned are known as
occupied subnets. In this Subnetting the occupied subnets are 0-15, 16-31, 32-47
and 48-63. These subnets provide the addresses (0 to 63) which are already
assigned in previous segments.

Let’s use the first available subnet 64-79 from this Subnetting for the third segment
(LAN Segment3).

Forth segment (LAN Segment4) also has the similar requirement. Let’s assign next
available subnet 80-95 to it.

Next segments are WAN links. WAN links require only 2 addresses. For 2 valid
addresses we need the block size of 4.

In class C, Subnetting of /30 provides us 64 networks of block size 4.

0-3, 4-7, 8-11, 12-15, 16-19, 20-23, 24-27, 28-31, 32-35, 36-39, 40-43, 44-47, 48-51,
52-55, 56-59, 60-63, 64-67, 68-71, 72-75, 76-79, 80-83, 84-87, 88-91, 92-95, 96-99,
100-103, 104-107, 108-111, 112-115, 116-119, 120-123, 124-127, 128-131, 132-
135, 136-139, 140-143, 144-147, 148-151, 152-155, 156-159, 160-163, 164-167,
168-171, 172-175, 176-179, 180-183, 184-187, 188-191, 192-195, 196-199, 200-
203, 204-207, 208-211, 212-215, 216-219, 220-223, 224-227, 228-231, 232-235,
236-239, 240-243, 244-247, 248-251, 252-255

Exclude the occupied subnets and use first four available subnets 96-99, 100-103,
104-107 and 108-111 for WAN links.

Following figure explains above steps and Subnetting.

Subnetting table for first example of VLSM


Segment CIDR Subnet Mask Network Address Broad cast Address

LAN Segment1 /27 255.255.255.224 192.168.1.0 192.168.1.31

LAN Segment 2 /27 255.255.255.224 192.168.1.32 192.168.1.63

LAN Segment 3 /28 255.255.255.240 192.168.1.64 192.168.1.79


LAN Segment 4 /28 255.255.255.240 192.168.1.80 192.168.1.95

WAN Link 1 /30 255.255.255.252 192.168.1.96 192.168.1.99

WAN Link 2 /30 255.255.255.252 192.168.1.100 192.168.1.103

WAN Link 3 /30 255.255.255.252 192.168.1.104 192.168.1.107

WAN Link 4 /30 255.255.255.252 192.168.1.108 192.168.1.111

VLSM Example 2

In this example, first segment (VLAN1) requires the block size of 256.

In class B, Subnetting of /24 provides us 256 subnets and 256 hosts in each subnet.

0.0, 1.0, 2.0, 3.0, 4.0, 5.0 ……………………………….. 252.0, 253.0, 254.0, 255.0

Let’s assign first subnet 0.0 to this segment.

Since second segment (VLAN2) and third segment (LAN Segment1) also have the
similar requirement, instead of doing Subnetting again, let’s use the next available
subnets from already subnetted subnets for these segments.

Assign second subnet 1.0 and third subnet 2.0 to the second segment (VLAN2) and
third segment (LAN Segment1) respectively.
Fourth segment (LAN Segment2) requires the block size of 64 which is different and
lower from current block size. Instead of using current subnets, let’s do Subnetting
again for this segment.

In class B, Subnetting of /26 provides 1024 subnets with block size of 64.

0.0, 0.64, 0.128, 0.192, 1.0, 1.64, 1.128, 1.192, 2.0, 2.64, 2.128, 2.192, 3.0, 3.64,
3.128, 3.192, 4.0, 4.64, 4.128, 4.192………………………………….. 254.0, 254.64,
254.128, 254.192, 254.0, 254.64, 254.128, 254.192

Exclude already occupied subnets and use first available subnet 3.0 for this segment
(LAN segment2).

Next two segments are WAN links. For WAN links we use the Subnetting of /30.

In class B, Subnetting of /30 provides 16384 networks with the block size of 4.

0.4, 0.8, 0.12, ….…… 3.0, 3.4, …………. 3.56, 3.60, .64, 3.68, 3.72, 3.78,
…………………………… 255.248, 255.252

Just like we did above, exclude occupied subnets and assign first two available
subnets 3.64 and 3.68 to the WAN Link1 and WAN Link2 respectively.

Subnetting table for second example of VLSM


Segment CIDR Subnet Mask Network Address Broad cast Address

VLAN1 /24 255.255.255.0 172.168.0.0 172.168.0.255

VLAN2 /24 255.255.255.0 172.168.1.0 172.168.1.255

LAN Segment 1 /24 255.255.255.0 172.168.2.0 172.168.2.255

LAN Segment 2 /26 255.255.255.192 172.168.3.0 172.168.3.63

WAN Link 1 /30 255.255.255.252 172.168.3.64 172.168.3.67

WAN Link 2 /30 255.255.255.252 172.168.3.68 172.168.3.71


VLSM Example 3

The largest segment (LAN Segment 3) requires the block size 512.

In class A, Subnetting of /23 provides 32768 networks with the block size of 512.

0.0.0, 0.2.0, 0.4.0, …………………………………. 0.252.0, 0.254.0

Assign first subnet 0.0.0 to this segment.

The second largest segment (LAN Segment 4) requires the block size of 256.

In class A, Subnetting of /24 provides 65536 networks with the block size of 256.

0.0.0, 0.1.0, 0.2.0, 0.3.0, 0.4.0, 0.5.0, ……………………… 0.252.0, 0.253.0, 0.254.0

Exclude the occupied subnets and assign first available subnet 0.2.0 to it.

The third largest segment (LAN Segment 1) requires the block size of 128.

In class A, Subnetting of /25 provides 131072 networks with the block size of 128.

0.0.0, 0.0.128, 0.1.0, 0.1.128, 0.2.0, 0.2.128, 0.3.0, 0.3.128, 0.4.0, 0.4.128
………………… 0.254.0, 0.254.128 , 0.255.0 , 0.255.128

Assign first available subnet 0.3.0 to this segment.

The fourth largest segment (LAN Segment 5) requires the block size of 64.

In class A, Subnetting of /26 provides 262144 networks with the block size of 64.
0.0.64, 0.0.128, 0.0.192, 0.0.255, 0.1.64, …………………. 0.2.192, 0.2.255,
0.3.64, 0.3.128, 0.3.192, 0.3.255, 0.4.64 …………………. , 0.254.0 , 0.254.64 ,
0.254.128 , 0.254.255

In this Subnetting, the first subnet with available addresses is 0.3.128. Assign it to
this segment.

The fifth largest segment (LAN Segment2) requires the block size of 32.

In class A, Subnetting of /27 provides 524288 networks with the block size of 32.

0.0.32, 0.0.64, 0.0.96, 0.0.128 ………. 0.3.0, 0.3.32, 0.3.64, 0.3.96, 0.3.128,
0.3.160, 0.3.192, 0.3.224, 0.3.255, …………………. , 0.255.0, 0.255.32, 0.255.64,
0.255.92, 0.255.128, 0.255.224, 0.255.255

The first available subnet of this Subnetting is 0.3.192. Let’s assign it to this
segment.

Next six segments are WAN links. For WAN links use the Subnetting of /30.

In class A, Subnetting of /30 provides 4194304 networks with the block size of 4.

0.0.0, 0.0.4, 0.0.8 …………………….…………….. 0.3.208, 0.3.212, 0.3.216,


0.3.220, 0.3.224, 0.3.228, 0.3.232, 0.3.236, 0.3.240, 0.3.248, 0.3.252, 0.4.0, 0.4.8,
…………….. 0.255.240, 0.255.244, 0.255.248, 0.255.252

Assign subnets 0.3.224, 0.3.228, 0.3.232, 0.3.236, 0.3.240 and 0.3.248 to WAN links
respectively.

Subnetting table for third example of VLSM


Segment CIDR Subnet Mask Network Address Broad cast Add

LAN Segment 3 /23 255.255.254.0 10.0.0.0 10.0.1.255

LAN Segment 4 /24 255.255.255.0 10.0.2.0 10.0.2.255

LAN Segment 1 /25 255.255.255.128 10.0.3.0 10.0.3.127

LAN Segment 5 /26 255.255.255.192 10.0.3.128 10.0.3.191

LAN Segment 2 /27 255.255.255.224 10.0.3.192 10.0.3.223

WAN Link1 /30 255.255.255.252 10.0.3.224 10.0.3.227

WAN Link2 /30 255.255.255.252 10.0.3.228 10.0.3.231

WAN Link3 /30 255.255.255.252 10.0.3.232 10.0.3.235

WAN Link4 /30 255.255.255.252 10.0.3.236 10.0.3.239

WAN Link5 /30 255.255.255.252 10.0.3.240 10.0.3.243


WAN Link6 /30 255.255.255.252 10.0.3.244 10.0.3.247

Supernetting Tutorial: - Supernetting


Explained with Examples
This tutorial explains Supernetting, route summarization and route aggregation in
detail with examples. Learn how Supernetting is done step by step along with the
fundamental and the basic concepts of Supernetting such as what is Supernetting,
why Supernetting is done and what are the advantages of Supernetting.

What is Supernetting?

Supernetting is the process of summarizing a bunch of contiguous Subnetted


networks back in a single large network. Supernetting is also known as route
summarization and route aggregation.

Following figure shows an example of Supernetting.


In above example, 8 subnets are summarized in single subnet.

Why Supernetting is done?

Supernetting is mainly done for optimizing the routing tables. A routing table is the
summary of all known networks. Routers share routing tables to find the new path
and locate the best path for destination.

Without Supernetting, router will share all routes from routing tables as they are.
With Supernetting, it will summarize them before sharing. Route summarization
reduces the size of routing updates dramatically.

Following figure shows an example of route summarization.


Advantage of Supernetting

Supernetting provides following advantages.

 It reduces the size of routing updates.


 It provides a better overview of network.
 It decreases the use of resources such as Memory and CPU.
 It decreases the required time in rebuilding the routing tables.

Supernetting components
Each route advertises a certain number of addresses including network ID,
broadcast ID and subnet mask. We can use a term Block size to refer all these
addresses collectively.

In order to perform the Supernetting, we need Network ID, CIDR Value, Broadcast
ID, Subnet Mask and Block Size of each route.

 Network ID and broadcast ID are used to check the alignment of routes. Supernetting
can be performed only if routes are sequential.
 Block size is used to calculate the summarized route from given routes.
 Subnet mask and CIDR value is the same thing in different notations. Both are used
to find the ON network bits in IP address. In exam, question may use any notation.
While preparing for Cisco exam, you should practice with both.

Since an advertise route is the combination of network ID and CIDR value, we only
need to figure out the broadcast ID, subnet mask and block size.
For block size use following formulas:-

32 – CIDR Value = Number of host bits


Block size = 2Number of host bits
For example if CIDR value is 25 then block is 128.

32 -25 = 7
27 = 128
Broadcast ID is the last address of network. Once you know the block size, to
calculate the broadcast ID, simply count the addresses starting from network ID till
the last address of the block.

For example if network ID is 192.168.1.0/25 and block size is 128 and then
broadcast ID will be 192.168.1.127/25.

In counting, the 0 is used as a number. For example, [0, 1 and 2] are 3 numbers.

Following table lists all CIDR values along with subnet mask and block size.

Supernetting chart
CIDR Subnet mask

/8 255.0.0.0

/9 255.128.0.0

/10 255.192.0.0

/11 255.224.0.0

/12 255.240.0.0

/13 255.248.0.0

/14 255.252.0.0

/15 255.254.0.0

/16 255.255.0.0

/17 255.255.128.0

/18 255.255.192.0

/19 255.255.224.0

/20 255.255.240.0

/21 255.255.248.0

/22 255.255.252.0

/23 255.255.254.0
/24 255.255.255.0

/25 255.255.255.128

/26 255.255.255.192

/27 255.255.255.224

/28 255.255.255.240

/29 255.255.255.248

/30 255.255.255.252

This tutorial is the last part of the article “IP Subnetting in Computer Network Step by
Step Explained with Examples”. Other parts of this article are following.

This tutorial is the first part of the article. It explains IP addressing and network addressing such as IP
address, subnet mask, IP address types and IP classes in detail.

Basic Subnetting in Computer Networks Explained

This tutorial is the second part of the article. It explains what Subnetting is and why it is necessary in
computer network along with the advantages of Subnetting.

Subnetting Tutorial - Subnetting Explained with Examples

This tutorial is the third part of the article. It explains the Subnetting concepts and terms such as network
id, broadcast id, total hosts, valid hosts, power of 2, block size and CIDR in detail.

Subnetting Tricks Subnetting Made Easy

This tutorial is the fourth part of the article. It explains the easiest and the fastest way of performing
Subnetting in Cisco exams and interviews.

VLSM Subnetting Explained with Examples

This tutorial is the fifth part of the article. It explains what VLSM Subnetting is and how to perform it step by
step along with differences between FLSM Subnetting and VLSM Subnetting.

VLSM Subnetting Examples and Calculation Explained

This tutorial is the sixth part of the article. It explains VLSM Subnetting examples step by step in detail
including VLSM Subnetting practice questions and answers.
Key points of Supernetting

Supernetting can be done only in same address space. If address space is


completely different between two or more routes, they cannot be summarized in a
single route. For example, we can’t summarize the route 192.168.1.0/25 with the
route 193.168.1.128/25.
A route can be summarized only in a route which is bigger than it in block size. For
example we can’t summarize a route of block size 64 in a route of block size 32 but
we can summarize two routes of block size 32 in a single route of block size 64.

The easiest way of calculating the summarized route is adding the block size of all
sequential routes and using the Subnetting which provides the block size that is
equal to the result of addition. For example if we have two sequential routes of block
size 16, we can summarize them in a single route of block size 32.

Summarization can be done only in available bock sizes. For example if we have 5
routes of block size 8, we cannot summarize them in single route of block size 40
(8x5). 40 is not a valid block size. For valid block sizes see the Supernetting chart
give above. In this case, the best choice is summarizing first four routes is single
summarized route of block size 32 and keeping the fifth route as it is.

Just like block size, network ID of summarized route must be matched with the
network ID of first sequential route. To calculate the valid network in summarized
block size, simply count in block size starting from 0.

For example, if summarized block size is 32 then valid network IDs are 0, 32, 64, 96,
128, 160, 192 and 224. If the first sequential route of routes which we are
summarizing doesn’t start with any one of these network IDs, they can’t be
summarized in a single route of block size 32, even they satisfy the block size
requirement.

For instance the route 192.168.1.16/28 and the route 192.168.1.32/28 can’t be
summarized in a single route of block size 32 even they are sequential and their
collective block size (16+16) is equal to the 32.

Any sequential routes which start with any one of these network IDs can be
summarized with this block size. For instance route 192.168.1.0/28 and the route
192.168.1.16/28 can be summarized in a single route 192.168.1.0/27 of block size
32

Never select a block size which does not cover all addresses unless it is clearly
mentioned in question that remaining addresses will be used behind the router
where summarization will be performed.

For example, if we have two routes with block size of 16 and 8, we can’t summarize
them in a single route of block size 32. If we do that, router will advertise a
summarized route that says this router have network path for 32 addresses while in
reality it have network path only for 24 (16+8) addresses.

Let’s take another example. If we have three routes with block size of 16, instead of
summarizing all of them in single route of block size 64 (16+16+16 = 48), we should
summarize only first two routes in a single route of block size 32 (16+16 =32). In this
case, router will advertise two routes; one summarized route of block size 32 and
other original route. Advertising two correct routes is better than advertising a single
incorrect route.
Supernetting Examples Explained Step by Step
Above we took the two examples of Supernetting. Let’s understand how
Supernetting was performed in them step by step.

Arrange all the routes in ascending order based on their after slash value (also
known CIDR value). If CIDR value is same in two or more routes, use their IP
addresses for ordering.

Supernetting Example 1 After slash value or CIDR Value Supernetting Example 2

192.168.1.0/25 25 10.0.0.0/23

192.168.1.128/26 26 10.0.2.0/24

192.168.1.192/27 27 10.0.3.0/25

192.168.1.224/28 28 10.0.3.128/26

192.168.1.240/30 30 10.0.3.192/27

192.168.1.244/30 30 10.0.3.224/28

192.168.1.248/30 30 10.0.3.240/30

192.168.1.252/30 30 10.0.3.244/30

10.0.3.248/30

10.0.3.252/30

Write the CIDR value, Subnet Mask, Network ID, Broadcast ID and block size of
each route.

Supernetting Example 1
Route CIDR value Subnet Mask Network ID

192.168.1.0/25 25 255.255.255.128 192.168.1.0

192.168.1.128/26 26 255.255.255.192 192.168.1.128

192.168.1.192/27 27 255.255.255.224 192.168.1.192

192.168.1.224/28 28 255.255.255.240 192.168.1.224

192.168.1.240/30 30 255.255.255.252 192.168.1.240

192.168.1.244/30 30 255.255.255.252 192.168.1.244

192.168.1.248/30 30 255.255.255.252 192.168.1.248

192.168.1.252/30 30 255.255.255.252 192.168.1.252


Supernetting Example 2
Route CIDR value Subnet Mask Network ID

10.0.0.0/23 23 255.255.254.0 10.0.0.0

10.0.2.0/24 24 255.255.255.0 10.0.2.0

10.0.3.0/25 25 255.255.255.128 10.0.3.0

10.0.3.128/26 26 255.255.255.192 10.0.3.128

10.0.3.192/27 27 255.255.255.224 10.0.3.192

10.0.3.224/28 28 255.255.255.240 10.0.3.224

10.0.3.240/30 30 255.255.255.252 10.0.3.240

10.0.3.244/30 30 255.255.255.252 10.0.3.244

10.0.3.248/30 30 255.255.255.252 10.0.3.248

10.0.3.252/30 30 255.255.255.252 10.0.3.252

Group the routes based on sequence. If a route’s network ID starts from where
previous route’s broadcast ID ends, it is a sequential route. But if it does not start
from where previous route ends, it is not a sequential route.
Add the block size of all sequential routes.

In first example, sum of block sizes is 256 and in second example it is 1024.

Check the nearest valid block size which provides equal or less number of
addresses. The block size 256 and 1024 exactly match with our requirement. The
Subnetting of /24 and /22 give us the block size of 256 and 1024 respectively.

To write the summarize route, use the network ID of first route with the CIDR value
or the subnet mask of the summarized route.

In first example, network ID of the first route is 192.168.1.0 and the CIDR value of
summarized route is /24. Thus, the summarized route for first example will be
192.168.1.0/24.

Same way in second example, network ID of first route is 10.0.0.0 and the CIDR
value of summarized route is /22. So, the summarize route for second example will
be 10.0.0.0/22.
Complex Supernetting Examples
If IP addressing is planed correctly, Supernetting is simple and straightforward as we
have seen in above examples. It becomes difficult only if unplanned IP addressing is
used in network.

If you are preparing for Cisco exam, you should practice with unplanned IP
addressing. To test candidates’ caliber, Cisco usually puts complex and unplanned
networks in Supernetting related questions.

To get an overview of how Supernetting questions could be difficult in Cisco exam,


let’s have two examples of complex Supernetting. These examples are based on
Supernetting questions asked in CCNA Routing and Switching exam.

Supernetting Example 3
Supernetting Example 4

Step 1: - Arrange all routes in ascending order.

Supernetting Example 3 Supernetting Example 4

Router A Router B Router A

172.168.1.32/28 172.168.1.64/28 122.128.58.0/29

172.168.1.48/28 172.168.1.80/28 122.128.58.48/29

172.168.1.128/28 172.168.1.96/28 122.128.58.64/29

172.168.1.144/28 172.168.1.112/28 122.128.58.72/29

172.168.1.160/28 172.168.1.192/28 122.128.58.80/29

172.168.1.176/28 172.168.1.208/28 122.128.58.56/29

Step 2: - Write the network ID, broadcast ID, CIDR value, subnet mask and block
size of each route.

Supernetting Example 3 (Router A)


Route CIDR Subnet mask Network ID

172.168.1.32 28 255.255.240.0 172.168.1.32

172.168.1.48 28 255.255.240.0 172.168.1.48

172.168.1.128 28 255.255.240.0 172.168.1.128

172.168.1.144 28 255.255.240.0 172.168.1.144


172.168.1.160 28 255.255.240.0 172.168.1.160

172.168.1.176 28 255.255.240.0 172.168.1.176

Supernetting Example 3 (Router B)


Route CIDR Subnet mask Network ID

172.168.1.64 28 255.255.240.0 172.168.1.64

172.168.1.80 28 255.255.240.0 172.168.1.80

172.168.1.96 28 255.255.240.0 172.168.1.96

172.168.1.112 28 255.255.240.0 172.168.1.112

172.168.1.192 28 255.255.240.0 172.168.1.192

172.168.1.208 28 255.255.240.0 172.168.1.208

Supernetting Example 4 (Router A)


Route CIDR Subnet mask Network ID

122.128.58.0 29 255.255.255.248 122.128.58.0

122.128.58.48 29 255.255.255.248 122.128.58.48

122.128.58.64 29 255.255.255.248 122.128.58.64

122.128.58.72 29 255.255.255.248 122.128.58.72

122.128.58.80 29 255.255.255.248 122.128.58.80

Supernetting Example 4 (Router B)


Route CIDR Subnet mask Network ID

122.128.58.8 29 255.255.255.248 122.128.58.8

122.128.58.16 29 255.255.255.248 122.128.58.16

122.128.58.24 29 255.255.255.248 122.128.58.24

122.128.58.32 29 255.255.255.248 122.128.58.32

122.128.58.40 29 255.255.255.248 122.128.58.40

122.128.58.56 29 255.255.255.248 122.128.58.56

Step 3: - Based on network ID and Broadcast ID make the group of sequential


routes.
Step 4: - Summarize each group of sequential routes in a single or multiple
summarized routes.

 Add the block size of all sequential routes in group.


 Find the valid block which is equal or less in size.
 Starting from 0, count in valid block size and check whether the network ID of first
sequential route exists in result or not.
 If network ID of first sequential route exists in result, use the valid block size to
summarize the routes.
 For summarization use the CIDR value which provides this block size.
 If network ID of first sequential route does not exist in result, use smaller valid block
size and count again. Repeat this step until the network ID of first sequential route
does not fall in result.

Supernetting example 3 (Router A)


As we can see in above figure, there are two groups of sequential routes in this
router.
In first group, there are two sequential routes; 32 and 48. Both routes have a block
size of 16. The sum of block sizes is 32 (16+16). 32 is a valid block size. The
network ID of first sequential route is 32 which is a valid network ID in block size 32
(0, 32, 64,…). Block size 32 is associated with CIDR value /27. Let’s use this block
size for summarization.

Summarize the routes 172.168.1.32/28 and the route 172.168.1.48/28 in a single


route 172.168.1.32/27 of block size 32.

In second group, there are 4 sequential routes 128, 144, 160 and 176 of block size
16. The sum of all block sizes is 64. 64 is a valid block size. Network ID of first
sequential route (128) is also in the range of block size 64 (0, 64, 128, 192 ……).
Thus, we can use the block size 64 to summarize these routes. CIDR value of block
size 64 is /26. Let’s use it to summarize these routes.

Summarize the routes 172.168.1.128/28, 172.168.1.144/28, 172.168.1.160/28 and


172.168.1.176/28 in a single route 172.168.1.128/26 of block size 64.

Supernetting example 3 (Router B)


This router also has the two groups of sequential routes. In first group there are 4
sequential routes 64, 80, 96 and 112 of block size 16 and in second group there are
2 sequential routes 192 and 208 of block size 16.

The sum of block sizes is 64 (16+16+16+16) in first group and 32 (16+16) in second
group. Both 64 and 32 are valid block sizes and the network ID of first sequential
route in both groups is also a valid network ID in both block sizes.

Summarize the routes 172.168.1.64/28, 172.168.1.80/28, 172.168.1.96/28 and


172.168.1.112/28 a single route 172.168.1.64/26 of block size 64.

Summarize the routes 172.168.1.192/28 and the route 172.168.1.208/28 in a single


route 172.168.1.192/27 of block size 32.

Supernetting example 4 (Router A)


There are total 5 routes behind this router. Since first two routes 0 and 48 have no
sequential routes, we have to advertise them individually. We can’t summarize a
route which has no sequential route.

Remaining 3 routes 64, 72 and 80 are sequential with the block size 8. The sum of
block sizes (8+8+8) is 24. Since 24 is not a valid block size, we have to exclude the
routes from summarization until the sum of block sizes becomes equal to a valid
block size. If we exclude one route from summarization, the sum of block sizes
reduces to 16 which is a valid block size.

In block size 16, 64 (the network ID of first sequential route) is a valid network ID (0,
16, 32, 48, 64, 80……).

Summarize first two routes in a summarize route 122.128.58.64/28 of block size 16


and advertise the remaining third route 122.128.58.80/29 independently.
Supernetting example 4 (Router B)
There are total 6 routes behind this router. Since last route 56 has no sequential
route, it can’t be summarized.

Remaining five routes 8, 16, 24, 32 and 40 are sequential. Total numbers of address
in these routes are 40 (8+8+8+8+8). 40 is not a valid block size. The nearest valid
block size is 32. So if we exclude one route (8+8+8+8-8 = 32), can we use the block
size 32 for remaining routes?

No, even 32 is a valid block size, still it can’t be used. In order to use it, network ID of
first route must be any one ID form 0, 32, 64, 96, 128, 160, 192 and 224. While in
this case, network ID of first route is 8. Thus the block size 32 can’t be used for
summarization.

Our next valid block size is 16. If we use this block size, we have to create two
summarized routes and skip one sequential route from the summarization. Each
summarized route of block size 16 will summarize the 2 sequential routes of the
block size 8.

Since in order to use the block size 16, we have to skip one route from the five
sequential routes and due to the same reason explained above in block size 32 we
can’t summarize the first route 8, exclude the first route from summarization.

Summarize remaining 4 routes (16, 24, 32, and 40) of block size 8 in two separate
summarized routes 122.128.58.16/28 and 122.128.58.32/28 of block size 16.

Following table lists the summarized routes for all four routers.

Example3 (Router A) Example3 (Router B) Example4 (Router A)

172.168.1.32/27 172.168.1.64/26 122.128.58.0/29

172.168.1.128/26 192.168.1.192/27 122.128.58.48/29

122.128.58.64/28

122.128.58.80/29

Internetworking in Computer Network


This tutorial explains internetworking in computer network with five key
internetworking devices (hub, bridge, switch, router and multilayer). Learn basic
internetworking concepts such as collision domain and broadcast domain in detail
with examples.
Internetworking term in computer networking explains how computer networks
connect with each other through Internetworking devices. Before we learn
internetworking in details, let’s understand what computer network is first.

Computer networks are basically built from three components; End Devices,
Networking Devices and Media.

End Devices: - End devices are used to access or transmit the data. Computer,
laptop, data server and tablet are the example of end devices.

Networking Devices: - Networking devices are used to control the data flow.
Switches, Routers, HUB, Bridges, firewalls and modems are the example of
networking devices.

Media: - Media is used to transmit the data. Copper cables, fiber cable and wireless
signals are the example of media.

Following figure illustrate a simple computer network

Let’s start exploring above network, assume that you are working on PC1 and want
to send a file to PC3. What will you do?
Probably you will access PC3 from any network application such
as Network [Available in left pane of windows explorer on any Windows OS] and
drop the file in shared folder from PC3. That’s all, your job is done.

But wait…. it’s your job that is done not computer’s. Actually computer’s job is just
started. Computer will start with name resolution process. In Name resolution
process hostname is translated with IP address and vice versa. Its same
mechanisms that mobile phone uses. When you dial someone’s number from
contact what happen? Your mobile phone displays his name on screen. This feature
allows us to know who is calling us or to whom we are calling.

For example in following figure SAM whose mobile number is 098765432112 calling
to BOB whose mobile number is 123456789012.

Neither Bob nor SAM has to remember the each other’s mobile number. Because
mobile numbers and contact names are stored in phonebook application. Phonebook
is the smallest part of DNS service. DNS service is the database of contact numbers
and names. Names are used for human reference while numbers are used for
mobile network. Both are converted with each others in name resolution process.
Same thing happens in computer network. You can replace name and number of
mobile network with hostname and IP address in computer network.

In computer network:-

 Destination hostname must be converted with IP address before source can access
it.
 Source PC uses DNS or ARP broadcast to resolve the hostname with IP address.

In our example we are sending a file from PC1 to PC3. Hostname of our destination
address is PC3. It must be converted in IP address before PC1 can access it. PC1
uses DNS service to resolve the hostname with IP address.
Okay our source computer knows the IP address of destination computer. Will it
send the file now? Not yet, it needs to know one more address; MAC address. MAC
address is a hardware address and burned with Ethernet card from manufacturer.

How computer will know the MAC address of destination computer? Again it will use
the ARP broadcast to find out the MAC address.

A sample broadcast from PC1 to find out the MAC address of PC3

Time Source Destination Protocol Info


8.123 192.168.1.1 Broadcast ARP Who has 192.168.1.3?
Tell 192.168.1.1
A sample response from PC3 to PC1

Time Source Destination Protocol Info


8.124 192.168.1.3 192.168.1.1 ARP 192.168.1.3 is at
00:0b:db:99:d3:5e
Key Points
Every computer in network has a unique network address. This address represents
its location in network. Computer address is built from two addresses IP address and
MAC address.

IP Address: - IP address is a software address. We need to configure it on each PC.

MAC Address: - MAC address is a hardware address. It is assigned with Ethernet


card from its manufacture company.

Computers know their own address but they don't know others. To know others
address they use two types of broadcast ARP and RARP.

Network applications rely on broadcast messages to get the necessary information.


Beside ARP and RARP there are lots of broadcast in the network that create serious
performance issue. To deal with broadcast issue, a large network is divided in many
small networks. Each small network has its own broadcast boundaries and known as
broadcast domain.

Broadcast domain

Broadcast is a destination less message. It never carries user data. It is used by


computer for network functionality. Domain is the group of computers sharing same
characteristics.

So broadcast domain is the group of computers those share same broadcast.


Multilayer switches and routers can control the broadcast.

Collision

Collision is another bigger network issue that every network has to face. Collision
occurs when two sender devices sense media at a time.
Collision domain

Collision domain is a group of computers those share same collision. More


computers you put in network, more collision you will experience. Collision seriously
effect network performance. Collision should be less than one percent of total traffic.
If it increases, we will have to implement collision removal devices. Bridges,
switches, routers, multilayer switches can control the collision.

Networking devices

In this section we will take five key networking devices those are used to connect
multiple computers in single network and explain how they affect broadcast and
collision.

HUB

If you have two devices, you can connect them directly with a cable. But if you have
more than two devices, you need a center device that can connect them. HUB
solves this issue. It has single purpose, connect multiple devices in single network.

Hub is a multi-port repeater. It cannot control collision and broadcast. HUB is the
earliest device in computer network. Usually you will not see it in current network.

Bridge

Bridge connects devices more intelligently. It can remove collision from network.

It keeps record of connected device and create separate route for each devices.
Bridge have following limitations.

 They cannot control broadcast.


 Bridges manage collision by software that slows down overall network performance.
 Bridges have port limitation.
 Bridges are outdated now. They are hard to find in current time computer network.
They are replaced by switches.

Switch

Switches have all goodies of bridges. They can control collision at hardware level
that improves overall network performance.

Switches create separate route for each connected device that eliminates CSMA/CD
process completely.

Switch keeps route information in memory. We will explain this process in detail with
example in our next article. For this article just make sure that you know switch
maintain a table which is used to keep track of connected devices. It is known as
CAM table and also used to remove the collision.
Switches can control the collision but they cannot control the broadcast.

Router

Router can control both collision and broadcast. Beside this router do a lot more that
we will explain in next article.

Routers have following drawback: -

 They are very expensive


 They have limited ports
Multilayer switches

Multilayer switches are the most expensive device among these. They can control
both collision and broadcast.

Multilayer switches are usually deployed in enterprise size company environment.

Summary
Device Collision Broadcast

HUB Single collision domain Single broadcast domain

Bridge Per port collision domain Single Broadcast domain

Switch Per port collision domain Single Broadcast domain

Router Per port collision domain Per port broadcast domain

Multilayer switch Per port collision domain Per port broadcast domain

You might also like