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

1-Subnetting

Subnetting involves borrowing bits from the host portion of an IP address to create additional network addresses. The subnet mask is used to determine the division between the network and host portions of the IP address. Subnetting is essential for efficient routing, as it allows routers to better direct data between smaller, defined network segments, reducing broadcast traffic and improving overall network management. The process is commonly used in both IPv4 and IPv6 networks to ensure scalabl
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

1-Subnetting

Subnetting involves borrowing bits from the host portion of an IP address to create additional network addresses. The subnet mask is used to determine the division between the network and host portions of the IP address. Subnetting is essential for efficient routing, as it allows routers to better direct data between smaller, defined network segments, reducing broadcast traffic and improving overall network management. The process is commonly used in both IPv4 and IPv6 networks to ensure scalabl
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

Computer Arts and Technological College, Inc.

Legazpi ● Ligao ● Polangui

IP ADDRESS SUBNETTING

Learning Objectives:

After reading this INFORMATION SHEET, YOU MUST be able to:

1. Learn to divide the network in to small network groups.


2. Learn the important term in subnetting.
3. Identify the special subnet.

As we talked about before, there are two parts in an IP Address. One for
them is Network part and the other is Host part. With IP Subnetting, we are
adding one more part. This is “Subnet Part”. From the Host part, we borrow
some bits and we will use this part for Subnet.

Subnetting is dividing the network into smaller network groups and by


doing this, using the IP Address Block more efficient. Subnetting allows you to
create multiple logical networks that exist within a single Class A, B, or C
network. If you do not subnet, you are only able to use one network from your
Class A, B, or C network, which is unrealistic.
Computer Arts and Technological College, Inc.
Legazpi ● Ligao ● Polangui

For Subnetting, Subnet Masks are used. Subnets masks are 32 bit
addresses like IP Addresses. Subnet Masks are used with IP Addresses. The 1s
represents the network parts, and 0s represents the host parts.

We can show Subnet Masks with four octets like IP addresses


(255.255.255.0) or we can show it like /X. Here, for the 255.255.255.0 Subnet
Mask, we can use /24. This means that the first 24 bit is full of 1s and it is
network part.

CIDR versus VLSM

In Subnetting, there are two important terms.

a. CIDR (Classless Inter Domain Routing)


CIDR (Classless Inter Domain Routing) is the term that is used
for using IP addresses independent from their traditional IP
Classes. In other words, CIDR is using IP addresses without
classes.

b. VLSM (Variable Length Subnet Mask)


VLSM (Variable Length Subnet Mask) is the term that is used
for using different Subnet Mask for different sun networks. In
other words, it is the mechanism that allows different Subnet
Masks and provide division of a network into sub networks. It is
like Subnet of subnets.

CIDR is used on the addresses that will advertise to the internet. So, it is
used in the Internet Service Provider part. VLSM is used in a company or in
smaller networks to use IP address spaces ideally.
Computer Arts and Technological College, Inc.
Legazpi ● Ligao ● Polangui

Special Subnets

In Subnetting some Subnet Masks are used specifically sometimes.


These are /24, /30, /31/ and /32.

a. /24
This is the Subnet Mask that is usually used in the local networks by
default.
b. /32
This is the Subnet Mask used generally on Loopback and System
interfaces.
c. /31
This is the Subnet Mask used on point-to-point links
d. /30
This is also widely used in Service Provider Networks for point-to-
point connections.

Loopback Interface is the “virtual” interfaces. There can be many


Loopback interfaces in a Router. Loopback Interfaces are used for its “always
up and never physically down” characteristics generally. We give these
Loopback Interfaces a /32 Loopback IP address.

There is also a System Address that is used on Alcatel-Lucent Service


Routers. This is a specific loopback address that provide to reach the router’s
itself. This address is very important for ALU routers. It is used in many
protocol configurations. System addresses are /32 IP addresses.
Computer Arts and Technological College, Inc.
Legazpi ● Ligao ● Polangui

Subnetting Examples

In this part, we will see four different Subnetting Examples. With these
Subnetting Examples, you will learn this lesson very well.

IP Subnetting Examples

In the first one of the Subnetting Examples, we will use,


192.168.5.85 /24 Address. Let’s determine the network and host part of
this address. This is the first example, so we are starting with an easy
example.

IP Address : 192.168.5.85
Subnet Mask : 255.255.255.0

For this example, firstly we will convert this decimal numbers to


the binary equals. As you can see below, the 1s in the Subnet Mask will
show the number of bits that network part has. And the 0s will show the
host part bits.

IP Address : 11000000. 10101000.00000101.01010101


Subnet Mask : 11111111. 11111111. 11111111.00000000

So, here, the first 24 bits (First 3 octets) are network bits and the
last 8 bits (Last octet) are the host bits.

For this IP and Subnet Mask, to determine the Network Address of


this IP address, we will use “AND” operation between IP Address and
Subnet Mask in binary mode.

IP Add: 11000000. 10101000.00000101.01010101


SubM : 11111111. 11111111. 11111111.00000000
AND : 11000000. 10101000.00000101.00000000
Computer Arts and Technological College, Inc.
Legazpi ● Ligao ● Polangui

When we use AND operation with this binary numbers, as you can
see, the last octet will be multiple with zero (AND is Multiplication). So
the result of this multiplication will be 192.168.5.0. Here, the first three
octets will be same as IP address and the last octet will be full of 0s.

For this example our broadcast address will be 192.168.5.255. AS


you can see, all the host bits are full of 1s for broadcast address. The
other addresses in the middle through 192.168.5.1 to 192.168.5.254 are
host addresses.

1. IP Subnetting Examples

In the second one of Subnetting Examples, we will do a little more


complex example. This time our IP address will be 10.128.240.50/30.

IP Address : 10.128.240.50
Sunet Mask : 255.255.255.252

Here, there is a challenge in front of us. As you can see, we have


seen the /30 and write 255.255.255.252. How can we do this? Let’s see
bit by bit.

/30 means that the subnet mask has 30 bits 1s and 2 bits 0s.
Remember the total Subnet Mask is 32 bits. So in binary mode our
Subnet Mask is:

11111111.11111111.11111111.11111100 (First 30 bits are 1s and


2 bits are 0s)

And the decimal equal of this Subnet Mask is: 255.255.255.252

Now, let’s determine the network, broadcast and host addresses of


this prefix. An IP address with Subnet Mask called Prefix. So, we will
write the binary equals of IP address and Subnet and use AND again.
Computer Arts and Technological College, Inc.
Legazpi ● Ligao ● Polangui

IP Add : 00001010.10000000.11110000.00110010
SubM : 11111111.11111111.11111111.11111100
AND : 00001010.10000000.11110000.00110000

The result of AND operation is the Network Address. This is


00001010.10000000.11110000.00110000 in binary. The decimal value
of this is 10.128.240.48.

Here, the last two bits are host bits and the other bits are network
bits. When we set all the host bits with 1s, we will find the Broadcast
Address. This is 00001010.10000000.11110000.00110011 in binary.
The decimal value is 10.128.240.51.

The middle addresses can be used for hosts. These addresses are
10.128.240.49 and 10.128.240.50.

Network Address : 10.128.240.48


Host Addresses : 10.128.240.49 and 10.128.240.50
Broadcast Address : 10.128.240.51

/30 addresses are generally used in Service Provider Networks. So,


you can work with /30 too much in the future.
Computer Arts and Technological College, Inc.
Legazpi ● Ligao ● Polangui

2. IP Subnetting Example

Now, let’s do a comparison example and see the benefits of


Subnetting.

Think about 172.16.100.0/24 prefix and 172.16.100.0/28 prefix.


As you can see, the only difference is Subnet Mask. In the first prefix,
first 24 bits is network bits and the last 8 bits (32-24) are the host bits.
In the second prefix, first 28 bits are network bits and the last 4 bits (32-
28) are host bits.

Let’s firstly talk about the first Prefix. We will write the IP
Address and the Subnet Mask of this Prefix in binary format:

172.16.100.0 = 10101100.00010000.01100100.00000000
255.255.255.0 =11111111.11111111.11111111.00000000

When we use AND operation, our network address is


10101100.00010000.01100100.00000000 (the same as the IP showed in
prefix by change). This is 172.16.100.0

And the Broadcast address is 172.16.100.255. The other 254 IP


addresses are host IP addresses.

172.16.100.1
172.16.100.2
….
172.16.100.254

For the first prefix, we have only one network that has 254 hosts.
Computer Arts and Technological College, Inc.
Legazpi ● Ligao ● Polangui

Now, let’s check the second prefix. 172.16.100.0 /28.

172.16.100.0 = 10101100.00010000.01100100.00000000
255.255.255.240 =11111111.11111111.11111111.11110000

When we use AND operation here, our network address will be the
same, in binary 10101100.00010000.01100100.00000000 or in decimal
172.16.100.0. But our Broadcast address will change, because our host
bits are only the last 4 bits anymore.

10101100.00010000.01100100.00000000 network address


(172.16.100.0)
10101100.00010000.01100100.00001111 broadcast address
(172.16.100.15)

This is for the first network. We divide the network by using higher
Subnet Mask. So, let’s look at the other networks:

10101100.00010000.01100100.00010000
10101100.00010000.01100100.00100000
10101100.00010000.01100100.00110000
10101100.00010000.01100100.01000000
….
10101100.00010000.01100100.11110000

As you can see, we have 16 networks. We have divide a Prefix, into


smaller 16 different Prefix. Each of these Prefix has 14 host
address, 1 broadcast address and 1 network address.

So, if we use a given address with a higher Subnet Mask value like
given in the second example, we will have more networks. In other words,
we can divide the network into smaller pieces. So, we will not waste
Computer Arts and Technological College, Inc.
Legazpi ● Ligao ● Polangui

the IP Addresses. Smaller networks that has few hosts do not need more
addresses. With Subnetting, using a small network with few host
addresses is a way of best practice of a network engineer.

Before the usage of an IP Prefix, it is better to check your needs for


now and for the future. How many subnets and hosts you need and you
will need in the future? According to these needs, you can determine
Subnetting and divide your IP Prefix into smaller parts.

3. IP Subnetting Examples

In the last of these Subnetting Examples, we will see our network’s


needs and according to these needs, we will determine our IP Address
Prefixes.

We will use the below topology. And we have given 192.168.1.0/24


IP Address.
Computer Arts and Technological College, Inc.
Legazpi ● Ligao ● Polangui

As you can see, in this topology, there are four subnets and each
subnets host address need is also given.

Subnet 1 = 28 hosts
Subnet 2 = 52 hosts
Subnet 3 = 15 host
Subnet 4 = 5 hosts

To overcome this Subnetting issue, firstly we determine the host


bits for each subnet.

For the first subnet; we need 5 host bits. With 5 bits we can have
2^5=32 addresses. This means that there are 32-2 usable host
addresses.

For the second subnet; we need 6 host bits. With 6 bits we can
have 2^6=64 addresses. This means that there are 64-2 usable host
addresses.

For the third subnet; we need 5 host bits. With 5 bits we can have
2^5=32 addresses. You can think that we can use 2^4=16 address. But
we cannot. Because, one of the address is used for broadcast address
and the other is for network address. This means that there are 14
usable addresses.

For the fourth subnet; we need 3 host bits. With 3 bits we can have
2^3=8 addresses. This means that there are 8-2 usable host addresses.
Computer Arts and Technological College, Inc.
Legazpi ● Ligao ● Polangui

Now let’s pick it up.

1. For first subnet, our Subnet Mask will be /27 (27 network bits
and 5 host bits. 5+27=32)
2. For second subnet, our Subnet Mask will be /26 (26 network
bits and 6 host bits. 6+26=32)
3. For third subnet, our Subnet Mask will be /27 (27 network bits
and 5 host bits. 5+27=32)
4. For fourth subnet, our Subnet Mask will be /29 (29 network
bits and 3 host bits. 3+29=32)

Here, the router interfaces will also need IP address. So, for each
subnet, one IP address will be go to the Router interface.

Remember, we have given an IP address 192.168.1.0/24. Let’s


divide this Prefix according to the above values.

Let’s begin with the biggest network. If we use /26 with


192.168.1.0 like 192.168.1.0/26, then we will have 4 subnets. The given
Subnet was 24 and our new subnet is 26. 26-24=2 and 2^2=4 subnets.

192.168.1.0/26
192.168.1.64/26
192.168.1.128/26
192.168.1.192/26

We will use the first one for the Subnet 2. (192.168.1.0/26)

Now, for the first and third subnet, let’s use the second block
(192.168.1.64/26) and divide it again. If we divide it by borrowing a bit
again, then we will have two subnets.
Computer Arts and Technological College, Inc.
Legazpi ● Ligao ● Polangui

192.168.1.64/27
192.168.1.96/27

We can use these two Prefixes for first and second subnet.

And lastly, for the small subnet, we can use the above third block
(192.168.10.128/26). We will divide it again. Because we need only 5
host address.

When we divide again, we will have the below small subnets, and
we can use the first one for our fourth and last Subnet.

192.168.1.128/29
192.168.1.136/29
192.168.1.144/29
192.168.1.152/29
192.168.1.160/29
192.168.1.168/29
192.168.1.176/29
192.168.1.184/29

As you can see, with this Subnetting, we have used our IP Block
very efficiently. The unused remaining blocks can be used in the future.
What are these remaining blocks let’s remember? The remaining blocks
are the last block of /26 subnets and the last 7 block of /29 subnets.

At the end our subnets will be like below:

192.168.1.0/26
192.168.1.64/27
192.168.1.96/27
192.168.1.128/29
Computer Arts and Technological College, Inc.
Legazpi ● Ligao ● Polangui

This is VLSM (Variable Length Subnet Mask). Its meaning is using


subnet of subnets or dividing a network into smaller network with using
different subnet masks.

CIDR or Classless Inter Domain Routing provides the flexibility of


borrowing bits of Host part of the IP address and using them as Network in
Network, called Subnet. By using subnetting, one single Class A IP address can
be used to have smaller sub-networks which provides better network
management capabilities.

a. Class A Subnets

In Class A, only the first octet is used as Network identifier and rest of
three octets are used to be assigned to Hosts (i.e. 16777214 Hosts per
Network). To make more subnet in Class A, bits from Host part are
borrowed and the subnet mask is changed accordingly.

For example, if one MSB (Most Significant Bit) is borrowed from host bits
of second octet and added to Network address, it creates two Subnets
(21=2) with (223-2) 8388606 Hosts per Subnet.

The Subnet mask is changed accordingly to reflect subnetting. Given


below is a list of all possible combination of Class A subnets.
Computer Arts and Technological College, Inc.
Legazpi ● Ligao ● Polangui

In case of subnetting too, the very first and last IP address of every
subnet is used for Subnet Number and Subnet Broadcast IP address
respectively. Because these two IP addresses cannot be assigned to
hosts, sub-netting cannot be implemented by using more than 30 bits as
Network Bits, which provides less than two hosts per subnet.
Computer Arts and Technological College, Inc.
Legazpi ● Ligao ● Polangui

b. Class B Subnets

By default, using Classful Networking, 14 bits are used as Network bits


providing (214) 16384 Networks and (216-2) 65534 Hosts. Class B IP
Addresses can be subnetted the same way as Class A addresses, by
borrowing bits from Host bits. Below is given all possible combination of
Class B subnetting.
Computer Arts and Technological College, Inc.
Legazpi ● Ligao ● Polangui

c. Class C Subnets

Class C IP addresses are normally assigned to a very small size network


because it can only have 254 hosts in a network. Given below is a list of
all possible combination of subnetted Class B IP address.

How to Subset a Class C Address Using the Binary Method

It can be helpful to know how to be your own subnet mask calculator.


Subset a Class C address with the binary method by following these four steps
(which will be explained in more detail below):

1. Convert to binary.
2. Calculate the subset address.
3. Find host range.
4. Calculate the total number of subsets and the hosts per subnet.

We will use a Class C address, which takes 5 bits from the Host field for
subnetting and leaves 3 bits for defining hosts as shown in figure 1 below.
Having 5 bits available for defining subnets means that we can have up to 32
(2^5) different subnets.
Computer Arts and Technological College, Inc.
Legazpi ● Ligao ● Polangui

It should be noted that in the past using subnet zero (00000---) and all-ones
subnet (11111---) was not allowed. This is not true nowadays. Since Cisco IOS
Software Release 12.0 the entire address space including all possible subnets
is explicitly allowed.

Let's use IP address 192.168.10.44 with subnet mask 255.255.255.248 or /29.

Step 1: Convert to binary.

Step 2: Calculate the subset address.

To calculate the IP Address Subnet you need to perform a bit-wise


AND operation (1+1=1, 1+0 or 0+1 =0, 0+0=0) on the host IP address and
subnet mask. The result is the subnet address in which the host is
situated.
Computer Arts and Technological College, Inc.
Legazpi ● Ligao ● Polangui

Step 3: Find host range.

We know already that for subnetting this Class C address we have


borrowed 5 bits from the Host field. These 5 bits are used to identify the
subnets. The remaining 3 bits are used for defining hosts within a
particular subnet.

The Subnet address is identified by all 0 bits in the Host part of the
address. The first host within the subnet is identified by all 0s and a 1.
The last host is identified by all 1s and a 0. The broadcast address is the
all 1s. Now, we move to the next subnet and the process is repeated the
same way.

The following diagram clearly illustrates this process:


Computer Arts and Technological College, Inc.
Legazpi ● Ligao ● Polangui

Step 4: Calculate the total number of subsets and the hosts per subnet.

Knowing the number of Subnet and Host bits we can now calculate
the total number of possible subnets and the total number of hosts per
subnet. We assume in our calculations that all-zeros and all-ones
subnets can be used. The following diagram illustrates the calculation
steps.
Computer Arts and Technological College, Inc.
Legazpi ● Ligao ● Polangui
Computer Arts and Technological College, Inc.
Legazpi ● Ligao ● Polangui

Title : ACTIVITY 2

Steps/ Procedures:

1. Do the following task for the lesson IP address subnetting.

TASK 1: Given an IP address 165.203.13.10, answer the following


question.

1. How many subnetworks if we borrow 2 bits?

2. What are the range of each subnetwork?

3. What are the network address?

4. What are the broadcast address?

5. How many IP address per subnetwork?

6. How many usable IP address per subnetwork?

7. What is the subnet mask?

TASK 2: Given an IP address 90.19.21.1, answer the following question.

1. How many subnetworks if we borrow 3 bits?

2. What are the range of each subnetwork?

3. What are the network address?

4. What are the broadcast address?

5. How many IP address per subnetwork?

6. How many usable IP address per subnetwork?


Computer Arts and Technological College, Inc.
Legazpi ● Ligao ● Polangui

7. What is the subnet mask?

TASK 3: Given an IP address 212.192.21.19, answer the following


question.

1. How many subnetworks if we borrow 3 bits?

2. What are the range of each subnetwork?

3. What are the network address?

4. What are the broadcast address?

5. How many IP address per subnetwork?

6. How many usable IP address per subnetwork?

7. What is the subnet mask?

TASK 4: Given an IP address 210.21.19.1, answer the following question.

1. How many subnetworks if we borrow 3 bits?

2. What are the range of each subnetwork?

3. What are the network address?

4. What are the broadcast address?

5. How many IP address per subnetwork?

6. How many usable IP address per subnetwork?

7. What is the subnet mask?

TASK 5: Given an IP address 203.119.121.27, answer the following


question.
Computer Arts and Technological College, Inc.
Legazpi ● Ligao ● Polangui

1. How many subnetworks if we borrow 4 bits?

2. What are the range of each subnetwork?

3. What are the network address?

4. What are the broadcast address?

5. How many IP address per subnetwork?

6. How many usable IP address per subnetwork?

7. What is the subnet mask?

TASK 6: Given an IP address 190.19.10.1, answer the following question.

1. How many subnetworks if we borrow 3 bits?

2. What are the range of each subnetwork?

3. What are the network address?

4. What are the broadcast address?

5. How many IP address per subnetwork?

6. How many usable IP address per subnetwork?

7. What is the subnet mask?

TASK 7: Given an IP address 134.143.143.21, answer the following


question.

1. How many subnetworks if we borrow 4 bits?

2. What are the range of each subnetwork?

3. What are the network address?


Computer Arts and Technological College, Inc.
Legazpi ● Ligao ● Polangui

4. What are the broadcast address?

5. How many IP address per subnetwork?

6. How many usable IP address per subnetwork?

7. What is the subnet mask?

2. Create a document of the about above task.

3. Save it as .doc or .docx or .pdf.

4. Filename format will Activity_number-Subject-Lastname_Firstname.doc or


Activity_number-Subject-Lastname_Firstname.docx or Activity_number-
Subject-Lastname_Firstname.pdf

5. Upload and send the document for activity 2. The document should be in
doc, docx or pdf format.

You might also like