Академический Документы
Профессиональный Документы
Культура Документы
2
Classless Addressing
Subnetting and supernetting in classful
addressing did not really solve the address
depletion problem.
With the growth of the Internet, it was clear
that a larger address space was needed as
a long-term solution.
Although the long-range solution IPv6 has
already been devised, a short-term solution
was also devised to use the same address
space but to change the distribution of
addresses to provide a fair share to each
organization. 3
Classless Addressing use:
another reason
Individuals or small companies need
small number of addresses, such as 2 to
16
256 class C addresses will be too much
for them
ISPs provide Internet access for
individuals and small businesses by
subdividing a large range of addresses
in groups of 2, 4, 8, 16 and so on using
classless addressing
4
Classless InterDomain Routing
(CIDR):
Variable
Length Blocks
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.
We can have a block of 1 address, 2 addresses, 4
addresses, 128 addresses, and so on.
5
CIDR Prefix lengths
Format of CIDR: x.y.z.t/n,
where n is the number of 1s in the mask
6
Mask for classless
addressing
Masks for classful addressing are
implicit
255.0.0.0 (/8) for Class A
255.255.0.0 (/16) for Class B
255.255.255.0 (/24) for Class C
In classless addressing the address
must be accompanied by mask
7
Variable Length
Subnetting
Example: A site has a class C address
and wants 5 subnets with sizes 60, 60,
60, 30 and 30 hosts, respectively.
Normal subnetting wont work 2 choices
s=2 4 subnets of 62
s=3 8 subnets of 30
Solution: Different subnet masks can
be applied at different router ports to
maximum IP address use
8
Variable Length
Subnetting
Solution: Variable Length Subnetting
allows us to
Use s=2 subnet mask (255.255.255.192)
for 3 subnets, 62 hosts each
Further subdivide the unused addresses by
using s=3 subnet mask (255.255.255.224)
for 2 subnets of 30 hosts each
9
10
Restrictions on blocks
Number of addresses (including
special addresses) must be a
power of 2.
First address must be evenly
divisible by the number of
addresses
There must be n zeros in the host id
portion for a block of 2n addresses.
11
Example
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
Solution
Only two are eligible (a and c). The address
205.16.37.32 is eligible because 32 is
divisible by 16. The address 17.17.33.80 is
eligible because 80 is divisible by 16.
12
Example
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
Solution
In this case, the right-most byte must be 0.
As we mentioned earlier, the IP addresses
use base 256 arithmetic. When the right-
most byte is 0, the total address is divisible
by 256. Only two addresses are eligible
13 (b
Example 3
Solution
Next Figure shows the solution. The first, second,
and fourth bytes are easy; for the third byte we
keep the bits corresponding to the number of 1s in
that group. The first address is 140.120.80.0/20.
16
Example 5
17
Example 7
Solution
The prefix length is 20. The number of addresses in
the block is 23220 or 212 or 4096. Note that
this is a large block with 4096 addresses.
18
Example 8
Solution
We found in the previous examples that the first
address is 140.120.80.0/20 and the number of
addresses is 4096. To find the last address, we
need to add 4095 (4096 1) to the first address.
19
Example 8 (Continued)
21
Example 10
Solution
We follow the procedure in the previous examples to find the
first address, the number of addresses, and the last address.
To find the first address, we notice that the mask (/29) has five
1s in the last byte (11111111 11111111 1111111 11111000).
So we write the last byte as powers of 2 and retain only the
leftmost five as shown in next slide:
22
Example 10 (Continued)
202 128 + 64 + 0 + 0 + 8 + 0 + 2 + 0
The leftmost 5 numbers are 128 + 64 + 0 + 0 + 8 =200
The first address is 190.87.140.200/29
The number of addresses is 23229 or 8.
To find the last address, we use the complement
of the mask. The mask has twenty-nine 1s; the
complement has three 1s. The complement is
0.0.0.7.
If we add this to the first address, we get
190.87.140.207/29. In other words, the first
address is 190.87.140.200/29, the last address is
23
190.87.140.207/29. There are only 8 addresses in
Example 11
Noteworthy points -
In classless addressing,
the last address in the
block does not
necessarily end in 255.
In CIDR notation, the
block granted is defined
25
by the first address and
Variable Length
Subnetting
In fixed-length subnetting, the
number of subnets is a power of 2.
Whereas, in variable length
subnetting, when an organization
is granted a block of addresses, it
can create subnets to meet its
needs.
The prefix length increases to
define the subnet prefix length.
26
Example
5.32
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.
27
Example
5.32
28
Example 5.32
29
Example 5.32 (Continued)
30
Example 5.32 (Continued)
32
Another Example
36
We need 4 bits for addresses
Another Example (2^4=16)
Add 1 more bit to the mask (/28)
Use 11000000 (192) to 11100000
(224) for 3 subnets with 16
addresses each
Subdivide the rest into subnets
We need 5 bits for addresses
with less addresses
(2^5=32)
We need 2 bits for addresses Add 1 more bit to the mask (/27)
(2^2=4) Use 10000000 (128) and 10100000
Add 2 more bits to the mask (/30) (160) for 2 subnets with 32 addresses
Use 11110000 (240) to 11111100 each
(252) for 4 subnets with 4 addresses Subdivide the rest into subnets
each with less addresses
38
Example 5.34 cont.
39
Example 5.34
Add 1 more bit to the mask (/28)
Use 10100000 (160) and 10110000 (176)
for
2 subnets with 16 addresses
- (160 for nw, 161 to 174 for hosts, 175 for
broadcast) for one
- (176 for nw, 177 to 190 for hosts, 191 for
broadcast) for the other
40
Example 5.34 (Continued)
41
Example 5.34 (Continued)
42
Example 5.34 (Continued)
44
Example
5.35
45
Example 5.35 (Continued)
Group 1
For this group, each of 64 customers needs 256
addresses. This means the suffix length is 8 (28
=256). The prefix length is then 32 8 = 24. The
addresses are:
1st address Last address
1st Customer 190.100.0.0/24 190.100.0.255/24
2nd Customer 190.100.1.0/24 190.100.1.255/24
...
64th Customer 190.100.63.0/24 190.100.63.255/24
Total = 64 256 = 16,384
46
Example 5.35 (Continued)
Group 2
For this group, each of 128 (2x64) customers needs
128 addresses. This means the suffix length is 7 (27
=128). The prefix length is then 32 7 = 25. The
addresses are:
1st address Last address
1st Customer 190.100.64.0/25 190.100.64.127/25
256 addresses
divided among
2nd Customer
2 customers 190.100.64.128/25 190.100.64.255/25
3rd Customer 190.100.65.0/25 190.100.65.127/25
Group 3
For this group, each of the 128 (4x32) customers
needs 64 addresses. This means the suffix length is
6 (26 = 64). The prefix length is then 32 6 = 26.
The addresses
1st Customer are:
190.100.128.0/26
256 addresses
190.100.128.63/26
2nd Customer 190.100.128.64/26 190.100.128.127/26
divided among
3rd Customer 4 customers
190.100.128.128/26 190.100.128.191/26
4th Customer 190.100.128.192/26 190.100.128.255/26
49
50
Exercise
An ISP is granted a block of addresses starting with
220.45.39.0/24 (256 addresses). The ISP needs to
distribute these addresses to two groups of customers
as follows:
a. The first group has 4 customers; each needs 32
addresses.
b. The second group has 4 customers; each needs 16
addresses.