Overview
This lecture covers the core challenge of reliable data transfer over unreliable channels, the evolution of protocol mechanisms, and the use of finite state machines to specify sender and receiver behavior.
Reliable Data Transfer Problem
- Reliable communication requires coping with channels that may lose, corrupt, or reorder messages.
- The transport layer provides reliable transfer between a sending and a receiving process.
- Channels for transport protocols are often bidirectional and unreliable, even if application dataflow is unidirectional.
Protocol Specification and Interfaces
- Protocol complexity depends on whether the channel can lose, corrupt, or reorder data.
- Protocols use an API allowing the application layer to send and receive data via the transport layer.
- The transport layer adds headers to data and ensures in-order, exactly-once delivery.
Finite State Machines (FSMs) for Protocols
- Text descriptions are insufficient for specifying protocols; FSMs provide precision.
- State represents the status of a protocol entity (sender or receiver).
- Transitions occur on events (like data arrival) and may trigger actions.
RDT 1.0: Protocol over Perfect Channels
- Sender FSM: Waits for data, sends packet using UDT_send, transitions back to waiting.
- Receiver FSM: Waits for packet, delivers data up to application, transitions back to waiting.
RDT 2.0: Protocol over Channels with Bit Errors
- Errors detected using checksums; protocol uses acknowledgments (ACK) and negative acknowledgments (NAK).
- Sender behaves in stop-and-wait fashion: sends a packet, waits for ACK/NAK before sending the next.
- Receiver sends NAK on corruption, ACK on success, and ensures in-order delivery.
RDT 2.1: Handling Corrupted ACK/NAK and Duplicates
- Sequence numbers added to packets allow detection and discarding of duplicates.
- Sender FSM: Four states, sending sequence 0 or 1, and waiting for ACK/NAK for each.
- Receiver FSM: Two states, waiting for sequence 0 or 1; delivers data only once per sequence number.
- Protocol retransmits on receiving corrupted ACK/NAK or duplicate packets.
Protocol Mechanisms Recap
- Error detection (checksums) identifies corrupted packets.
- ACK/NAK mechanisms enable communication of success/failure back to sender.
- Retransmission ensures delivery despite errors.
- Sequence numbers prevent duplicate delivery.
Key Terms & Definitions
- Reliable Data Transfer (RDT) — Ensuring data is delivered accurately and in order over unreliable channels.
- Transport Layer — Network layer responsible for process-to-process communication and reliability.
- Finite State Machine (FSM) — Formal model describing protocol behavior with states and transitions.
- Stop-and-Wait Protocol — Sender waits for acknowledgment before sending the next packet.
- ACK/NAK — Acknowledgment and Negative Acknowledgment messages for confirming packet receipt status.
- Sequence Number — Unique identifier added to packets for detecting duplicates and ensuring order.
- Checksum — Error-detection code used to verify data integrity.
Action Items / Next Steps
- Read about RDT 2.2 protocol, which uses only ACKs.
- Prepare for the next section on handling packet loss within the communication channel.