0% found this document useful (0 votes)
3 views

Week 5 - Network Layer Part -1

The document covers the functionalities of the network layer in the OSI model, including routing, addressing, fragmentation, error handling, and congestion control. It discusses IP addressing, including IPv4 and classful/classless addressing, subnetting, and variable-length subnet masks (VLSM). Additionally, it highlights the importance of subnetting for network performance, security, and scalability.

Uploaded by

tayfuncebec602
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Week 5 - Network Layer Part -1

The document covers the functionalities of the network layer in the OSI model, including routing, addressing, fragmentation, error handling, and congestion control. It discusses IP addressing, including IPv4 and classful/classless addressing, subnetting, and variable-length subnet masks (VLSM). Additionally, it highlights the importance of subnetting for network performance, security, and scalability.

Uploaded by

tayfuncebec602
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 39

WEEK 5

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.

■ Unique and Universal.

– 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

Change the following IPv4 addresses from dotted-


decimal notation to binary notation.

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

Find the class of each address.


a. 00000001 00001011 00001011 11101111
b. 11000001 10000011 00011011 11111111
c. 14.23.120.8
d. 252.5.15.111

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

• The network address is the beginning address of each block.


• It can be found by applying the default mask to any of the addresses in the block
(including itself).
• It retains the netid of the block and sets the hostid to zero.
Default Masks

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

Step 5: Identify Host Ranges


■ Each subnet has usable IPs between the network and broadcast address:

Step 6: Verify Total Usable Hosts


■ Formula:
■ 2ℎ−2=Usable Hosts per subnet
■ where h is the remaining host bits
■ In this case: Remaining host bits = 6 (since we borrowed 2 bits)
■ 26−2=64−2=62 usable hosts per subnet

26
Fixed Length Subnet Mask (FLSM)

■ Each subnet has the same subnet mask.


■ All subnets have the same number of hosts.
■ The subnets are evenly distributed across the network.

Note: The previous 3 slides are an example of FLSM calculations

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.

A block of addresses is granted to a small organization. We know that one of


the addresses is 205.16.37.39/28. What is the first address in the block?

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.

Find the last address for the block in 205.16.37.39/28.

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.

Find the number of addresses in 205.16.37.39/28.

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

■ Unlike Fixed-Length Subnet Masking (FLSM), VLSM (Variable-Length Subnet


Masking) allows different subnet masks for different subnetworks, optimizing IP
address allocation.
■ Scenario:We have a Class C network 192.168.1.0/24 and need to divide it into
subnets for different departments with varying host requirements:

34
Variable Length Subnet Mask (VLSM) Subnetting - Example

Step 1: Arrange the Subnets in Descending Order of Hosts


We allocate subnets from largest to smallest to avoid IP wastage.
1. Servers → 50 hosts
2. HR → 25 hosts
3. IT → 10 hosts
4. Admin → 5 hosts

35
Variable Length Subnet Mask (VLSM) Subnetting - Example

Step 2: Allocate Subnet Masks Based on Host Requirements


■ Formula for calculating usable hosts::
■ 2ℎ−2=Usable Hosts per subnet
■ where h is the remaining host bits

36
Variable Length Subnet Mask (VLSM) Subnetting - Example

■ Step 3: Assign Subnets to Each Department

Step 4: Remaining IPs


■ The total network was 192.168.1.0/24 (256 IPs), and we've used only part of it.
■ The remaining IPs (192.168.1.120 - 192.168.1.255) can be used for future
expansion or other purposes.

37
Variable Length Subnet Mask(VLSM)

Watch This
https://youtu.be/dACOaMOE98Q

38
Static Routing

■ Watch this video


■ https://youtu.be/P28ttP3MRuw?si=5IhkVrC1UG5bE1Rj

39

You might also like