logo
Computer Networks

05. Transport Layer

Transport Layer

1. Functions

  • End-to-end process communication
  • Transport layer addressing (port numbers)
  • Multiplexing and demultiplexing
  • Error detection, flow control, reliability

2. Transport Layer Addressing and Ports

  • Port numbers are used to identify processes within a host
  • Common ports: 80 (HTTP), 443 (HTTPS), 25 (SMTP), 53 (DNS)

3. Connectionless and Connection-oriented Services

  • Connectionless: UDP, simple and efficient, no guarantee
  • Connection-oriented: TCP, reliable transmission, guarantees order, no errors, no duplicates

4. UDP Protocol

  • UDP datagram structure: source port, destination port, length, checksum, data
  • Features: connectionless, unreliable, no congestion control, suitable for real-time applications

5. TCP Protocol

  • TCP segment structure: source/destination port, sequence number, acknowledgment number, flags, window, checksum, urgent pointer, options, data
  • Connection management: three-way handshake to establish, four-way handshake to terminate
  • Reliable transmission: sequence numbers, acknowledgments, timeout retransmission, sliding window, flow control, congestion control
  • Flow control: sliding window, prevents sender from sending too fast
  • Congestion control: slow start, congestion avoidance, fast retransmit, fast recovery

Exercises

  1. Briefly describe the main functions of the transport layer.
  2. What are the main differences between UDP and TCP?
  3. How does TCP achieve reliable transmission?
  4. What is the difference between TCP flow control and congestion control?
  5. What are the processes for establishing and releasing a TCP connection?
  6. What is the function of port numbers? Give examples of common ports.
Reference Answers

1. Main Functions

End-to-end communication, addressing, multiplexing/demultiplexing, reliability, flow control


2. Differences between UDP and TCP

UDP: connectionless, unreliable, no congestion control; TCP: connection-oriented, reliable, ordered, flow control, congestion control


3. TCP Reliable Transmission

Sequence numbers, acknowledgments, timeout retransmission, sliding window, flow control, congestion control


4. Flow Control vs. Congestion Control

Flow control prevents receiver overload, congestion control prevents network overload


5. TCP Connection Establishment and Release

Three-way handshake to establish, four-way handshake to release


6. Function and Examples of Port Numbers

Identify processes within a host. Common ports: 80 (HTTP), 443 (HTTPS), 25 (SMTP), 53 (DNS)