You are on page 1of 17

Classless IP Addressing

Version 4.0 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 1
Classless inter-domain routing (CIDR)
CIDR notation is a notation that is used in classless IP addressing and it
represents a given IP address as x.y.z.t/n. Where x.y.z.t defines one of the
addresses. And the /n defines the mask.
In classless addressing variable-length blocks are assigned that belong to no
class. In this architecture, the entire address space (2^32 addresses) is divided
into blocks of different sizes.
Each address in a block can be considered as a two-level hierarchy structure:
The left most ‘n’ bits(the prefix) define the network and the right most
32-n bits (the suffix)define the various hosts in the network.

© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 2


CIDR(continued…)

 In CIDR notation, the block granted is defined by the first address and
the prefix length.

© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 3


Restrictions on Classless address blocks

 To simplify the handling of addresses , the Internet authorities imposed three


restrictions on classless address blocks:
1. The address in a block must be contiguous
2. The number of addresses in a block must be in powers of 2
3. The first address must be evenly divisible by the number of addresses

Classless address block

206.160.35.64/28

206.160.35.65/28

206.160.35.79/28

© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 4


Table1 Prefix lengths

Classful addressing is a special case of classless addressing.

© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 5


Questions

1. Which of the following can be the beginning address of a block that contains 16
addresses?
A.205.16.37.32 B. 190.16.42.44 C. 17.17.33.80 D. 123.45.24.52
2. Which of the following can be the beginning address of a block that contains
256 addresses?
A.205.16.37.32 B. 190.16.42.0 C. 17.17.32.0 D. 123.45.24.52
3. Which of the following can be the beginning address of a block that contains
1024 addresses?
A.205.16.37.32 B. 190.16.42.0 C. 17.17.32.0 D. 123.45.24.52

© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 6


The first address , the last address and the number of
addresses in a block
 Given an IP address block 206.160.35.39/28
1. Find the first address ?
2. Find the last address?
3. Find the number of addresses in the block
 Solution:
1. The first address of a given block can be found by setting the right most 32-
n bits to zeros. In this case n is 28 . 32 – 28 = 4. So we should find the
binary equivalent of 39 and set the last 4 bits to 0. 39 = 00100111.Setting
the bits in red to zero.=00100000 = 32.Then the first address is
206.160.35.32
Question: apply the mask to find the first address .

© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 7


The first address , the last address and the number of
addresses in a block (continued…)

 Solution:
2.The last address of a given block can be found by setting the right most 32-n
bits to 1s.In this case n is 28 . 32 – 28 = 4. So we should find the binary
equivalent of 39 and set the last 4 bits to 1s. 39 = 00100111.Setting the bits
in red to 1s.=00101111 = 47.Therefore the last address is 206.160.35.47
Note: it is also possible to find the last address by ORing the given IP
address with the complement of the mask. Find the last address using this
method.
3.The number of addresses in a block can be found by using the formula 2^32-
n.In this case n is 28. So 2^32-28 = 2^4 = 16.
Note: it is also possible to find the number of addresses in a given block by
complementing the mask converting it into decimal and adding one .

© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 8


Exercise

 Find the first address ,the last address and the number of addresses for the
following blocks of IP addresses:
A. 140.120.84.24/20
B. 190.87.140.202/29
C. 10.200.24.0/22

© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 9


Sub-netting in classless addressing

 When an organization is granted a large block of addresses, it can create subnets


to meet its needs by dividing its addresses among its subnets.
 During sub-netting the prefix length increases to define the subnet prefix length
 In fixed-length sub-netting, the number of subnets is a power of 2.
 Example 1:
 An organization is granted the block 130.34.12.64/26. The organization needs 4
subnets. Find the subnet prefix length, the subnet addresses and the range of
addresses in each subnet?
 Solution
We need 4 subnets, which means we need to add two more 1s (log2 4 = 2) to the
site prefix. The subnet prefix is then /28.

© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 10


Sub-netting in classless addressing(continued…)

 The site has 232−26 = 64 addresses. Each subnet has 232–28 = 16 addresses. Now let
us find the first and last address in each subnet.
 1. The first address in the first subnet is 130.34.12.64/28, using the procedure the
we saw in the previous examples. Note that the first address of the first subnet is
the first address of the block. The last address of the subnet can be found by
adding 15 (16 −1) to the first address. The last address is 130.34.12.79/28.
 2.The first address in the second subnet is 130.34.12.80/28; it is found by adding
1 to the last address of the previous subnet. Again adding 15 to the first address,
we obtain the last address, 130.34.12.95/28.

© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 11


Sub-netting in classless addressing(continued…)

 3. Similarly, we find the first address of the third subnet to be 130.34.12.96/28


and the last address to be 130.34.12.111/28.
 4. Similarly, we find the first address of the fourth subnet to be 130.34.12.112/28
and the last to be 130.34.12.127/28.

© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 12


Sub-netting in classless addressing(continued…)

 Example 2:
 An organization is granted a block of addresses with the beginning address
14.24.74.0/24. There are 232−24= 256 addresses in this block. The organization
needs to have 11 subnets as shown below:
a. two subnets, each with 64 addresses.
b. two subnets, each with 32 addresses.
c. three subnets, each with 16 addresses.
d. four subnets, each with 4 addresses.
 Design the subnets.

© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 13


Sub-netting in classless addressing(continued…)

 Solution:
 1. We use the first 128 addresses for the first two subnets, each with 64 addresses.
Note that the mask for each subnet is /26. The subnet address for each subnet is
given in the figure in the next slide.
 2. We use the next 64 addresses for the next two subnets, each with 32 addresses.
Note that the mask for each network is /27. The subnet address for each subnet is
given in the figure in the next slide.
 3. We use the next 48 addresses for the next three subnets, each with 16
addresses. Note that the mask for each network is /28. The subnet address for
each subnet is given in the figure in the next slide.
 4. We use the last 16 addresses for the last four subnets, each with 4 addresses.
Note that the mask for each network is /30. The subnet address for each subnet is
given in the figure in the next slide.

© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 14


Sub-netting in classless addressing(continued…)

© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 15


Exercise

 Assume MIT has three campuses: Ainalem,Elala, and Hakfen. The


Ainalem campus is connected to the Elala and Hakfen campuses via
private, point-to-point WAN lines. MIT is granted a block of 1024
addresses with the beginning address 170.102.32.0/22. The management
has decided to allocate 128 addresses for the Elala campus and divide the
rest of addresses between the two campuses. Design the subnets for
campuses of MIT and show the subnets addresses for each campus. Use
appropriate diagram to clarify your answer.

© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 16


End of slides

ANY QUESTION?

© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 17

You might also like