Chapter 4 2 min read
Save

Network Layer

Data Communication and Computer Network · BCA · Updated Apr 23, 2026

Table of Contents

Network Layer

The network layer (OSI Layer 3) is responsible for source-to-destination delivery of packets across multiple networks. Its primary duties are logical addressing, routing, and fragmentation/reassembly.

IPv4 Addressing

An IPv4 address is a 32-bit identifier written in dotted-decimal notation (e.g., 192.168.1.1). Addresses are divided into network and host portions. Classful addressing defines classes A (0–127), B (128–191), C (192–223), D (multicast), and E (reserved). Classless addressing (CIDR) uses a prefix length (e.g., /24) for flexible allocation.

Subnetting

Subnetting divides a network into smaller sub-networks by borrowing host bits for the subnet ID. A subnet mask distinguishes network and host portions. Subnetting improves address utilisation, reduces broadcast domains, and enhances security. Variable-length subnet masking (VLSM) allows subnets of different sizes.

IPv6

IPv6 uses 128-bit addresses (written in hexadecimal colon notation) to solve IPv4 address exhaustion. It provides a vastly larger address space, simplified header format, built-in security (IPSec), and better support for quality of service. Transition mechanisms include dual stack, tunnelling, and header translation.

Routing Concepts

Routing determines the best path for packets from source to destination. Routers maintain routing tables and use algorithms to update them. Routes can be static (manually configured) or dynamic (learned via protocols). Metrics include hop count, bandwidth, delay, and cost.

Routing Algorithms

Distance-vector algorithms (e.g., Bellman-Ford) share routing tables with neighbours periodically; they are simple but slow to converge. Link-state algorithms (e.g., Dijkstra) build a complete topology map; they converge faster but require more memory. Path-vector algorithms (used by BGP) carry the full path to detect loops.

Routing Protocols

RIP (Routing Information Protocol) is a distance-vector protocol using hop count (max 15). OSPF (Open Shortest Path First) is a link-state protocol using cost metrics and areas. BGP (Border Gateway Protocol) is a path-vector protocol used between autonomous systems on the Internet.

Network Address Translation

NAT translates private IP addresses to public ones, conserving IPv4 addresses. Static NAT maps one-to-one; dynamic NAT maps from a pool; PAT (Port Address Translation) maps many private addresses to one public address using port numbers.

ICMP and ARP

ICMP (Internet Control Message Protocol) reports errors and provides diagnostic functions (ping, traceroute). ARP (Address Resolution Protocol) maps IP addresses to MAC addresses within a LAN. RARP does the reverse.

Summary

The network layer enables inter-network communication through logical addressing (IP), routing algorithms and protocols, subnetting, NAT, and supporting protocols like ICMP and ARP.

Related Notes

Discussion

0 comments

Join the discussion

Log in to share your thoughts and help fellow students.

Log in to comment

No comments yet. Be the first to share your thoughts!