Week 5 - Network Layer Part -1
Week 5 - Network Layer Part -1
NETWORK LAYER
Course Handled By
Femilda Josephin
1
Network Layer Functionalities
■ The network layer, also known as the third layer of the OSI (Open Systems Interconnection) model,
is responsible for routing data packets between different networks.
■ Addressing: The network layer adds a logical network address to each packet, which helps in
identifying the source and destination networks of the packet.
■ Routing: The network layer uses routing algorithms to determine the best path for data packets
to travel from the source network to the destination network.
■ Fragmentation and reassembly: The network layer can break large packets into smaller ones to
facilitate transmission across networks with different maximum transmission unit (MTU) sizes. It
can also reassemble the fragments at the destination.
■ Error handling: The network layer provides error detection and handling mechanisms to ensure
that data packets are delivered correctly.
■ Congestion control: The network layer can use congestion control techniques to manage the
flow of data packets across networks to prevent congestion.
■ Quality of Service (QoS): The network layer can prioritize certain types of traffic (such as voice or
video) over others to ensure that they receive the necessary bandwidth and latency
requirements.
■ Interoperability: The network layer provides interoperability between different types of networks
and devices.
2
DELIVERY
■ The network layer supervises the handling of the packets by the underlying physical
networks. We define this handling as the delivery of a packet.
3
FORWARDING
■ Forwarding means to place the packet in its route to its destination.
■ Forwarding requires a host or a router to have a routing table.
■ When a host has a packet to send or when a router has received a packet to be
forwarded, it looks at this table to find the route to the final destination.
4
Route method versus next-hop method
5
Host-specific versus network-specific method
6
Default method
7
IP Addressing
■ IP addressing is the process of assigning unique logical addresses to devices on a
network using the Internet Protocol (IP).
■ An IP address is a 32-bit number (IPv4) or a 128-bit number (IPv6) that uniquely
identifies a device on a network.
– The address space of IPv4 is 232 (4,294,967,296)
– Notation.
■ Binary notation
■ Dotted-decimal notation
8
IPv4
■ 32 bits long
– An IPv4 address is a 32-bit address that uniquely and universally defines the
connection of a device (for example, a computer or a router) to the Internet.
– Two devices on the Internet can never have the same address at the same time
– Addressing system must be accepted by any host that wants to be connected to the
Internet.
9
IPV4
10
Example 1
Change
Change the
the following
following IPv4
IPv4 addresses
addresses from
from binary
binary
notation
notation to
to dotted-decimal
dotted-decimal notation.
notation.
SOLUTION
19.11
Example 2
SOLUTION
19.12
Types of addressing
■ Classful Addressing
■ Classless Addressing
Classful Addresing
13
Classful Addressing (cont’d)
⚫ Finding the class in decimal notation
14
Classful Addressing
■ In classful addressing, the address space is divided into five classes: A,
B, C, D, and E.
15
Classful Addressing – Class Range
16
Example 3
Solution
a. The first bit is 0. This is a class A address.
b. The first 2 bits are 1; the third bit is 0. This is a
class C
address.
c. The first byte is 14; the class is A.
d. The first byte is 252; the class is E. 19.17
Network Address
• The network address is the first address.
• The network address defines the network to the rest of the Internet.
• Given the network address, we can find the class of the address, the
block, and the range of the addresses in the block
• In classful addressing, the network address (the first address in the
block) is the one that is assigned to the organization.
18
Mask
■ A mask is a 32-bit binary number that gives the first address in the block (the
network address) when bitwise ANDed with an address in the block.
■ Masking concept
Mask (cont’d)
• AND Operation
If an IP address of 192.168.1.10 is assigned to a device, the default mask that will be assigned is
255.255.255.0, indicating that the first 24 bits of the IP address are used for the network portion and
the last 8 bits are used for the host portion.
IP address 162.168.10.77 -> Network address 162.168.0.0
21
Finding the Network Address
Given:
■ IP Address: 192.168.1.10
■ Subnet Mask: 255.255.255.0
Step 1
IP Address: 192.168.1.10 → 11000000.10101000.00000001.00001010
Subnet Mask: 255.255.255.0 → 11111111.11111111.11111111.00000000
Step 2
11000000.10101000.00000001.00001010
AND
11111111.11111111.11111111.00000000
-----------------------------------
11000000.10101000.00000001.00000000
Step 3
Convert Back to Decimal
Network Address = 192.168.1.0
22
Subnetting
■ Subnetting is the process of dividing a large network into smaller subnetworks, or
subnets.
Benefits of subnetting
■ Address space conservation: Subnetting allows us to break up a larger network into
smaller subnets, each with its own unique network ID.
■ Improved network performance: By dividing a larger network into smaller subnets,
we can reduce the amount of traffic on each subnet, which can help improve network
performance and reduce congestion.
■ Security: Subnetting can also help improve network security by allowing us to isolate
specific groups of users or devices on separate subnets, which can help limit the
spread of viruses, malware, and other security threats.
■ Scalability: Subnetting can help improve network scalability by allowing us to add or
remove subnets as needed, without having to reconfigure the entire network.
23
Subnetting - Steps
Step 1: Identify the Given IP Address and Subnet Mask
■ Example:IP Address: 192.168.1.10
■ Default Subnet Mask: 255.255.255.0 (Class C)
■ Assume we need 4 subnets, so we must borrow bits.
Step 2: Determine How Many Bits to Borrow
■ Formula to calculate the number of subnets:
■ 2𝑛 ≥ Required Subnets
■ n is the number of borrowed bits.
■ For 4 subnets:22=4(We need to borrow 2 bits)
Step 3: Calculate the New Subnet Mask
■ Default Class C subnet mask: 255.255.255.0
■ Borrow 2 bits from the host portion:
■ Default: 11111111.11111111.11111111.00000000 (255.255.255.0)
■ New: 11111111.11111111.11111111.11000000 (255.255.255.192)
■ New subnet mask: 255.255.255.192
■ Subnet increment (Block size): 256 - 192 = 64
24
Subnetting - Steps
Step 4: Find the Subnet Ranges
■ The subnets are calculated using the block size (64):
■192.168.1.0 → First Subnet (Network Address)
■192.168.1.64 → Second Subnet
■192.168.1.128 → Third Subnet
■192.168.1.192 → Fourth Subnet
■ Broadcast addresses (one less than the next subnet):
■192.168.1.63 → Broadcast for first subnet
■192.168.1.127 → Broadcast for second subnet
■192.168.1.191 → Broadcast for third subnet
■192.168.1.255 → Broadcast for fourth subnet
25
Subnetting - Steps
26
Fixed Length Subnet Mask (FLSM)
Watch This
https://youtu.be/Grdx7t8egQg
27
Classless Addressing
■ Classless addressing, also known as Classless Inter-Domain Routing (CIDR)
■ Allows for more flexible allocation of IP addresses than the original class-based
addressing scheme
■ Classless addressing resulted in inefficient use of IP address space
■ With CIDR, an IP address is divided into two parts: the network prefix and the host
identifier. The network prefix can be of any length, allowing for more flexibility in
the allocation of IP addresses.
■ CIDR notation is used to represent IP addresses with variable-length subnet masks,
using a slash (/) followed by the number of bits in the network prefix.
■ For example, the CIDR notation for the IP address 192.168.1.0 with a subnet mask
of 255.255.255.0 would be 192.168.1.0/24, indicating that the first 24 bits of the IP
address are used for the network prefix.
■ CIDR has become the standard method of assigning IP addresses and is widely used
in modern networks.
28
Finding First address or Network Address
■ In IPv4 addressing, a block of addresses can be defined as x.y.z.t /n in which x.y.z.t defines
one of the addresses and the /n defines the mask.
■ The first address in the block can be found by setting the rightmost 32 − n bits to 0s.
Solution
The binary representation of the given address is
11001101 00010000 00100101 00100111
If we set 32−28 rightmost bits to 0, we get
11001101 00010000 00100101 0010000
or
205.16.37.32. 29
Finding Last address or Broadcast Address
The last address in the block can be found by setting the rightmost
32 − n bits to 1s.
Solution
The binary representation of the given address is
11001101 00010000 00100101 00100111
If we set 32 − 28 rightmost bits to 1, we get
11001101 00010000 00100101 00101111
or
205.16.37.47
30
Finding the number of addresses
The number of addresses in the block can be found by using the formula
232−n.
Solution
The value of n is 28, which means that number
of addresses is 2 32−28 or 16.
31
Finding the network address
■ What is the network address if one of the addresses is
167.199.170.82/27
Solution
■ The prefix length is 27, which means that we must keep the first 27 bits
as is and change the remaining bits (5) to 0s.
■ The 5 bits affect only the last byte. The last byte is 01010010. Changing
the last 5 bits to 0s, we get 01000000 or 64.
■ The network address is 167.199.170.64/27.
32
Variable Length Subnet Mask(VLSM)
Subnet with requirements shown?
VLSM stands for Variable-Length Subnet Masking. It is a technique used in computer
networking to divide an IP network into smaller subnets of different sizes, according to the
specific needs of the network.
33
Variable Length Subnet Mask (VLSM) Subnetting - Example
34
Variable Length Subnet Mask (VLSM) Subnetting - Example
35
Variable Length Subnet Mask (VLSM) Subnetting - Example
36
Variable Length Subnet Mask (VLSM) Subnetting - Example
37
Variable Length Subnet Mask(VLSM)
Watch This
https://youtu.be/dACOaMOE98Q
38
Static Routing
39