CSS Prepare

optional · CSS study notes

Transport Layer

🧭

On this page — click any heading below to jump straight to it. ⬅️ Back to P-II.II. Computer Communications & Networks


OSI Layer: Transport Layer (L4)

Definition

The Transport Layer (OSI Layer 4) provides process-to-process delivery of the entire message between application processes running on different hosts.

Why a Transport Layer is Needed

  • Network layer delivers only host-to-host (IP address identifies a machine, not a process)
  • Multiple applications run on one host simultaneously — need port numbers to identify the correct process
  • Provides services IP does not: reliability, ordering, flow control, congestion control

Functions

  • Service-point (port) addressing — delivers to correct process
  • Segmentation and reassembly — splits message, numbers segments for reordering
  • Connection control — connectionless (UDP) or connection-oriented (TCP)
  • Flow control — end-to-end, prevents fast sender overwhelming slow receiver
  • Error control — end-to-end, retransmission of lost/corrupt segments
  • Congestion control — protects the network core from overload
  • Multiplexing/demultiplexing — many applications share one network connection

Addressing

  • Port number — 16-bit, range 0–65,535
  • Well-known ports (0–1023) — HTTP 80, HTTPS 443, FTP 20/21, SSH 22, Telnet 23, SMTP 25, DNS 53, DHCP 67/68, POP3 110, IMAP 143, SNMP 161
  • Registered ports (1024–49151) — vendor-assigned
  • Dynamic/ephemeral ports (49152–65535) — temporary, client-side
  • Socket address = IP address + port number
  • Connection identified by 4-tuple: source IP, source port, destination IP, destination port

Protocols

  • TCP — connection-oriented, reliable, byte-stream, flow + congestion control, 20-byte header
  • UDP — connectionless, unreliable, message-oriented, minimal 8-byte header
  • SCTP — message-oriented, multi-streaming and multi-homing, used in telecom signalling

TCP vs UDP

BasisTCPUDP
ConnectionConnection-oriented (handshake)Connectionless
ReliabilityGuaranteed, with retransmissionBest-effort
OrderingIn-order deliveryNo ordering
Header20 bytes (min)8 bytes
Flow controlYes (sliding window)No
Congestion controlYes (AIMD)No
SpeedSlowerFaster
UseWeb, email, file transferDNS, VoIP, streaming, gaming

Numericals

Q1 — Socket identification

A server on port 80 has 3 clients connected from IPs A, B, and C.

  • All share destination (server IP, 80) but each has a distinct source IP + source port
  • TCP distinguishes them by the 4-tuple, so 3 separate sockets exist even on one server port

Q2 — Header efficiency

Payload = 100 bytes.

  • TCP: 100 ÷ 120 = 83.3% efficient
  • UDP: 100 ÷ 108 = 92.6% efficient
  • Shows why UDP suits small, frequent real-time packets

Q3 — Maximum concurrent connections

A client with one IP can open up to 65,535 − 49,152 ≈ 16,383 ephemeral ports to a single server IP:port pair, bounding simultaneous connections from that host.

Q4 — Throughput vs window

Window = 64 KB, RTT = 100 ms.

  • Max throughput = (64 × 1,024 × 8) ÷ 0.1 = 5,242,880 bps ≈ 5.24 Mbps
  • Regardless of link speed, small window + high RTT caps throughput (need window scaling)

CSS Exam Angle

  • Standard opening line: "Network layer = host-to-host; transport layer = process-to-process" — earns immediate marks
  • The TCP vs UDP table is examinable almost every year
  • Memorise the well-known port list; it appears in MCQs
  • Link window-size numerical to bandwidth-delay product for a complete answer

Likely Questions

  1. Explain the functions of the transport layer and distinguish it from the network layer.
  2. Compare TCP and UDP with suitable applications for each.
  3. What is a socket? Explain multiplexing using the 4-tuple.

📜 Past-Paper Questions & Structured Answers

Questions are paraphrased; answer focus is suggested guidance, not an official marking scheme.

2020 · Paper-I · Q3(a) · 4 marks

Question (paraphrased): Give standard ports for HTTP, FTP, SMTP, HTTPS and DNS.

Answer focus: A compact table is sufficient; include FTP’s control/data distinction.

ServiceConventional port / transport
HTTPTCP 80
FTPTCP 21 control; TCP 20 for the server’s active-mode data connection
SMTPTCP 25 for server-to-server transfer
HTTPS443; TCP for HTTP/1.1 and HTTP/2, UDP for HTTP/3 over QUIC
DNSUDP/TCP 53

FTP passive mode uses a negotiated server data port. The classic HTTP/HTTPS TCP answer fits the paper’s context; HTTP/3 is the modern qualification.

2023 · Paper-II · Q3(c) · 6 marks

Question (paraphrased): Give two applications suited to connection-oriented service and two suited to connectionless service.

Answer focus: Exactly four examples, each justified by its delivery needs.

Service choiceApplicationWhy it fits
Connection-oriented reliable streamFile transfer using FTP/TCPMissing or reordered bytes would change the file; retransmission and ordering are valuable.
Connection-oriented reliable streamRemote login using SSH/TCPCommands and responses must arrive in sequence and without unnoticed omission.
Connectionless datagramsInteractive voice using RTP/UDPA late sample may be less useful than a small gap; the application can use jitter buffering and loss concealment.
Connectionless datagramsA small ordinary DNS lookup over UDPA short request/reply avoids connection setup; the client can retry if necessary.

Qualification: these are suitable examples, not universal rules. DNS also uses TCP, and UDP applications still need congestion control. Connection orientation alone is not identical to reliability; TCP supplies both.