ACtE0504 Transport layer¶
Transport service¶
- Transport layer provides end-to-end process communication between hosts.
- It supports segmentation, reassembly, multiplexing, de-multiplexing, and reliability or low-overhead delivery depending on protocol.
- Service is between processes, not just between machines.
Ports and sockets¶
- A port identifies an application process on a host.
- A socket is an OS-managed communication endpoint.
- A socket address is typically an IP address plus a port.
- A TCP connection is identified by source and destination IP addresses and ports together with the protocol.
- Server processes usually bind to well-known ports; clients typically use ephemeral ports.
Standard port cues¶
| Service | Default port | Transport |
|---|---|---|
| HTTP | 80 | TCP |
| HTTPS | 443 | TCP |
| FTP control | 21 | TCP |
| FTP data, active mode server side | 20 | TCP |
| SMTP | 25 | TCP |
| POP3 | 110 | TCP |
| IMAP | 143 | TCP |
| DNS | 53 | UDP mainly, TCP also used |
| SSH | 22 | TCP |
| Telnet | 23 | TCP |
FTP control listens on TCP 21. In active mode, the server normally originates the data connection from TCP 20; passive mode uses a negotiated server port rather than a universal data port.
TCP versus UDP¶
| Feature | TCP | UDP |
|---|---|---|
| Connection style | Connection-oriented | Connectionless |
| Reliability | Reliable with ACK and retransmission | Best-effort |
| Ordering | In-order byte stream | No inherent ordering guarantee |
| Flow control | Yes | No built-in end-to-end flow control |
| Congestion control | Yes | No built-in standard mechanism |
| Overhead | Higher | Lower |
| Typical use | Web, file transfer, mail | Voice, video, DNS queries, simple request-response |
Decisive cues:
- TCP offers reliability, sequencing, and congestion control.
- UDP is preferred where low latency and lower overhead matter and occasional loss is acceptable.
Connection establishment and release¶
- TCP connection establishment uses the three-way handshake: SYN, SYN-ACK, ACK.
- Connection release commonly uses FIN and ACK exchanges.
- Handshake confirms reachability and initial sequence synchronization.
Flow control and buffering¶
- Flow control prevents a fast sender from overwhelming a slow receiver.
- TCP uses a receive window for receiver-based flow control.
- Buffering temporarily stores data during rate mismatch.
- Multiplexing combines many application streams onto one host's transport service.
- De-multiplexing delivers received segments to the correct application using port numbers.
Congestion control¶
- Congestion is a network-wide overload condition, different from receiver-specific flow control.
- TCP congestion control adjusts sending behavior when packet loss or delay suggests overload.
- Classic ideas: slow start, congestion avoidance, fast retransmit, fast recovery.
Trap:
- Flow control protects the receiver.
- Congestion control protects the network.
Transport-layer examples¶
- If reliability and in-order delivery are required, choose TCP.
- If the stem highlights low overhead and query-response simplicity, UDP may fit better.
- If the question asks which field directs data to the correct process, the answer is port number.
ACtE0504 revision box¶
- Transport is end-to-end between processes.
- Port identifies process; socket identifies endpoint.
- TCP: reliable, ordered, connection-oriented.
- UDP: connectionless, low overhead, no built-in reliability.
- Three-way handshake: SYN -> SYN-ACK -> ACK.
- Flow control is not the same as congestion control.