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
| Basis | TCP | UDP |
|---|---|---|
| Connection | Connection-oriented (handshake) | Connectionless |
| Reliability | Guaranteed, with retransmission | Best-effort |
| Ordering | In-order delivery | No ordering |
| Header | 20 bytes (min) | 8 bytes |
| Flow control | Yes (sliding window) | No |
| Congestion control | Yes (AIMD) | No |
| Speed | Slower | Faster |
| Use | Web, email, file transfer | DNS, 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
- Explain the functions of the transport layer and distinguish it from the network layer.
- Compare TCP and UDP with suitable applications for each.
- 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.
| Service | Conventional port / transport |
|---|---|
| HTTP | TCP 80 |
| FTP | TCP 21 control; TCP 20 for the server’s active-mode data connection |
| SMTP | TCP 25 for server-to-server transfer |
| HTTPS | 443; TCP for HTTP/1.1 and HTTP/2, UDP for HTTP/3 over QUIC |
| DNS | UDP/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 choice | Application | Why it fits |
|---|---|---|
| Connection-oriented reliable stream | File transfer using FTP/TCP | Missing or reordered bytes would change the file; retransmission and ordering are valuable. |
| Connection-oriented reliable stream | Remote login using SSH/TCP | Commands and responses must arrive in sequence and without unnoticed omission. |
| Connectionless datagrams | Interactive voice using RTP/UDP | A late sample may be less useful than a small gap; the application can use jitter buffering and loss concealment. |
| Connectionless datagrams | A small ordinary DNS lookup over UDP | A 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.