You are on page 1of 56

CHAP.

4: SUBNETTING

1 02/25/2022
CHAP. 4: SUBNETTING
Subnetting is a method used to take one
larger network and break it into a bunch of
smaller networks called normally smaller
segments or subnetworks.
Subnetting was introduced to overcome
some of the problems that parts of the
Internet were beginning to experience with
the classful two-level addressing hierarchy:

2 02/25/2022
CHAP. 4: SUBNETTING
Internet routing tables were beginning to
grow.
Local administrators had to request another
network number from the Internet before a
new network could be installed at their site.

3 02/25/2022
CHAP. 4 CONT’
How to Create Subnets
To create subnetworks, you take bits from
the host portion of the IP address and
reserve them to define the subnet address.

4 02/25/2022
CHAP. 4 CONT’
SUBNET DESIGN CONSIDERATIONS
The deployment of an addressing plan requires
careful thought on the part of the network
administrator.
There are four key questions that must be
answered before any design should be undertaken:
1) How many total subnets does the organization
need today?
2) How many total subnets will the organization
need in the future?
5 02/25/2022
CHAP. 4 CONT’
3) How many hosts are there on the
organization's largest subnet today?
4) How many hosts will there be on the
organization's largest subnet in the future?

6 02/25/2022
CHAP. 4 CONT’
The first step in the planning process is to take
the maximum number of subnets required and
round up to the nearest power of two.
For example, if an organization needs 9 subnets,
23 (or 8) will not provide enough subnet
addressing space, so the network administrator
will need to round up to 24 (or 16).
When performing this assessment, it is critical
that the network administrator always allows
adequate room for future growth.
7 02/25/2022
CHAP. 4 CONT’
The second step is to make sure that there
are enough host addresses for the
organization's largest subnet.
If the largest subnet needs to support 50
host addresses today, 25 (or 32) will not
provide enough host address space so the
network administrator will need to round up
to 26 (or 64).

8 02/25/2022
CHAP. 4 CONT’
The final step is to make sure that the
organization's address allocation provides
enough bits to deploy the required subnet
addressing plan.

9 02/25/2022
CHAP. 4 CONT’
Subnetting Class C Addresses
There are many different ways to subnet a
network.
The right way is the way that works best for you.
In a Class C address, only 8 bits are available for
defining the hosts.
Remember that subnet bits start at the left and go
to the right, without skipping bits.
This means that the only Class C subnet masks
can be the following:
10 02/25/2022
CHAP. 4 CONT’
Binary Decimal for Classless Inter-Domain
Routing (CIDR)
 00000000 = 0 /24
 10000000 = 128 /25
 11000000 = 192 /26
 11100000 = 224 /27
 11110000 = 240 /28
 11111000 = 248 /29
 11111100 = 252 /3002/25/2022
11
CHAP. 4 CONT’
We can’t use a /31 or /32 because we have
to have at least 2 host bits for assigning IP
addresses to hosts.

12 02/25/2022
CHAP. 4 CONT’
Given:
An organization has been assigned the
network number 193.1.1.0/24 and it needs to
define six subnets.
The largest subnet is required to support 25
hosts.
The first step is to determine the number of
bits required to define the six subnets.

13 02/25/2022
CHAP. 4 CONT’
Since a network address can only be subnetted
along binary boundaries, subnets must be
created in blocks of powers of two [2 (2 1), 4 (2
2
), 8 (2 3), 16 (2 4), etc.].
Thus, it is impossible to define an IP address
block such that it contains exactly six subnets.
For this example, the network administrator
must define a block of 8 (2 3) and have two
unused subnets that can be reserved for future
use.
14 02/25/2022
CHAP. 4 CONT’
Since 8 = 2 3, three bits are required to enumerate
the eight subnets in the block.
In this example, the organization is subnetting a
/24 so it will need three more bits, or a /27, as
future growth, the extended-network-prefix.
A 27-bit extended-network-prefix can be
expressed in dotted-decimal notation as
255.255.255.224.

15 02/25/2022
CHAP. 4 CONT’
This is illustrated in the following figure.

16 02/25/2022
CHAP. 4 CONT’
Subnet Mask: It is a mask used to determine what
subnet an IP address / workstation belongs to.
prefix is the number of bits used to define the IP
for subnet mask and host.
The eight subnet numbers for this example are
given below.
The italicized portion of each address identifies
the extended-network-prefix, while the bold digits
identify the 3- bits representing the subnet-number
field:
17 02/25/2022
CHAP. 4 CONT’
Base Network: 11000001.00000001.00000001 .00000000 = 193.1.1.0/27
Subnet 0: 11000001.00000001.00000001.000 00000 = 193.1.1.0/27
Subnet 1: 11000001.00000001.00000001.001 00000 = 193.1.1.32/27
Subnet 2: 11000001.00000001.00000001.010 00000 = 193.1.1.64/27
Subnet 3: 11000001.00000001.00000001.011 00000 = 193.1.1.96/27
Subnet 4: 11000001.00000001.00000001.100 00000 = 193.1.1.128/27
Subnet 5: 11000001.00000001.00000001.101 00000 = 193.1.1.160/27
Subnet 6: 11000001.00000001.00000001.110 00000 = 193.1.1.192/27
Subnet 7: 11000001.00000001.00000001.111 00000 = 193.1.1.224/27

18 02/25/2022
CHAP. 4 CONT’
As you see, the first part indicates the IP
address of the host. The second part indicates
the netmask value. Example: 193.1.1.225 /27
where 193.1.1.225 is the host IP address and
/27 indicates the netmask. IP Subnet-Zero
allows you to use the first and last subnet e.g
193.1.1.0 and 193.1.1.224 in your network
design. So, for the IP subnet-zero you are
allowed to use subnets 0, 32, 64, 96, 128, 160,
19
192, and 224. 02/25/2022
CHAP. 4 CONT’
The number of subnets= 2x where x is the
number of masked bits, or the 1s.
For our example, the number of masked or 1s
are 3.
The number of subnets is 23 = 8 subnets.

20 02/25/2022
CHAP. 4 CONT’
DEFINING HOST ADDRESSES FOR
EACH SUBNET
In our current example, there are 5
unmasked bits in the host-number field of
each subnet address.
This means that each subnet represents a
block of 30 host addresses (25 -2 = 30. Note
that the 2 is subtracted because the all-0s and
the all-1s host addresses cannot be used).
21 02/25/2022
CHAP. 4 CONT’
The hosts on each subnet are numbered 1
through 30.
The valid host addresses for Subnet 2 in our
example are given below.
The italicized portion of each address
identifies the extended-network-prefix,
while the bold digits identify the 5-bit host-
number field:

22 02/25/2022
CHAP. 4 CONT’
Subnet 2: 11000001.00000001.00000001.010 00000 = 193.1.1.64/27
Host 1: 11000001.00000001.00000001.010 00001 = 193.1.1.65/27
Host 2: 11000001.00000001.00000001.010 00010 = 193.1.1.66/27
Host 3: 11000001.00000001.00000001.010 00011 = 193.1.1.67/27
Host 4: 11000001.00000001.00000001.010 00100 = 193.1.1.68/27
Host 5: 11000001.00000001.00000001.010 00101 = 193.1.1.69/27
.
.
Host 15: 11000001.00000001.00000001.010 01111 = 193.1.1.79/27
Host 16: 11000001.00000001.00000001.010 10000 = 193.1.1.80/27
Host 27: 11000001.00000001.00000001.010 11011 = 193.1.1.91/27
Host 28: 11000001.00000001.00000001.010 11100 = 193.1.1.92/27
Host 29: 11000001.00000001.00000001.010 11101 = 193.1.1.93/27
Host 30:11000001.00000001.00000001.010 11110 = 193.1.1.94/27
23 02/25/2022
CHAP. 4 CONT’
The number of hosts=2y-2 where y is the
number of unmasked bits, or the 0s.
In our example, y=5 and 25-2=30 hosts.

24 02/25/2022
CHAP. 4 CONT’
SECOND WAY FOR SUBNETTING
Here’s how you get the answers to the above
five big questions:
How many subnets?
Number of subnets= 2x. x is the number of
masked bits, or the 1s.
How many hosts per subnet?
 Number of hosts per subnet =2y – 2. y is the
number of unmasked bits, or the 0s. You need to
subtract 2 for the subnet address and the
25 broadcast address, which are not valid hosts.02/25/2022
CHAP. 4 CONT’
What are the valid subnets?
 256 – Subnet mask = block size, or
increment number. In our example, the
block size is 256 – 224 = 32. Start
counting at zero in blocks of 32 until you
reach the subnet mask value and these are
your subnets: 0, 32, 64, 96, 128, 160, 192,
and 224.
26 02/25/2022
CHAP. 4 CONT’
What’s the broadcast address for each subnet?
 Since we counted our subnets in the last section
as 0, 32, 64, 96, 128, 160, 192, and 224, the
broadcast address is always the number right
before the next subnet.
For example, the 0 subnet has a broadcast
address of 31 because the next subnet is 32. The
32 subnet has a broadcast address of 63 because
the next subnet is 64. And so on. And remember,
the broadcast of the last subnet is always 255.
27 02/25/2022
CHAP. 4 CONT’
What are the valid hosts?
Valid hosts are the numbers between the
subnets, omitting the all 0s and all 1s.
For example, if 0 is the subnet number and
31 is the broadcast address, then 1–30 is the
valid host range—it’s always the numbers
between the subnet address and the
broadcast address.

28 02/25/2022
CHAP. 4 CONT’
SUBNETTING PRACTICE EXAMPLES
Subnetting Class C Addresses
Example #1C: 255.255.255.128 (/25)
Since 128 is 10000000 in binary, there is
only 1 bit for subnetting and 7 bits for hosts.
We’re going to subnet the Class C network
address 192.168.10.0.
192. 168.10.0 = Network address.
255.255.255.128 = Subnet mask.
29 02/25/2022
CHAP. 4 CONT’
Now, let’s answer the big five questions:
 How many subnets?
 Since 128 is 1 bit on (10000000), the answer
would be 21 = 2.
How many hosts?
We have 7 host bits off (10000000), so the
equation would be 27 – 2 = 126 hosts.

30 02/25/2022
CHAP. 4 CONT’
What are the valid subnets?
256 – 128 = 128.
Remember, we’ll start at zero and count in our
block size, so our subnets are 0, 128.

31 02/25/2022
CHAP. 4 CONT’
What’s the broadcast address for each
subnet?
The number right before the value of the
next subnet is all host bits turned on and
equals the broadcast address.
For the zero subnet, the next subnet is 128,
so the broadcast of the 0 subnet is 127.

32 02/25/2022
CHAP. 4 CONT’
What are the valid hosts?
These are the numbers between the subnet and
broadcast address.
The easiest way to find the hosts is to write out
the subnet address and the broadcast address.
This way, the valid hosts are obvious.
The following table shows the 0 and 128
subnets, the valid host ranges of each, and the
broadcast address of both subnets:
33 02/25/2022
CHAP. 4 CONT’
Subnet 0 128
First host 1 129
Last host 126 254
Broadcast 127 255

34 02/25/2022
CHAP. 4 CONT’
Subnetting Class B Addresses
Before we dive into this, let’s look at all the
possible Class B subnet masks first.
Notice that we have a lot more possible
subnet masks than we do with a Class C
network address:

35 02/25/2022
CHAP. 4 CONT’

255.255.0.0 (/16)
255.255.128.0 (/17) 255.255.255.0 (/24)
255.255.192.0 (/18) 255.255.255.128 (/25)
255.255.224.0 (/19) 255.255.255.192 (/26)
255.255.240.0 (/20) 255.255.255.224 (/27)
255.255.248.0 (/21) 255.255.255.240 (/28)
255.255.252.0 (/22) 255.255.255.248 (/29)
 255.255.254.0 (/23) 255.255.255.252 (/30)
36 02/25/2022
CHAP. 4 CONT’
 We know the Class B network address has 16
bits available for host addressing.
 This means we can use up to 14 bits for
subnetting (because we have to leave at least 2
bits for host addressing).
 Using a /16 means you are not subnetting with
class B, but it is a mask you can use.
 The process of subnetting a Class B network is
pretty much the same as it is for a Class C,
except that you just have more host bits and
you start in the third octet.
37 02/25/2022
CHAP. 4 CONT’

 Use the same subnet numbers for the third octet


with Class B that you used for the fourth octet
with Class C, but add a zero to the network
portion and a 255 to the broadcast section in
the fourth octet.
 The following table shows you an example of
host range of two subnets used in a Class B 240
(/20) subnet mask.

38 02/25/2022
CHAP. 4 CONT’
Practice Example #1B: 255.255.128.0
(/17)
172.16.0.0 = Network address
255.255.128.0 = Subnet mask
Number of Subnets= 21 = 2 (same as Class
C).
Number of Hosts per subnet= 215 – 2 =
32,766 (7 bits in the third octet, and 8 in the
fourth).
39 02/25/2022
CHAP. 4 CONT’
Valid subnets
The block size= 256 – 128 = 128. So, the
valid subnets are: 0, 128.
Remember that subnetting is performed in
the third octet, so the subnet numbers are
really 0.0 and 128.0, as shown in the next
table.

40 02/25/2022
CHAP. 4 CONT’
What are Broadcast address for each
subnet and valid hosts?
The following table shows the two subnets
available, the valid host range, and the
broadcast address of each:
 Subnet 0.0 128.0
 First host 0.1 128.1
 Last host 127.254
255.254
 Broadcast 127.255
41 02/25/2022
255.255
CHAP. 4 CONT’
Practice Example #2B: 255.255.192.0 (/18)
172.16.0.0 = Network address
255.255.192.0 = Subnet mask
Number of Subnets= 22 = 4.
Number of Hosts= 214 – 2 = 16,382 (6 bits in
the third octet, and 8 in the fourth).

42 02/25/2022
CHAP. 4 CONT’
Valid subnets
Block size= 256 – 192 = 64. Then the valid
subnets are: 0, 64, 128, and 192.
Remember that the subnetting is performed in
the third octet, so the subnet numbers are really
0.0, 64.0, 128.0, and 192.0, as shown in the next
table.

43 02/25/2022
CHAP. 4 CONT’
 Broadcast address for each subnet and valid
hosts.
The following table shows the four subnets
available, the valid host range, and the broadcast
address of each:
 
Subnet 0.0 64.0 128.0
192.0
First host 0.1 64.1 128.1
192.1
44 02/25/2022
Last host 63.254 127.254 191.254
CHAP. 4 CONT’
Subnetting Practice Examples: Class A
Addresses
Practice Example #1A: 255.255.0.0 (/16)
Class A addresses use a default mask of
255.0.0.0, which leaves 22 bits for subnetting
since you must leave 2 bits for host addressing.
The 255.255.0.0 mask with a Class A address is
using 8 subnet bits.
Number of Subnets= 28 = 256.

45 Number of Hosts= 2 16
– 2 = 65,534. 02/25/2022
CHAP. 4 CONT’
Valid subnets is given by the block size=
256 – 255 = 1. So, valid subnets are: 0, 1, 2,
3, etc. (all in the second octet).
The subnets would be 10.0.0.0, 10.1.0.0,
10.2.0.0, 10.3.0.0, etc., up to 10.255.0.0.
Broadcast address for each subnet?
 Valid hosts?

46 02/25/2022
CHAP. 4 CONT’
The following table shows the first two and
last two subnets, valid host range, and
broadcast addresses for the private Class A
10.0.0.0 network:

47 02/25/2022
CHAP. 4 CONT’

48 02/25/2022
EXERCISES

Write the subnet, broadcast address, and


valid host range for question 1 through
question 6:
1. 192.168.100.25/30
2. 192.168.100.37/28
3. 192.168.100.66/27
4. 192.168.100.17/29
5. 192.168.100.99/26
6. 192.168.100.99/25
49 02/25/2022
EXERCISES
1. What is the maximum number of IP
addresses that can be assigned to hosts on
a local subnet that uses the
255.255.255.224 subnet mask?
2. You have a Class B network and need 29
subnets. What is your mask?
3. What subnet and broadcast address is the IP
address 172.16.10.33 255.255.255.224
(/27) a member of?
50 02/25/2022
4. What is the subnet for host ID
10.16.3.65/23?
5. What is the subnetwork address for a
host with the IP address
200.10.5.68/28?
6. What subnet and broadcast address is
the IP address 172.16.46.255
255.255.240.0 (/20) a member of?
51 02/25/2022
7. What is the subnet and broadcast address of the
host 172.16.88.255/20?
8. If an Ethernet port on a router were assigned an
IP address of 172.16.112.1/25, what would be the
valid subnet address of this host?
9. You need to subnet a network that has 5 subnets,
each with at least 16 hosts. Which classful subnet
mask would you use?
10.You have an interface on a router with the IP
address of 192.168.192.10/29. What is the
broadcast address the hosts will use on this LAN?
52 02/25/2022
11. Given the I. P address 184.60.229.148/28
For each row in table below, enter the values of that
type of address.  
Type of address Enter LAST octet Enter LAST octet Enter full address
in binary in decimal in decimal

Network
Broadcast
First Usable Host
Address

Last Usable Host


Address

53 02/25/2022
12. Complete the following table:
IP Address Class Subnet Network Private or
mask ID public?
192.186.257.1/24

10.176.31.9/15

176.29.3.5/24

192.186.192.60/28

172.146.10.27/25

54 02/25/2022
13. A network administrator is connecting hosts A
and B directly through their Ethernet interfaces,
as shown in the illustration. Ping attempts
between the hosts are unsuccessful. What can be
done to provide connectivity between the hosts?

55 02/25/2022
END OF CHAPTER FOUR!

56 02/25/2022

You might also like