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 IV — Transport & Upper Layers Overview

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

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

FunctionDescription
Multiplexing / DemultiplexingMultiple applications share the network by using port numbers
Reliable deliveryTCP ensures all segments are delivered correctly in order
Flow controlPrevents sender from overwhelming a slower receiver
Congestion controlPrevents sender from overwhelming the network itself
Connection managementTCP establishes and terminates connections
SegmentationBreaks application data into appropriately sized segments

Port Numbers

RangeClassificationExamples
0–1023Well-known ports (reserved)HTTP:80, HTTPS:443, FTP:20/21, SSH:22, DNS:53
1024–49151Registered portsMySQL:3306, PostgreSQL:5432, MongoDB:27017
49152–65535Dynamic/EphemeralAssigned temporarily to client sockets

A socket = IP address + Port number → uniquely identifies a process-to-process communication endpoint.

---

2. TCP vs UDP — Overview

FeatureTCPUDP
ConnectionConnection-orientedConnectionless
ReliabilityGuaranteed deliveryBest-effort
OrderingIn-order deliveryNo ordering guarantee
Error controlError detection + retransmissionError detection only
Flow controlYes (sliding window)No
Congestion controlYes (AIMD)No
SpeedSlower (overhead)Faster
Header size20–60 bytes8 bytes
ApplicationsWeb, email, file transferDNS, video streaming, VoIP, gaming

---

3. Session Layer (Layer 5)

The Session Layer manages sessions — structured dialogues between applications.

Session Layer Responsibilities

FunctionDescriptionExample
Session establishmentSet up communication session between processesLogin to a remote system
Session maintenanceKeep session alive, re-establish if interruptedLong database transaction
Session terminationProperly close sessions, release resourcesLogout, transaction commit
Dialog controlManage half-duplex / full-duplex dialogueTurn-taking in early protocols
SynchronisationInsert checkpoints for resumable transfersLong 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

FunctionDescriptionExamples
Data translationConvert between different data representationsASCII ↔ EBCDIC, Big endian ↔ Little endian
Encryption/DecryptionProtect data confidentialityTLS/SSL (HTTPS)
Compression/DecompressionReduce data size for efficient transmissiongzip, zlib, LZW
Data formattingStandardise data structuresJPEG, 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

ProtocolPortTransportDescription
HTTP80TCPWorld Wide Web — web page requests
HTTPS443TCPHTTP over TLS — encrypted web
FTP20/21TCPFile transfer (data/control channels)
SFTP22TCPSecure FTP over SSH
SMTP25/587TCPSending email
IMAP143/993TCPReceiving/managing email on server
POP3110/995TCPDownloading email from server
DNS53UDP/TCPDomain name to IP resolution
DHCP67/68UDPAutomatic IP address assignment
SSH22TCPSecure remote shell access
Telnet23TCPUnsecure remote access (legacy)
SNMP161/162UDPNetwork 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

  1. Client queries its local resolver (configured in OS, usually from DHCP)
  2. Local resolver checks its cache — if found, return immediately
  3. If not cached, resolver queries Root DNS Server → learns TLD nameserver address
  4. Queries TLD nameserver (e.g., .com TLD server) → learns authoritative nameserver
  5. Queries authoritative nameserver for google.com → gets final IP
  6. Returns IP to client; caches result for TTL duration

DNS Record Types

RecordPurposeExample
AIPv4 addresswww.example.com → 93.184.216.34
AAAAIPv6 addresswww.example.com → 2606:2800::1
CNAMEAlias to another hostnamewww → example.com
MXMail exchange serverexample.com → mail.example.com
NSName serverexample.com → ns1.example.com
TXTText recordSPF, DKIM, domain verification
PTRReverse 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.