Retransmission Protocols
- Send Windows
- Go-Back-N
- Selective Repeat Protocol
- bandwidth-delay product
- TCP retransmission
- Kermit
- Xmodem
Send Window
- send window is how many outstanding bytes or packets sender can have
- if window = 0, sender must stop
- if the number of outstanding packets (bytes) = window, sender must stop
- window = packets buffered by network + packets buffered by receiver
- networks with high latency require large windows
- receivers with small amounts of memory require small windows
- a large window means less coupling between sender and receiver
- flow control: receiver can slow down sender
Go-Back-N
- like ABP, but window size W > 1 (if W = 1, GBN = ABP)
- sender sends up to W packets, each with sequence number
- receiver sends ack (with sequence number) for every
in-order packet
- receiver discards out-of-order packets
- when sender gets ack i, it sends packet i+W
- if packet i not acked within timeout T, sender retransmits
i, i+1, ..., i+W-1
- if it takes time t to send a packet, T >= W * t
- since there can be W outstanding packets, sequence numbers
must have range at least 0... W
Selective Repeat Protocol
- like GBN, but only packets that are unacked at timeout are resent
- more efficient of network usage:
doesn't need to retransmit entire window on timeout
- requires more receiver resources:
receiver must buffer out-of-order packets and deliver them in order
once the missing packets are received
- sequence numbers must have range at least 0... 2W-1, since
we need to distinguish retransmissions due to lost acks from new packets
(packets in the "last" window from packets in the "current" window)
Bandwidth-delay product
- window = packets buffered by network + packets buffered by receiver
- receiver knows how much it will buffer
- how many bytes/packets are buffered by the network?
- bottleneck router is the slowest router in the path
- bottleneck router can forward B bytes (packets)/second
- total latency, from sending packets to receiving acks, is d seconds
- bandwidth-delay product is B * d bytes/packets
- B * d data is buffered by the network
TCP retransmission
- similar to selective repeat, but
- acks are cumulative and network not FIFO, so
- we don't exactly know which packet is dropped
- instead, receiver sends duplicate acks when receiving
new out-of-order packets
- after 3 duplicate acks, TCP retransmits next packet
- packet losses that don't get 3 duplicate acks:
- packet loss at end of data stream
- packet loss when window is small
- timeout in TCP is adaptive, based on measured network latency
Correctness of GBN, SRP, TCP
- will sender always retransmit a dropped packet?
- can receiver always distinguish retransmission from new packet?
- does receiver have enough information to deliver packets in order?
Kermit
- file transfer over point-to-point links
- 1 byte each for mark, length, sequence, type, 0-94 bytes of data,
1 byte checksum
- printable ASCII characters for all control fields
- type field identifies packet: ack/nack, connection
establishment/teardown, etc.
- length identifies data length
- sequence is modulo 64
- ABP on half-duplex connections
- optional SRP on full-duplex connections
XModem
- 1 byte each for mark, sequence, complement sequence, 128 bytes
of data, 1 byte checksum
- redundant sequence, checksummed data
- ABP on half-duplex link
- receiver sends nack after 15 seconds of idle
- sender sends right after nack
- if packet received correctly, receiver sends ack
- if packet has errors, receiver sends nack
- acks and naks have no sequence numbers
- sender needs no timer:
- unlikely total packet loss
- recover after 15s