Transfer Presented by: Muhammad Bilal Course: Computer Networks Topics to be Covered • Packet vs Frame • What is Reliable Data Transfer? • Why is Reliable Data Transfer Important? • Principles of Reliable Data Transfer • Stop-and-wait and Go-back-N design and evaluation • TCP and UDP semantics and syntax • TCP RTT estimation Packet vs Frame What is Reliable Data Transfer? • Reliable Data Transfer (RDT) is a crucial concept in computer networking. • It refers to the assurance that data sent from one computer or device to another arrives accurately and in the correct order. Why is Reliable Data Transfer Important? • Reliable data transfer is fundamental to ensure the integrity and consistency of data transmission. • In computer networking, data may traverse various types of networks, including wired and wireless, with different characteristics, such as packet loss, delay, and jitter. • The significance of reliable data transfer lies in several key aspects: Key principles of reliable data transfer Reliable data transfer is a fundamental concept in computer networking that ensures data is transmitted accurately and in the correct order from a sender to a receiver. It involves several principles and techniques to achieve this goal. Below are the key principles of reliable data transfer:
• Error Detection and Correction • Selective Repeat
• Sequential Packet Delivery • Congestion Control • Acknowledgments (ACKs) • Buffering • Timeouts • Acknowledgment Numbering • Flow Control • Windowing • Duplication Handling • Checksums • Timer Management • Retransmission • Finite State Machines Key principles of reliable data transfer (1/4) • Error Detection and Correction: Reliable data transfer protocols incorporate error detection and correction mechanisms to identify and rectify errors that may occur during transmission. Common techniques include checksums and parity checks. • Sequential Packet Delivery: Data packets are sent and received in a sequential order to ensure that the data is reconstructed correctly. The receiver reorders the packets if necessary. • Acknowledgments (ACKs): The receiver sends acknowledgments to the sender to confirm the successful receipt of data packets. If an ACK is not received, the sender assumes that the packet was lost or corrupted and retransmits it. Key principles of reliable data transfer • Timeouts: To account for network delays and potential packet loss, reliable data transfer protocols use timeout mechanisms. If an acknowledgment is not received within a specified time, the sender retransmits the packet. • Flow Control: Flow control mechanisms prevent the sender from overwhelming the receiver with data. The receiver signals the sender when it is ready to receive more data, ensuring efficient data transfer. • Windowing: In protocols like Go-Back-N and Selective Repeat, a window of sent but unacknowledged packets is maintained. This allows for pipelining of multiple packets without waiting for individual ACKs. • Checksums: Checksums are used to detect errors in data packets. The receiver calculates a checksum based on the received data and compares it to the sender's checksum. A mismatch indicates an error. Key principles of reliable data transfer • Retransmission: When packet loss or corruption is detected, the sender retransmits the affected packets. This process continues until all packets are successfully received and acknowledged. • Selective Repeat: In this approach, the sender only retransmits the lost or corrupted packets, rather than all packets in the window, making it more efficient than some other protocols like Go-Back-N. • Congestion Control: Reliable data transfer protocols may incorporate congestion control mechanisms to prevent network congestion, which can lead to packet loss and decreased performance. • Buffering: Both sender and receiver may use buffers to store and manage incoming and outgoing packets. Buffers help manage the flow of data and prevent data loss due to speed mismatches between sender and receiver. • Acknowledgment Numbering: To keep track of packets, sequence numbers or acknowledgment numbers are assigned to each packet. These numbers aid in identifying missing or out-of-order packets. Key principles of reliable data transfer • Duplication Handling: Receivers are designed to discard duplicate packets, ensuring that only one copy of each packet is delivered to the higher-layer application. • Timer Management: Timers are used to track the elapsed time since packet transmission. If a timer expires without receiving an acknowledgment, the sender initiates retransmission. • Finite State Machines: Many reliable data transfer protocols are designed using finite state machines to manage different states such as sending, receiving, and error recovery. Stop-and-Wait Protocol: • Stop-and-Wait is a simple and straightforward protocol for reliable data transfer. The sender sends one packet and waits for an acknowledgment (ACK) before sending the next packet. • The Stop-and-Wait protocol is a simple and widely used protocol for reliable data transfer in computer networking. It is primarily used in situations where reliability is more critical than high throughput. Working of Stop and wait Protocol • The sender transmits a data packet to the receiver. • The receiver receives the packet and checks for errors using error detection mechanisms (e.g., checksums). • If the receiver successfully receives the packet without errors, it sends an ACK to the sender. • The sender, upon receiving the ACK, considers the packet as successfully delivered and proceeds to send the next packet (if any). • If the sender does not receive an acknowledgment within a specified timeout period, it assumes the packet was lost or corrupted during transmission. • In this case, the sender retransmits the same packet. • Stop-and-Wait inherently provides flow control, as the sender only sends a new packet when it receives an acknowledgment for the previous one. • This prevents the sender from overwhelming the receiver. • If an ACK is not received or if the ACK is lost, the sender will retransmit the same packet. • The receiver can detect duplicate packets and discard them. • Since the sender waits for an acknowledgment before sending the next packet, out-of-order packet arrival is not a concern in Stop-and-Wait. Stop-and-Wait is not highly efficient, especially in situations with high network latency or high bandwidth-delay products. It may lead to underutilization of network resources because the sender often needs to wait for ACKs. Example 1 Use Cases • Stop-and-Wait is typically used in scenarios where reliability is paramount, and the data transfer rate is not a critical factor. • It is suitable for low-error-rate environments, such as local networks or applications with minimal latency tolerance. Go-Back-N ARQ Protocol • The Go-Back-N (GBN) protocol is a widely used automatic repeat request (ARQ) protocol for reliable data transfer in computer networking. It is designed to improve the efficiency of data transfer compared to simpler protocols like Stop-and-Wait. Here are the key characteristics and workings of the Go-Back-N protocol: Working of Go-Back-N ARQ 1. Basics • Go-Back-N allows the sender to transmit multiple data packets (a "window" of packets) before waiting for acknowledgments (ACKs) from the receiver. • The receiver acknowledges correctly received packets using cumulative acknowledgments. 2. Window Size: • The sender maintains a window of outstanding (unacknowledged) packets. • The window size determines how many packets can be sent before waiting for ACKs. • The receiver expects to receive packets within a specific sequence number range, and the window slides as ACKs are received. Working of Go-Back-N Protocol (Cont ..) 3. Data Transmission: • The sender can transmit multiple data packets within the window. • Each packet is assigned a sequence number. • The receiver receives the packets and checks for errors using error detection mechanisms. 4. Acknowledgment: • The receiver sends cumulative ACKs for the highest consecutive sequence number received successfully. • For example, if packets 1, 2, and 3 are received correctly, the receiver sends an ACK for packet 4, indicating that packets 1, 2, and 3 have been received and can be acknowledged. Working of Go-Back-N Protocol (Cont ..) 5. Timeout Mechanism: • The sender maintains individual timers for each unacknowledged packet in the window. • If the sender's timer for a particular packet expires (indicating that an ACK was not received in time), it retransmits all unacknowledged packets starting from that packet. 6. Flow Control: • Go-Back-N provides flow control by allowing the sender to transmit multiple packets in a single window, reducing the waiting time compared to Stop-and-Wait. 7. Error Handling: • If a packet is lost or corrupted in transit, the receiver cannot successfully acknowledge subsequent packets in the window. • The sender will eventually time out and retransmit all unacknowledged packets starting from the lost/corrupted one. Working of Go-Back-N Protocol (Cont ..) 8. Handling Out-of-Order Packets: • Go-Back-N is less tolerant of out-of-order packet arrivals than some other ARQ protocols. • The receiver expects packets to arrive in sequential order within the window. 9. Efficiency: • Go-Back-N is more efficient than Stop-and-Wait in terms of bandwidth utilization and throughput, especially in networks with high bandwidth-delay products. • It allows the sender to send multiple packets before waiting for acknowledgments, reducing idle time. Use Cases • Go-Back-N is suitable for scenarios where a balance between reliability and efficiency is required. • It is often used in a wide range of applications, including data transfers over networks with moderate error rates. Example 1 • Example 1: In GB4, if every 5th packet being transmitted is lost and if we have to spend 10 packets then how many transmissions are required? Conclusion 1/2 • In summary, reliable data transfer is the backbone of computer networking. • It ensures data integrity, sequential order, and minimizes the impact of packet loss, ultimately contributing to a better user experience and business continuity. • These principles form the basis for various reliable data transfer protocols, including Stop-and-Wait, Go-Back-N, Selective Repeat, and TCP (Transmission Control Protocol). The specific protocol chosen depends on factors like network conditions, latency, and the requirements of the application. Conclusion 2/2 • While Stop-and-Wait is straightforward and reliable, it may not be the best choice for high-speed or high-latency networks, as it can lead to suboptimal performance. In such cases, more efficient protocols like Go-Back-N or Selective Repeat are often preferred. Nonetheless, Stop-and-Wait remains a valuable learning tool and can be suitable for specific low-speed or error-sensitive applications. • The Go-Back-N protocol enhances data transfer efficiency by allowing the sender to transmit multiple packets before waiting for acknowledgments. It is a well-suited choice for scenarios where moderate error handling and efficient use of available bandwidth are required. However, it may not be ideal for networks with extremely high error rates or where strict ordering of packets is essential.