Presentation is loading. Please wait.

Presentation is loading. Please wait.

What is TCP? Connection-oriented reliable transfer Stream paradigm

Similar presentations


Presentation on theme: "What is TCP? Connection-oriented reliable transfer Stream paradigm"— Presentation transcript:

1 What is TCP? Connection-oriented reliable transfer Stream paradigm
No packet loss. How? Uses acknowledgments, retransmission, and TO. Stream paradigm Allows sender to generate a stream of bytes; then divide stream into small segments; and then sends each segment in IP datagram. Flow control Receiver advertises window that specifies how many additional bytes it can accept.

2 What is TCP? TCP connection establishment TCP versus UDP
Send SYN seq=x Receive SYN seq=x Send SYN seq=y, Ack x+1 Receive SYN, Ack Send Ack y+1 Receive Ack TCP versus UDP UDP TCP Datagrams, unreliable Connectionless (identified by port) No flow control No congestion control Multimedia applications Segments, reliable Connection-oriented (socket API binding) Flow control Congestion control All the others

3 TCP Congestion Control
Question: How does TCP control network congestion? Specifically, when does TCP increase or decrease its sending rate and how much? Here, we will study how TCP supports network congestion control.

4 Early TCP Early TCP runs like go-back-n. What if … sender receiver
1. Send up to a window of data 2. Ack for each packet sender receiver 3. If TO, resend from the oldest unacked What if … 1. Packet arrives faster than output link sender router 2. Queue grows and packet drops 3. TO and resend … increase network traffic! Throughput becomes so low Congestion collapse!

5 Avoid Congestion Collapse?
How can we address the congestion collapse problem? Can we adopt self-clocking mechanism in TCP? Self-clocking A new packet is not put into network until the old packet leaves. It is called connection in equilibrium.

6 Initial Start Goal: Reach equilibrium by opening up the window quickly. 0R 1 1 RTT 1R 2 3 2R 4 6 5 7 3R 8 12 9 13 10 14 11 15 Sender sets cwnd to 1. As Ack arrives, cwnd is increased by one segment. Slow start: exponential increase of cwnd.

7 Congestion Avoidance After slow start, what happens?
ssthresh Slow Start TCP cwnd We want to ensure that cwnd does not increase exponentially forever. In congestion avoidance, cwnd is increased by 1/cwnd segments (approx. 1 segment per RTT) for one Ack received (additive increase).

8 Congestion Avoidance What if TO occurs?
It indicates network congestion. Update ssthresh = max(2, min(cwnd/2, rwnd)) segments This is multiplicative decrease! cwnd = 1 System goes back to slow start. That’s why CA is called AIMD (Additive Increase Multiplicative Decrease). AIMD in CA is known to be stable, i.e., converges to a fair share condition.

9 Can We Do Better? TCP Tahoe (SS, CA, FR)
Usually TO takes long and degrades TCP performance. Is there a way to learn network congestion earlier than TO? 1. Send segments 0 to 5 Segment 2 gets lost 2. dupAcks(2) sender receiver 3. Fast retransmit after 3 dupAcks and go back to SS TCP Tahoe (SS, CA, FR)

10 Even Better? In TCP Tahoe, should we go back to SS after fast retransmit? Why? In addition to packet loss, doesn’t dupAck also indicate that a segment has left the network ? 3 dupAcks sender receiver Retransmits lost segment Reduces ssthresh by half Reduces cwnd by half Inflates cwnd by one segment for each dupAck (self-clocking) Comes out of this Fast Recovery when it receives ack for lost segment. TCP Reno (SS, CA, Fast Recovery) Reno tries to keep track of the number of dupAcks to estimate the amount of outstanding data in the net. What if there are multiple segment losses?

11 TCP Congestion Control
Slow-Start Congestion Avoidance cwnd Additive Increase Multiplicative Decrease (AIMD) ssthresh 1 TCP-Reno 3 DupAck Timeout time new ssthresh = cwnd / 2

12 Vegas Dream? So far, all the schemes use Acks to infer packet losses to detect network congestion and devise self-clocking. Can we estimate expected throughput of a connection and use it for cwnd increase or decrease? Congestion avoidance Expected throughput = current cwnd / min RTT Actual throughput = bytes xmitted / measured RTT Diff = expected throughput - actual throughput If Diff < alpha, linear increase of cwnd (good condition) Else if Diff > beta, linear decrease of cwnd (congestion)

13 TCP Vegas Slow start Retransmission
Exponential increase cwnd every other RTT. Calculate Diff using the other RTT. Transition from SS to CA occurs when actual throughput is lower than expected throughput by gamma. Retransmission A segment is retransmitted after one dupAck. This will be helpful when cwnd small or multiple segment losses. TCP Vegas was popular due to its more accurate estimation. It was, however, never widely deployed. Why?


Download ppt "What is TCP? Connection-oriented reliable transfer Stream paradigm"

Similar presentations


Ads by Google