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

week 5 6

The document discusses the network layer of the OSI model, highlighting its role in routing, addressing, and delivering packets across networks. Key protocols such as ARP, RARP, IPv4, and IPv6 are examined, along with their functions and importance in network communication. It emphasizes the transition to IPv6 to address scalability and security challenges in modern networking.

Uploaded by

haq4ibtisam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

week 5 6

The document discusses the network layer of the OSI model, highlighting its role in routing, addressing, and delivering packets across networks. Key protocols such as ARP, RARP, IPv4, and IPv6 are examined, along with their functions and importance in network communication. It emphasizes the transition to IPv6 to address scalability and security challenges in modern networking.

Uploaded by

haq4ibtisam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 45

ADVANCE NETWORK

By Muhammad Faraz Ali Shah


Week: 5,6
Lecture: 1
Topic: network layer
Program: BSCS /Bcs

Contact: [email protected]
Department Of Computer Science and IT
QURTUBA UNIVERSITY OF SCIENCE AND TECHNOLOGY
2
Week 5,6,7:
Topics To Cover This Week

• Issues in the network layer.


• Key protocols: ARP, RARP, IPv4, IPv6, ICMP, ICMPv6, IGMP.
• Structure of the IP header

3
Introduction:

What is the Network Layer?


The third layer in the OSI model responsible for routing,
addressing, and delivering packets across networks.
Why is it Important?
Ensures data is delivered correctly, efficiently, and reliably
between devices across different networks.
Introduction:

Network layer is a fundamental part of the OSI (Open Systems Interconnection) model, which is a
conceptual framework used to understand and implement network communication. The network layer is
responsible for the delivery of packets from the source host to the destination host across multiple networks.
Here are some key functions and concepts related to the network layer:

1. Routing: The network layer determines the best path for data to travel from the source to the destination.
It uses routing algorithms and protocols to make decisions based on network conditions, topology, and
policies.

2. Logical Addressing: Unlike the data link layer, which uses physical addresses (like MAC addresses), the
network layer uses logical addressing (like IP addresses). Each device on a network is assigned a unique IP
address that identifies it on the network.
Introduction:
3. Packet Forwarding: Once a path is determined, the network layer forwards packets from one network to
another. It encapsulates data from the transport layer into packets, adding necessary headers that contain
routing information.

4. Fragmentation and Reassembly: If the packet size exceeds the maximum transmission unit (MTU) of a
network, the network layer can fragment the packet into smaller pieces for transmission. At the destination,
these fragments are reassembled into the original packet.

5. Error Handling: The network layer can provide mechanisms for error handling and diagnostics, such as
ICMP (Internet Control Message Protocol), which sends error messages and operational information.

6. Protocols: Common protocols that operate at the network layer include Internet Protocol (IP), Internet
Protocol version 4 (IPv4), Internet Protocol version 6 (IPv6), and others. These protocols define how data
packets are structured and routed.
Network Layer Responsibilities:
• Core Functions:
• Addressing: Logical addressing (e.g., IP addresses) to identify devices.
• Routing: Determining the best path for data packets to travel.
• Fragmentation and Reassembly: Splitting large packets and reconstructing them
at the destination.
• Error Handling: Managing issues like packet loss and duplication.
• Quality of Service (QoS): Ensuring reliable data transfer based on priority and
bandwidth.

7
Issues in the Network Layer:
Key Challenges:

• Addressing: Managing and assigning unique addresses in IPv4/IPv6.

• Routing: Adapting to dynamic network topology changes.

• Scalability: Handling the growth of devices and traffic.

• Security: Mitigating threats such as spoofing and DDoS attacks.

• Interoperability: Integrating different network protocols and architectures.

8
Address Resolution Protocol (ARP):

ARP, or Address Resolution Protocol, is a crucial protocol used in computer networking. Its
primary function is to map a network layer address (like an IP address) to a data link layer
address (like a MAC address).
Key Functions of ARP:
1. Address Resolution: When a device wants to communicate with another device on the same
local network, it needs to know the MAC address corresponding to the destination device's IP
address. ARP facilitates this by resolving the IP address into a MAC address.
2. ARP Request: When a device (let's call it Device A) wants to find the MAC address of
another device (Device B) on the same local network, it broadcasts an ARP request packet. This
packet contains the IP address of Device B and asks, "Who has this IP address? Please send me
your MAC address."

9
Address Resolution Protocol (ARP):

3. ARP Reply: When Device B receives the ARP request and recognizes its own IP address,
it sends an ARP reply back to Device A. This reply contains its MAC address, allowing
Device A to know how to frame its packets for transmission.
4. Caching: To reduce the number of ARP requests on the network, devices maintain an
ARP cache. This cache stores recently resolved IP-to-MAC address mappings, so if Device
A needs to communicate with Device B again soon, it can check the cache instead of
sending another ARP request.
5. Broadcast Domain: ARP operates within a single broadcast domain, meaning it is used
primarily for local network communications. When devices are on different networks,
routers handle the forwarding of packets, and ARP is not used across those boundaries.

10
Importance of ARP:

- Efficiency: By resolving IP addresses to MAC addresses, ARP enables efficient


communication within a local area network (LAN).
- Dynamic Nature: ARP allows devices to dynamically discover addresses, which is
essential in networks where devices frequently join or leave.
- Integration with Other Protocols: ARP works closely with the Internet Protocol (IP),
enabling seamless communication between devices using different protocols.

11
Address Resolution Protocol (ARP):

Purpose:
• Resolves IP addresses to MAC addresses for data link layer communication.
How It Works:
• Sends a broadcast request for the MAC address corresponding to a specific
IP.
• Receives a unicast reply with the requested MAC address.
Diagram: Include a flow diagram of the ARP process.

12
Reverse Address Resolution Protocol (RARP):

RARP, or Reverse Address Resolution Protocol, is like the mirror image of ARP! While
ARP maps IP addresses to MAC addresses, RARP does the opposite—it maps MAC
addresses to IP addresses. It's a bit like asking a device, "Hey, I have this MAC address.
What's the IP address that goes with it?"
How RARP Works:
1. RARP Request: Let's say a diskless workstation needs to boot up and doesn't have its IP
address configured. It sends out a RARP request packet containing its MAC address and
asks, "Hey, can someone tell me what IP address I should use?"

13
Reverse Address Resolution Protocol (RARP):

2. RARP Server Response: A RARP server on the network receives this request, looks up
the MAC address in its table, and replies with the corresponding IP address. This way, the
workstation can configure its IP address dynamically based on the response.
Significance of RARP:
- Diskless Booting: RARP is particularly useful for diskless workstations or devices that
need to boot up and obtain their IP configuration from a central server.
- Simplifying Network Management: By allowing devices to obtain IP addresses
dynamically, RARP simplifies network configuration and management, especially in
environments with a large number of devices.

14
Reverse Address Resolution Protocol (RARP):

So, while ARP helps devices find MAC addresses based on IP addresses, RARP assists
devices in discovering IP addresses based on MAC addresses, making it an important
protocol in certain network setups, especially for devices that need to boot up without pre-
configured IP information.

15
Reverse Address Resolution Protocol (RARP):

Purpose:
• Maps a MAC address to an IP address.
Use Case:
• Bootstrapping diskless devices to acquire an IP address from a server.
Limitations:
• Replaced by protocols like BOOTP and DHCP for dynamic addressing.

16
Internet Protocol Version 4 (IPv4):
It is the backbone of the internet! It stands for Internet Protocol version 4. Basically, it's the way
we identify devices on a network using a unique address. Each IPv4 address is a 32-bit number,
usually shown in four groups of numbers separated by dots, like this: 192.168.1.1.
Here’s why IPv4 is important:
1. Addressing: Every device connected to the internet or a local network needs an IP address to
communicate. IPv4 gives us over 4 billion unique addresses, which was a lot back in the day!
2. Routing: Routers use these addresses to send data packets to the right destination. It's like
sending a letter to a friend's house—without the right address, it won't get there!
3. Subnetting: IPv4 allows networks to be divided into smaller networks, which helps
manage traffic and improve performance.

17
Internet Protocol Version 4 (IPv4):
Overview:
• Connectionless protocol for packet delivery using 32-bit addresses.
Key Features:
• Fragmentation and reassembly.
• Best-effort delivery.
Limitations:
• Address exhaustion due to the limited 32-bit space.
Applications: Legacy systems and some modern networks.

18
Internet Protocol Version 6 (IPv6):

It's the next generation of the Internet Protocol, and it was created to solve the limitations of
IPv4, especially the shortage of IP addresses.
Key Features of IPv6:
1. Larger Address Space: IPv6 uses 128-bit addresses, which allows for a staggering number of
unique IP addresses—about 340 undecillion (that’s 340 followed by 36 zeros)! This means we
won’t run out of addresses anytime soon.
2. Simplified Addressing: IPv6 addresses are usually written in eight groups of four
hexadecimal digits, separated by colons. For example, an IPv6 address looks like this:
2001:0db8:85a3:0000:0000:8a2e:0370:7334.
3. Improved Routing: With IPv6, routing is more efficient. It reduces the size of routing
tables and makes routing more straightforward.

19
Internet Protocol Version 6 (IPv6):

4. Built-in Security: IPv6 has IPsec (Internet Protocol Security) built into it, which
provides better security for data transmission.
5. No More NAT: With the vast number of addresses available, IPv6 can eliminate the
need for Network Address Translation (NAT), which is often used in IPv4 to help
conserve addresses.
6. Better Multicast and Anycast: IPv6 improves support for multicast (sending data to
multiple destinations) and anycast (sending data to the nearest destination)
communications.
IPv6 is essential for the future of the internet as more devices connect and the demand
for unique IP addresses grows. It's like having a huge address book that can
accommodate everyone!

20
Internet Protocol Version 6 (IPv6):

Overview:
• Successor to IPv4, using 128-bit addresses.
Key Features:
• Larger address space.
• Simplified header format.
• Enhanced security (IPSec is mandatory).
• Better support for mobility and multicast.
Transition Challenges:
• Coexistence with IPv4 (dual-stack networks).

21
Internet Control Message Protocol (ICMP):
Purpose:
• Provides error reporting and network diagnostics.
Functions:
• Echo requests and replies (ping).
• Destination unreachable and time exceeded messages.
Limitations:
• Vulnerable to attacks like ICMP flooding.
Internet Control Message Protocol for IPv6 (ICMPv6)
:
Internet Control Message Protocol for IPv6 (ICMPv6)
Purpose:
• Extends ICMP functionality for IPv6.
Features:
• Neighbor Discovery Protocol (NDP).
• Path MTU discovery.
Multicast Listener Discovery (MLD).
Internet Group Management Protocol
(IGMP):
Purpose:
• Manages membership in multicast groups.
Use Case:
• Supports efficient delivery of multicast traffic (e.g., video streaming).
Key Functions:
• Join and leave multicast group messages.
IP Header Structure

Key Fields in IPv4 Header:


• Version: Indicates IP version (4 or 6).
• Header Length: Size of the header in 32-bit words.
• Type of Service (TOS): QoS parameters.
• Total Length: Length of the packet (header + data).
• Identification, Flags, Fragment Offset: For fragmentation and
reassembly.
• Time to Live (TTL): Limits packet lifetime.
• Protocol: Identifies the upper-layer protocol (e.g., TCP/UDP).
• Header Checksum: Error detection for the header.
• Source and Destination Addresses: Sender and receiver IPs.
Visual Diagram: Include a detailed diagram of the IPv4 header with field descriptions.
Summary and Future Trends
Summary of Key Points:
• Network layer ensures reliable data delivery across interconnected
networks.
• ARP, RARP, ICMP, and IGMP are vital auxiliary protocols.
• Transition to IPv6 addresses scalability and security concerns.
Future Trends:
• Full transition to IPv6.
• Enhanced routing algorithms for IoT and 5G networks.
• Integration with software-defined networking (SDN).
IP Addressing Basics:
What is an IP Address?
• A logical identifier for devices on a network.
• Consists of:
• Network Portion: Identifies the network.
• Host Portion: Identifies the specific device within the network.
IPv4 Address Format:
• 32-bit binary address divided into four octets (e.g., 192.168.1.1).
IP Address Classes Overview

Purpose of Address Classes:


• Define ranges to accommodate networks of varying sizes.
Classification (A, B, C):
• Based on the number of networks and hosts per network.
• Determined by the first few bits of the address.
.
Class A Address:
Range: 1.0.0.0 to 126.0.0.0.
Subnet Mask: 255.0.0.0 (default).
Network Portion: First 8 bits (1st octet).
Host Portion: Last 24 bits (3 octets).
Number of Networks: 128.
Number of Hosts per Network: ~16.7 million.
Use Case:
• Suitable for very large networks (e.g., ISPs, large
corporations).
Example: 10.0.0.1 (Private Address).
Class B Address:
Range: 128.0.0.0 to 191.255.0.0 .
Subnet Mask: 255.255.0.0 (default).
Network Portion: First 16 bits (2 octets).
Host Portion: Last 16 bits (2 octets).
Number of Networks: ~16,384.
Number of Hosts per Network: ~65,536.
Use Case:
• Medium-sized networks (e.g., universities, regional ISPs).
Example: 172.16.0.1 (Private Address).
Class C Address:
Range: 192.0.0.0 to 223.255.255.255 .
Subnet Mask: 255.255.255.0 (default).
Network Portion: First 24 bits (3 octets).
Host Portion: Last 8 bits (1 octet).
Number of Networks: ~2 million.
Number of Hosts per Network: 254.
Use Case:
• Small networks (e.g., small businesses, home networks).
Example: 192.168.1.1 (Private Address).
Comparing Address Classes:

Feature Class A Class B Class C

First Octet Range 1–126 128–191 192–223

Default Subnet Mask 255.0.0.0 255.255.0.0 255.255.255.0

Number of Networks 128 ~16,384 ~2 million

Number of Hosts/Network ~16.7 million ~65,536 254

Use Case Large networks Medium networks Small networks


Challenges with Address Classes:
Address Exhaustion:
• Rapid growth of devices led to IPv4 address depletion.
Inefficiency:
• Fixed classes do not allow flexible allocation of IPs.
Solution:
• Classless Inter-Domain Routing (CIDR) introduced for efficient use
of IPv4.
•.
Transition to IPv6:
Why IPv6?
• Overcomes limitations of address classes and IPv4 space.
Features of IPv6:
• 128-bit addressing.
• Simplified header for faster routing.
• No reliance on classes.
Conclusion:
Summary:
• Network layer addresses core challenges of communication in a
multi-network environment.
• Class A, B, and C addresses were pivotal in early internet growth.
• Transition to IPv6 is critical to accommodate modern network
demands.
Takeaway:
• Understanding address classes helps grasp the evolution of IP
addressing.
Subnetting:
What is Subnetting?
• Dividing a larger network into smaller, more manageable sub-networks.
Why Subnet?
• Efficient IP Address Utilization: Reduces waste of IP addresses.
• Improved Network Management: Simplifies maintenance and
troubleshooting.
• Enhanced Security: Isolates traffic within subnets.
Real-World Applications:
• Corporate networks, campus networks, and ISP customer segmentation.
Understanding the Subnet Mask:

What is a Subnet Mask?


• A 32-bit number used to distinguish between the network and
host portions of an IP address.
Examples of Subnet Masks:
• Class A Default: 255.0.0.0
• Class B Default: 255.255.0.0
• Class C Default: 255.255.255.0
Visual Representation: Show an IP address and subnet mask in
binary.
Bit Subnetting:
What is Bit Subnetting?
• Borrowing bits from the host portion to create additional subnets.
Subnetting Formula:
• Number of Subnets: 2n2^n2n, where nnn is the number of bits
borrowed.
• Number of Hosts per Subnet: 2h−22^h - 22h−2, where hhh is the
number of remaining host bits.
Example: Subnet a Class C network (192.168.1.0/24) into 4 subnets.
• Borrow 2 bits → Subnet mask becomes 255.255.255.192 (/26).
• Each subnet supports 26−2=622^6 - 2 = 6226−2=62 hosts.
.
Host Portion vs. Network Portion:
How to Differentiate:
• Network Portion: Determined by the subnet mask.
• Host Portion: Remaining bits after the network portion.
Example:
• IP Address: 192.168.1.5
• Subnet Mask: 255.255.255.0 (/24)
• Network Portion: 192.168.1
• Host Portion: 5
Visual Diagram: Highlight the network and host bits in binary.
CIDR Notation:
What is CIDR (Classless Inter-Domain Routing)?
• Represents subnet masks using a suffix (e.g., /24 for
255.255.255.0).
Benefits of CIDR:
• Flexible allocation of IP addresses.
• Reduces address waste compared to classful addressing.
Example:
192.168.0.0/28 → Subnet mask: 255.255.255.240
Subnetting Example:
Scenario: You have a network 192.168.1.0/24 and need 4 subnets.
Steps:
• Determine bits to borrow: 22=42^2 = 422=4.
• New subnet mask: 255.255.255.192 (/26).
• Subnet ranges:
• Subnet 1: 192.168.1.0 - 192.168.1.63
• Subnet 2: 192.168.1.64 - 192.168.1.127
• Subnet 3: 192.168.1.128 - 192.168.1.191
• Subnet 4: 192.168.1.192 - 192.168.1.255
Real-World Use Case:

Scenario: A company with multiple departments needs separate subnets.


Network: 10.0.0.0/8
Subnetting Plan:
• Borrow bits to create subnets for HR, IT, Sales, etc.
• Use VLANs to map subnets to specific switches.
.
.
Common Subnetting Mistakes:
Misallocating IPs: Borrowing too many or too few bits.
Overlapping Subnets: Incorrectly defining subnet ranges.
Forgetting Reserved Addresses:
• Network address and broadcast address cannot be assigned to
hosts.
Tools for Subnetting:

Manual Calculation: Using binary arithmetic.


Subnet Calculators: Online tools and software for quick calculations.
Command-Line Tools:
• Linux: ipcalc
• Windows: netsh
.
Thank you!

Muhammad Faraz Ali Shah


Lecturer Cs
[email protected]

You might also like