Unit 3
1. Network Layer (Layer 3)
The Network Layer sits at Layer 3 of the OSI model, between the Transport Layer (Layer 4) and the Data Link Layer (Layer 2).
Its main job is to move packets from the source host to the destination host, possibly across multiple networks and routers.
Key Responsibilities
- Logical addressing (IP addresses) to identify hosts and networks uniquely
- Routing – deciding the best path for each packet through routers
- Forwarding – sending each packet to the correct next hop based on the routing table
- Fragmentation and reassembly (if needed) when packets are too big for the underlying link's MTU
- Support for subnetting, NAT, and multicast via additional protocols like IGMP
Common Network-Layer Protocols
- IP (IPv4/IPv6) – basic addressing and packet delivery
- ICMP – control and error messages
- IGMP – multicast group management
2. Logical Addressing (IP Addresses)
Logical addressing means assigning software-based, globally meaningful addresses (like IP addresses) to hosts and routers, instead of fixed hardware addresses.
These addresses are used by the Network Layer to find the right path across the Internet.
Main Points
- Logical address = IP address (e.g.,
192.168.1.10, 172.16.0.5, 2001:db8::1)
- Assigned by the network (via DHCP or manually), not burned into the NIC like MAC
- Single IP address consists of two parts:
- Network part – identifies which network the host belongs to
- Host part – identifies the specific device inside that network
- Through subnetting and CIDR, divides large IP spaces into smaller subnets
- Used by routers to forward packets hop-by-hop until reaching right destination
3. Routing Protocols
Routing protocols are the rules routers use to discover networks and build routing tables so they know how to send packets.
Main Types
| Type |
Description |
Examples |
| Distance-Vector |
Each router tells neighbors: "I can reach network X in N hops" Share full routing table periodically |
RIP, IGRP |
| Link-State |
Flood Link-State Packets (LSPs) to whole network Build complete topology map + Dijkstra's SPF |
OSPF, IS-IS |
| Hybrid |
Combine distance-vector + link-state for fast convergence |
EIGRP (Cisco) |
| Exterior Gateway |
Between Autonomous Systems (AS) Internet backbone protocol |
BGP |
4. ICMP (Internet Control Message Protocol)
ICMP is a Network-Layer protocol that runs on top of IP (protocol number 1).
It sends control messages and error reports to help diagnose and manage IP communication.
Key Functions
- Error reporting: Destination Unreachable, Time Exceeded, Parameter Problem
- Diagnostic tools:
ping = ICMP Echo Request/Reply (reachability + RTT)
traceroute = ICMP Time Exceeded (hop discovery)
- Control messages: Redirect (better next-hop), Source Quench (obsolete)
5. IGMP (Internet Group Management Protocol)
IGMP manages IPv4 multicast group memberships on local networks between hosts and local multicast router.
How It Works
- Router Query: "Which multicast groups are you interested in?"
- Host Report: Reply for desired groups (Class D: 224.0.0.0-239.255.255.255)
- Leave Group: IGMPv2/v3 Leave message
- Router maintains membership table and forwards only to active LANs
Use Cases: Live streaming, IPTV, distributed applications
6. TCP (Transmission Control Protocol)
TCP is Layer 4, connection-oriented, reliable, ordered, flow-controlled protocol running on top of IP.
Key Features
- 3-way Handshake: SYN → SYN-ACK → ACK
- Reliable: Sequence numbers + ACKs + Retransmission
- Ordered: Reassemble segments correctly
- Flow Control: Sliding window mechanism
- Congestion Control: Slow-start, Congestion avoidance, Fast recovery
Common Uses: HTTP/HTTPS, FTP, SMTP/POP/IMAP, SSH/Telnet
7. UDP (User Datagram Protocol)
UDP is Layer 4, connectionless, lightweight protocol with 8-byte header.
Characteristics
- No connection setup – send immediately
- Unreliable – no ACKs, retransmission, or ordering
- No flow/congestion control in UDP itself
- Uses: VoIP, Live video, Games, DNS, DHCP
8. UDP & Congestion Control
UDP has NO congestion control unlike TCP, so high-rate UDP can congest networks.
Solutions
- Application-level control: Measure loss/RTT, reduce rate
- QUIC protocol: TCP-like reliability on UDP
- RFC 8085: Guidelines for UDP congestion control
9. Big Picture Integration
| Layer |
Protocols |
Key Functions |
| Network Layer |
IP + ICMP + IGMP |
Logical addressing, Routing, Multicast |
| Transport Layer |
TCP vs UDP |
TCP: Reliable, ordered UDP: Fast, real-time |
Network Layer: End-to-end packet delivery across networks
Transport Layer: Process-to-process reliable vs real-time communication