Summary of "Lec-23: Stop and Wait ARQ protocol | Data link layer"
Main ideas / concepts explained (Stop-and-Wait ARQ)
Basic operation (“Stop & Wait” behavior)
- The sender transmits one frame/packet.
- The sender then pauses (“stops”) and waits.
- The sender remains stopped until it receives an acknowledgment (ACK).
- After the ACK arrives successfully, the sender sends the next frame.
- This repeats continuously—hence “Stop & Wait.”
What an acknowledgment means
- An ACK indicates the receiver accepted the frame successfully.
- ACKs are only sent when data is received correctly.
- If a data/frame does not arrive successfully (or is not accepted), then the receiver produces no meaningful ACK for that frame.
Why sequence numbers are needed
- Sequence numbers disambiguate retransmissions and prevent confusion when messages are lost.
- Without sequence numbers:
- A sender sends a frame.
- The receiver accepts it and sends an ACK.
- The ACK gets lost.
- The sender times out and retransmits, and the receiver can’t tell whether it’s a duplicate or a new frame.
- With sequence numbers:
- The receiver can determine whether an incoming frame is the one it expects next.
Error control / retransmission logic (with timeout)
Timeout mechanism
- After sending a frame, the sender starts a timeout timer.
- If the sender does not receive the ACK before the timer expires, it assumes communication failed and retransmits the same frame.
Timeout duration
- Timeout is typically set to about 2 × round-trip time (RTT).
- RTT is the time for a transmission to go from sender to receiver and back (including the ACK return).
Sequence number details for Stop-and-Wait
Given window sizes
- Sender window size = 1
- Receiver window size = 1
- This implies the protocol needs two sequence states to distinguish the “next” frame from the previous one.
Sequence numbers used
- Sequence numbers are only 0 and 1.
- The system alternates between two states: 0 → 1 → 0 → …
ACK behavior and expected-frame rule
- The receiver sends ACKs related to the next expected sequence.
- Example:
- Sender sends frame 0
- Receiver accepts it and ACKs 1 (meaning it now expects frame 1)
- Sender sends frame 1
- Receiver ACKs accordingly, alternating afterward
Loss scenarios covered (key cases)
Case 1: Frame gets lost
- Sender sends frame 1
- Frame 1 does not arrive, so the receiver accepts nothing
- The receiver sends no ACK
- Sender waits until timeout, then retransmits frame 1
- Receiver accepts it and the protocol continues
Case 2: ACK gets lost
- Sender sends frame 1
- Receiver accepts frame 1 and would ACK the next expected sequence (per alternating logic)
- The ACK fails to reach the sender
- Sender times out and retransmits the same frame
- The receiver uses sequence numbers to detect whether the retransmission is a duplicate
- If the receiver is already expecting frame 1 but receives the wrong sequence (e.g., frame 0 due to state mismatch), it discards it
- The receiver can then retransmit the correct ACK so the sender can recover its proper state
Overall takeaway / lesson
- The window size (1 for both sender and receiver) restricts the protocol to a small set of sequence numbers (0 and 1).
- Sequence numbers + ACKs + timeout + retransmission ensure correct operation even when frames or ACKs are lost.
Speakers / sources featured
- No specific named speakers or external sources were identified in the provided subtitles.
Category
Educational
Share this summary
Is the summary off?
If you think the summary is inaccurate, you can reprocess it with the latest model.
Preparing reprocess...