Chapter 3 Transport Layer

Similar documents
Chapter 3 Transport Layer

Chapter 3 Transport Layer

Chapter 3 Transport Layer

Chapter 3 outline. 3.5 Connection-oriented transport: TCP. 3.6 Principles of congestion control 3.7 TCP congestion control

CSC 4900 Computer Networks: TCP

Chapter III: Transport Layer

CMPE 150/L : Introduction to Computer Networks. Chen Qian Computer Engineering UCSC Baskin Engineering Lecture 10

Mid Term Exam Results

CSCI Topics: Internet Programming Fall 2008

CC451 Computer Networks

Computer Networking Introduction

Principles of congestion control

CSC 8560 Computer Networks: TCP

Lecture 15: Transport Layer Congestion Control

TCP reliable data transfer. Chapter 3 outline. TCP sender events: TCP sender (simplified) TCP: retransmission scenarios. TCP: retransmission scenarios

Chapter 3 outline. 3.5 Connection-oriented transport: TCP. 3.6 Principles of congestion control 3.7 TCP congestion control

CSCI Topics: Internet Programming Fall 2008

Lecture 11. Transport Layer (cont d) Transport Layer 1

CNT 6885 Network Review on Transport Layer

TCP: Overview RFCs: 793,1122,1323, 2018, 2581

Lecture 8. TCP/IP Transport Layer (2)

TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581

Chapter 3 Transport Layer

Congestion Control. Principles of Congestion Control. Network-assisted Congestion Control: ATM. Congestion Control. Computer Networks 10/21/2009

Detecting half-open connections. Observed TCP problems

Application. Transport. Network. Link. Physical

Chapter 3- parte B outline

CSC 401 Data and Computer Communications Networks

Congestion Control. Principles of Congestion Control. Network assisted congestion. Asynchronous Transfer Mode. Computer Networks 10/23/2013

Chapter 3 outline. 3.5 Connection-oriented transport: TCP. 3.6 Principles of congestion control 3.7 TCP congestion control

rdt3.0: channels with errors and loss

Chapter III: Transport Layer

Outline. TCP: Overview RFCs: 793, 1122, 1323, 2018, Development of reliable protocol Sliding window protocols

CS 43: Computer Networks. 19: TCP Flow and Congestion Control October 31, Nov 2, 2018

The Transport Layer Congestion control in TCP

Flow and Congestion Control (Hosts)

CSCE 463/612 Networks and Distributed Processing Spring 2017

CS321: Computer Networks Congestion Control in TCP

Congestion Control. Daniel Zappala. CS 460 Computer Networking Brigham Young University

Data Communications & Networks. Session 9 Main Theme Network Congestion Causes, Effects, Controls, and TCP Applications. Dr. Jean-Claude Franchitti

Outline. TCP: Overview RFCs: 793, 1122, 1323, 2018, steam: r Development of reliable protocol r Sliding window protocols

Chapter 3 Transport Layer

Transmission Control Protocol. ITS 413 Internet Technologies and Applications

Chapter 3 Transport Layer

CSCD 330 Network Programming Winter 2015

TCP congestion control:

Go-Back-N. Pipelining: increased utilization. Pipelined protocols. GBN: sender extended FSM

Good Ideas So Far Computer Networking. Outline. Sequence Numbers (reminder) TCP flow control. Congestion sources and collapse

Transport Layer PREPARED BY AHMED ABDEL-RAOUF

Chapter 6 Transport Layer

LECTURE 3 - TRANSPORT LAYER

Chapter 3: Transport Layer. Chapter 3 Transport Layer. Chapter 3 outline. Transport services and protocols

ECE 610: Homework 4 Problems are taken from Kurose and Ross.

Computer Networking: A Top Down Approach

CS 268: Lecture 7 (Beyond TCP Congestion Control)

TCP conges+on control

Transport Layer Congestion Control

15-744: Computer Networking TCP

Computer Network Fundamentals Spring Week 10 Congestion Control Andreas Terzis

Correcting mistakes. TCP: Overview RFCs: 793, 1122, 1323, 2018, TCP seq. # s and ACKs. GBN in action. TCP segment structure

Chapter 3 Transport Layer

Chapter 3 Transport Layer

Congestion Control In The Internet Part 2: How it is implemented in TCP. JY Le Boudec 2014

Outline Computer Networking. TCP slow start. TCP modeling. TCP details AIMD. Congestion Avoidance. Lecture 18 TCP Performance Peter Steenkiste

Congestion Control In The Internet Part 2: How it is implemented in TCP. JY Le Boudec 2014

Congestion Control In The Internet Part 2: How it is implemented in TCP. JY Le Boudec 2015

Chapter 3 Transport Layer

Transport layer. UDP: User Datagram Protocol [RFC 768] Review principles: Instantiation in the Internet UDP TCP

CS4700/CS5700 Fundamentals of Computer Networks

Transport layer. Review principles: Instantiation in the Internet UDP TCP. Reliable data transfer Flow control Congestion control

Bandwidth Allocation & TCP

CS3600 SYSTEMS AND NETWORKS

Flow and Congestion Control Marcos Vieira

Congestion Control In The Internet Part 2: How it is implemented in TCP. JY Le Boudec 2015

CS519: Computer Networks. Lecture 5, Part 4: Mar 29, 2004 Transport: TCP congestion control

Part1: Lecture 2! TCP congestion control!

Master Course Computer Networks IN2097

Congestion Control in TCP

CS Transport. Outline. Window Flow Control. Window Flow Control

User Datagram Protocol (UDP) Transmission Control Protocol (TCP)

What is Congestion? Congestion: Moral of the Story. TCP Approach. Transport Layer: TCP Congestion Control & Buffer Management

CC451 Computer Networks

Transport protocols. Transport Layer 3-1

By Ossi Mokryn, Based also on slides from: the Computer Networking: A Top Down Approach Featuring the Internet by Kurose and Ross

Chapter 4. Computer Networking: A Top Down Approach 5 th edition. Jim Kurose, Keith Ross Addison-Wesley, sl April 2009.

COMP/ELEC 429/556 Introduction to Computer Networks

Master Course Computer Networks IN2097

Master Course Computer Networks IN2097

TCP Congestion Control

Congestion. Can t sustain input rate > output rate Issues: - Avoid congestion - Control congestion - Prioritize who gets limited resources

image 3.8 KB Figure 1.6: Example Web Page

internet technologies and standards

Congestion Control in TCP

Fall 2012: FCM 708 Bridge Foundation I

Chapter 3 Transport Layer

Page 1. Review: Internet Protocol Stack. Transport Layer Services. Design Issue EEC173B/ECS152C. Review: TCP

Advanced Congestion Control (Hosts)

CMSC 417. Computer Networks Prof. Ashok K Agrawala Ashok Agrawala. October 30, 2018

internet technologies and standards

TCP Congestion Control. Lecture 16. Outline. TCP Congestion Control. Additive Increase / Multiplicative Decrease (AIMD)

Transcription:

Chapter 3 Transport Layer A note on the use of these ppt slides: We re making these slides freely available to all (faculty, students, readers). They re in PowerPoint form so you can add, modify, and delete slides (including this one) and slide content to suit your needs. They obviously represent a lot of work on our part. In return for use, we only ask the following:! If you use these slides (e.g., in a class) in substantially unaltered form, that you mention their source (after all, we d like people to use our book!)! If you post any slides in substantially unaltered form on a www site, that you note that they are adapted from (or perhaps identical to) our slides, and note our copyright of this material. Computer Networking: A Top Down Approach 5 th edition. Jim Kurose, Keith Ross Addison-Wesley, April 2009. Thanks and enjoy! JFK/KWR All material copyright 1996-2010 J.F Kurose and K.W. Ross, All Rights Reserved Transport Layer 3-1

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-2

Principles of Congestion Control Congestion:! informally: too many sources sending too much data too fast for network to handle! different from flow control!! manifestations: " lost packets (buffer overflow at routers) " long delays (queueing in router buffers)! a top-10 problem! Transport Layer 3-3

Causes/costs of congestion: scenario 1! two senders, two receivers Host A λ in : original data λ out! one router, infinite buffers Host B unlimited shared output link buffers! no retransmission! large delays when congested! maximum achievable throughput Transport Layer 3-4

Causes/costs of congestion: scenario 2! one router, finite buffers! sender retransmission of timed-out packet " application-layer input = application-layer output: λ in = λ out " transport-layer input includes retransmissions : λ in λ in Host B λ in : original data λ' in : original data, plus retransmitted data λ out Host A finite shared output link buffers Transport Layer 3-5

Congestion scenario 2a: ideal case! sender sends only when router buffers available λ out R/2 λ in R/2 Host B copy λ in : original data λ' in : original data, plus retransmitted data λ out Host A free buffer space! finite shared output link buffers Transport Layer 3-6

Congestion scenario 2b: known loss! packets may get dropped at router due to full buffers " sometimes lost! sender only resends if packet known to be lost (admittedly idealized) Host B copy λ in : original data λ' in : original data, plus retransmitted data λ out Host A no buffer space! Transport Layer 3-7

Congestion scenario 2b: known loss! packets may get dropped at router due to full buffers " sometimes not lost! sender only resends if packet known to be lost (admittedly idealized) λ out R/2 λ in R/2 when sending at R/ 2, some packets are retransmissions but asymptotic goodput is still R/2 (why?) Host B λ in : original data λ' in : original data, plus retransmitted data λ out Host A free buffer space! Transport Layer 3-8

Congestion scenario 2c: duplicates! packets may get dropped at router due to full buffers! sender times out prematurely, sending two copies, both of which are delivered λ out R/2 λ in R/2 when sending at R/ 2, some packets are retransmissions including duplicated that are delivered! Host B copy timeout λ in λ' in λ out Host A free buffer space! Transport Layer 3-9

Congestion scenario 2c: duplicates! packets may get dropped at router due to full buffers! sender times out prematurely, sending two copies, both of which are delivered λ out R/2 λ in R/2 when sending at R/ 2, some packets are retransmissions including duplicated that are delivered! costs of congestion:! more work (retrans) for given goodput! unneeded retransmissions: link carries multiple copies of pkt " decreasing goodput Transport Layer 3-10

Causes/costs of congestion: scenario 3! four senders! multihop paths! timeout/retransmit Q: what happens as λ in and increase? λ in Host A λ in : original data λ' in : original data, plus retransmitted data finite shared output link buffers λ out Host B Transport Layer 3-11

Causes/costs of congestion: scenario 3 H o st A λ o u t H o st B another cost of congestion:! when packet dropped, any upstream transmission capacity used for that packet was wasted! Transport Layer 3-12

Transport Layer 3-13

Approaches towards congestion control Two broad approaches towards congestion control: end-end congestion control:! no explicit feedback from network! congestion inferred from end-system observed loss, delay! approach taken by TCP network-assisted congestion control:! routers provide feedback to end systems " single bit indicating congestion (SNA, DECbit, TCP/IP ECN, ATM) " explicit rate sender should send at Transport Layer 3-14

Case study: ATM ABR congestion control ABR: available bit rate:! elastic service! if sender s path underloaded : " sender should use available bandwidth! if sender s path congested: " sender throttled to minimum guaranteed rate RM (resource management) cells:! sent by sender, interspersed with data cells! bits in RM cell set by switches ( network-assisted ) " NI bit: no increase in rate (mild congestion) " CI bit: congestion indication! RM cells returned to sender by receiver, with bits intact Transport Layer 3-15

Case study: ATM ABR congestion control! two-byte ER (explicit rate) field in RM cell " congested switch may lower ER value in cell " sender send rate thus maximum supportable rate on path! EFCI bit in data cells: set to 1 in congested switch " if data cell preceding RM cell has EFCI set, sender sets CI bit in returned RM cell Transport Layer 3-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 3-17

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) sending rate ACKs being received, so increase rate X X X X X loss, so decrease rate TCP s sawtooth behavior Q: how fast to increase/decrease? details to follow time Transport Layer 3-18

TCP Congestion Control: details! sender limits transmission: LastByteSent-LastByteAcked! roughly, rate = cwnd RTT cwnd Bytes/sec! cwnd is dynamic, function of perceived network congestion How does sender perceive congestion?! loss event = timeout or 3 duplicate acks! TCP sender reduces rate (cwnd) after loss event three mechanisms: " AIMD " slow start " conservative after timeout events Transport Layer 3-19

TCP Slow Start! when connection begins, increase rate exponentially until first loss event: RTT Host A Host B one segment " initially cwnd = 1 MSS two segments " double cwnd every RTT " done by incrementing cwnd for every ACK received four segments! summary: initial rate is slow but ramps up exponentially fast time Transport Layer 3-20

Refinement: inferring loss! after 3 dup ACKs: " cwnd is cut in half " window then grows linearly! but after timeout event: " cwnd instead set to 1 MSS; " window then grows exponentially " to a threshold, then grows linearly Philosophy:! 3 dup ACKs indicates network capable of delivering some segments! timeout indicates a more alarming congestion scenario Transport Layer 3-21

Refinement Q: when should the exponential increase switch to linear? A: when cwnd gets to 1/2 of its value before timeout. Implementation:! variable ssthresh! on loss event, ssthresh is set to 1/2 of cwnd just before loss event Transport Layer 3-22

Summary: TCP Congestion Control Λ cwnd = 1 MSS ssthresh = 64 KB dupackcount = 0 timeout ssthresh = cwnd/2 cwnd = 1 MSS dupackcount = 0 retransmit missing segment dupackcount == 3 ssthresh= cwnd/2 cwnd = ssthresh + 3 retransmit missing segment duplicate ACK dupackcount++ slow start New ACK! new ACK cwnd = cwnd+mss dupackcount = 0 transmit new segment(s), as allowed cwnd > ssthresh Λ timeout ssthresh = cwnd/2 cwnd = 1 MSS dupackcount = 0 retransmit missing segment timeout ssthresh = cwnd/2 cwnd = 1 dupackcount = 0 retransmit missing segment fast recovery duplicate ACK new ACK cwnd = cwnd + MSS (MSS/cwnd) dupackcount = 0 transmit new segment(s), as allowed cwnd = ssthresh dupackcount = 0 congestion avoidance New ACK! New ACK cwnd = cwnd + MSS transmit new segment(s), as allowed. New ACK! duplicate ACK dupackcount++ dupackcount == 3 ssthresh= cwnd/2 cwnd = ssthresh + 3 retransmit missing segment Transport Layer 3-23

TCP throughput! what s the average throughout of TCP as a function of window size and RTT? " ignore slow start! let W be the window size when loss occurs. " when window is W, throughput is W/RTT " just after loss, window drops to W/2, throughput to W/2RTT. " average throughout:.75 W/RTT Transport Layer 3-24

TCP Futures: TCP over long, fat pipes! example: 1500 byte segments, 100ms RTT, want 10 Gbps throughput! requires window size W = 83,333 in-flight segments! throughput in terms of loss rate: 1.22 MSS RTT! L = 2 10-10 Wow a very small loss rate!! new versions of TCP for high-speed L Transport Layer 3-25

TCP Fairness fairness goal: if K TCP sessions share same bottleneck link of bandwidth R, each should have average rate of R/K TCP connection 1 TCP connection 2 bottleneck router capacity R Transport Layer 3-26

Why is TCP fair? two competing sessions:! additive increase gives slope of 1, as throughout increases! multiplicative decrease decreases throughput proportionally R equal bandwidth share Connection 2 throughput Connection 1 throughput loss: decrease window by factor of 2 congestion avoidance: additive increase loss: decrease window by factor of 2 congestion avoidance: additive increase R Transport Layer 3-27

Fairness (more) Fairness and UDP! multimedia apps often do not use TCP " do not want rate throttled by congestion control! instead use UDP: " pump audio/video at constant rate, tolerate packet loss 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, gets rate R/10 " new app asks for 11 TCPs, gets R/2! Transport Layer 3-28

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 + Bonus on fairness/ resource sharing Transport Layer 3-29

Fairness & Computing! Pascal (died 350 years ago) " computer pioneer " Pascal s formula " Pascaline 1 st mech. calculator " Also wrote Pensées (Thought)! Et ainsi ne pouvant faire que ce qui est juste fût fort, on fit que ce qui est fort fût juste. (fg 135, Raison des effets) As they could not fortify justice they have justified force. Transport Layer 3-30

What is fair? TCP connection 3 TCP connection 4 TCP connection 1 TCP connection 2 Capacity C Capacity C Capacity C Transport Layer 3-31

Resource sharing! Link l has capacity c l! A flow f i is traversing a set of link " We denote by S l the set of flows traversing l " We denote the rate of f i by r i! Clearly we operate under some constraints! The main question is how to set r i for all f i Transport Layer 3-32

What is fair? TCP connection 3 TCP connection 4 TCP connection 1 TCP connection 2 Capacity C Capacity C Capacity C Transport Layer 3-33

Different feasible allocations! (r1,r2,r3,r4) = (C/4,C/4,C/4,C/4)! (r1,r2,r3,r4) = (C/3,C/3,C/3,C/3) Very egalitarian Equally egalitarian And intuitively better! (r1,r2,r3,r4) = (C/4,C/4,C/2,C/2)! (r1,r2,r3,r4) = (C/8,C/8,C*7/8,C*7/8)! (r1,r2,r3,r4) = (C/2,C/2,0,0)! (r1,r2,r3,r4) = (0,0,C,C) Start from egalitarian Give extra capacity to only some All routers used 100% A variants of the precedent one Maximum sum of rate = max volume Transport Layer 3-34

Some lessons learned! There are multiple solutions, it s not simple.! Sometimes (like here) flow can be treated equally, but maybe not always! Avoiding to leave any capacity unused is a bad objective (flows 3,4 are starved)! Maximizing the sum of rates is a bad objective as well (flows 1,2 are starved) Transport Layer 3-35

What is fair? TCP connection 5 TCP connection 3 TCP connection 4 TCP connection 1 TCP connection 2 Capacity C Capacity C Capacity C In that case, an allocation that seems good is (r1,r2,r3,r4,r5) = (C/4,C/4,C/2,C/4,C/4) Transport Layer 3-36

Max-min fairness! An allocation is max-min fair if an increase within the domain of feasible allocation always implies a decrease for a flow with smaller rate " (i.e., a poor will have to suffer for a rich)! r is max-min fair if, for any x feasible " If we have x i >r i for a given i " Then, we necessarily have a flow j such that x j < r j r i Transport Layer 3-37

Properties of max-min fairness! Is a max-min allocation unique? " Not hard (can you see why?)! Does a max-min fair solution always exist?! Let a link l be called a bottleneck for f i if " Link l is saturated and f i has maximum rate among all sources using link l " Prop: if each flow has a bottleneck, then the allocation is max-min fair Transport Layer 3-38

Water-filling algorithms! A link is said saturated if " A flow is saturated if it goes through a sat. link " Let T l be the subset of S l that are not sat. 1. Choose unsaturated link l that minimizes 2. Increase ALL unsaturated flows by y l 3. Go back to step 1 until all links are sat. Transport Layer 3-39

Key idea of the proof! A flow always increases " But it is stopped as soon as one of its link is saturated. " At this time, no other flow on this link will increase, and hence this link is a bottleneck Transport Layer 3-40

Proportional fairness! An allocation r is proportionally fair if for any other allocation x we have:! Roughly speaking You can t increase someone without someone else losing a larger fraction of its rate. " Except that this is the sum of fraction Transport Layer 3-41

Example of Prop. Fair TCP connection 3 TCP connection 4 TCP connection 1 TCP connection 2 Capacity C Capacity C Capacity C Transport Layer 3-42

Properties of Prop. Fair! Is that unique? Does it always exist! THM: The unique proportional fair allocation is the value of r that maximizes! J is a concave function, the constraint domain is convex, an easy optimization " Can be obtained through gradient descent Transport Layer 3-43

More Utilitarian fairness! Let us define! Let r be the solution of subject to capacity " r is the α-fair allocation! α=1 : prop. fair, α=2: pot. delay, α very large: approaches maxmin Transport Layer 3-44

Does TCP follows any fairness?! Yes, under some assumptions " No limit on receiver window " No slow start (pure AIMD), No time-out " No delay in ACK transmission and response " Independent packet losses We can then justify a fluid approximation proving that TCP maximizes under capacity constraints Transport Layer 3-45

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 3-46