Chapter 5 Network Layer
Chapter 5 Network Layer
Binary Number 1 1 0 0 0 0 0 0
(11000000)
Calculate 1x128 1x64 0x32 0x16 0x8 0x4 0x2 0x1 192
Add Them Up… 128 + 64 +0 +0 +0 +0 +0 +0
Binary Number 1 0 1 0 1 0 0 0
(10101000)
168
Calculate 1x128 0x64 1x32 0x16 1x8 0x4 0x2 0x1
Binary Number 0 0 0 0 1 0 1 1
(00001011) 11
Calculate 0x128 0x64 0x32 0x16 1x8 0x4 1x2 1x1
Binary Number 0 0 0 0 1 0 1 0
(00001010) 10
Calculate 0x128 0x64 0x32 0x16 1x8 0x4 1x2 0x1
01/23/2025
Add Them Up… 0 +0 +0 +0 +8 +0 +2 +0
192.168.11.10
Subnetting
Subnetting is a process of dividing or segmenting a
network into smaller networks called subnets.
A subnet or a subnetwork is a segmented piece of a larger
network.
If an organization was granted a large block in class A or
B, it could divide the addresses into several contiguous
groups and assign each group to smaller networks (called
subnets).
or, in rare cases, share part of the addresses with
neighbors.
Reasons for Subnetting
Large networks need to be segmented into smaller sub-
networks, creating smaller groups of devices and
services in order to:
Control traffic by containing broadcast traffic within
subnetwork
Reduce overall network traffic and improve network
performance
Communication Between Subnets
A router is necessary for devices on different networks and
subnets to communicate.
Each router interface must have an IPv4 host address that
belongs to the network or subnet that the router interface is
connected to.
Devices on a network and subnet use the router interface
attached to their LAN as their default gateway.
Subnetting cont..
Networks are most easily subnetted at the octet boundary of /8,
/16, and /24.
Notice that using longer prefix lengths decreases the number of
hosts per subnet.
Cont..
Example IP Address 192.168.5.85
This address is a class C address. Its default subnet mask is
255.255.255.0.
Or it could be written as 192.168.5.85/24. this shows 24 bits are
network portion.
Binary of 192.168.5.85 and 255.255.255.0 are
11000000.10101000.00000101.01010101
11111111.11111111.11111111.00000000
By Anding these two, we get
11000000.10101000.00000101.00000000 = 192.168.5.0
This is the network address and 192.168.5.255 is the broadcast
address.
192.168.5.1 - 192.168.5.254 will be the usable host address range.
Cont..
Formulas for Subnet Calculation
Possible Number of Subnets
To calculate the number of possible subnets, use the formula 2 n,
where n equals the number of host bits borrowed.
For example, if three host bits are borrowed, then n=3.
Subnet 0 Subnet 1
Network 192.168.1.0-127/25 Network 192.168.1.128-
Mask: 255.255.255.128 255/25
Mask: 255.255.255.128
Cont..
192.168.1.0/25
Subnet 0
Network 192.168.1.0-
127/25
Subnet 1
Network 192.168.1.128-
255/25
Cont..
It is important to balance the number of subnets needed and
the number of hosts required for the largest subnet.
Design the addressing scheme to accommodate the
maximum number of hosts for each subnet.
Allow for growth in each subnet.
Cont..
Example
Number of needed subnets 14
Number of needed usable hosts 10
Network Address 192.10.10.0
No of subnets 2n = 24 = 16
No of hosts 2h = 24 = 16
No of usable hosts = no of hosts – 2 = 16 -2 = 14
Network id usable host range broadcast address
Subnet 1-> 192.10.10.0 192.10.10.1-192.10.10.14
192.10.10.15
Subnet 2-> 192.10.10.16 192.10.10.17-192.10.10.30
192.10.10.31
Subnet 3-> 192.10.10.32 192.10.10.33-192.10.10.46
192.10.10.47
Subnet 4-> 192.10.10.48 192.10.10.49-192.10.10.62
192.10.10.63
Cont..
Subnet 5-> 192.10.10.64 192.10.10.65-192.10.10.78 192.10.10.79
Subnet 6-> 192.10.10.80 192.10.10.81-192.10.10.94 192.10.10.95
Subnet 7-> 192.10.10.96 192.10.10.97-192.10.10.110 192.10.10.111
Subnet 8-> 192.10.10.112 192.10.10.113-192.10.10.126 192.10.10.127
Subnet 9-> 192.10.10.128 192.10.10.129-192.10.10.142 192.10.10.143
Subnet 10-> 192.10.10.144 192.10.10.145-192.10.10.158 192.10.10.159
Subnet 11-> 192.10.10.160 192.10.10.161-192.10.10.174 192.10.10.175
Subnet 12-> 192.10.10.176 192.10.10.177-192.10.10.190 192.10.10.191
Subnet 13-> 192.10.10.192 192.10.10.193-192.10.10.206 192.10.10.207
Subnet 14-> 192.10.10.208 192.10.10.209-192.10.10.222 192.10.10.223
Subnet 15-> 192.10.10.224 192.10.10.225-192.10.10.238 192.10.10.239
Subnet 16-> 192.10.10.240 192.10.10.241-192.10.10.254 192.10.10.255
Subnetting Based on Host
Requirements
There are two considerations when planning subnets:
Number of Subnets required
Number of Host addresses required
To Calculate number of subnets
Formula 2n (where n is the number of bits borrowed)
Subnet needed for each department in graphic
Example
You have been given the network
address 192.168.10.0/25 by your customer. Based
on this information, answer the ff questions.
1) Find the subnet mask?
2) Find the total number of network can be created?
3) Find the total number of IP address on each
network?
4) Find the total number of host on each network?
5) Find the first usable host IP address and the last
usable host IP address on each network?
Solution:-
Number of network: 2n
Total number of bits borrowed from host)
21=2
Number of IP add on each network: 2n
Total number of host bits)
27=128
Number of hosts on each network: 2n-2
Total number of remaining host bits)
27-2=126
Exercise
You have been given the network address 192.168.10.0/28
from EthioTelecom. Based on this information, answer the
following questions.
1) Find the subnet mask?
2) Find the total number of network can be created?
3) Find the total number of IP address on each network?
4) Find the total number of host on each network?
5) Find the first usable host IP address and the last usable
host IP address on each network?
Cont..
Traditional Subnetting Wastes Addresses
Traditional subnetting - same number of addresses
is allocated for each subnet.
Subnets that require fewer addresses have unused
(wasted) addresses.
Variable Length Subnet Mask (VLSM) or
subnetting a subnet provides more efficient use of
addresses.
Variable Length Subnet
Masks (VLSM)
VLSM allows a network space to be divided in
unequal parts.
Subnet mask will vary depending on how many
bits have been borrowed for a particular subnet.
Network is first subnetted, and then the subnets
are subnetted again.
Process repeated as necessary to create subnets of
various sizes.
Using VLSM subnets, the network segments can
be addressed with minimum waste.
Example
192.168.1.0/24 IP
Address.
Subnet 1 = 28 hosts
Subnet 2 = 52 hosts
Subnet 3 = 15 host
Subnet 4 = 5 hosts
Cont..
To overcome this Subnetting issue, firstly we determine
the host bits for each subnet.
For the first subnet; we need 5 host bits. With 5 bits we
can have 25=32 addresses. This means that there are 32-2
usable host addresses.
For the second subnet; we need 6 host bits. With 6 bits we
can have 26=64 addresses. This means that there are 64-2
usable host addresses.
For the third subnet; we need 5 host bits. With 5 bits we
can have 25=32 addresses…
For the fourth subnet; we need 3 host bits. With 3 bits we
can have 23=8 addresses. This means that there are 8-2
usable host addresses.
Cont..
If we use /26 with 192.168.1.0 like 192.168.1.0/26, then we
will have 4 subnets. The given Subnet was 24 and our new
subnet is 26. 26-24=2 and 22=4 subnets.
192.168.1.0/26
192.168.1.64/26
192.168.1.128/26
192.168.1.192/26
We will use the first one for the Subnet 2. (192.168.1.0/26)
Now, for the first and third subnet, let’s use the second
block (192.168.1.64/26) and divide it again.
If we divide it by borrowing a bit again, then we will have
two subnets.
192.168.1.64/27
192.168.1.96/27
Cont..
We can use these two Prefixes for first and second subnet.
And lastly, for the small subnet, we can use the above third
block(192.168.10.128/26).
We will divide it again.
Because we need only 5 host address.
When we divide again, we will have the below small subnets,
and we can use the first one for our fourth and last Subnet.
192.168.1.128/29
192.168.1.136/29
192.168.1.144/29
192.168.1.152/29
192.168.1.160/29
192.168.1.168/29
192.168.1.176/29
192.168.1.184/29
Cont..
we have used our IP Block very efficiently. The unused
remaining blocks can be used in the future. What are
these remaining blocks let’s remember. The remaining
blocks are the last block of /26 subnets and the last 7
block of /29 subnets.
At the end our subnets will be like below:
192.168.1.0/26
192.168.1.64/27
192.168.1.96/27
192.168.1.128/29
Classless Addressing
Formal name is Classless Inter-Domain Routing (CIDR,
pronounced “cider.
Created a new set of standards that allowed service providers
to allocate IPv4 addresses on any address bit boundary
(prefix length) instead of only by a class A, B, or C address.
CIDR or Classless Inter Domain Routing provides the
flexibility of borrowing bits of Host part of the IP address
and using them as Network in Network, called Subnet.
Eg.
190.79.18.70/18
This address is a traditional class B and its default subnet
mask is 255.255.0.0. but it has 18 network bits that are all 1.
therefore the subnet mask will be 255.255.192.0.
Supernetting
It is inverse of subnetting
Combining of multiple networks to single networks
Converting network bits to hosts bits i.e. converting 1’s into 0’s
It is also known as classless inter domain routing(CIDR)
Benefit of supernetting
Reduce the network traffic
To minimize the routing table
Steps:
Write all numbers in binary
Find matching bits left to write upto match
Write them upto match and 0 upto end (New Network ID)
Make all 1 upto match and zero upto end (New Mask)
Example
192.168.0.0/24
192.168.1.0/24
192.168.2.0/24
192.168.3.0/24
Step 1 and 2
11000000.10101000.00000000.00000000
11000000.10101000.00000001.00000000
11000000.10101000.00000010.00000000
11000000.10101000.00000011.00000000
Step 3
11000000.10101000.00000000.00000000
192.168.0.0 (New Network ID)
Step 4
11111111.11111111.11111100.00000000
255.255.252.0 (New Mask ID)