TCP Protocol
Try to combine Transport Layer#Go Back N (GBN) and Transport Layer#Selective ACK (SACK)
ACK and receiver buffering
Slow Start
- Every time a new
ACKcomes back, increase window size by 1 is doubled every RTT (exponential) - Goes until Slow Start Threshold (
)
Congestion Avoidance
- Slow down the rate of increasing
after Slow Start Threshold - When packet loss happens, reset
Fast Recovery
- Quickly recover from
DupACKs


In summary, the TCP protocol goes from exponential first then linear

TCP State Diagram

TCP Saw-Tooth Behavior
Average TCP Throughput
where

TCP Timeout Management
TCP has a single timer to keep track of all timeouts
- Update alarm duration to be

RTO Estimation
Exponential Weighted Moving Average (EWMA)
RTO can be estimated as a function of the historical RTT + a safety function
is the current RTT

- When estimating
ignore dupACKs, and any staleACKs that is left of's window base
Large
means large
Largethe network will get congested and transmitter will react slowly
Smallnetwork utilization is low since transmitter (SST) will react too quickly, even before the network get too congested
Packets to Bytes
TCP operates as a byte stream
uses MSS (maximum segment size) to separate segments of packets
TCP Flow Control
- Receiver buffer may fill up really fast
- Receiver
TCP includes how much space is available in its socket buffer bytes ( ACKincludes this value) - When
TCP gets ACK, it decides to senddoes not change, keeps following the protocol This is because the receiver buffer could drain quickly, because the OS could switch thread and quickly handle the packets on terminal
TCP Fairness
Between TCP and UDP
UDP doesn't control congestion, so TCP would always cuts back (TCP being polite), the channel allocation is not fair
Between TCP and TCP
TCP Random Early Drop
Hack/Workaround for the network layer to give feedback to TCP about its queue size/congestion.
Network layer drops a random data packet from each flow, so that the router queue does not fill up above some threshold (say 60%).
TCP over Wireless
Bit Error Rate (BER) is the probability that bit will flip
- Wireless:
packets corrupt (1 bit error every bits) - Wired:
packets corrupt
TCP must differentiate between wireless losses and congestion losses (at router) because
- If congestion loss then reduce
- Else if wireless loss then simply retransmit and don't change
TCP performs bad on wireless
- Retransmits congests the links
- TCP keeps going into congestion control
Solutions:
(Both violates the layer principles)
- Split TCP
- TCP snoop
- Link layer is snooping into TCP header so that it can retransmit lost packets