Siksha Sarovar

Siksha Sarovar (sikshasarovar.com) is a free educational web application that helps students in India learn programming and prepare for academic and competitive exams. The platform offers structured coding courses (C, C++, Python, Java, HTML, CSS, PHP, Power BI, AI, Machine Learning, Data Science), complete university curriculum notes for BCA/MCA students with previous year question papers, Class 10 and Class 12 CBSE/HBSE school notes, and dedicated preparation material for SSC, UPSC, Banking, Railway and other government exams. Browsing the site is completely free and requires no account. Users may optionally sign in with Google solely to save their learning progress, quiz scores and personal preferences across devices.

Privacy Policy | Terms of Service | Contact Siksha Sarovar | About Siksha Sarovar

v4.0.9 · PWA
Siksha Sarovar logo
Siksha Sarovar
Your Learning Universe

Siksha Sarovar is a free e-learning platform for coding courses, BCA university notes and competitive exam preparation. Optional Google sign-in saves your learning progress across devices.

Initializing knowledge base…
Compiling modules 0%

Unit III — Network Layer & Routing Overview

Lesson 9 of 15 in the free Computer Networks notes on Siksha Sarovar, written by Rohit Jangra.

Unit III — Network Layer & Routing Overview

Unit III covers the Network Layer (Layer 3) — the layer responsible for logical addressing (IP addresses) and routing (determining the best path for packets across interconnected networks).

---

1. Network Layer Functions

FunctionDescription
Logical AddressingAssign globally unique IP addresses to identify hosts across networks
RoutingDetermine the optimal path from source to destination network
Packet ForwardingForward each received packet to the correct outgoing interface
Fragmentation & ReassemblyBreak large packets into smaller fragments for links with smaller MTU
Error ReportingICMP provides error messages and diagnostic information
Congestion ControlMechanisms to prevent network overload (IP-level: minimal; TCP handles this)

---

2. Network Layer vs Data Link Layer

AspectData Link Layer (Layer 2)Network Layer (Layer 3)
AddressingMAC address (hardware, local)IP address (logical, global)
ScopeSingle network segment (LAN)Across multiple networks (internetwork)
UnitFramePacket
ProtocolEthernet, Wi-Fi (802.11), PPPIP (IPv4, IPv6), ICMP, OSPF
Key deviceBridge, SwitchRouter

---

3. IP Routing Concepts

Routing vs Forwarding

  • Routing (control plane): The process of building and maintaining routing tables — determines the best path
  • Forwarding (data plane): The per-packet operation of reading the destination IP, looking it up in the routing table, and sending the packet out the appropriate interface

Routing Table Structure

Each routing table entry contains:

  1. Destination network (IP prefix + subnet mask)
  2. Next hop (IP address of the next router, or "directly connected")
  3. Interface (which router interface to send out)
  4. Metric (cost: hop count, bandwidth, delay — lower = better)

Types of Routes

TypeHow LearnedUpdate Method
Directly connectedInterface configured with IP addressAutomatic
Static routeManually configured by adminManual update
Dynamic routeLearned from routing protocol (RIP, OSPF, BGP)Automatic convergence
Default route0.0.0.0/0 — catch-all for unknown destinationsConfigured or learned

---

4. Networking Devices Overview

DeviceOSI LayerIntelligenceKey Function
Repeater/HubLayer 1NoneAmplify/repeat signal; all ports in same collision domain
BridgeLayer 2MAC addressForward frames between segments; reduce collision domains
SwitchLayer 2MAC address tableHigh-speed frame forwarding per MAC; full-duplex
RouterLayer 3Routing tableRoute packets between networks; separate broadcast domains
GatewayLayer 4–7Protocol translationConnect networks using different protocols

---

5. IPv4 vs IPv6

FeatureIPv4IPv6
Address length32 bits (4 bytes)128 bits (16 bytes)
Address notationDotted decimal: 192.168.1.1Hexadecimal groups: 2001:db8::1
Address space~4.3 billion~340 undecillion (3.4×10^38)
Header size20–60 bytes (variable)40 bytes (fixed)
ChecksumIn headerRemoved (handled by L4)
NAT needed?Yes (address exhaustion)No (massive address space)
FragmentationBy routers and hostsOnly by source host
Built-in securityOptional (IPsec)Mandatory IPsec support
AutoconfigurationDHCPSLAAC (Stateless Address Autoconfiguration)
Exam Tip: IPv4 exhaustion is the primary reason IPv6 was developed. IPv4 = 32 bits = ~4.3 billion addresses; IPv6 = 128 bits = virtually unlimited. Key differences: IPv6 has no header checksum (TCP/UDP handle it), no broadcast (uses multicast), and uses SLAAC for auto-configuration.

---

6. Key Protocols in Unit III

ProtocolLayerPurpose
IP (IPv4/IPv6)Layer 3Logical addressing and packet delivery
ICMPLayer 3Error reporting, diagnostics (ping, traceroute)
ARPLayer 2/3Resolve IP address to MAC address
RARP/BOOTP/DHCPLayer 3/7Assign IP addresses to hosts dynamically
RIPLayer 7/3Distance-vector routing protocol
OSPFLayer 3Link-state routing protocol
BGPLayer 4/3Path-vector routing — Internet's core routing protocol

---

Study Deep: Why the Network Layer Matters

  • IP is the "narrow waist" of the internet: Every internet technology (Ethernet, Wi-Fi, fibre, cellular) must speak IP at Layer 3. Above IP, any application protocol can run; below IP, any physical technology can be used. This universality is why the internet works across so many different technologies.
  • Classless routing (CIDR) replaced the original class A/B/C system in 1993 to slow IPv4 exhaustion — without CIDR, the internet routing tables would have grown unmanageably large.
  • NAT (Network Address Translation) has allowed IPv4 to survive far longer than expected — a single public IP can serve thousands of private hosts. This breaks end-to-end connectivity but conserves public addresses.