Chapter 5
Chapter 5
Subnetting/Supernetting
Subnetting/Supernetting
and Classless Addressing
Outline
Outline
o o SubnettingSubnetting o o SupernernettingSupernernetting oSUBNETTING
SUBNETTING
5.1
5.1
5.1
5.1
Subnetting
Subnetting
o
o IP addresses are designed with two level of IP addresses are designed with two level of
hierarchy hierarchy n
n Two levels of hierarchy is not Two levels of hierarchy is not enoughenough o
o Solution:Solution: subnetting subnetting
n
n A network is divided into several smaller A network is divided into several smaller networks
networks
n
n Each smaller network is called aEach smaller network is called a subnetw subnetwork ork or or aa subnet
I
I
P addr
P addr
e
e
s
s
s
s
e
e
s
s
ar
ar
e
e
de
de
s
s
i
i
gn
gn
e
e
d wi
d wi
th
th
II P addr
P addr e
es
ss
se
es
s ar
ar e
e de
des
siign
gne
ed wi
d wi th
th
two l
two l
e
e
ve
ve
l
l
s
s
of h
of h
i
i
e
e
r
r
ar
ar
chy.
chy.
two l
Figure 5-1
Figure 5-1
A
A
N
N
e
e
twor
twor
k
k
wi
wi
th
th
T
T
wo
wo
L
L
e
e
v
v
e
e
l
l
s
s
of
of
H
Figure 5-2
Figure 5-2
A
A
N
N
e
e
twor
twor
k
k
wi
wi
th
th
T
T
h
h
r
r
e
e
e
e
L
L
e
e
ve
ve
l
l
s
s
of
of
H
Su
Su
bn
bn
et
et
ti
ti
ng
ng
(
(
Co
Co
nt
nt
.)
.)
o
o The subnetwThe subnetworksorks still still appear appear as a sas a singleingle
network to the rest of the Internet network to the rest of the Internet
o
o For example, a packet destined for hostFor example, a packet destined for host
141.14.192.2 still reaches router R1 141.14.192.2 still reaches router R1
o
o However, R1 knows the network 141.14 isHowever, R1 knows the network 141.14 is
physically divided into subnetworks physically divided into subnetworks
n
Three Levels of
Three Levels of
Hierarchy
Hierarchy
o
o Three levelThree level
n
n Site, subnet, and hostSite, subnet, and host o
o The routing of an IP datagram now involvesThe routing of an IP datagram now involves
three step three step n
n Delivery to theDelivery to the site site
n
n Delivery to theDelivery to the subnetw subnetwork ork
n
Figure 5-3
Figure 5-3
A
A
ddr
ddr
e
e
s
s
s
s
e
e
s
s
i
i
n
n
a N
a N
e
e
twor
twor
k
k
wi
wi
th
th
and w
Subnet Mask
Subnet Mask
o
o The network mask create the network addressThe network mask create the network address
o
o The subnet mask create the subnetwork The subnet mask create the subnetwork
address address
o
o Subnet Mask Subnet Mask
n
n Nonconti Noncontiguous: a mguous: a mixture of 0s aixture of 0s and 1snd 1s
o
o Out-of-dayOut-of-day
n
n ContiguoContiguous: a run of 1s us: a run of 1s followed by a run of 0sfollowed by a run of 0s
o
Figure 5-5
Figure 5-5
D
Finding the Subnet Address
Finding the Subnet Address
o
o Given an IP address, we can find theGiven an IP address, we can find the subnet subnet
address
address in the same way as we fin the same way as we found theound the network address
network address n
n Apply the mask to the addressApply the mask to the address
o
Straight Method
Straight Method
o
o Use binary notation for both the address andUse binary notation for both the address and
the mask the mask
o
o Then apply the AND operation to find theThen apply the AND operation to find the
subnet address subnet address
E
Example xample 1 1
E
Example xample 1 1
W
Wha
hat i
t is t
s th
he s
e sub
ubne
netw
twor
ork
k ad
add
drres
ess i
s if t
f th
hee
destination address is 200.45.34.56 and the
destination address is 200.45.34.56 and the
subnet mask is
Solution Solution Solution Solution
11001000 00101101 00100010 00111000
11001000 00101101 00100010 00111000
11111111 11111111 1111
11111111 11111111 1111
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
11001000 00101101 0010
11001000 00101101 0010
0000
0000
0000
0000
00000000
00000000
00000000
00000000
The
Short-Cut Method
Short-Cut Method
o
o If the byte in the mask is 255, copy thIf the byte in the mask is 255, copy the byte ine byte in
the address the address
o
o If the byte in the mask is 0, repIf the byte in the mask is 0, replace the byte inlace the byte in
the address with 0 the address with 0
o
o If the byte in the mask is neither 2If the byte in the mask is neither 255 nor 0,55 nor 0,
we write the mask and the address in binary we write the mask and the address in binary and apply the AND operation
E
Example xample 2 2
E
Example xample 2 2
Wh
What
at is
is th
the s
e sub
ubne
netw
twor
ork
k ad
addr
dres
ess i
s if t
f th
hee
destination address is 19.30.80.5 and the
destination address is 19.30.80.5 and the
mask is 255.255.192.0?
mask is 255.255.192.0?
Solution Solution Solution SolutionSee Next Figure.
Figure 5-6
Figure 5-6
E
Default Mask and Subnet Mask
Default Mask and Subnet Mask
o
o The number of 1sThe number of 1s in a default mask isin a default mask is
perdetermined perdetermined
n
n 8, 16, or 248, 16, or 24
o
o But, in a subnet mask, the number of 1s isBut, in a subnet mask, the number of 1s is
more than the number of 1s in the more than the number of 1s in the corresponding default mask
Figure 5-7 Figure 5-7
Co
Co
mp
mp
ar
ar
i
i
s
s
o
o
n of
n of
a
a
D
D
e
e
f
f
a
a
u
u
l
l
t M
t M
as
as
k and
k and
a S
a S
u
u
bn
bn
e
e
t M
t M
as
as
k
k
Number of Subnetworks
Number of Subnetworks
o
o Found by counting the number of extra bitsFound by counting the number of extra bits
that are added to the default
that are added to the default mask in a subnetmask in a subnet mask
mask
o
o For example, in above figureFor example, in above figure
n
n The number of extra 1s is 3The number of extra 1s is 3
o
o The lThe lengength of sth of subneubnetidtid = 3= 3
n
T
T
h
h
e
e
n
n
u
u
mbe
mbe
r
r
of
of
s
s
u
u
bne
bne
ts
ts
mu
mu
s
s
t be
t be
T
Th
he
e n
nu
umbe
mber
r of
of s
su
ubn
bne
ets
ts mu
mus
st be
t be
a po
a po
we
we
r
r
of
of
2.
2.
a po
Number of Addresses per Subnet
Number of Addresses per Subnet
o
o Found by counting the number of Found by counting the number of 0s0s in thein the
subnet mask subnet mask
o
o For example, in above figureFor example, in above figure
n
n The number of 0s is 13The number of 0s is 13
o
o The The lenlength gth of of hosthostidid = = 1313
n
n The number of addressed in each subnet is 2^13 =The number of addressed in each subnet is 2^13 = 8192
Designing Subnets
Designing Subnets
o
o How a network managers design subnetsHow a network managers design subnets
n
n Deciding the number of subnetsDeciding the number of subnets
n
n Finding the subnet mask Finding the subnet mask
n
n Find the range of address in each subnetFind the range of address in each subnet
o
o Start with the first subnet and its first address is theStart with the first subnet and its first address is the
first address in the block first address in the block
o
o Add the number of addresses in each subnet minusAdd the number of addresses in each subnet minus
one to get the last address one to get the last address
o
o Add one to the last address in obtain step to obtain theAdd one to the last address in obtain step to obtain the
first address in the next subnet first address in the next subnet
E
Example xample 3 3
E
Example xample 3 3
A company is granted the site address
A company is granted the site address
201.70.64.0 (class C). The company needs
201.70.64.0 (class C). The company needs
six subnets. Design the subnets.
o
o The number of 1s in the defThe number of 1s in the default mask is 24ault mask is 24
(class C).
(class C).
o
o The company needs six subnets.The company needs six subnets.
n
n This number 6 is not a power of 2.This number 6 is not a power of 2.
n
n The next number that is a power of 2 is The next number that is a power of 2 is 8 (23)8 (23) o
o We need 3 more 1s in the subnet mask.We need 3 more 1s in the subnet mask.
n
n The total number of 1s in the subnet mask is 27The total number of 1s in the subnet mask is 27 (24 + 3).
(24 + 3). n
n The tThe total notal numbumber of 0s is 5 (er of 0s is 5 (32 -32 - 27).27).
Solution
Solution
Solution Solution
S
Soluolutition on (Co(Contintinunueed) d)
S
Soluolutition on (Co(Continti nunueed) d)
.
S
Soluolutition on (Co(Contintinunueed) d)
S
Soluolutition on (Co(Continti nunueed) d)
The mask is
The mask is
1111 11111111111 1111111 11111111 111111 111111111111 1111110000000000 or or 255.255.255.224 255.255.255.224The number of subnets is 8. The number of subnets is 8.
The number of addresses in each subnet is 2 The number of addresses in each subnet is 255 (5 is the number of 0s) or 32.
Figure 5-8
Figure 5-8
E
E
Example xample 4 4
E
Example xample 4 4
A company is granted the site address
A company is granted the site address
181.56.0.0 (class B). The company needs
181.56.0.0 (class B). The company needs
1000 subnets. Design the subnets.
o
o The number of 1s in the defThe number of 1s in the default mask is 16ault mask is 16
(class B).
(class B).
o
o The company needs 1000 subnets.The company needs 1000 subnets.
n
n This number is not a power of 2.This number is not a power of 2.
n
n The next number that is a power of 2 is 1024 (210).The next number that is a power of 2 is 1024 (210). o
o We need 10 more 1s in the subnet mask.We need 10 more 1s in the subnet mask.
n
n The total number of 1s in the subnet mask is 26 (16The total number of 1s in the subnet mask is 26 (16 + 10).
+ 10). n
n The tThe total notal numbumber of 0s is 6 (er of 0s is 6 (32 -32 - 26).26).
Solution
Solution
Solution Solution
o
o The mask isThe mask is
11 1111111111111 1 1111111111111111 1111111111111111 1111000000000000 or or 255.255 255.255.255.192..255.192. o
o The number of subnets is 1024.The number of subnets is 1024.
o
o The number of addresses in each subnet is 26The number of addresses in each subnet is 26
(6 is the number of 0s) or 64. (6 is the number of 0s) or 64. n
n See the Next FigureSee the Next Figure
S
Soluolutition on (Co(Contintinunueed) d)
S
Figure 5-9
Figure 5-9
E
Variable Length Subnetting
Variable Length Subnetting
o
o A site that is granted a class C address andA site that is granted a class C address and
have five subnets with the number of hosts have five subnets with the number of hosts n
n 60, 60, 60, 30, 3060, 60, 60, 30, 30 o
o Cannot use a subnet mask with only extra 2Cannot use a subnet mask with only extra 2
bits bits
n
n Allow only four subnetAllow only four subnet o
o Cannot use a subnet make with Cannot use a subnet make with extra 3 bitsextra 3 bits
n
Var
Var
iab
iab
le Le
le Le
ngt
ngt
h Subn
h Subn
ett
ett
ing
ing
(Co
(Co
nt.)
nt.)
o
o SolutionSolution
n
n Variable length subnettingVariable length subnetting o
o Use two different masks, one applied afUse two different masks, one applied after theter the
other other n
n First use the mask with 26 1s (255.255.255.192)First use the mask with 26 1s (255.255.255.192) to divide the network into
to divide the network into four sub four subnet net
n
n Then, apply mask with 27 1s (255.255.255.224)Then, apply mask with 27 1s (255.255.255.224) to
to oneone of the subnet to divide it of the subnet to divide it intointo two smaller two smaller subnets
Figure 5-10
Figure 5-10
V
SUPERNETTING
SUPERNETTING
5.2
5.2
5.2
5.2
Supernetting
Supernetting
o
o Class A and B addresses are almost depleted.Class A and B addresses are almost depleted.
However, class C addresses are still available However, class C addresses are still available
o
o But, the size of class block, 256, is too smallBut, the size of class block, 256, is too small
o
o Solution:Solution: subnetting subnetting
n
n Combine several class C blocks to create a larger Combine several class C blocks to create a larger range of addresses
Figure 5-11
Figure 5-11
A
Make a Supernet
Make a Supernet
o
o RulesRules
n
n The number of blocks must beThe number of blocks must be a power of 2a power of 2 (1, 2,(1, 2, 4
4, , 88, , 1166, , .. .. ..))
n
n The blocks must beThe blocks must be contiguouscontiguous in the addressin the address space (no gaps between the blocks).
space (no gaps between the blocks).
n
n TheThe third bytethird byte of theof the first add first addressress in thein the supe
superblorblockck mumust be evenly divst be evenly divisiblisible bye by ththee nunumbmbeer r of blocks
of blocks..
o
o In other words, if the number of blocks isIn other words, if the number of blocks is N N , the third, the third
byte mu
E
Example xample 5 5
E
Example xample 5 5
A company needs 600 addresses. Which of
A company needs 600 addresses. Which of
the following set of class C blocks can be
the following set of class C blocks can be
used t
used to form
o form a su
a superne
pernett for th
for this co
is compan
mpany?
y?
198. 198.47.47.32.32.0 198.47.0 198.47.33.33.00 198.198.47.47.34.34.00 198.47. 198.47.32.032.0 198.47.198.47.42.0 42.0 198.47.198.47.52.0 52.0 198.47.198.47.62.062.0 198.47. 198.47.31.031.0 198.47.198.47.32.0 32.0 198.47.198.47.33.0 33.0 198.47.198.47.52.052.0 198.47.32.0 198.47.33.0 198.47.34.0 198.47.35.0 198.47.32.0 198.47.33.0 198.47.34.0 198.47.35.0Solution
Solution
Solution Solution
1
1: No, there are only three blocks <> 2^n,: No, there are only three blocks <> 2^n,
2
2: No, the blocks are not contiguous.: No, the blocks are not contiguous.
3
3: No, 31 in the first block is not divisible by 4.: No, 31 in the first block is not divisible by 4.
4
Su
Su
pe
pe
rn
rn
et
et
Ma
Ma
sk
sk
o
o In original block of addresses, we knoIn original block of addresses, we know thew the
range of addresses fro
range of addresses from the first addressm the first address n
n Since Since the mthe mask is ask is perdefinedperdefined (default m(default mask)ask)
o
o In subnettingIn subnetting or supor supernetternetting, thing, the first ae first addressddress
alone cannot derive the range of addresses alone cannot derive the range of addresses n
n We need to know theWe need to know the mask mask , subnet mask or , subnet mask or supe
I
I
n
n
II n
n subnetting
subnetting
subnetting
subnetting
,,
,
,
we
we
n
n
e
e
e
e
d th
d th
e
e
f
f
i
i
r
r
s
s
t addr
t addr
e
e
s
s
s
s
of
of
th
th
e
e
we
we n
ne
ee
ed th
d the
e ffiirr s
st addr
t addr e
es
ss
s of
of th
the
e
s
s
u
u
bn
bn
e
e
t an
t an
d th
d th
e
e
s
s
u
u
bn
bn
e
e
t m
t m
as
as
k
k
to
to
s
su
ubn
bne
et an
t and th
d the
e s
su
ubn
bne
et m
t mas
ask
k to
to
de
de
f
f
i
i
n
n
e
e
t
t
h
h
e
e
r
r
an
an
ge
ge
of
of
addr
addr
e
e
s
s
s
s
e
e
s
s
.
.
de
I
I
n
n
II n
n supernetting
supernetting
supernetting
supernetting
,,
,
,
we
we
n
n
e
e
e
e
d th
d th
e
e
f
f
i
i
r
r
s
s
t
t
addr
addr
e
e
s
s
s
s
of
of
we
we n
ne
ee
ed th
d the
e ffiirr s
st addr
t addr e
es
ss
s of
of
t
t
h
h
e
e
tth
he
e supernet
supernet
supernet
supernet
and the
and the
a
and th
nd the
e supernet
supernet
supernet mas
supernet
mas
mask
mas
k to
k
k
to
to
to
de
de
f
f
i
i
n
n
e
e
th
th
e
e
r
r
an
an
ge
ge
of
of
addr
addr
e
e
s
s
s
s
e
e
s
s
.
.
de
Sup
Sup
er
er
ne
ne
t
t
Ma
Ma
sk
sk
(C
(C
ont
ont
.)
.)
o
o A supernetA supernet mask mask is the is the reversreverse of a e of a subnetsubnet
mask mask n
n A subnet mask has more 1s than the default mask A subnet mask has more 1s than the default mask
n
Figure 5-12
Figure 5-12
Comp
Comp
ar
ar
i
i
s
s
on of
on of
S
S
u
u
bne
bne
t, D
t, D
e
e
f
f
aul
aul
t,
t,
a
E
Example xample 6 6
E
Example xample 6 6
We n
We need t
eed to m
o make
ake a su
a super
pernet
netwo
work
rk out
out of 1
of 16
6
class
class C blo
C blocks.
cks. What i
What is the s
s the super
upernet
net mask
mask??
Solution
Solution
Solution Solution
We need 16 blocks. For 16 blocks we need to change four
We need 16 blocks. For 16 blocks we need to change four
1s to 0s in the default mask. So the mask is
1s to 0s in the default mask. So the mask is
11111111 11111111 1111 11111111 11111111 111100000000 0000000000000000 Or Or 255.255.240.0 255.255.240.0
E
Example xample 7 7
E
Example xample 7 7
A sup
A supernernetet has a fhas a firsirst adt addredress of ss of 205205.1.16.6.32.32.0 an0 and ad a super
supernetnet mamask of 255.2sk of 255.255.255.248.48.0. A router rece0. A router receives threives threee packets wi
packets with the follth the following desowing destination tination addressesaddresses::
205.16.37.44 205.16.37.44 205.16.42.56 205.16.42.56 205.17.33.76 205.17.33.76
Which packet belongs to the supernet? Which packet belongs to the supernet?
Solution
Solution
Solution Solution We ap
We apply tply the suhe superpernetnet masmask to sek to see if we cae if we can findn find
the beginning address.
the beginning address.
205.16.37.44 205.16.37.44 AND AND 255.255.248.0255.255.248.0 èè 205.16.32.0205.16.32.0 205.16.42.56 205.16.42.56 AND AND 255.255.248.0255.255.248.0 èè 205.16.40.0205.16.40.0 205.17.33.76 205.17.33.76 AND AND 255.255.248.0255.255.248.0 èè 205.17.32.0205.17.32.0
Only the first address belongs to this supernet.
E
Example xample 8 8
E
Example xample 8 8
A sup
A supernernetet has has a firsa first addt addresress of 20s of 205.5.16.16.32.32.0 an0 and ad a supernet
supernet mask of mask of 255.255.255.255.248.0. H248.0. How manow many blocks y blocks are inare in this su
o
o ThThe sue superpernenett hahas 21 1ss 21 1s..
o
o The default mask has 24 1s.The default mask has 24 1s.
o
o Since the difference is 3Since the difference is 3
n
n There are 23 or There are 23 or 8 blocks in this supernet.8 blocks in this supernet. o
o The blocks are 205.16.32.0 to 205.16.39.0.The blocks are 205.16.32.0 to 205.16.39.0.
n
n The first address The first address is 205.16.32.0.is 205.16.32.0.
n
n The last address is 205.16.39.255.The last address is 205.16.39.255.
Solution
Solution
Solution Solution
CLASSLESS
CLASSLESS
ADDRESSING
ADDRESSING
5.3
5.3
5.3
5.3
Classless Addressing
Classless Addressing
o
o Classfull addresClassfu addressing sing has has createcreated mad manyny
problems problems
o
o Solution: classless addressing Solution: classless addressing
o
o Idea:Idea: variable-length blocksvariable-length blocks
n
n The whole address space (2^32 The whole address space (2^32 addresses) isaddresses) is divided into blocks of different
Figure 5-13
Figure 5-13
V
Number of Addresses in a Block
Number of Addresses in a Block
o
o There is only one condition on the number of There is only one condition on the number of
addresses in a block addresses in a block n
n It It mmusust bt be a e a popowewer or of 2 f 2 (2(2, 4, 4, , 8,8, .. .. .).) o
o A household may be given a block of 2A household may be given a block of 2
addresses. addresses.
o
o A small business may be given 16 aA small business may be given 16 addresses.ddresses.
o
o A large organization may be given 1024A large organization may be given 1024
addresses addresses
Beginning Addresses
Beginning Addresses
o
o The beginning address mustThe beginning address must be evenly divisiblebe evenly divisible
by the number of addresses. by the number of addresses. n
n Ex: if a block contains 4 addresses, the beginningEx: if a block contains 4 addresses, the beginning address must be divisible by 4.
address must be divisible by 4. o
o If the block has less than 256 addresses, weIf the block has less than 256 addresses, we
need to check only the rightmost byte. need to check only the rightmost byte.
o
o If it has less than 65,536 addresses, we need toIf it has less than 65,536 addresses, we need to
check only the two rightmost bytes, and so on. check only the two rightmost bytes, and so on.
E
Example xample 9 9
E
Example xample 9 9
Which of the following can be the beginning address of a Which of the following can be the beginning address of a block that
block that contains contains 16 addres16 addresses?ses? 205.16.37.32 205.16.37.32 190.16.42.44 190.16.42.44 17.17.33.80 17.17.33.80 123.45.24.52 123.45.24.52 Solution Solution Solution Solution
The address 205.16.37.32 is eligible because 32 is
The address 205.16.37.32 is eligible because 32 is
divisible by 16. The address 17.17.33.80 is eligible
divisible by 16. The address 17.17.33.80 is eligible
because 80 is divisible by 16.
E
Examplxample e 10 10
E
Examplxampl e e 10 10
Which of the following can be the beginning address of a Which of the following can be the beginning address of a block that
block that contains contains 1024 ad1024 addresses?dresses? 205.16.37.32 205.16.37.32 190.16.42.0 190.16.42.0 17.17.32.0 17.17.32.0 123.45.24.52 123.45.24.52 Solution Solution Solution Solution
To be divisible by 1024, the rightmost byte of an
To be divisible by 1024, the rightmost byte of an
address should be 0 and the second rightmost byte
address should be 0 and the second rightmost byte
must be divisible by 4. Only the address 17.17.32.0
Mask
Mask
o
o LikLike te the che classlassfulful addraddressessinging, s, subneubnettittingng , a, andnd
supernetting, in classless addressing, given supernetting, in classless addressing, given n
n First add First addressress
n
n The mask The mask
o
Slash Notation
Slash Notation
o
o Attach the number of 1s in a mask Attach the number of 1s in a mask to the end of ato the end of a classless address
classless address o
o Also called CIDR (C Also called CIDR (C lassless I lassless I nter nter D Domainomain R Routing)outing) o
o The CIDR convey two ideasThe CIDR convey two ideas
n
n The address isThe address is classlessclassless n
n Routing is done usingRouting is done using inteinterdomrdomainain routrouting ing
o
o A mask and a slash followed by a number define theA mask and a slash followed by a number define the same thing
same thing
n
Figure 5-14
Figure 5-14
S
S
S
l
l
as
as
h
h
n
n
otati
otati
on i
on i
s
s
al
al
s
s
o c
o c
al
al
l
l
e
e
d
d
S
Sllas
ash
h n
notati
otation i
on is
s al
als
so ca
o calllle
ed
d
CIDR
CIDR
CIDR
CIDR
notation.
notation.
notation.
notation.
Prefix and Suffix
Prefix and Suffix
o
o PrefixPrefix
n
n Another name for the common part of the address rangeAnother name for the common part of the address range
o
o Prefix range: the length of the prefixPrefix range: the length of the prefix
n
n Equal toEqual to nn in the slash notationin the slash notation
o
o SuffixSuffix
n
n The varying part of the address rangeThe varying part of the address range
o
o Suffix range: the length of the suffixSuffix range: the length of the suffix
n
E
Exxample ample 11 11
E
Examplxampl e e 11 11
A small organization is given a block with the A small organization is given a block with the beginning
beginning address address and and the the prefix prefix lengthlength 205.16.37.24/29
205.16.37.24/29 (in slash notation). What is the(in slash notation). What is the range of the block?
o
o The beginning address is 205.16.37.24.The beginning address is 205.16.37.24.
o
o To find the last address we keep the first 29To find the last address we keep the first 29
bits and change the last 3 bits to 1s.
bits and change the last 3 bits to 1s.
n
n Beginning:Beginning: 11001111 00010000 00100101 0001111001111 00010000 00100101 00011000000 n
n Ending Ending :: 11001111 00010000 00100101 0001111001111 00010000 00100101 00011111111
o
o There are only 8 addresses in this block.There are only 8 addresses in this block.
Solution
Solution
Solution Solution
E
Examplxample e 12 12
E
Examplxampl e e 12 12
We can find the range of addresses in Example 11 by We can find the range of addresses in Example 11 by another method. We can argue that the length of the another method. We can argue that the length of the suffix is 32
suffix is 32 −− 29 or 3. So there are 229 or 3. So there are 233 == 8 addresses in this8 addresses in this
block. If the
block. If the first address is 205.16.37.24, the last addressfirst address is 205.16.37.24, the last address is 205.16.37.31 (24
A
A
bl
bl
oc
oc
k
k
i
i
n
n
cl
cl
as
as
s
s
e
e
s
s
A
A
, B
, B
, and C
, and C
A
A bl
bloc
ock
k iin
n cl
clas
ass
se
es
s A
A, B
, B, and C
, and C
can
can
e
e
as
as
i
i
l
l
y be
y be
r
r
e
e
pr
pr
e
e
s
s
e
e
n
n
te
te
d i
d i
n
n
s
s
l
l
as
as
h
h
can
can e
eas
asiill y be
y be rre
epr
pr e
es
se
en
ntte
ed i
d in
n s
sllas
ash
h
nota
nota
ti
ti
on as
on as
nota
notati
tio
on
n as
as
A
A..B
B..C.
C.D
D/ n
/ n
A
A
.
.
B
B
.
.
C.
C.
D
D
/ n
/ n
whe
whe
r
r
e
e
n i
n i
s
s
whe
wherr e
e n
n iis
s
e
e
i
i
th
th
e
e
r
r
8 (cl
8 (cl
as
as
s
s
A
A
), 16 (cl
), 16 (cl
as
as
s
s
B
B
), or
), or
e
eiith
the
er
r 8 (cl
8 (cl as
ass
s A
A), 16 (cl
), 16 (cl as
ass
s B
B), or
), or
24 (cl
24 (cl
as
as
s
s
C)
C)
.
.
24 (cl
Finding the Network Address
Finding the Network Address
o
o We can derive the network address if we knowWe can derive the network address if we know
n
n One of the address in the block One of the address in the block
n
n TheThe prefix le prefix lengthngth, or a, or a mask mask , or the, or the suffix len suffix lengthgth o
o Solution 1Solution 1
n
n AND the mask and the address to find the firstAND the mask and the address to find the first address, i.e., network address
address, i.e., network address o
o Solution 2Solution 2
n
E
Example 1xample 13 3
E
Examplxample e 13 13
What is the network address if one of the addresses is What is the network address if one of the addresses is 167.199.170.82/27?
o
o The prefix length is 27, which means that weThe prefix length is 27, which means that we
must keep the first 27 bits as it is and
must keep the first 27 bits as it is and changechange
the remaining bits (5) to 0s.
the remaining bits (5) to 0s.
o
o The 5 bits affect only the last byte.The 5 bits affect only the last byte.
o
o The last byte is 01010010.The last byte is 01010010.
o
o Changing the last 5 bits to 0s, we getChanging the last 5 bits to 0s, we get
01000000 or 64.
01000000 or 64.
o
o The network address is 167.199.170.64/27.The network address is 167.199.170.64/27.
Solution
Solution
Solution Solution
Subnetting
Subnetting
o
o We can also We can also use subuse subnettinettingng with with classlclasslessess
addressing addressing n
n Just increase the prefix length to derive the subnetJust increase the prefix length to derive the subnet prefix lengt
prefix lengthh
o
E
Exxample ample 14 14
E
Examplxampl e e 14 14
An organization is granted the block An organization is granted the block 130.34.12.64/26. The organization needs to have 130.34.12.64/26. The organization needs to have four subnets. What are the subnet addresses and four subnets. What are the subnet addresses and the range of addresses for each subnet?
o
o The suffix length is 6 (32-26).The suffix length is 6 (32-26). o
o This means the total number of addresses in theThis means the total number of addresses in the block is 6
block is 64 (2^6).4 (2^6).
o
o If we If we create four subnets, each subnet will have 16create four subnets, each subnet will have 16 addresses.
addresses.
o
o Let us first Let us first find the subnet prefix (subnet mask).find the subnet prefix (subnet mask). o
o We need four subnets, which means we need to addWe need four subnets, which means we need to add two more 1s to the site prefix.
two more 1s to the site prefix. Solution
Solution
Solution Solution
S
Soluolutition on (Co(Contintinunueed) d)
S
Soluolutition on (Co(Continti nunueed) d)
The subnet prefix is then /28.
The subnet prefix is then /28.
Subnet 1: 130.34.12.64/28 to 130.34.12.79/28. Subnet 1: 130.34.12.64/28 to 130.34.12.79/28. Subnet 2 : 130 Subnet 2 : 130.34.12.80/28 to 130.34.12.95/28..34.12.80/28 to 130.34.12.95/28. Subnet 3: 130.34.12.96/28 to 130.34.12.111/28. Subnet 3: 130.34.12.96/28 to 130.34.12.111/28. Subnet 4: 130.34.12.112/28 to 130.34.12.127/28. Subnet 4: 130.34.12.112/28 to 130.34.12.127/28.
See the Next Figure
Figure 5-15
Figure 5-15
E
E
Examplxample e 15 15
E
Examplxampl e e 15 15
An ISP is granted a block of addresses starting with An ISP is granted a block of addresses starting with 190.100.0.0/16. The ISP needs to distribute these 190.100.0.0/16. The ISP needs to distribute these addresses to three groups of customers as follows:
addresses to three groups of customers as follows:
1. The first group has 64 customers; each needs 256 addresses.
1. The first group has 64 customers; each needs 256 addresses.
2. The second group has 128 customers; each needs 128 addresses.
2. The second group has 128 customers; each needs 128 addresses.
3. The third group has 128 customers; each needs 64 addresses
3. The third group has 128 customers; each needs 64 addresses..
Design the
Design the subblocksubblockss and give and give the slasthe slash notatioh notation for eachn for each subblock. Find out how many addresses are still available subblock. Find out how many addresses are still available
Solution Solution Solution Solution Group 1 Group 1
For this group, each customer needs 256 addresses.
For this group, each customer needs 256 addresses.
This means the suffix length is 8 (2
This means the suffix length is 8 (288 == 256). The256). The
prefix length is then 32
prefix length is then 32 −− 88 == 24.24.
01: 190.100.0.0/24 01: 190.100.0.0/24 èè190.100.0.255/24190.100.0.255/24 02: 190.100.1.0/24 02: 190.100.1.0/24 èè190.100.1.255/24190.100.1.255/24 ……… ……….... 64: 190.100.63.0/24 64: 190.100.63.0/24èè190.100.63.255/24190.100.63.255/24 Total Total 6464 256256 16,38416,384
S
Soluolutition on (Co(Contintinunueed) d)
S
Soluolutition on (Co(Continti nunueed) d) Group 2
Group 2
For this group, each customer needs 128 addresses.
For this group, each customer needs 128 addresses.
This means the suffix length is 7 (2
This means the suffix length is 7 (277 == 128). The128). The
prefix length
prefix length is then 32is then 32 −− 77 == 25. The addresses are:25. The addresses are:
001: 190.100.64.0/25 001: 190.100.64.0/25 èè190.100.64.127/25190.100.64.127/25 002: 190.100.64.128/25 002: 190.100.64.128/25 èè190.100.64.255/25190.100.64.255/25 128: 190.100.127.128/25 128: 190.100.127.128/25 èè190.100.127.255/25190.100.127.255/25 Total Total == 128128 ×× 128128 == 16,38416,384
S
Soluolutition on (Co(Contintinunueed) d)
S
Soluolutition on (Co(Continti nunueed) d) Group 3
Group 3
For this group, each customer needs 64 addresses.
For this group, each customer needs 64 addresses.
This means the suffix length is 6 (2
This means the suffix length is 6 (266 == 64). The64). The
prefix length is then 32
prefix length is then 32 −− 66 == 26.26.
001 001:190.100.128.0/26:190.100.128.0/26 èè190.100.128.63/26190.100.128.63/26 002 002:190.100.128.64/26:190.100.128.64/26 èè190.100.128.127/26190.100.128.127/26 ……… ……… 128 128:190.100.159.192/26:190.100.159.192/26 èè190.100.159.255/26190.100.159.255/26
S
Soluolutition on (Co(Contintinunueed) d)
S
Soluolutition on (Co(Continti nunueed) d)
Number of granted addresses: 65,536
Number of granted addresses: 65,536
Number of allocated addresses: 40,960
Number of allocated addresses: 40,960
Number of available addresses: 24,576
Other Issues
Other Issues
o
o SupernettingSupernetting
n
n TherThere is no need for superne is no need for supernettiettingng in classin classlessless addressing
addressing
n
n If an If an organizatiorganization become larger on become larger
o
o It may ask a larger block and return the original oneIt may ask a larger block and return the original one
o
o Migration: when the idea of classlessMigration: when the idea of classless
addressing come true addressing come true n
n Organization that own class A, B, or C mustOrganization that own class A, B, or C must
o
o Use slash notation (/8, /16, /24)Use slash notation (/8, /16, /24) o