0 ratings0% found this document useful (0 votes) 27 views16 pagesU3 Lectura 2 - Subnetworks
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here.
Available Formats
Download as PDF or read online on Scribd
Subnetworks
Network administrators sometimes need to divide networks, especially large ones, into smaller
networks. These smaller divisions are called subnetworks (referred to as subnets), and they
provide addressing flexibility, This topic describes the purpose and functions of subnets and
their addressing schemes.
Subnetworks
‘There are several reasons why network administrators might want to subnet a network,
including helping to control network traffic. For example, on an Ethemet network, every host
‘on the same physical network sees all the packets of data sent out on the network. In heavy
traffic situations this can result in collisions, making the network performance painfully siow.
In these situations, routers are used, in addition to their many other functions, to separate
networks by breaking the network into multiple subnets,
In such multiple-network environments, each subnetwork may be connected to the Internet via
a single router (see figure). In this example, the Class B address (172.16.0.0) is subdivided into
iultiple subnetworks (172.16.1.0, 172.16.2.0, 172.16.3.0, and 172.16.4.0). The actual details of
the internal network environment and how the network is divided into multiple subnetworks are
inconsequential to other IP networks.
‘The subnet address is taken from the host number portion of Class A, Class B, and Class C
addresses, and is assigned locally, usually by the network administrator. Also, like IP
addresses, each subnet address must be unique.
Copyright © 2003, Cisco Systems, Inc. IP Aderessing and Routing 6-27Subnet Address Scheme
a 2,
5
oo 8,
Ta SB
(72.2). 180)
When you configure routers, you can connect each interface to a different network or subnet,
segment. You must select an available host address from each different network or subnet to
assign to the interface of the router that connects to that network or subnet (see figure). In this
example, the router has two Ethernet interfaces. The interface that is connected to the
172.16.2.0 subnetwork is assigned the IP address of 172.16.2.1 and the other interface that is
connected to the 172.16.3.0 subnetwork is assigned the IP address of 172.16.3.1
Note Multiple IP addresses can be configured on a single interface
1628 Induction o Cisco Networking Technologies (INTRO) v1.03 ‘Copyright © 2003, Cisco Systems, ncSubnet Masking
‘A subnet mask has a specific function in relation to the subnet address: to tell devices
participating on the network which part of an address is the network number, including the
subnet, and which partis the host. This topic describes how subnet addresses and masks are
constructed.
Subnet Mask
Class C address = 24 bits for network, 8 bit for host.
In this ease, we are borrowing 3 bits out ofthe host part for subnetting,
Network Network Network SM_Host
Octet @ bits) Octet (@bits) Octet (bits) Octet (8 bits)
14tatad eattatadd 14444444 +[Patooo00
Lode
New Host
Subnet
‘The subnet mask above in dotted-decimal notation = 255.255.255.224
+ Anetwork or subnetwork is defined in the subnets mask by a series of
contiguous ts.
‘A subnet address includes the network portion, plus a subnet field and a host field. The subnet
field and the host field are created from the original host portion for the entire network. To
create a subnet address, a network administrator borrows bits from the original host portion and.
designates them as the subnet field. The ability to decide how to divide the original host portion
into the new subnet and host fields provides addressing flexibility for the network
administrator.
‘Subnets consisting of all 0s or all 1s are discouraged because of possible confusion with the
classful network address which has all 0s in the host portion or the classful network broadcast
‘address which has all Is in the host portion. A single bit subnet is seldom used because the only
possible values are 0 and 1. The use of subnet 0 is discouraged.
‘The maximum number of bits that can be borrowed can be any number that leaves at least two
bits remaining for the host number.
Although subnet masks use the same format as IP addresses, they are not IP addresses
themselves. Each subnet mask is 32 bits long and is divided into four octets and is usually
represented in the dotted-decimal notation like IP addresses, Subnet masks have all 1s in the
network and subnetwork portions and all 0s inthe host portion (see figure). In this Class C
subnetting example, three bits from the original host field have been borrowed for the subnet,
field, leaving the five remaining bits for the new host field. The subnet mask expressed in
dotted-decimal notation is 255.255.255.224.
Copyright © 2003, Cisco Systems, Inc. IP Aderessing and Routing 6-29,Using a Subnet Mask
Teles 4 a Es
CEE diosa ciara TOOT NN RTO
ee)
Easter cceecere cr RETO ero
Fess | eho ITN elaraiocc i cootssafetsoasasas
Errand Ty a 12
IP Address 192.168.34.139 Subnet Mask 255.255.255.224
If no bits are borrowed to represent a subnet, the default subnet masks for Class A, B, and C
networks are as follows:
Class A Default subnet mask = 255.0.0.0 (8 network bits, 24 host bits)
Class 8 Default subnet mask = 255.255.0.0 (16 network bits, 16 host bits)
GtassC Default subnet mask = 255.255.255.0 (24 network bits, 8 host bits)
630
Introduction to Cisco Networking Technologies (INTRO) v.0a ‘Copyright © 2003, Cisco Systems, ncDetermin
ing the Subnet Number
Ifthe IP address and the subnet mask are known, the subnet number can be calculated. This
topic presents the procedure for determining the subnet number.
Given a
the procs
Determining the Subnet Number
1 Address v2 |e | Q
<_ttg gte*8
Defaut Subnet ass | 255 | 0 °
Mask
awa sist
eit
Subnet Mask as | ss | os |
—
+ Ifa bits borrowed for a subnet mask, use host bits starting at the
high-order bit position|
wn IP address and subnet mask (see figure), to determine the subnetwork number, follow
sedure below.
Procedure for Determining the Subnetwork Number
Stop
‘Action
Express the IP address in binary form.
Express the subnet mask in binary form.
Perform a logical AND operation on the IP address and the subnet mask, (The result of the
logical AND operation isthe subnet number.)
Express the subnet number as dotied-decimal notation
As an illustration, given a Class B network address, if you borrow eight bits to represent a
subnet, the subnet mask for the same Class B network would be 255.255.255.0, as shown in the
figure,
Copyright© 2003, Cis Systeme, ne. IP Addressing and Routing 6-31Note ‘This AND operation is done by combining the binary versions of the IP address withthe
‘subnet mask. The calculaions ace expressed as:
AND 1=1
1ANDO=0
OAND1=0
QANDO=0
1632 _Inoducton o Cisco Networking Technologies (INTRO) v1.03 ‘Copyright © 2003, Cisco Systems, ncModifying a Default Subnet Mask
‘A default subnet mask can be modified to meet specific network requirements. This topic
describes the process for modifying a default subnet mask
Modifying a Default Subnet Mask
Tecacor
1 Address wo [iw ft 1
see es
Defaut Subnet as | o | o °
Mask
Modified
Subnet Mask
+ Ifa bits borrowed for a subnet mask, use host bits starting at the
high-order bit position|
‘The number of bits to be borrowed for subnet addressing depends on both of these
requirements:
Number of subnetworks required
‘Number of hosts required on each subnetwork
A Class A network has three octets in the host field. Up to 22 bits, therefore, can be borrowed
to create subnetworks. Remember that the fourth octet must have at least two bits left for the
host ID portion of the address. These remaining two bits will provide for a possible
combination of four IP addresses (00, 01, 10, and 11). All0s in the host portion of the address
(00) and alls in the host portion of the address (11) are not available for valid host IP
addresses. After borrowing 22 bits, the subnet mask would be 255.255.255.252.
A Class B network has two octets in the host field. Therefore, up to 14 bits can be borrowed to
create subnetworks. The first and second octets are part of the Class B network mask
(255.255.0.0). After borrowing 14 bits, the subnet mask would be 255.255.255.252.
‘A Class C network has only one octet in the host field. Therefore, up to only six bits can be
borrowed in Class C networks to create subnetworks. The first, second, and third octets are part
of the Class C network mask (255.255.255,0). Afier borrowing six bits, the subnet mask would
be 255.255.255.252
Copyright© 2003, Cisco Systems, Ine. IP Addressing and Routing 6-33Octet Values of a Subnet Mask
o
°
1
1
1
1
1
1
1
EEEREERE
+ The decimal equivalent ofthe binary is typically used in an IP address.
There are only eight valid subnet mask values per octet (see figure). The subnet field always
immediately follows the network number. That is, the borrowed bits must be the first n bits of
the default host field, where n is the desired size of the new subnet field (see figure). The
subnet mask is the tool used by the router to determine which bits are routing (network or
subnet) bits and which bits are host bits.
1634 Introduction o Cisco Networking Technologies (INTRO) v1.03 ‘Copyright © 2003, Cisco Systems, ncNetwork Address Planning
One of the decisions that you must make whenever you create subnets is to determine the
‘optimal number of subnets and hosts. When you create subnets, you lose many potential
addresses. For this reason, network administrators must pay close attention to the percentage of
addresses that they lose by creating subnets. This topic explains a process for computing usable
subnets
Class C Subnetting Example
Number of Total number
eran) ofhosts
ca
30
is
30
cy
+ Note: The table above does not use the all zeros and all ones subnets,
trading safety for address usage efficiency.
+ The number of host IP addresses with a Class C subnetwork depends on
the number of bits borrowed for subnetting.
‘Computing Usable Subnetworks
‘Whenever you borrow bits from the host field, itis important to note the number of additional
subnets that are being created each time you borrow one more bit (see figure). Borrowing two
bits creates four possible subnets (2°) (but remember that there are always two discouraged
subnets (all 0s and Is subnets). Each time you borrow another bit from the host field, the
‘number of subnets created increases by a power of 2.
For example:
‘Using three bits for the subnet field results in eight possible subnets, six of which are
usable (2°= 8, 8 ~ 2 unusable subnets = 6 usable subnets).
Using four bits for the subnet field results in 16 possible subnets, 14 of which are usable
(2'= 16, 16 ~2 unusable subnets = 14 usable subnets).
In general, you can use the following formula to calculate the number of usable subnets, given
the number of subnet bits used:
Number of subnets = 2"- 2 (where n is the number of subnet bits).
Copyright © 2003, Cisco Systems, Inc. IP Aderessing and Routing 6-35,Computing Hosts per Subnetwork
Each time you borrow one bit from a host field, there is one less bit remaining in the host field
that can be used for host numbers and the number of host addresses that you can assign
decreases by a power of 2
To help you understand how this works, consider a Class C network address as an example, in
which ail eight bits in the last octet are used for the host field. Therefore, there are 256 (2")
possible addresses available to assign to hosts (254 usable addresses, after you subtract the two
addresses [the broadcast and the subnet address] which you cannot use).
Now, imagine that this Class C network is divided into subnets. If you borrow two bits from the
default eight-bit host field, the size of the host field decreases to six bits. Ifyou write out all the
possible combinations of Os and 1s that could occur in the remaining six bits, you discover that
the total number of possible hosts that could be assigned in each subnet decreases to 64 (2°)
The number of usable host numbers decreases to 62 (64 ~ 2)
In the same Class C network, if you borrow three bits, the size of the host field decreases to five
bits and the total number of hosts that you could assign to each subnet decreases to 32 (2°). The
‘number of usable host numbers decreases to 30 (32 ~ 2).
‘The number of possible host addresses that can be assigned to a subnet is related to the number
of subnets that have been created. In a Class C network, for example, if you apply a subnet
mask of 255.255.255.224, you have to borrow three bits (224 = 11100000) from the host field.
Six usable subnets are created (8 minus 2), each having 30 (32 minus 2) usable host addresses.
In general, the following formula can be used to calculate the number of usable host addresses,
given the number of host bits used:
Number of host addresses = 2"- 2 (where n is the number of host bits).
636
Introduction to Cisco Networking Technologies (INTRO) v.0a ‘Copyright © 2003, Cisco Systems, ncSubnetting Class C Addresses
‘To practice creating subnet addresses, suppose that you are a network administrator. Your
company has a Class C network address of 192.168.57.0. You want to subdivide your network
into three subnets and you need at least 20 hosts per subnet. This topic presents the steps to
follow to create subnet and host addresses.
Determi How Many Bits to Borrow
TT
+ Network address: 192.168.87.0
+ Subnets needed: Three
+ Bits to borrow:
128 6432168421
+ Borrowing three bits for the subnet should fit the requirements:
Three subnet bits: 2°— 2 = 6 subnets
Five bits remain for the host portion: 25-2 = 30 hosts per
subnet
+ Default Class C mask 11111111 11111111 11111111 00000000
+ Modified subnet mask 11411111 11111111 11111111 11100000
+ Required subnet mask in dotted-decimal notation =
255.255.255.224
Ina Class C network address, there are eight bits available in the fourth octet for a total of 256
possible hosts. To create a custom subnet mask, you need to borrow three bits from the host
part of the address. The procedure for accomplishing this is shown in the following table.
Copyright© 2003, Cisco Systems, Ine. IP Addressing and Routing 637Determining the Subnet and Host
Addresses
es c ‘7. 5
Cf eT rE
Fre Tec
Serle or Tosco
er TOT
Taare ca aa Co
ee cd
re
Grisso es EES
TTiSsc eas SEC
and £0.00 7
Soro Coo CSOT OTT
Procedure for Creating a Custom Subnet Mask
‘stop | Action Notes
4, | Determine how many subnets are | To see how many bits you should borrow from the host
‘needed. In this case you need | portion of the network address, add the bil values from
‘twee subnets fight to left uni the total (decimal value) is greater than
the numberof subnets you need. Because you need three
‘subnets, add the one bit through the three bit, which
‘equals Seven. This is more than the number of subnets
Yyou need, so you need to borrow atleast three bts from
the host address starting from the left side ofthe octet that
‘contains the hast address (see figure.
72. | When you know how many bits fo | Remember that every bil you Borrow from the host leaves
borrow, bocrow them from the left fewer bis for the hosts, Because you need to Borrow three
side ofthe frst octet of the host | bls from the left side, you must show that In the new value
address. in your subnet mask, The default subnet mask fr the
‘Class C network address is 255.255.255,0, and your new
“custom subnet mask is 255,255 255,224, The 224
‘comes from the value ofthe fist three Bits from the left
(128 + 64 + 32 = 224). These bits now become 1s and are
par ofthe overall subnet mask. This leaves five bits for
the host IP addresses, § bits = 32 hosts per subnet
\With this information you can
build the tables shown inthe
figure.
1638 Introduction o Cisco Networking Technologies (INTRO) v1.03 ‘Copyright © 2003, Cisco Systems, ncAddresses
ee
od
492,
rsa
Ce
oe
Geese
Pee eee eo
i
os
Determining the Subnet and Host
Tecacor
mH
Csi
a
Gis)
Carita)
Corrs)
coir
sie
nH
Garis
Procedure for Creating a Custom Subnet Mask (Cont.)
Step | Action Notes
“4.__| Afteryounave allthe subnetwork | Again consider the third subnet, 192.168.57.64, as an
‘addresses, you can determine the
directed broadcast address (see
figure) and the ranges of possible
host IP addresses for each subnet
‘example. As you learned earler, the directed broadcast
‘address has al the 1s in the host portion. As shown in
the figure, when you place all 1s in the host bits, the
broadeast address for the 192.168. 57.64 subneiwork is
192.168.57.95,
Now that you know the directed
broadcast for the 192.188.57.64
‘subnetwork, determine the host
range of this network
Because 192.168.57.64 has al the Os inthe host portion,
itis subnetwork address, The fst usable host address
ofthis subnetwork is 192. 168.57.65
(1 400000:10107000.001 11007.01000001}), and the last
host addrass ofthis subnetwork is 192.168 57.95
(1100000.10101000.00111001.01011171). However,
because this address is used as the subnet broadcast
adarass, the last usable host address is 192,168.57.94
(1100000.10101000.00171001.01011110). Therefore,
the host address range for the 192.168.57.64
subnetwork is 192.168.57.65 to 192.168.5794.
Copyright © 2003, Cisco Systems, Inc.
IP Aderessing and Routing 6-30,Actual Subnets
Source Directed
Lore oy 3 - Peres
Crue oe a TE)
Stl feeders ae
Bee are peers reer re ere ae aes
Po Fee ruler alr ron ee EER
peel pepe risen sr eae ee ost eae)
Err car Fe ea rele fee ae
Subnet Per lee Ns ee CE
Pa ZESZESZEEIN ape
‘The first three bits are the subnet binary value. The last five bits are the host bits. By borrowing
three bits from the eight bits of the host address, you can create eight subnets with 32 hosts
each. The eight networks created are the “0,” "33," “64, ind “224” nets.
‘The “0” net and the “224” net are considered unusable because the “0” net has all zeros
(00000000) in the subnet portion of the address and the “224” net has all ones (11100000) in
the subnet portion of the address.
Notice that the first subnet always starts at 0 and, in this case, increases by 32, which is the
‘number of hosts on each subnet. One way to determine the number of hosts on each subnet, or
the start of each subnet, is to take the remaining host bits to the power of two. Because you
borrowed three of the eight bits for subnets and have five bits left, the number of hosts per
subnet is 32.
Another way to figure the number of hosts per subnet, or the “increment” from one subnet to
the next, is to subtract the subnet mask value in decimal (224 in the fourth octet) from 256
(which is the maximum number of possible combinations of eight bits), which equals 32. This
means you start at 0 for the first network and add 32 for each additional subnetwork. Consider
the third subnet (the “64” subnet) as an example. The IP address of 192.168.57.64 cannot be
used fora host ID because itis the “subnetwork ID” of the “64” subnet. As shown in the figure,
the host portion is all zeros.
{640 Induction o Cisco Networking Technologies (INTRO) v1.03 ‘Copyright © 2003, Cisco Systems, ncExample: Class C Subnet
g the Subnet and Host
Determi
Addresses
IP host address: 192.168.5.121
‘Subnet mask: 255.255.255.248,
Network [Network [Network [Subnet Host
OOo ESOT
C2 Serr TET Te TE LTET OT Tec TELE
losis) Tai cea aoa
Croc TTT TT
Five bits of subnetting
host addresses and 30 subnets,
1
figure illustrates a Class C network subnetted to provide s
Example: Table for Class C Subnet Planning
Subnetting Class C Addresses
ee ec
eat
This figure is an example table used for Class C subnet planning,
Copyright © 2003, Cisco Systems, Inc. IP Adéressing and Routing 6-41Summary
This topic summarizes the key points discussed in this lesson.
Summary
+ Networks—particularly large ones—are often
divided into smaller networks called subnetworks
or subnets.
+ A subnet address includes the network portion,
plus a subnet field and a host field and is created
by borrowing bits from the original host portion
and designating them as the subnet field.
+ The function of a subnet mask is to tell devices
which part of an address is the network number,
including the subnet, and which part is the host.
Summary (Cont.)
+ To determine a subnet address, follow these steps:
Express the IP address in binary form
Express the subnet mask in binary form
Perform a logical AND operation on the IP
address and subnet mask
The result of the logical AND operation is the
subnetwork number
Express the subnetwork number as dotted-
decimal notation
1642 —_Inoducton o Cisco Networking Technologies (INTRO) v1.03 ‘Copyright © 2003, Cisco Systems, nc