Sobes.tech
Middle

What happens at the transport layer?

sobes.tech AI

Answer from AI

At the Transport Layer of the OSI/TCP/IP model, interaction occurs between applications on different hosts, not between the hosts themselves. Main functions:

  • Segmentation and reassembly of data: Data from upper layers is divided into segments (for TCP) or datagrams (for UDP) and passed to the network layer. On the receiving side, these parts are reassembled.
  • Application identification (Ports): Port numbers are used to distinguish applications running on the same host. For example, a web server typically uses port 80 (HTTP) or 443 (HTTPS).
  • Flow control (for TCP): Manages the data transfer rate between sender and receiver to prevent buffer overflow.
  • Error control (for TCP): Ensures reliable data delivery using sequence numbers, acknowledgments (ACKs), and retransmission of lost segments. UDP does not have built-in error control at this level.
  • Connection management (for TCP): Establishes, maintains, and terminates a logical connection between applications. A typical example is the "three-way handshake" for establishing a TCP connection. UDP is a connectionless protocol.

Two main transport layer protocols:

  1. TCP (Transmission Control Protocol): Reliable, connection-oriented protocol. Guarantees data delivery in the correct order. Used for applications requiring high reliability (e.g., HTTP, FTP, SMTP).
  2. UDP (User Datagram Protocol): Unreliable, connectionless protocol. Does not guarantee delivery or order of packets. Used for applications where speed is more important than reliability (e.g., DNS, DHCP, streaming video/audio).

Comparison of TCP and UDP:

Characteristic TCP UDP
Type Connection-oriented Connectionless
Reliability High (guaranteed delivery) Low (no delivery guarantees)
Error control Present (ACK, retransmission) Absent
Flow control Present Absent
Delivery order Guaranteed Not guaranteed
Overhead High Low
Speed Lower Higher
Application examples HTTP, FTP, SMTP, SSH DNS, DHCP, VoIP, streaming video/audio

At this level, logical interaction occurs between processes running on end hosts, providing services to the network layer (transmitting segments/datagrams) and receiving data from the session layer or application layer, depending on the model.