Skip to content

Commit

Permalink
TCP class
Browse files Browse the repository at this point in the history
  • Loading branch information
SichangHe committed Sep 9, 2024
1 parent 9d2e164 commit e0a1113
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 21 deletions.
20 changes: 20 additions & 0 deletions src/notes/class_notes/csci651.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,26 @@ NABC for research: need, approach, benefit, competition
- obvious window-based transport protocol implementation cause 100x slowdown
- need to get to connection equilibrium → slow start
- preserve equilibrium → round trip timing consider variance
- goal: keep bottleneck full
- self-clocking: packet spacing follow ACK → follow bottleneck
- resource limit:
congestion avoidance w/
[AI/MD](../cs/networking.html#congestion-window-cwnd)
- congestion detection: packet loss, ~~delay~~
- congestion recovery

## *A Binary Feedback Scheme for Congestion Avoidance in Computer Networks*, Kadangode K. Ramakrishnan, Raj Jain, SIGCOMM 1988

- explicit congestion notification (ECN) router add congestion bit to packet,
returned later in ack
- fair share
- avoid oscillation & congestion collapse
- math model & simulation for policy

## *BBR: Congestion-Based Congestion Control*, Neal Cardwell, Yuchung Cheng, C. Stephen Gunn, Soheil Hassas Yeganeh, Van Jacobson

- TCP need to measure ideal window size = bottleneck RTT × bandwidth
- measure RTT: exponential weighted moving average
(EWMA)—ACK time - sent time
- measure bandwidth: window size & packet loss & ACK rate
- TCP keep probing at equilibrium → oscillation
43 changes: 23 additions & 20 deletions src/notes/cs/networking.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
e.g. internet checksum
- easy in software
- miss many error
- cyclic redundancy check (CRC):
divide message as a polynomial by generator polynomial
- cyclic redundancy check (CRC): divide message as a polynomial by
generator polynomial

e.g. BISYNC, DDCMP, HDLC, ethernet, Wi-Fi
- easy in hardware with shift register
Expand Down Expand Up @@ -297,8 +297,8 @@ enable computer in network share same globally routed public address

## IP forwarding by router

- if interface is connected to destination network,
translate to link-layer address (e.g. MAC) and deliver over local network
- if interface is connected to destination network, translate to
link-layer address (e.g. MAC) and deliver over local network
- else, find a router nearer to destination and do the above to it

### address translation
Expand Down Expand Up @@ -478,22 +478,24 @@ functionality should be provided at a layer only if it can be complete there
- AdvertisedWindow has 16 bit, maximum sliding window size is 64KiB
- option flag to multiply value in AdvertisedWindow
- Nagle's algorithm: sender wait for ACK if cannot send full frame
- silly window syndrome: sender send tiny frame due to tiny AdvertisedWindow
- silly window syndrome: sender send tiny frame due to
tiny AdvertisedWindow
- adaptive transmission: EstimatedRTT $t_e$, MeasuredRTT $t_m$, Timeout $t_o$
- Karn/Partridge algorithm with parameter $a$:

$$
t_e=a\cdot t_e+(1-a)\cdot t_m\\
t_o=2\cdot t_e
$$
$$
t_e=a\cdot t_e+(1-a)\cdot t_m\\
t_o=2\cdot t_e
$$

- Jacobson/Karels algorithm with DeviationRTT $\sigma$, parameter $\delta$:
- Jacobson/Karels algorithm with DeviationRTT $\sigma$,
parameter $\delta$:

$$
t_e=t_e+(\delta\cdot (t_m-t_e))\\
\sigma=\sigma+\delta\cdot(|t_m-t_e|-\sigma)\\
t_o=t_e+4\cdot\sigma
$$
$$
t_e=t_e+(\delta\cdot (t_m-t_e))\\
\sigma=\sigma+\delta\cdot(|t_m-t_e|-\sigma)\\
t_o=t_e+4\cdot\sigma
$$

- ignore retransmitted packet

Expand Down Expand Up @@ -564,8 +566,8 @@ popular example: REST/gRPC

## traffic flow

- defined as (Source IP, Destination IP) or
(Source IP, Source Port, Destination IP, Destination Port)
- defined as (Source IP, Destination IP) or (Source IP, Source Port,
Destination IP, Destination Port)
- aid router track soft state

## resource allocation fairness
Expand Down Expand Up @@ -613,10 +615,11 @@ additive increase/ multiplicative decrease (AI/MD)

### TCP slow start

- exponentially increase `cwnd` at start
- exponentially increase `cwnd` at start: each ACK: `cwnd += 1`
- when dropped
- `SSthresh = cwnd / 2`
- `cwnd = packet_size`
- slow start threshold `SSthresh = cwnd / 2`
- each RTT: `cwnd = packet_size`
- actual: each ACK: `cwnd += packet_size / cwnd`
- slow start while `cwnd < SSthresh`, do AI/MD afterwards

### TCP fast retransmit
Expand Down
2 changes: 1 addition & 1 deletion src/notes/research/JSphere
Submodule JSphere updated 1 files
+5 −0 sketch.md

0 comments on commit e0a1113

Please sign in to comment.