Presentation is loading. Please wait.

Presentation is loading. Please wait.

Transport Layer CS 381 3/7/2017.

Similar presentations


Presentation on theme: "Transport Layer CS 381 3/7/2017."— Presentation transcript:

1 Transport Layer CS 381 3/7/2017

2 Chapter 3 outline 3.1 transport-layer services
3.2 multiplexing and demultiplexing 3.3 connectionless transport: UDP 3.4 principles of reliable data transfer 3.5 connection-oriented transport: TCP segment structure reliable data transfer flow control connection management 3.6 principles of congestion control 3.7 TCP congestion control Transport Layer

3 Principles of Congestion Control
Informally: “too many sources sending too much data too fast for network to handle” Different from flow control! Flow Control: Sender decreases packet transmission to accommodate receiver. Manifestations: Lost packets (buffer overflow at routers) Long delays (queueing in router buffers) a top-10 problem! Transport Layer

4 Causes/costs of congestion: scenario 1
Two senders, two receivers One router, infinite buffers No errors/retransmissions No flow control No congestion control Both hosts transmitting continuously at the same time unlimited shared output link buffers Host A lin : original data Host B lout Transport Layer

5 Causes/costs of congestion: scenario 1
Maximum throughput for two senders: R/2 Link can’t deliver packets to receiver at a rate that exceeds R/2 As the sending rate approaches R/2, the average package delay increases (as the number of buffered packets increase). When the sending rate exceeds R/2, packet delay becomes infinite. Transport Layer

6 Causes/costs of congestion: scenario 1
First cost of a congested network: Large queuing delays are experienced as the packet arrival rate nears the link capacity Why? Processing packet header takes time! Transport Layer

7 Causes/costs of congestion: scenario 2
Two senders, two receivers one router, finite buffers Packets dropped when arriving to router with full buffer sender retransmission of lost packet Host A lout lin : original data l'in : original data, plus retransmitted data Host B finite shared output link buffers Transport Layer

8 Causes/costs of congestion: scenario 2
Case 1: Hosts only transmits data when it knows buffer space in the router is free. No packet loss Throughput up to R/2 Sending rate cannot exceed R/2 since packet loss is assumed never to occur Realistic scenario? NO! Why? R/2 lin lout Transport Layer

9 Causes/costs of congestion: scenario 2
Case 2: Sender retransmits only when a packet is know for certain to be lost. How does the sender know for sure a packet is lost? Performance is decreased as the sender resends lost packets Assume for each 3 packets transmitted, 1 packet is duplicated 33% performance decrease due to packet retransmissions in this case Second cost of a congested network: Sender must retransmit to compensate for lost packets due to router buffer overflow R/2 lin lout R/3 Transport Layer

10 Causes/costs of congestion: scenario 2
Case 3: Sender times out prematurely, retransmits a dup packet that has been delayed in the router buffer, but not lost Destination receives duplicate data Work done by router to forward duplicate data is wasted Assume each packet has to be forwarded twice by the router Due to large queueing delays 50% performance decrease due to packet retransmissions in this case Third cost of a congested network: Duplicate transmissions from sender due to large delays may cause routers to forward unneeded copies of data Transport Layer

11 Causes/costs of congestion: scenario 3
Four senders, four receivers Four routers, finite buffers Packets dropped when arriving to router with full buffer Sender retransmission of lost packet Host A lout lin : original data Host B l'in : original data, plus retransmitted data finite shared output link buffers Host D Host C Transport Layer

12 Causes/costs of congestion: scenario 3
Fourth cost of a congested network: When a packet is dropped along a path, any “upstream” transmission capacity used for that packet is wasted! Transport Layer

13 Approaches towards congestion control
Two broad approaches Network-assisted congestion control: Routers provide feedback to end systems about current buffer state. Two ways: “Choke packet”: Examine sender packet header to obtain IP, notify about state of buffers. Router can update a field in the sender’s packet header that indicates state of buffers. Note: This can take up to 1 RTT. Complexity? Router explicit communication with end host processes Flooding, loss of choke packets, etc. Transport Layer

14 Approaches towards congestion control
two broad approaches End-end congestion control: No explicit feedback from network core Congestion of network “inferred” by the end systems based on packet loss and delay This is the approach taken by TCP Segment loss (3 dup ACK, timeout) indicates congestion TCP adjusts sender’s transmission rate based on congestion Transport Layer

15 Approaches towards congestion control
Two broad approaches Transport Layer

16 Chapter 3 outline 3.1 transport-layer services
3.2 multiplexing and demultiplexing 3.3 connectionless transport: UDP 3.4 principles of reliable data transfer 3.5 connection-oriented transport: TCP segment structure reliable data transfer flow control connection management 3.6 principles of congestion control 3.7 TCP congestion control Transport Layer

17 TCP congestion control:
Goal: TCP sender should transmit as fast as possible, but without congesting the network Q: how to find rate just below congestion level? Decentralized approach: each TCP sender sets its own rate, based on implicit feedback ACK: segment received (a good thing!), network not congested increase sending rate Lost segment: assume loss due to congested network decrease sending rate Transport Layer

18 TCP congestion control:
TCP sender rate is dynamic based on current status of the network Questions: How does a TCP sender limit transmission rate? How does a TCP sender perceive network congestion? How does TCP react to network congestion? Transport Layer

19 TCP congestion control:
How does a TCP sender limit transmission rate? Ignoring flow control, a TCP sender keeps track of a variable, congestion window, or cwnd. By adhering to the constraint: LastByteSent – LastByteAcked <= min{cwnd, rwnd} The TCP sender modifies the value of cwnd to adjust the rate at which it sends data into the network. Sending rate: ~cwnd/RTT bps Transport Layer

20 TCP congestion control:
How does a TCP sender perceive network congestion? Excessive congestion in the network causes packets to be dropped or delayed, which creates a “loss” event at the TCP sender TCP considers a loss event as: Timeout for receiving ACK Receiving 3 dup ACKs The TCP sender perceives the above loss events as network congestion and adjusts its transmission rate to accommodate Transport Layer

21 TCP congestion control:
How does a TCP sender react to network congestion? A lost packet implies congestion TCP sender rate should be decreased Successfully ACK’d packets implies that the network is delivering packets to the destination TCP sender rate should be increased Transport Layer

22 TCP congestion control: bandwidth probing
“Probing for bandwidth”: increase transmission rate on receipt of ACK, until eventually loss occurs, then decrease transmission rate Continue to increase on ACK, decrease on loss Since available bandwidth is changing, depending on other connections in network ACKs being received, so increase rate X loss, so decrease rate X X X TCP’s “sawtooth” behavior sending rate X time Q: How fast to increase/decrease? details to follow Transport Layer

23 TCP Congestion Control: details
Sender limits rate by limiting number of unACKed bytes “in pipeline”: Cwnd: differs from rwnd (how, why?) Cwnd set by TCP sender (congestion control window) Rwnd set by TCP receiver (used for flow control) Sender limited by min(cwnd,rwnd) Roughly: Cwnd is dynamic, function of perceived network congestion Sending rate = cwnd RTT bytes/sec Transport Layer

24 TCP Congestion Control: more details
Segment loss event: reducing cwnd Timeout: no response from receiver Set cwnd to 1MSS Aggressive response to congestion Why reduce cwnd to 1? 3 duplicate ACKs: at least some segments getting through (recall fast retransmit) Set cwnd in half, not as aggressive as timeout event Why? Transport Layer

25 TCP Congestion Control: more details
ACK received: increase cwnd Slowstart phase: Increase exponentially fast (despite the name) at connection start, or following timeout Doubles cwnd for each successful ACK, until cwnd reaches predetermined threshold Congestion avoidance: Cwnd increase linearly Generally happens after slowstart phase reaches threshold Transport Layer

26 TCP Congestion Control: MSS
MSS: Maximum Segment Size TCP MSS is calculated by Link Layer frame MTU (maximum transmission unit) – IP header – TCP header. Ethernet typical MTU size: 1500 bytes So, TCP typical MSS size over Ethernet: 1500 – 20 – 20 = 1460 bytes Transport Layer

27 TCP Slow Start When connection begins, cwnd = 1 MSS (maximum segment size) Ex: MSS = 500 bytes & RTT = 200 msec Initial rate = 20 kbps Available bandwidth may be >> MSS/RTT Desirable to quickly ramp up to respectable rate Increase rate exponentially until first loss event or when threshold reached Double cwnd every RTT Done by increasing cwnd for every ACK received Host A Host B one segment RTT two segments four segments time Transport Layer

28 TCP: congestion avoidance
Due to previous loss events, the TCP sender will probe for bandwidth less aggressively ssthresh: cwnd/2 when loss occurs When cwnd > ssthresh grow cwnd linearly Increase cwnd by 1 MSS (1460 bytes) per RTT Approach possible network congestion slower than in slowstart Transport Layer

29 TCP: congestion avoidance
AIMD: Additive Increase Multiplicative Decrease ACKs: Increase cwnd by 1 MSS per RTT: additive increase loss: Set cwnd to half (non-timeout-detected loss ): multiplicative decrease Remember: The TCP sender responds to all timeout events by reducing cwnd to 1. Transport Layer

30 TCP congestion control FSM: overview
slow start congestion avoidance cwnd > ssthresh loss: timeout loss: timeout loss: timeout new ACK loss: 3dupACK fast recovery loss: 3dupACK Transport Layer

31 TCP: Fast Recovery TCP Tahoe: Earlier version of TCP TCP Reno:
Reaction to loss events Timeout: set ssthresh = cwnd/2, then cwnd to 1 and enter slowstart until cwnd >= ssthresh. Then enter congestion avoidance 3 dup ACK’s: set ssthresh = cwnd/2, then cwnd to 1 and enter slowstart until cwnd >= ssthresh. Then enter congestion avoidance TCP Reno: Timeout: Same as TCP Tahoe 3 dup ACK’s: set cwnd = cwnd/2 = ssthresh and enter congestion avoidance

32 Versions of TCP TCP Reno cwnd window size (in segments) ssthresh
TCP Tahoe Transmission round Transport Layer

33 Summary: TCP Congestion Control
When cwnd < ssthresh, the TCP sender is in slow- start phase, window grows exponentially. When cwnd >= ssthresh, the TCP sender is in congestion-avoidance phase, window grows linearly. When triple duplicate ACK occurs, ssthresh set to cwnd/2, cwnd set to ~ ssthresh When timeout occurs, ssthresh set to cwnd/2, cwnd set to 1 MSS. Transport Layer

34 Transport layer Protocol Fairness
Fairness and UDP Multimedia apps often do not use TCP Does not want rate throttled by congestion control No flow control Instead use UDP: Pump audio/video at constant rate Tolerates packet loss Current research interests for developing congestion-control mechanisms for the Internet that prevent UDP traffic from unfairly transmitting data Transport Layer

35 Transport layer Protocol Fairness
Fairness and parallel TCP connections Nothing prevents app from opening parallel connections between 2 hosts. Web browsers do this Example: link of rate R supporting 9 connections; New app asks for 1 TCP connection, gets rate R/10 New app instead asks for 11 TCP connections, gets R/2 ! Transport Layer

36 Chapter 3: Summary Principles behind transport layer services:
Multiplexing, demultiplexing Reliable data transfer Flow control Congestion control Instantiation and implementation in the Internet UDP TCP Next: Leaving the network “edge” (application, transport layers) Into the network “core” Transport Layer


Download ppt "Transport Layer CS 381 3/7/2017."

Similar presentations


Ads by Google