week 5 6
week 5 6
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
3
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:
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:
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