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
| Function | Description |
|---|---|
| Logical Addressing | Assign globally unique IP addresses to identify hosts across networks |
| Routing | Determine the optimal path from source to destination network |
| Packet Forwarding | Forward each received packet to the correct outgoing interface |
| Fragmentation & Reassembly | Break large packets into smaller fragments for links with smaller MTU |
| Error Reporting | ICMP provides error messages and diagnostic information |
| Congestion Control | Mechanisms to prevent network overload (IP-level: minimal; TCP handles this) |
---
2. Network Layer vs Data Link Layer
| Aspect | Data Link Layer (Layer 2) | Network Layer (Layer 3) |
|---|---|---|
| Addressing | MAC address (hardware, local) | IP address (logical, global) |
| Scope | Single network segment (LAN) | Across multiple networks (internetwork) |
| Unit | Frame | Packet |
| Protocol | Ethernet, Wi-Fi (802.11), PPP | IP (IPv4, IPv6), ICMP, OSPF |
| Key device | Bridge, Switch | Router |
---
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:
- Destination network (IP prefix + subnet mask)
- Next hop (IP address of the next router, or "directly connected")
- Interface (which router interface to send out)
- Metric (cost: hop count, bandwidth, delay — lower = better)
Types of Routes
| Type | How Learned | Update Method |
|---|---|---|
| Directly connected | Interface configured with IP address | Automatic |
| Static route | Manually configured by admin | Manual update |
| Dynamic route | Learned from routing protocol (RIP, OSPF, BGP) | Automatic convergence |
| Default route | 0.0.0.0/0 — catch-all for unknown destinations | Configured or learned |
---
4. Networking Devices Overview
| Device | OSI Layer | Intelligence | Key Function |
|---|---|---|---|
| Repeater/Hub | Layer 1 | None | Amplify/repeat signal; all ports in same collision domain |
| Bridge | Layer 2 | MAC address | Forward frames between segments; reduce collision domains |
| Switch | Layer 2 | MAC address table | High-speed frame forwarding per MAC; full-duplex |
| Router | Layer 3 | Routing table | Route packets between networks; separate broadcast domains |
| Gateway | Layer 4–7 | Protocol translation | Connect networks using different protocols |
---
5. IPv4 vs IPv6
| Feature | IPv4 | IPv6 |
|---|---|---|
| Address length | 32 bits (4 bytes) | 128 bits (16 bytes) |
| Address notation | Dotted decimal: 192.168.1.1 | Hexadecimal groups: 2001:db8::1 |
| Address space | ~4.3 billion | ~340 undecillion (3.4×10^38) |
| Header size | 20–60 bytes (variable) | 40 bytes (fixed) |
| Checksum | In header | Removed (handled by L4) |
| NAT needed? | Yes (address exhaustion) | No (massive address space) |
| Fragmentation | By routers and hosts | Only by source host |
| Built-in security | Optional (IPsec) | Mandatory IPsec support |
| Autoconfiguration | DHCP | SLAAC (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
| Protocol | Layer | Purpose |
|---|---|---|
| IP (IPv4/IPv6) | Layer 3 | Logical addressing and packet delivery |
| ICMP | Layer 3 | Error reporting, diagnostics (ping, traceroute) |
| ARP | Layer 2/3 | Resolve IP address to MAC address |
| RARP/BOOTP/DHCP | Layer 3/7 | Assign IP addresses to hosts dynamically |
| RIP | Layer 7/3 | Distance-vector routing protocol |
| OSPF | Layer 3 | Link-state routing protocol |
| BGP | Layer 4/3 | Path-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.