Unit IV — Transport & Upper Layers Overview
Unit IV covers the upper layers of the OSI model with special focus on the Transport Layer (Layer 4), which provides end-to-end reliable delivery, and the upper layers (Session, Presentation, Application) that directly support network applications.
---
1. Transport Layer (Layer 4)
The Transport Layer provides logical, end-to-end communication between processes running on different hosts.
Key Transport Layer Functions
| Function | Description |
|---|---|
| Multiplexing / Demultiplexing | Multiple applications share the network by using port numbers |
| Reliable delivery | TCP ensures all segments are delivered correctly in order |
| Flow control | Prevents sender from overwhelming a slower receiver |
| Congestion control | Prevents sender from overwhelming the network itself |
| Connection management | TCP establishes and terminates connections |
| Segmentation | Breaks application data into appropriately sized segments |
Port Numbers
| Range | Classification | Examples |
|---|---|---|
| 0–1023 | Well-known ports (reserved) | HTTP:80, HTTPS:443, FTP:20/21, SSH:22, DNS:53 |
| 1024–49151 | Registered ports | MySQL:3306, PostgreSQL:5432, MongoDB:27017 |
| 49152–65535 | Dynamic/Ephemeral | Assigned temporarily to client sockets |
A socket = IP address + Port number → uniquely identifies a process-to-process communication endpoint.
---
2. TCP vs UDP — Overview
| Feature | TCP | UDP |
|---|---|---|
| Connection | Connection-oriented | Connectionless |
| Reliability | Guaranteed delivery | Best-effort |
| Ordering | In-order delivery | No ordering guarantee |
| Error control | Error detection + retransmission | Error detection only |
| Flow control | Yes (sliding window) | No |
| Congestion control | Yes (AIMD) | No |
| Speed | Slower (overhead) | Faster |
| Header size | 20–60 bytes | 8 bytes |
| Applications | Web, email, file transfer | DNS, video streaming, VoIP, gaming |
---
3. Session Layer (Layer 5)
The Session Layer manages sessions — structured dialogues between applications.
Session Layer Responsibilities
| Function | Description | Example |
|---|---|---|
| Session establishment | Set up communication session between processes | Login to a remote system |
| Session maintenance | Keep session alive, re-establish if interrupted | Long database transaction |
| Session termination | Properly close sessions, release resources | Logout, transaction commit |
| Dialog control | Manage half-duplex / full-duplex dialogue | Turn-taking in early protocols |
| Synchronisation | Insert checkpoints for resumable transfers | Long file transfers (resume from checkpoint) |
Practical note: In TCP/IP, the Session layer is minimal — most session management is handled by the Application layer (HTTP cookies, TLS sessions).
---
4. Presentation Layer (Layer 6)
The Presentation Layer translates data between the application's format and the network's format.
Presentation Layer Functions
| Function | Description | Examples |
|---|---|---|
| Data translation | Convert between different data representations | ASCII ↔ EBCDIC, Big endian ↔ Little endian |
| Encryption/Decryption | Protect data confidentiality | TLS/SSL (HTTPS) |
| Compression/Decompression | Reduce data size for efficient transmission | gzip, zlib, LZW |
| Data formatting | Standardise data structures | JPEG, MP4, JSON, XML |
Protocols: SSL/TLS (HTTPS), MIME (email attachments), XDR (External Data Representation), JPEG, PNG, MPEG.
---
5. Application Layer (Layer 7)
The Application Layer provides network services directly to end-user applications.
Key Application Layer Protocols
| Protocol | Port | Transport | Description |
|---|---|---|---|
| HTTP | 80 | TCP | World Wide Web — web page requests |
| HTTPS | 443 | TCP | HTTP over TLS — encrypted web |
| FTP | 20/21 | TCP | File transfer (data/control channels) |
| SFTP | 22 | TCP | Secure FTP over SSH |
| SMTP | 25/587 | TCP | Sending email |
| IMAP | 143/993 | TCP | Receiving/managing email on server |
| POP3 | 110/995 | TCP | Downloading email from server |
| DNS | 53 | UDP/TCP | Domain name to IP resolution |
| DHCP | 67/68 | UDP | Automatic IP address assignment |
| SSH | 22 | TCP | Secure remote shell access |
| Telnet | 23 | TCP | Unsecure remote access (legacy) |
| SNMP | 161/162 | UDP | Network device management |
Exam Tip: Memorise key port numbers: HTTP=80, HTTPS=443, FTP=20/21, SSH=22, Telnet=23, DNS=53, DHCP=67/68, SMTP=25, POP3=110, IMAP=143. These are commonly tested in MCQs.
---
6. DNS (Domain Name System)
DNS translates human-readable domain names (e.g., www.google.com) to IP addresses.
DNS Resolution Process
- Client queries its local resolver (configured in OS, usually from DHCP)
- Local resolver checks its cache — if found, return immediately
- If not cached, resolver queries Root DNS Server → learns TLD nameserver address
- Queries TLD nameserver (e.g.,
.comTLD server) → learns authoritative nameserver - Queries authoritative nameserver for
google.com→ gets final IP - Returns IP to client; caches result for TTL duration
DNS Record Types
| Record | Purpose | Example |
|---|---|---|
| A | IPv4 address | www.example.com → 93.184.216.34 |
| AAAA | IPv6 address | www.example.com → 2606:2800::1 |
| CNAME | Alias to another hostname | www → example.com |
| MX | Mail exchange server | example.com → mail.example.com |
| NS | Name server | example.com → ns1.example.com |
| TXT | Text record | SPF, DKIM, domain verification |
| PTR | Reverse DNS (IP → hostname) | 34.216.184.93 → example.com |
---
Study Deep: The Upper Layers in Modern Networking
- TLS is both Layer 5 and Layer 6: TLS manages sessions (session ID, resumption) and provides encryption/decryption — it spans both Session and Presentation layers in practice.
- HTTP/2 and HTTP/3: HTTP/2 (over TLS+TCP) added multiplexing — multiple requests over one TCP connection. HTTP/3 uses QUIC (over UDP) instead of TCP to eliminate TCP's head-of-line blocking.
- DNS is critical infrastructure: Every internet connection starts with a DNS lookup. DNS over HTTPS (DoH) and DNS over TLS (DoT) encrypt DNS queries to prevent surveillance and manipulation.