Network Layer



Network Layer

The Network Layer is the 3rd layer of the OSI model.
Its main job is to deliver data from source to destination across different networks.

Key Functions

  • Logical addressing (IP address)
  • Routing (path selection)
  • Packet forwarding
  • Internetworking

Real-life example: Choosing the best route on Google Maps to reach your destination.

Switching Techniques

Switching decides how data moves from sender to receiver through the network.

Circuit Switching

A dedicated communication path is established before data transmission and remains reserved until communication ends.

Steps

  1. Connection establishment
  2. Data transfer
  3. Connection termination

Characteristics

  • Fixed path
  • No packet loss
  • Continuous transmission

Example: Traditional telephone call

Advantages

  • Reliable
  • No delay during transmission

Disadvantages

  • Wastes bandwidth when not in use
  • Not suitable for data networks

Packet Switching

Data is divided into small packets, and each packet may travel via different paths to the destination.

Characteristics

  • No dedicated path
  • Efficient bandwidth use
  • Packets reassembled at destination

Example: Internet, email, WhatsApp messages

Advantages

  • High efficiency
  • Suitable for data communication

Disadvantages

  • Packet delay
  • Packet loss possible

Message Switching

Entire message is sent and stored at intermediate nodes before forwarding.

Characteristics

  • No dedicated path
  • Store-and-forward technique

Example: Old telegraph systems

Disadvantages

  • High delay
  • Not used in modern networks

Switching Techniques Comparison (Exam-Important)

FeatureCircuitPacketMessage
PathDedicatedDynamicDynamic
DelayLowVariableHigh
EfficiencyLowHighMedium
ExampleTelephoneInternetTelegraph

Logical Addressing

Logical addressing is used to identify devices uniquely in a network using IP addresses.

IPv4 Addressing

IPv4 uses 32-bit addresses, written in dotted decimal notation.

Example: 192.168.1.1

Total Addresses

2³² ≈ 4.3 billion

IPv4 Address Classes

ClassRangeNetwork BitsHost BitsUse
A1 – 126824Large networks
B128 – 1911616Medium networks
C192 – 223248Small networks
D224 – 239Multicasting
E240 – 255Research

Subnetting

Subnetting divides a large network into smaller sub-networks (subnets).

Purpose

  • Better network management
  • Reduced traffic
  • Improved security

Subnet Mask Example : 255.255.255.0

Real-life example: Dividing a big company into department-wise networks.

IPv6 Addressing

IPv6 uses 128-bit addresses, written in hexadecimal format.

Example: 2001:0db8:85a3::8a2e:0370:7334

Advantages of IPv6

  • Huge address space
  • Better security
  • Auto-configuration
  • No NAT required

IPv4 vs IPv6 Comparison

FeatureIPv4IPv6
Address Size32-bit128-bit
Address FormatDecimalHexadecimal
SecurityOptionalBuilt-in
Address SpaceLimitedVery large

Important Exam Questions

  • Explain switching techniques with comparison
  • Differentiate circuit, packet, and message switching
  • Explain IPv4 addressing and classes
  • What is subnetting? Explain with example
  • Compare IPv4 and IPv6

Network Layer Protocols & Routing Techniques

Network Layer Protocols – Introduction

Network layer protocols help in:

  • Address resolution
  • Automatic IP configuration
  • Communication between devices in a network

These protocols work along with IP to ensure correct data delivery.

ARP (Address Resolution Protocol)

ARP is used to find the MAC address of a device when its IP address is known.

IP → MAC address

Working of ARP

  • Sender broadcasts ARP request: “Who has this IP?”
  • Receiver replies with its MAC address
  • Mapping is stored in ARP cache

Example: A computer knows the IP of another system in LAN but needs its MAC address to send data.

Key Points

  • Used in IPv4
  • Operates in LAN
  • Essential for packet delivery

RARP (Reverse Address Resolution Protocol)

RARP is the reverse of ARP.
It finds IP address using MAC address.

MAC → IP address

Example: Diskless workstation requests IP address from server using its MAC address.

Limitations

  • Needs RARP server
  • Obsolete now

BOOTP (Bootstrap Protocol)

BOOTP assigns:

  • IP address
  • Gateway
  • Boot file location

to a system during startup.

Features

  • Static IP mapping
  • Manual configuration required

Example: Used earlier for diskless machines to boot from network.

DHCP (Dynamic Host Configuration Protocol)

DHCP automatically assigns IP addresses and other network settings.

DHCP Process (DORA – Exam Important)

  • Discover – Client broadcasts request
  • Offer – Server offers IP
  • Request – Client requests IP
  • Acknowledge – Server confirms

Advantages

  • No manual configuration
  • Avoids IP conflicts
  • Widely used today

Example: Mobile phone connecting to Wi-Fi gets IP automatically.

Comparison of Network Layer Protocols

ProtocolPurposeStatus
ARPIP → MACActive
RARPMAC → IPObsolete
BOOTPBoot & IP assignmentRare
DHCPAutomatic IP assignmentWidely used

Routing Techniques

Routing decides the best path for data packets to reach destination.

Intradomain Routing

Routing within a single organization or autonomous system (AS).

Types

  • Distance Vector Routing: Uses hop count. Example: RIP
  • Link State Routing: Uses complete network topology. Example: OSPF

Example: Routing inside a college campus network.

Interdomain Routing

Routing between different autonomous systems.

Protocol Used

  • BGP (Border Gateway Protocol)

Example: Routing between ISP networks on the Internet.

Intradomain vs Interdomain Routing (Exam Table)

FeatureIntradomainInterdomain
AreaWithin ASBetween AS
ProtocolRIP, OSPFBGP
ComplexityLowHigh
ExampleCollege networkInternet routing

Important Exam Questions

  • Explain ARP and RARP with examples
  • Describe BOOTP and DHCP
  • Explain DHCP process (DORA)
  • Differentiate intradomain and interdomain routing
  • Explain routing protocols with examples

Exam Tips

  • Write DORA steps clearly
  • Use comparison tables
  • Draw simple diagrams
  • Mention real-life examples

Conclusion

Network layer protocols like ARP, DHCP ensure correct addressing, while routing techniques ensure efficient packet delivery.

  • DHCP is most widely used today
  • Intradomain routing handles internal networks
  • Interdomain routing forms the backbone of the Internet