Concentre-se na conectividade da fibra óptica!

qual é o pdu associado à camada de transporte

qual é o pdu associado à camada de transporte

The transport layer utilizes a specific protocol data unit to manage end-to-end communication. When using Transmission Control Protocol (TCP), this unit is known as a Segment. Conversely, User Datagram Protocol (UDP) employs a Datagram. These distinct units facilitate data exchange across networks. For instance, TCP accounts for approximately 55% of traffic in mobile networks, while UDP comprises about 45%. It is important to distinguish this networking term from a Distribuição de energia Unidade, which serves a different function in electrical systems.

Key Takeaways

  • The transport layer uses a Protocol Data Unit (PTU) to send data.
  • TCP uses a PDU called a Segment. UDP uses a PDU called a Datagram.
  • TCP Segments ensure data arrives correctly and in order. They are reliable.
  • UDP Datagrams send data quickly. They do not guarantee delivery or order.
  • Port numbers help the transport layer send data to the right application.
  • TCP is good for web browsing and email. UDP is good for video streaming and online games.
  • Choosing the right PTU helps applications work best.

Understanding the Transport Layer and its Protocol Data Unit

Understanding the Transport Layer and its Protocol Data Unit

The Transport Layer’s Role in Networking

Position in the OSI and TCP/IP Models

The transport layer holds a crucial position within network architecture. In the Open Systems Interconnection (OSI) model, it resides as Layer 4, directly above the network layer and below the session layer. Similarly, in the more widely implemented TCP/IP model, the transport layer sits between the internet layer and the application layer. This placement allows it to bridge the gap between network-level data delivery and application-specific communication.

Core Responsibilities for End-to-End Communication

The transport layer assumes significant responsibilities for ensuring effective end-to-end communication between applications running on different hosts. It supports process-to-process delivery, allowing multiple applications to share a single network connection. This layer performs multiplexing and demultiplexing, using port numbers to direct data to the correct application process. It also divides data from upper layers into segments (for TCP) or datagrams (for UDP) and adds necessary headers. Furthermore, the transport layer handles error detection, retransmission, and sequencing to maintain reliable communication. It coordinates flow control to prevent the receiver from being overloaded, managing data transmission rates to prevent a fast sender from overwhelming the receiver’s data buffer.

Introduction to the Transport Layer Protocol Data Unit

What is a Protocol Data Unit?

A Unidade de dados de protocolo (PDU) represents the fundamental unit of exchange between entities communicating via a specific networking protocol. Network professionals utilize PDUs when working with multilayer protocol stacks and managing protocol interactions. Networking protocols, especially those developed within layered reference models like the OSI or TCP/IP models, define their data exchange units. For example, a packet serves as the PDU for IP, which governs interactions between hosts identified by IP addresses at the network layer. PDUs typically consist of a protocol header, containing specific data like destination and source addresses, and a payload, which is the actual information transmitted.

Why the Transport Layer Needs a Specific PDU

The transport layer requires its own specific protocol data unit to manage the complexities of process-to-process communication. Unlike the network layer, which focuses on host-to-host delivery, the transport layer must ensure data reaches the correct application on that host. This necessitates additional information within the PDU, such as port numbers, to identify specific applications. The PDU also carries information for reliability, flow control, and connection management, depending on the chosen transport protocol.

The TCP Segment: A Reliable Protocol Data Unit

Defining the TCP Segment

Characteristics of a TCP Segment

A TCP segment represents the fundamental unit of data transmission within the Transmission Control Protocol. Each segment consists of a header and a payload. The header carries essential metadata for transmission. Its size typically ranges from 20 bytes to a maximum of 60 bytes if optional fields, such as timestamps or selective acknowledgments, are included. The Maximum Segment Size (MSS) defines the largest amount of data, excluding the header, that a TCP segment can carry. This is a Layer 4 concept directly influenced by the Maximum Transmission Unit (MTU) of the underlying Layer 2 network. Network engineers calculate MSS as MTU - IPHeader - TCPHeader. For example, with an Ethernet MTU of 1500 bytes, a 20-byte IP header, and a 20-byte TCP header, the MSS becomes 1460 bytes. Common MSS values include 512 bytes for older networks and 1460 bytes, which is the default on most Ethernet/IP networks.

Purpose of the TCP Segment Protocol Data Unit

The primary purpose of the TCP segment protocol data unit is to provide reliable, ordered, and error-corrected data transmission between applications. It organizes data for secure transmission between a server and a client. This ensures data integrity regardless of the amount of information exchanged. The TCP segment guarantees data is received error-free and in the correct order through mechanisms like error detection, packet re-transmission, and sequencing.

Key Components of a TCP Segment Header

Source and Destination Port Numbers

The TCP segment header includes crucial fields for identifying the communicating applications. A 16-bit Source Port field identifies the sender’s application port number. Similarly, a 16-bit Destination Port field identifies the receiver’s application port number. These port numbers enable multiplexing and demultiplexing, ensuring data reaches the correct process on the destination host.

Sequence and Acknowledgment Numbers

Sequence numbers are vital for ordered delivery. A 32-bit Sequence Number field assigns a unique number to every byte of data. This number indicates the byte number of the first byte in the segment. It helps reassemble out-of-order segments. The 32-bit Acknowledgment Number field indicates the next expected sequence number from the sender. This confirms the receipt of previous bytes and is present when the ACK flag is set.

Control Flags and Window Size

The TCP header contains several control flags, each serving a specific function. These include:

  • SYN (Synchronize): Used to initiate a connection during the three-way handshake.
  • ACK (Acknowledgment): Indicates that the Acknowledgment Number field is significant.
  • FIN (Finish): Signals the end of data transmission from the sender.
  • RST (Reset): Resets the connection due to an unrecoverable error.
  • URG (Urgent): Indicates that the Urgent Pointer field is significant, pointing to urgent data.
  • PSH (Push): Requests immediate delivery of buffered data to the application.
    The Window Size field, a 16-bit value, is crucial for flow control. It specifies the amount of data the receiver is willing to accept, preventing a fast sender from overwhelming a slower receiver. This value can scale up to 1 GB or more with the Window Scale option.

Functions Enabled by the TCP Segment Protocol Data Unit

Reliable Data Transfer and Error Recovery

TCP ensures reliable data transfer through a combination of acknowledgments, timeouts, and retransmission mechanisms. Each segment includes a checksum field to detect corruption. If a segment is corrupted, the destination TCP discards it, treating it as lost. TCP uses acknowledgments to confirm the successful delivery of data segments. Missing, delayed, or corrupted segments are retransmitted. This occurs either when the sender receives three duplicate acknowledgments, known as Fast Retransmission, or when a retransmission timer expires, referred to as Retransmission after RTO. Pipelined protocols like Go-Back-N and Selective Repeat also handle lost or corrupted data and acknowledgment packets, further enhancing reliability.

Flow Control and Congestion Management

TCP employs sophisticated mechanisms for flow control and congestion management. Flow control limits the number of unacknowledged segments based on the receiver’s advertised receive window size (RWND). The maximum data in flight is the minimum of RWND and the congestion window (CWND). For congestion management, TCP uses a congestion control algorithm incorporating Additive-Increase/Multiplicative-Decrease (AIMD) and slow start. The congestion window (CWND) regulates the sending rate, limiting the total number of unacknowledged packets in transit. Slow start helps TCP flows quickly reach link capacity by exponentially increasing CWND. Once a slow start threshold is met, the flow enters congestion avoidance, and AIMD takes over, leading to linear CWND growth.

Connection Establishment and Termination

TCP segments facilitate connection establishment through a three-way handshake. A client initiates an active open by sending a SYN segment with its initial sequence number. The server acknowledges the client’s SYN and sends its own SYN in a single segment. Finally, the client acknowledges the server’s SYN, establishing the connection. Connection termination involves a four-way handshake. One application performs an active close by sending a FIN segment, indicating it has no more data to send. The other end receives the FIN, acknowledges it, and passes an end-of-file to its application. Later, that application closes its socket, causing its TCP to send a FIN. The system that performed the active close receives and acknowledges this final FIN, completing the termination.

The UDP Datagram: A Connectionless Protocol Data Unit

Defining the UDP Datagram

Characteristics of a UDP Datagram

A UDP datagram represents a simple, message-oriented transport layer protocol. It includes integrity verification through a checksum for both its header and payload. However, it offers no guarantees for message delivery to the upper layer protocol. The UDP layer does not retain any state of messages once it sends them, leading to its occasional designation as the ‘Unreliable Datagram Protocol’. Any desired transmission reliability must be implemented at the application level.

UDP datagrams possess several key characteristics:

  • Simple and Lightweight Structure: Each UDP datagram includes fields for Source Port, Destination Port, Length, Checksum (optional in IPv4, mandatory in IPv6), and Data.
  • Lack of Reliability: UDP does not provide acknowledgments or retransmissions. This means lost or corrupted packets may go unnoticed, making it unsuitable for applications requiring guaranteed delivery.
  • Connectionless Protocol: UDP does not establish a connection before data transmission. It treats each datagram as an independent unit without guarantees of delivery or order.
  • Simplicity and Efficiency: It has lower overhead and latency compared to TCP due to the absence of connection establishment and maintenance.
  • Stateless: Neither the sender nor receiver maintains state or connection-related information.
  • No Congestion Control: UDP sends data regardless of network conditions, potentially leading to packet loss if the network becomes overwhelmed.
  • No Flow Control: It lacks mechanisms to prevent a sender from overwhelming a receiver with too much data.
  • No Error Recovery or Sequencing: UDP offers no guarantees that packets will arrive, arrive in order, or arrive only once; packets may be out of order, duplicated, or lost.

Purpose of the UDP Datagram Protocol Data Unit

The User Datagram Protocol (UDP) serves as a communication protocol specifically chosen for time-sensitive applications. These include gaming, video playback, or Domain Name System (DNS) lookups. Its speedier communication stems from not spending time forming a firm connection with the destination before transferring data. UDP is primarily used to establish low-latency and loss-tolerating connections between applications on the internet. It prioritizes speed by enabling data transfer before the receiving party provides an agreement. This makes it beneficial for time-sensitive communications like VoIP, DNS lookups, and video or audio playback.

Key Components of a UDP Datagram Header

Source and Destination Port Numbers

The UDP datagram header contains essential fields for identifying the communicating applications. A Source Port field identifies the sender’s port when present. If not used, it is set to zero. The Destination Port field identifies the receiver’s port and is a required field. These port numbers allow the transport layer to direct the datagram to the correct application process on the destination host.

Length and Checksum Fields

The Length field specifies the total length of the UDP header and data in bytes. The minimum length is 8 bytes, which is the size of the header itself. The theoretical maximum is 65,535 bytes, but IPv4 limits data length to 65,507 bytes. For IPv6 jumbograms, the length field is zero if the total length exceeds 65,535 bytes. The Checksum field may be used for error-checking. It is optional in IPv4 and mandatory in most cases in IPv6. If unused, it contains all zeros.

Functions Enabled by the UDP Datagram Protocol Data Unit

Connectionless Communication and Minimal Overhead

UDP enables connectionless communication by allowing senders to transmit data packets (datagrams) directly to recipients. It does this without first establishing a dedicated connection or performing a handshake. This means no acknowledgment is required, facilitating uninterrupted data flow. UDP’s minimal overhead stems from several design choices. It uses a simple packet structure, which reduces the processing time and resources needed at both the sender and receiver. Unlike TCP, UDP does not implement flow control to regulate data transfer rates. It also lacks error recovery; UDP does not retransmit lost packets or handle error correction. Applications using UDP are responsible for managing data integrity and retransmissions if necessary. This omission of reliability mechanisms makes UDP faster and simpler.

Speed Over Reliability

UDP is a connectionless protocol that prioritizes speed. It does not establish a formal connection or verify data receipt. It simply sends data as individual datagrams without a handshake, similar to sending a postcard. This approach leads to unreliable delivery as it does not guarantee delivery, order, or error correction. When considering speed versus reliability, smaller datagrams are more reliable as they are less likely to be lost, corrupted, or reordered. They are also less prone to fragmentation, dropping, or delays. Larger datagrams are more efficient and faster due to carrying more payload per overhead unit, which reduces packet count and processing load. However, larger datagrams are less reliable as they are more prone to loss, corruption, reordering, network congestion, latency, and jitter. They also consume more bandwidth and resources.

Comparing the Transport Layer Protocol Data Units: Segment vs. Datagram

Comparing the Transport Layer Protocol Data Units: Segment vs. Datagram

Fundamental Differences in Protocol Data Unit Design

Reliability, Speed, and Overhead Comparison

TCP segments and UDP datagrams exhibit fundamental design differences, directly impacting their reliability, speed, and overhead. TCP prioritizes guaranteed data integrity. It ensures reliable data delivery and retransmits lost data. TCP uses sequence numbers to ensure data reassembly in the correct order. It performs robust error checking with checksums on both header and data. Furthermore, TCP incorporates built-in mechanisms to prevent network congestion. Conversely, UDP does not track or resend packets, leading to potential data loss. It also fails to track or re-order data, which can be problematic for sequential processing. UDP lacks mechanisms to slow down transmission during congestion.

TCP’s comprehensive features contribute to higher latency due to its three-way handshake and constant acknowledgments. It also incurs greater overhead with a larger 20-60 byte header, consuming more bandwidth. TCP is resource-intensive, requiring more memory and processing for connection state, timers, and sequence numbers. A lost packet in TCP can delay subsequent packets in the stream, a phenomenon known as head-of-line blocking. UDP, however, offers a faster, simpler, and more efficient approach. Its fixed 8-byte header results in very low overhead.

Feature TCP (Transmission Control Protocol) UDP (User Datagram Protocol)
Confiabilidade Guarantees data delivery. Does not guarantee data delivery.
Velocidade Comparatively slower. Faster, simpler, and more efficient.
Header Length Variable length (20-60 bytes). Fixed length (8 bytes).
Despesas gerais Low, but higher than UDP. Very low.

Connection-Oriented vs. Connectionless Approaches

The approach to establishing communication also distinguishes these two transport layer protocol data units. TCP is connection-oriented. It establishes a dedicated connection using a three-way handshake (SYN, SYN-ACK, ACK) before data transfer. It terminates this connection with a four-way handshake. TCP actively tracks the communication state throughout the session. In contrast, UDP is connectionless. It sends data without a preliminary handshake or a dedicated connection. Each packet transmits independently, and UDP does not track communication state.

Practical Applications of Each Protocol Data Unit

Use Cases for TCP Segments

Applications requiring reliable, ordered, and error-controlled data transmission predominantly use TCP segments. Text communication applications like WhatsApp, Instagram, Google Chat, and iMessage rely on TCP. The File Transfer Protocol (FTP) is essential for transferring files where data loss is unacceptable and correct order is crucial. The HyperText Transfer Protocol (HTTP), utilized for accessing web pages, leverages TCP’s capabilities for in-order data delivery, error control, flow control, and retransmission of data segments. Simple Mail Transfer Protocol (SMTP), an application layer protocol for sending emails, also relies on TCP services.

Use Cases for UDP Datagrams

Applications prioritizing speed over reliability often employ UDP datagrams. Live video streaming, used by VoIP and video conferencing, benefits from UDP’s lower overhead and tolerance to packet loss, which reduces latency. The Domain Name System (DNS) typically uses UDP for fast and lightweight queries. Market data multicast utilizes UDP in low-latency trading for efficient delivery of market data to multiple recipients simultaneously. Internet of Things (IoT) devices often employ UDP for sending small data packets. Streaming services like YouTube and Netflix rely on UDP for smooth, real-time playback by minimizing latency and allowing minor packet loss. Multiplayer games also prefer UDP to ensure real-time responsiveness and a smooth gaming experience, tolerating minor packet loss.

The Significance of the Transport Layer Protocol Data Unit

How PDUs Facilitate Process-to-Process Delivery

The Role of Port Numbers in PDU Routing

Transport layer PDUs, such as segments or datagrams, are crucial for extending the network layer’s host-to-host delivery service to a process-to-process delivery service. This involves application multiplexing and demultiplexing. On the sending side, the transport layer converts application messages into Transport PDUs by potentially breaking them into smaller chunks and adding a transport-layer header. These PDUs then pass to the network layer. On the receiving side, the transport layer receives these PDUs from the network layer, removes the transport header, reassembles the messages, and delivers them to the correct application process. This ensures applications running on different hosts can communicate logically, even though they are not physically connected.

Port numbers are crucial at the transport layer for identifying specific applications or services on a host. When data arrives at a destination, the transport layer uses the port number in the header to direct the data to the correct application. For example, port 80 handles HTTP traffic, and port 25 manages email. This mechanism enables multiple applications on a single device to communicate simultaneously without data misdirection.

Encapsulation and Decapsulation of the Protocol Data Unit

At the Transport Layer, encapsulation involves adding either a TCP or UDP header to the data. TCP headers are comprehensive, including source and destination port numbers, sequence numbers, acknowledgment numbers, window size, and control flags. In contrast, UDP headers are simpler, containing only source port, destination port, length, and checksum fields. This process transforms the data into a segment for TCP or a datagram for UDP. Decapsulation at this layer focuses on examining port numbers to direct the data to the correct application. For TCP, it also manages sequence numbers, acknowledgments, and flow control before removing the transport header and delivering the data to the application.

Impact on Network Performance and Application Design

Choosing the Appropriate Protocol Data Unit

The choice between a TCP segment and a UDP datagram significantly impacts network performance and application design. TCP ensures data integrity for critical applications like financial transactions and medical records, guaranteeing delivery. However, TCP overhead significantly impacts performance due to additional headers, acknowledgment traffic, and retransmissions, consuming bandwidth and processing resources. Head-of-line blocking can also delay subsequent data segments while waiting for missing ones to be retransmitted, particularly affecting performance in high-latency networks.

Conversely, UDP offers lightweight communication with minimal overhead, crucial for time-sensitive applications that cannot tolerate delays. Applications like video streaming (YouTube, Netflix) prefer UDP. Dropping a single frame is preferable to pausing the stream for retransmission, as users might only notice a minor glitch. Online gaming also benefits from UDP; receiving slightly outdated information is better than perfect information too late.

Optimizing for Different Communication Needs

Optimizing communication needs involves selecting the right transport layer protocol and implementing specific strategies. For instance, a PDU Router (PduR) efficiently routes PDUs between different communication protocols. It acts as a gateway for transmitting received PDUs between bus-specific interface modules or controllers. The CAN Transport Protocol (CanTp) optimizes message size by segmenting large PDUs and reassembling them at the receiver, including flow control. Developers consider the type of data, bandwidth requirements, reliability needs, and hardware costs when choosing protocols.


The transport layer’s protocol data unit is either a TCP Segment or a UDP Datagram. TCP Segments ensure reliable, ordered, and error-checked data delivery. UDP Datagrams optimize for fast, connectionless, and low-overhead transmission. Each PDU type serves distinct communication requirements. This makes the choice between them crucial for application performance and network efficiency. Understanding these PDUs is fundamental to comprehending how data travels across networks and reaches its intended process.

FAQ

What is the primary difference between a TCP Segment and a UDP Datagram?

A TCP Segment offers reliable, ordered, and error-checked data delivery. Conversely, a UDP Datagram provides fast, connectionless, and low-overhead transmission. Developers choose between them based on application needs.

Why do applications use TCP Segments?

Applications use TCP Segments when they require guaranteed data delivery. This includes web browsing, email, and file transfers. TCP ensures data arrives correctly and in the proper sequence.

When is a UDP Datagram the better choice for an application?

Applications prioritize speed over reliability when using UDP Datagrams. Examples include live video streaming, online gaming, and DNS lookups. These applications tolerate minor data loss for reduced latency.

What role do port numbers play in transport layer PDUs?

Port numbers identify specific applications on a host. They allow the transport layer to direct incoming data to the correct software process. This enables multiple applications to communicate simultaneously.

Does UDP provide any form of error checking?

Yes, UDP includes a checksum field. This checksum helps detect corruption in the header and payload. However, UDP does not retransmit lost or corrupted datagrams.

What is the purpose of TCP’s sequence and acknowledgment numbers?

Sequence numbers ensure ordered data delivery. They identify the position of data within the stream. Acknowledgment numbers confirm the successful receipt of data, enabling reliability and retransmission.

Can a single application use both TCP and UDP?

Yes, an application can use both TCP and UDP for different functions. For example, a gaming application might use UDP for real-time gameplay data and TCP for login or chat features.

Peça Citação AGORA!

pt_PT_ao90Portuguese