Systems Approach to Computer Networks

📡Systems Approach to Computer Networks Unit 8 – Transport Layer: Reliable Data Transfer

The transport layer's reliable data transfer ensures accurate and ordered delivery of data between sender and receiver. It tackles challenges like packet loss, corruption, and reordering using techniques such as error detection, sequence numbering, and acknowledgments. Reliable data transfer protocols implement algorithms to guarantee delivery, using sequence numbers and acknowledgments. They employ timeouts, retransmissions, and sliding window protocols to handle lost packets and improve efficiency. These mechanisms form the backbone of reliable communication in computer networks.

Key Concepts

  • Reliable data transfer ensures data is delivered accurately and in the correct order from sender to receiver
  • Focuses on handling issues such as packet loss, corruption, duplication, and reordering that can occur during network transmission
  • Utilizes techniques like error detection, error correction, sequence numbering, and acknowledgments to achieve reliability
  • Implements flow control mechanisms to prevent the sender from overwhelming the receiver with data
    • Manages the rate at which data is sent based on the receiver's capacity to process and store the incoming data
  • Incorporates congestion control strategies to avoid network congestion and maintain optimal performance
  • Builds upon the services provided by the underlying network layer (typically IP) to provide a reliable end-to-end communication channel
  • Commonly implemented in the transport layer protocols such as TCP (Transmission Control Protocol)

Reliable Data Transfer Protocols

  • Implement specific algorithms and mechanisms to ensure reliable data delivery between sender and receiver
  • Use sequence numbers to identify and order packets, allowing the receiver to detect missing or out-of-order packets
  • Employ acknowledgments (ACKs) sent by the receiver to confirm the successful receipt of packets
    • Positive acknowledgments (ACKs) indicate correctly received packets
    • Negative acknowledgments (NACKs) indicate corrupted or missing packets
  • Utilize timeouts and retransmissions to handle lost or delayed packets
    • If an acknowledgment is not received within a specified time (timeout), the sender assumes the packet was lost and retransmits it
  • Implement error detection techniques (checksums, CRCs) to identify corrupted packets and request retransmission
  • Incorporate sliding window protocols to enable efficient and reliable data transfer
    • Allow multiple packets to be sent and acknowledged simultaneously, improving throughput

Challenges in Network Communication

  • Packet loss occurs when packets fail to reach their destination due to network congestion, link failures, or other factors
    • Results in missing data and requires retransmission of lost packets
  • Packet corruption happens when bits in a packet are altered during transmission, leading to invalid data
    • Can be caused by physical layer issues (noise, interference) or hardware malfunctions
  • Packet duplication arises when the same packet is received multiple times by the receiver
    • May occur due to retransmissions or network anomalies, requiring duplicate detection and handling
  • Packet reordering happens when packets arrive at the receiver in a different order than they were sent
    • Can be caused by multiple paths, varying network delays, or parallel processing at intermediate nodes
  • Limited bandwidth and network congestion can impact the performance and reliability of data transfer
  • Heterogeneous network environments with different link capacities, latencies, and reliability characteristics pose challenges

Error Detection and Correction

  • Error detection techniques identify errors in transmitted data without necessarily correcting them
    • Checksums calculate a fixed-size value based on the data and append it to the packet for verification at the receiver
    • Cyclic Redundancy Checks (CRCs) use polynomial division to generate a checksum that can detect a wide range of errors
  • Error correction techniques not only detect errors but also attempt to correct them without retransmission
    • Forward Error Correction (FEC) adds redundant data to the original message, allowing the receiver to recover from a limited number of errors
    • Automatic Repeat Request (ARQ) combines error detection with retransmission of erroneous packets
      • Stop-and-Wait ARQ sends one packet at a time and waits for an acknowledgment before sending the next packet
      • Go-Back-N ARQ uses a sliding window to send multiple packets and retransmits all packets starting from the lost or corrupted one
      • Selective Repeat ARQ retransmits only the specific packets that are lost or corrupted, minimizing unnecessary retransmissions

Flow Control Mechanisms

  • Prevent the sender from overwhelming the receiver by sending data faster than the receiver can process and store it
  • Sliding window protocol is a common flow control mechanism used in reliable data transfer protocols
    • Sender maintains a window of packets that can be sent without waiting for individual acknowledgments
    • Receiver advertises its available buffer space (receiver window) to the sender, limiting the amount of unacknowledged data
  • Stop-and-Wait flow control sends one packet at a time and waits for an acknowledgment before sending the next packet
    • Simple but inefficient for high-latency networks due to the idle time between packets
  • Credit-based flow control assigns credits to the sender, representing the number of packets the receiver can accept
    • Sender decrements credits as packets are sent and increments them as acknowledgments are received
  • Rate-based flow control adjusts the sending rate based on the receiver's processing capacity and network conditions
    • Receiver provides feedback to the sender about its current receiving rate or available buffer space

Congestion Control Strategies

  • Aim to prevent and mitigate network congestion by regulating the rate at which senders inject data into the network
  • Slow start is a congestion control mechanism used by TCP to gradually increase the sending rate at the beginning of a connection
    • Sender starts with a small congestion window (cwnd) and doubles it with each round-trip time (RTT) until a threshold is reached
  • Congestion avoidance phase follows the slow start and aims to find the optimal sending rate without causing congestion
    • Sender increases the congestion window by one maximum segment size (MSS) per RTT until congestion is detected
  • Fast retransmit and fast recovery optimize the recovery process when packet loss is detected through duplicate acknowledgments
    • Sender retransmits the lost packet immediately and reduces the congestion window by a factor (usually half) to alleviate congestion
  • Explicit Congestion Notification (ECN) allows routers to explicitly signal congestion to the sender by marking packets
    • Sender responds to ECN signals by reducing its sending rate to prevent further congestion
  • TCP congestion control algorithms (Reno, NewReno, Cubic) implement different strategies to adapt the sending rate based on network conditions

TCP vs UDP: A Comparison

  • TCP (Transmission Control Protocol) provides reliable, ordered, and error-checked delivery of data between applications
    • Establishes a connection-oriented communication channel before data transfer begins
    • Guarantees that data is delivered accurately and in the same order as sent
    • Implements flow control, congestion control, and error recovery mechanisms
    • Suitable for applications that require reliable data delivery (web browsing, email, file transfer)
  • UDP (User Datagram Protocol) offers a connectionless, unreliable, and best-effort delivery service
    • Does not establish a prior connection and sends data without any reliability guarantees
    • Provides minimal error checking and does not ensure ordered delivery or retransmission of lost packets
    • Has lower overhead and latency compared to TCP due to its simplicity
    • Suitable for applications that prioritize speed and can tolerate some data loss (streaming media, online gaming, DNS)

Real-World Applications

  • Web browsers use TCP to ensure reliable delivery of web pages, images, and other content from servers to clients
  • Email clients and servers rely on TCP to guarantee the accurate and complete transfer of email messages and attachments
  • File transfer protocols (FTP, SFTP) employ TCP to ensure the integrity and completeness of transferred files
  • Voice over IP (VoIP) applications often use UDP for real-time audio transmission, prioritizing low latency over reliability
  • Online gaming platforms commonly utilize UDP for fast and responsive gameplay, tolerating occasional packet loss
  • Streaming media services (video streaming, online radio) may use UDP or adaptive bitrate streaming over TCP to optimize performance
  • Domain Name System (DNS) primarily uses UDP for fast and efficient resolution of domain names to IP addresses
  • Remote administration tools (SSH, RDP) rely on TCP for secure and reliable communication between remote systems


© 2024 Fiveable Inc. All rights reserved.
AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.

© 2024 Fiveable Inc. All rights reserved.
AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.