TCP - IP Reference Model Explained
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 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.
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.
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.
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
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
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.
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.
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.
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.
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.
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.
This tutorial is the second part of the article. It explains the seven layers of the OSI model in detail.
This tutorial is the fourth part of the article. It explains the five layers of the TCP/IP model in detail.
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 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.
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.
Top Layers 7 Application Provide a user interface for sending and receiving data
Bottom Layers 4 Transport Break the data stream into smaller segments and provide re
This tutorial is the first part of the article. It summarizes why the OSI model was created and what
advantages it has.
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.
This tutorial is the fourth part of the article. It explains the five layers of the TCP/IP model in detail.
This tutorial is the fifth part of the article. It explains how data is encapsulated and de-encapsulated when it
passes through the layers.
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.
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 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 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.
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.
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 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.
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 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:-
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.
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.
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.
This tutorial is the second part of the article. It explains the seven layers of the OSI model in detail.
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.
This tutorial is the fifth part of the article. It explains how data is encapsulated and de-encapsulated when it
passes through the layers.
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.
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.
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.
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.
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
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.
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.
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.
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.
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.
This tutorial is the sixth part of the article. It explains VLSM Subnetting examples for Cisco exams and
interviews.
This tutorial is the last part of the article. It explains Supernetting in detail with examples.
Advantage of Subnetting
Disadvantage of Subnetting
What is IP Subnetting?
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.
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.
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.
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.
This tutorial is the sixth part of the article. It explains VLSM Subnetting examples for Cisco exams and
interviews.
This tutorial is the last part of the article. It explains Supernetting in detail with examples.
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.
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.
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.
To learn more about IP address and its classes, you can see this tutorial.
In class A, B and C: -
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.
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.
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
This tutorial is the sixth part of the article. It explains VLSM Subnetting examples for Cisco exams and
interviews.
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 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.
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
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.
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
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
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.
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.
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.
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)
130.0.0.0/18 2 14 4 (22)
140.50.60.0/20 4 12 16 (24)
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)
Step 1
Find the interesting octet and make two new addresses from the given address in
rough area of worksheet as explained following: -
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
Step 2
Based on interesting octet, subtract after slash value form the upper value of octet
range.
Given Address Value after slash Interesting octet Upper value of range Subtraction
Step 3
Use the result of subtraction in following formula to calculate the block size
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
150.60.180.0/19 Third 180 32 0-31, 32-63, 64-95, 96 -127, 128-159, 160 - 191
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
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.
Step 1
Find the interesting octet as explained above.
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: -
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.
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
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
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
It supports both classfull and classless routing protocols. It supports only cla
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.
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.
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.
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.
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.
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: -
Before we perform VLSM Subnetting for this network, let’s understand how VLSM
Subnetting actually works.
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.
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.
2 4 8 16 32 64
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.
Production 52 54
Wan link 1 2 4
Development 74 76
Wan link 2 2 4
Administration 28 30
Wan link 3 2 4
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.
Subnet Subnet1
Network ID 192.168.1.0
Broadcast ID 192.168.1.127
Segment Development
Requirement 74
CIDR /25
Network ID 192.168.1.0
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.
Subnetting of 192.168.1.0/26
Network ID 0 64 1
First address 1 65 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.
Requirement 52
CIDR /26
Network ID 192.168.1.128
Broadcast ID 192.168.1.191
Subnetting of 192.168.1.0/27
Net ID 0 32 64 96 128
Exclude the already occupied subnets (Sub1 to Sub6) and assign the first available
subnet (Sub7) to this segment.
Segment Administration
Requirement 28
CIDR /27
Network ID 192.168.1.192
Broadcast ID 192.168.1.223
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
Requirement 2
CIDR /30
Network ID 192.168.1.224
Broadcast ID 192.168.1.227
Subnet Subnet 58
Requirement 2
CIDR /30
Network ID 192.168.1.228
First hosts 192.168.1.229
Broadcast ID 192.168.1.231
Subnet Subnet 59
Requirement 2
CIDR /30
Network ID 192.168.1.232
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.
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.
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.
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.
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.
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.
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.
/8 255.0.0.0 0 24 1 16777
/9 255.128.0.0 1 23 2 83886
/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.
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
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
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.
VLSM Example 1
The first largest segment (LAN Segment1) requires the block size 32. For 32 block
size, we use the Subnetting of /27.
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.
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.
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.
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
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.
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.
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
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.
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.
What is Supernetting?
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.
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 -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.
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.
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.
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.
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.
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
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.
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
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.
Supernetting Example 3
Supernetting Example 4
Step 2: - Write the network ID, broadcast ID, CIDR value, subnet mask and block
size of each route.
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.
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.
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……).
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.
122.128.58.64/28
122.128.58.80/29
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.
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
Computers know their own address but they don't know others. To know others
address they use two types of broadcast ARP and RARP.
Broadcast domain
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
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.
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.
Multilayer switches are the most expensive device among these. They can control
both collision and broadcast.
Summary
Device Collision Broadcast
Multilayer switch Per port collision domain Per port broadcast domain