Network Layer - Part 2

Download as pdf or txt
Download as pdf or txt
You are on page 1of 24

NETWORK LAYER

#Continue….

By
Abdul Ghofir, M.Kom
Ref: Forouzan, Data Communications and Networking
Classless Addressing
Hierarchy

1. Two-Level Hierarchy: No Subnetting


• An IP address can define only two levels of hierarchy when not subnetted.
• The n leftmost bits of the address x.y.z.t/n define the network
(organization network); the 32 – n rightmost bits define the particular host
(computer or router) to the network.
• The two common terms are prefix and suffix.
➢ The part of the address that defines the network is called the prefix
➢ The part that defines the host is called the suffix.
Two levels of hierarchy in an IPv4 address
Classless Addressing
Hierarchy

Each address in the block can be considered as a two-level


hierarchical structure:
the leftmost n bits (prefix) define
the network;
the rightmost 32 − n bits define
the host.
Classless Addressing
Hierarchy

2. Three-Levels of Hierarchy: Subnetting


• An organization that is granted a large block of addresses may want to
create clusters of networks (called subnets) and divide the addresses
between the different subnets.
• The organization, however, needs to create small subblocks of addresses,
each assigned to specific subnets.
• The organization has its own mask; each subnet must also have its own.
Classless Addressing
Hierarchy
➢As an example, suppose an organization is given the block
17.12.14.0/26, which contains 64 addresses. The organization has three
offices and needs to divide the addresses into three sub blocks of 32, 16,
and 16 addresses. We can find the new masks by using the following
arguments:
1. Suppose the mask for the first subnet is n1, then 232-n must be 32, which
means that n1 =27.
2. Suppose the mask for the second subnet is n2, then 232-n must be 16, which
means that n2 = 28.
3. Suppose the mask for the third subnet is n3, then 232-n must be 16, which
means that n3 =28.
This means that we have the masks 27, 28, 28 with the organization mask being
26.
Configuration and addresses in a subnetted network
Let us check to see if we can find the subnet addresses from one of
the addresses in the subnet.

a. In subnet 1, the address 17.12.14.29/27 can give us the subnet


address if we use the mask /27 because:
Host : 00010001 00001100 00001110 00011101
Mask : /27
Subnet : 00010001 00001100 00001110 00000000
(17.12.14.0)
Let us check to see if we can find the subnet addresses from one of
the addresses in the subnet.

b. In subnet 2, the address 17.12.14.45/28 can give us the subnet


address if we use the mask /28 because:
Host : 00010001 00001100 00001110 00101101
Mask : /28
Subnet : 00010001 00001100 00001110 00100000
(17.12.14.32)
Let us check to see if we can find the subnet addresses from one of
the addresses in the subnet.

c. In subnet 3, the address 17.12.14.50/28 can give us the subnet


address if we use the mask /28 because:
Host : 00010001 00001100 00001110 00110010
Mask : /28
Subnet : 00010001 00001100 00001110 00110000
(17.12.14.48)
Three-level hierarchy in an IPv4 address
Example 1

An ISP is granted a block of addresses starting with 190.100.0.0/16


(65,536 addresses). The ISP needs to distribute these addresses to
three groups of customers as follows:
a. The first group has 64 customers; each needs 256
addresses.
b. The second group has 128 customers; each needs 128
addresses.
c. The third group has 128 customers; each needs 64
addresses.
Design the subblocks and find out how many addresses are still
available after these allocations.
Solution

Group 1
For this group, each customer needs 256 addresses. This means that 8 (2log
256) bits are needed to define each host. The prefix length is then 32 − 8 =
24. The addresses are:
Solution

Group 2
For this group, each customer needs 128 addresses. This means that 7 (2log
128) bits are needed to define each host. The prefix length is then 32 − 7
= 25. The addresses are:
Solution

Group 3
• For this group, each customer needs 64 addresses. This means that 6 (2log
64) bits are needed to each host. The prefix length is then 32 − 6 = 26. The
addresses are:
Solution

Number of granted addresses to the ISP: 65,536


Number of allocated addresses by the ISP: 40,960
Number of available addresses: 24,576
An example of address allocation and distribution by an ISP
Network Address Translation (NAT)

• NAT enables a user to have a large set of addresses internally and


one address, or a small set of addresses, externally.
• To separate the addresses used inside the home or business and
the ones used for the Internet, the Internet authorities have
reserved three sets of addresses as private addresses.
Addresses for private networks
A NAT implementation
Addresses in a NAT
NAT address translation
Task

An ISP is granted a block of addresses starting with 150.80.0.0/16.


The ISP wants
to distribute these blocks to 2600 customers as follows.
a) The first group has 200 medium-size businesses; each needs 128
addresses.
b) The second group has 400 small businesses; each needs 16
addresses.
c) The third group has 2000 households; each needs 4 addresses.
Design the subblocks and give the slash notation for each subblock.
Find out how many addresses are still available after these
allocations.
THANK YOU

You might also like