Lecture 1
TODO:
Reliable Transmission: ARQ (Automatic Repeat reQuest)
- Enable reliable transmission
- Detect errors & missed packets
- Request retransmission of said packets
Stop and Wait
- Only one segment outstanding at a time
- Wait for ACK before sending next
- This is inefficient
- SIZE (L)/BANDWIDTH (R) to transmit
- RTT to send and receive ACK
Utilisation:
!! Check math
Pipelining
Allows
Utilisation:
Go-Back-N
The sender can send up to
The permissible sequence numbers to be sent is a windows of size
I.e.
If a frame is lost or corrupted, all subsequent frames (that have been received) are discarded
Out-of-order frames are NOT stored
Not stored, since there is assumed to be no buffer
Send cumulative ACKs for every packet up until that point (covers earlier lost ACKs)
Selective Repeat
Same as before, but accepts and buffers out-of-order frames
Sender only retransmits the lost/corrupted frames
Send ACKs for each individual packet, even if out-of-order
TCP Error Recovery
How does TCP handle problems?
What to do when segments are lost?
How do we determine when a segment is actually lost?
Retransmission
Use an adaptive retransmission algorithm to determine the timeout value
Based on Round Trip Time (RTT)
MSG sender -> receiver + ACK receiver -> sender
If timeout is shorter than RTT: re-send before ACK can even arrive (Premature timeout)
If timeout is (much) longer than RTT: wait around for ACK, even though packet is already lost
There are different ways to estimate RTT
SampleRTT: measured once per RTT
EstimatedRTT: exponential weighted moving average of the SampleRTT values collected
Where
DevRTT
Variation on the RTT, difference between SampleRTT and EstimatedRTT
(Estimated RTT + safety margin)
Fast Retransmit
If a packet is lost (i.e. you receive packets after it), keep sending ACKS for the last in-order packet
If the sender receives 3 duplicate ACKS, it will retransmit the missing segment before the timer even expires
!400
Selective Acknowledgement (SACK) vs No SACK
![[Pasted image 20260204104637.png]]
On the left, it keeps sending ACK for 123, indicating that the last seq it received was 123
On the right, it indicates the missing segment, and the ones that were actually received
TCP ACK generation
| Event at receiver | TCP Receiver action |
|---|---|
| Arrival of in-order segment with expected seq #. All data up to expected seq # already ACKed | Delayed ACK. Wait up to 500ms for next segment. If no next segment, send ACK |
| Arrival of in-order segment with expected seq #. One other segment has ACK pending | Immediately send single cumulative ACK, ACKing both in-order segments |
| Arrival of out-of-order segment higher-than-expect seq. # . Gap detected | Immediately send duplicate ACK, indicating seq. # of next expected byte |
| Arrival of segment that partially or completely fills gap | Immediate send ACK, provided that segment starts at lower end of gap |