Skip to content

Reliable Transmission and Error Checking

Topic

Reliable transmission: Stop-and-wait

protocol and Sliding window protocol Error detection – Parity check, Hamming distance, Cyclic Redundancy Code (CRC) – FDCN Chapter 10 dataword, codeword, syndrome, and PDCN Chapter 2.4 error

Reliable Transmission

  • Frames are sometimes corrupted while in transit, with an error code like CRC used to detect such errors.
  • A link-level protocol that wants to deliver frames reliably must somehow recover from these discarded frames.
  • An acknowledgement is a small control frame that a protocol sends back to it's peer saying that it has received an earlier frame. The action of waiting a reasonable amount of time is called a timeout.
  • The general strategy is of using ACK + timeouts -> Automatic Repeat Requests

Stop and Wait

  • The peer checks for ACK after every frame sent.
  • Pasted image 20250918135213.png
  • To solve the issue in (b) where timeout is too short to receive then ACK, it uses sequence numbers 0 and 1 Pasted image 20250918135545.png

  • But only one frame send at a time, so not using the complete capacity of the transmission medium. Bits-Per-Frame / Time-Per-Frame = 1024 x 8 / 0.045 = 182 kbps

Sliding Window (Go Back N, Selective Repeat)
  • Sender assigns a sequence number, denoted by SeqNum to each frame. The sender maintains three variables - The send window size (SWS), LAR - Last acknowledgement, LFS - Sequence number of last frame send.
LFS - LAR <= SWS
  • When an ACK arrives, the sender moves LAR to the right, thereby allowing the sender to transmit another frame. Also, the sender associates a time with each frame it transmits, and it retransmits the frame when the timer expires.

Example

-Send first 4 packets: 0,1,2,3

(unACKed window = [0–3]) ACK(0) received: Window slides → now allowed [1–4].
Sender can send packet 4. -ACK(1) received: Window slides → [2–5].
Sender can send packet 5. -f packet 2 lost: Receiver doesn’t ACK 2, so after timeout sender retransmits 2,3,4,5 (Go-Back-N).

  • Receiver maintains a RWS, bounded by (LFR) Last frame received and (LAF) Largest acceptable frame.
  • SeqNumToACK represents the largest sequence number yet not acknowledged. After sending
    LFR = SeqNumToAck
    LAF = LFR + RWS
    

Case when RWS = SWS

Not MaxSeqNum >= SWS + 1, when RWS=SWS Safe rule = SWS < MaxSeqNum + 1/2 General conditions: RWS + SWS <= MaxSeqNum

PiggyBacking

The ACK is comparatively small and only has a header, so instead of wasting the bandwidth, we attach the piggybacks to the next data frame. Saves bandwidth and reduces overhead.