CS138-lecture-20210406

TCP Cont. #

Flow control #

image_2021-04-06-09-03-32 image_2021-04-06-09-03-37

rwnd = receive window

Connection management #

image_2021-04-06-09-07-29 image_2021-04-06-09-10-15 image_2021-04-06-09-12-55 image_2021-04-06-09-18-38

TCP 3-way handshake steps:

  1. SYN = 1, ACK = 0: SYN packet
  2. SYN = 1, ACK = 1: SYNACK packet
  3. SYN = 0, ACK = 1: ACK packet. This packet can contain real data from client to server.

image_2021-04-06-09-23-31 image_2021-04-06-09-25-08 image_2021-04-06-09-27-31

Principles of congestion control #

image_2021-04-06-09-29-15 image_2021-04-06-09-31-29

In a perfect world: \( \lambda_{\text{in} } = \lambda_{\text{out} } \) , however this is not usually the case.

image_2021-04-06-09-33-10 image_2021-04-06-09-33-31 image_2021-04-06-09-33-43 image_2021-04-06-09-35-47

Causes/costs of congestion:

  1. When data is lost, TCP will retransmit such data. This causes what is sent by sender to be bigger than expected.
  2. When premature timeout happens, the data will be re transmitted unnecessarily, which causes corresponding data to be sent twice or more. This also causes what is sent by the sender to be bigger than expected.

image_2021-04-06-09-43-25 image_2021-04-06-09-43-09

  1. When one packet is dropped by one router, then all network resources/capacity used for this packet were wasted.

image_2021-04-06-09-50-08 image_2021-04-06-09-52-25 image_2021-04-06-09-52-35 image_2021-04-06-09-53-16 image_2021-04-06-09-54-24

ssthresh is a parameter. It starts at an initial value, but will be dynamically change to half of the value before congestion.

TCP congestion control phases:

  1. Slow start. It is exponentially growing at the beginning.
  2. Congestion avoidance. When you reach the threshold, TCP asks to slow down, from exponential to linear growth.
  3. Fast recovery. When a timeout happens, or when data loss happens, it indicates that possible traffic congestion has occurred. For fast recovery, TCP Reno and TCP Tahoe are different (drop to half vs drop to 1).

image_2021-04-06-10-03-02

MSS = maximum segment size

image_2021-04-06-10-04-02

Fast recovery:

  1. Data loss can be indicated by timeout or triple duplicate ACKs.
  2. TCP Tahoe always drops to 1, no matter if timeout or triple duplicate ACKs.
  3. TCP Reno
    1. When timeout happens, it drops to 1
    2. When triple duplicate ACKs happen, it drops to half

ssthresh is set to half of the cwnd (congestion window size) before congestion occurred.

image_2021-04-06-10-11-35 image_2021-04-06-10-12-05

AIMD = additive increase multiplicative increase

image_2021-04-06-10-13-17

This entire philosophy basically probes for usable bandwidth.