Reliable_data_transfer

RDT

possible failure

bit-errors, lossy, duplicate delivery , out-of-order delivery

methods

  • checksums: bit error
  • receiver feedback: bit error, ACK/NACK, Cumulative acknowledgments(I have received all packets with sequence numbers up to but not including sn.) allow acknowledgment of numerous packets at a time. They can be useful in pipelined protocols. 可能lost
  • retransmission : Sender sends another copy of segment, detect loss and allows for duplicate seg
  • sequence numbers : Distinguish between old and new, Gaps let receiver detect lost segment, find duplicate packets,restoring the transmitted order. have to be a bounded # bits
  • timer expiration: Segment or receiver feedback is lost (sender: Resends a packet after a timer fires. Sends a new packet after an acknowledgment (positive) arrives.)
  • window:Control sending of multiple segments, allow for reuse of sequence numbers, also allow for pipeling segments

protocols

Stop-n-Wait

  • Simplest Protocol that will handle bit errors and segment loss
    • use: checksum, ack, sn, timers
    • 1 bit for sequence number
    • 为了解决checksum返回的时候有问题。可能ack会lost。带来的问题就是可能重复发几次。所以需要seq num
    • 计时发送,看指定时间能否达到response, 没seq num. 接收者不能知道是否是重发。LOST ACK和lost segment对于发送方式一样的

Go Back N

  • sliding window: A mechanism to control multiple, in-flight segments without overwhelming receiver, Sender is allowed to transmit N segments without waiting for an ACK
  • “window” of up to N, consecutive unACKed segments allowed
  • Sets a timer for each in-flight segment
  • timeout(n): retransmit segment n and all higher seq# segments in window
  • sender:
    • Sender places a k-bit seq# in header
    • “window” of up to N, consecutive unACKed segments allowed
    • Sets a timer for each in-flight segment
    • timeout(n): retransmit segment n and all higher seq# segments in window
    • ACK(n): ACKs all segments up to, including seq# n (Cumulative ACK)
  • receiver: ACK-only: always send ACK for correctly-received segment with highest in-order seq, Receipt of out-of-order segment just discard and send with highest in-order seq
    • May generate duplicate ACKs
    • Why discard segs received out-of-order: Don’t want to buffer them, going to be re-sent anyway
  • A single segment error can cause many segments to be retransmitted

Selective Repeat

  • Receiver individually ACKs all correctly received segments
  • Buffers segs for eventual in-order delivery
  • Sender only resends segments for which ACK not received
  • Sets timer for each segment
  • Sender window of N consecutive seq#s
  • Limits seq # s of sent, but unACKed segs
  • issues: both side have varying view, receiver window移动了,但是发送端没收到ack, 会重传。
  • sequence number的space至少是2^k 个,k是window的大小

Backlinks