Anda di halaman 1dari 11

Subnetting Examples

Subnetting Examples
Problem 1:
Suppose you want to subnet the network 192.168.0.0 into 6 segments. Device an IP subnet plan,
giving the network, first host, last host and broadcast IP addresses for each subnet. Also specify the
subnet mask you would use.
Solution:
Step 1: Calculate required number of bits to borrow for subnetting.
using the formula 2
n
-2 = x where: n =number of bits borrowed
x =number of subnets required
2
n
-2 = 6
2
n
= 8
n = 3
In this problem, we
need to identify IP
class, subnet mask
and consider the
required 6 subnets.
The formula will specify
the number of possible
subnets from the value of
bits to borrow. -2 subnets
since all 0s and 1s
cannot be used
Since our network is a class C address, our
default mask will be 255.255.255.0. In binary,
11111111.11111111.11111111.00000000
We can only manipulate the last octet.
Borrowing 3 bits from it will leave us 5 bits ( the
0s in the last octet ) for the host.
11111111.11111111.11111111.11100000
Computing for the possible number of hosts will
give us 2
5
-2 =30 hosts per subnet
Since our network is a class C address, our
default mask will be 255.255.255.0. In binary,
11111111.11111111.11111111.00000000
We can only manipulate the last octet.
Borrowing 3 bits from it will leave us 5 bits ( the
0s in the last octet ) for the host.
11111111.11111111.11111111.11100000
Computing for the possible number of hosts will
give us 2
5
-2 =30 hosts per subnet
Subnet, 3
bits / Host,
5 bits
Subnetting Examples
Step 2: Calculate the subnet mask
Subnet mask has all 1s in the network + subnet part of the address.
Hence, 11111111.11111111.11111111.11100000 = 255.255.255.224
Step 3: Calculate all subnet network address
192. 168. 0.
11000000 10101000 00000000 00100000 192.168.0.32
11000000 10101000 00000000 01000000 192.168.0.64
11000000 10101000 00000000 01100000 192.168.0.96
11000000 10101000 00000000 10000000 192.168.0.128
11000000 10101000 00000000 10100000 192.168.0.160
11000000 10101000 00000000 11000000 192.168.0.192
Subnet Net wor k Addr esses
We cannot alter the
first three octets
since this is a class C
IP address.
From the three borrowed
bits, we count up
sequentially from 001-
110 ( all 0s and 1s
cannot be used )
Default subnet mask
is changed due to
additional 3 bits
borrowed.
Subnet Network
Address is all 0s in
the host ID field.
Subnet Network
Address is all 0s in
the host ID field.
Subnetting Examples
Step 4: Calculate all addresses of the first host, last host and broadcast on each subnet.
As computed, each subnet
will have 30 hosts. The
range from the first host to
the last host will give you 30
hosts each.
Fir st Host Last Host Br oadcast Addr ess
1st Subnet 192.168.0.32 192.168.0.33 192.168.0.62 192.168.0.63
2nd Subnet 192.168.0.64 192.168.0.65 192.168.0.94 192.168.0.95
3r d Subnet 192.168.0.96 192.168.0.97 192.168.0.126 192.168.0.127
4t h Subnet 192.168.0.128 192.168.0.129 192.168.0.158 192.168.0.159
5t h Subnet 192.168.0.160 192.168.0.161 192.168.0.190 192.168.0.191
6t h Subnet 192.168.0.192 192.168.0.193 192.168.0.222 192.168.0.223
Subnet Networ k Addr esses
Broadcast Address
is all 1s in the host
ID field.
Broadcast Address
is all 1s in the host
ID field.
192. 168. 0.
11000000 10101000 00000000 00111111 192.168.0.63
11000000 10101000 00000000 01011111 192.168.0.95
11000000 10101000 00000000 01111111 192.168.0.127
11000000 10101000 00000000 10011111 192.168.0.159
11000000 10101000 00000000 10111111 192.168.0.191
11000000 10101000 00000000 11011111 192.168.0.223
Br oadcast Addr esses
Subnetting Examples
Problem 2:
Given the Class C network of 204.15.5.0/24, subnet the network in order to create the network in
Figure 1 with the host requirements shown.
Figure 1.
Looking at the figure,
you can see that we
are required to create
five subnets. The
maximum number of
hosts is 28.
Subnetting Examples
Solution:
Step 1: Calculate required number of bits to borrow for subnetting.
using the formula 2
n
= x where: n =number of bits borrowed
x =number of subnets required
2
n
= 8
2
n
= 8
n = 3
In this example, we will
assume that we can use the
subnet zero for the purpose of
showing address optimization
later.
Note: In the past, there were
limitations to the use of a subnet 0
(all subnet bits are set to zero) and
all ones subnet ( all subnet bits set
to one ). Some devices would not allow the use
of these subnets. However, Cisco systems
devices will allow the use of these subnets
when the IP subnet zero command is
configured.
Note: In the past, there were
limitations to the use of a subnet 0
(all subnet bits are set to zero) and
all ones subnet ( all subnet bits set
to one ). Some devices would not allow the use
of these subnets. However, Cisco systems
devices will allow the use of these subnets
when the IP subnet zero command is
configured.
Instead of using the previous
examples formula, lets
consider this one. If we choose
2 bits, It will result to only 4
subnets which is lower than
what is required. So 3 bits is
appropriate.
Step 2: Calculate the subnet mask
Subnet mask has all 1s in the network + subnet bits.
Hence, 11111111.11111111.11111111.11100000 = /27 = 255.255.255.224
Number of 1s in the binary system
Subnetting Examples
Step 3: Calculate all subnet network address
204. 15. 5.
11001100 00001111 00000101 00000000 204.15.5.0/27
11001100 00001111 00000101 00100000 204.15.5.32/27
11001100 00001111 00000101 01000000 204.15.5.64/27
11001100 00001111 00000101 01100000 204.15.5.96/27
11001100 00001111 00000101 10000000 204.15.5.128/27
Subnet Net wor k Addr esses
Instead of using 204.15.5.0 255.255.255.224 we can use 204.15.5.0/27
Host ID field consists of 5 bits so, possible number of host is 2
5
2 =30 hosts per subnet
Cisco system
configured to accept
usage of IP subnet
zero
Subnetting Examples
Step 4: Calculate all addresses of the first host, last host and broadcast on each subnet.
As computed, each subnet
will have 30 hosts. The
range from the first host to
the last host will give you 30
hosts each.
Fir st Host Last Host Br oadcast Addr ess
1st Subnet 204.15.5.0/27 204.15.5.1/27 204.15.5.30/27 204.15.5.31/27
2nd Subnet 204.15.5.32/27 204.15.5.33/27 204.15.5.62/27 204.15.5.63/27
3r d Subnet 204.15.5.64/27 204.15.5.65/27 204.15.5.94/27 204.15.5.95/27
4t h Subnet 204.15.5.96/27 204.15.5.97/27 204.15.5.126/27 204.15.5.127/27
5t h Subnet 204.15.5.128/27 204.15.5.129/27 204.15.5.158/27 204.15.5.159/27
Subnet Net wor k Addr esses
Note: /XX indicates the subnet
mask of an address.
Note: /XX indicates the subnet
mask of an address.
Subnetting Examples
Problem 3:
Given the same network and requirements as in Problem 2, develop a subnetting scheme using
VLSM, given:
netA: must support 14 hosts
netB: must support 28 hosts
netC: must support 2 hosts
netD: must support 7 hosts
netE: must support 28 hosts
Solution:
Step 1: Calculate required number of hosts for each subnet.
using the formula 2
m
-2 = y where: m =number of bits on Host ID field
y =number of hosts required
2
m
-2 = 28
2
m
= 30
m = 5
We can have 5 bits on the
host ID field meaning 5 0s
counting from the last bit of
the last octet
Since the host field is always on the last octet
and the last bits, well count 5 0s from the end
bits:
11111111.11111111.11111111.11100000
The number of 1s will give us the subnet mask
which is /27 ( 27 1s )
Since the host field is always on the last octet
and the last bits, well count 5 0s from the end
bits:
11111111.11111111.11111111.11100000
The number of 1s will give us the subnet mask
which is /27 ( 27 1s )
For netB & netE:
Subnetting Examples
2
m
-2 = 14
2
m
= 16
m = 4
We can have 4 bits on the
host ID field meaning 4 0s
counting from the last bit of
the last octet
Since the host field is always on the last octet
and the last bits, well count 4 0s from the end
bits:
11111111.11111111.11111111.11110000
The number of 1s will give us the subnet mask
which is /28 ( 28 1s )
Since the host field is always on the last octet
and the last bits, well count 4 0s from the end
bits:
11111111.11111111.11111111.11110000
The number of 1s will give us the subnet mask
which is /28 ( 28 1s )
For netA:
2
m
-2 = 7
2
m
= 9
m = 4
We can have 4 bits on the
host ID field meaning 4 0s
counting from the last bit of
the last octet
Since the host field is always on the last octet
and the last bits, well count 4 0s from the end
bits:
11111111.11111111.11111111.11110000
The number of 1s will give us the subnet mask
which is /28 ( 28 1s )
Since the host field is always on the last octet
and the last bits, well count 4 0s from the end
bits:
11111111.11111111.11111111.11110000
The number of 1s will give us the subnet mask
which is /28 ( 28 1s )
**For netD:
We cannot use 3 bits
since it will only yield 6
hosts and we need 7
hosts
**For netD:
Subnetting Examples
2
m
-2 = 2
2
m
= 4
m = 2
We can have 2 bits on the
host ID field meaning 2 0s
counting from the last bit of
the last octet
Since the host field is always on the last octet
and the last bits, well count 2 0s from the end
bits:
11111111.11111111.11111111.11111100
The number of 1s will give us the subnet mask
which is /30 ( 30 1s )
Since the host field is always on the last octet
and the last bits, well count 2 0s from the end
bits:
11111111.11111111.11111111.11111100
The number of 1s will give us the subnet mask
which is /30 ( 30 1s )
For netC:
Step 2: Calculate all addresses of the subnet, first host and last host
This illustrates how
VLSM helped save
more than half of the
address space
Fir st Host Last Host # of host s
net B 204.15.5.0/27 204.15.5.1/27 204.15.5.30/27 30
net E 204.15.5.32/27 204.15.5.33/27 204.15.5.62/27 30
net A 204.15.5.64/28 204.15.5.65/28 204.15.5.78/28 14
net D 204.15.5.80/28 204.15.5.81/28 204.15.5.94/28 14
net C 204.15.5.96/30 204.15.5.97/30 204.15.5.98/30 2
Subnet Net wor k Addr esses
Note: Because of different subnet mask, routers
in a VLSM network must understand this type of
subnetting and must be configured. Native IP
routers only understand Static length subnet
mask.
Note: Because of different subnet mask, routers
in a VLSM network must understand this type of
subnetting and must be configured. Native IP
routers only understand Static length subnet
mask.

Anda mungkin juga menyukai