17-1 Last time □ UDP socket programming ♦ DatagramSocket, DatagramPacket □ TCP ♦ Sequence numbers, ACKs ♦ RTT, DevRTT, timeout calculations ♦ Reliable.

Slides:



Advertisements
Similar presentations
Introduction 1 Lecture 13 Transport Layer (Transmission Control Protocol) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer.
Advertisements

Principles of Congestion Control Chapter 3.6 Computer Networking: A top-down approach.
Transport Layer3-1 TCP. Transport Layer3-2 TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581 r full duplex data: m bi-directional data flow in same connection.
3-1 TCP Protocol r point-to-point: m one sender, one receiver r reliable, in-order byte steam: m no “message boundaries” r pipelined: m TCP congestion.
EEC-484/584 Computer Networks Lecture 8 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
1 Chapter 3 Transport Layer. 2 Chapter 3 outline 3.1 Transport-layer services 3.2 Multiplexing and demultiplexing 3.3 Connectionless transport: UDP 3.4.
Chapter 3 Transport Layer slides are modified from J. Kurose & K. Ross CPE 400 / 600 Computer Communication Networks Lecture 11.
Transport Layer3-1 Chapter 3 outline r 3.1 Transport-layer services r 3.2 Multiplexing and demultiplexing r 3.3 Connectionless transport: UDP r 3.4 Principles.
1 TCP Congestion Control. 2 TCP Segment Structure source port # dest port # 32 bits application data (variable length) sequence number acknowledgement.
Week 9 TCP9-1 Week 9 TCP 3 outline r 3.5 Connection-oriented transport: TCP m segment structure m reliable data transfer m flow control m connection management.
Transport Layer1 TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581 r reliable, in-order byte steam: m no “message boundaries” r pipelined: m TCP congestion.
Introduction 1 Lecture 14 Transport Layer (Transmission Control Protocol) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer.
School of Information Technologies TCP Congestion Control NETS3303/3603 Week 9.
Announcement Homework 2 in tonight –Will be graded and sent back before Th. class Midterm next Tu. in class –Review session next time –Closed book –One.
Chapter 3 Transport Layer slides are modified from J. Kurose & K. Ross CPE 400 / 600 Computer Communication Networks Lecture 12.
Announcement Project 2 finally ready on Tlab Homework 2 due next Mon tonight –Will be graded and sent back before Tu. class Midterm next Th. in class –Review.
Transport Layer 3-1 Fast Retransmit r time-out period often relatively long: m long delay before resending lost packet r detect lost segments via duplicate.
Transport Layer3-1 Congestion Control. Transport Layer3-2 Principles of Congestion Control Congestion: r informally: “too many sources sending too much.
10/7/ /9/2003 TCP and Congestion Control October 7-9, 2003.
Transport Layer3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach Featuring the Internet, 2 nd edition. Jim Kurose, Keith Ross Addison-Wesley,
EEC-484/584 Computer Networks Lecture 16 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
Transport Layer Transport Layer: TCP. Transport Layer 3-2 TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581 r full duplex data: m bi-directional.
Week 9 TCP9-1 Week 9 TCP 3 outline r 3.5 Connection-oriented transport: TCP m segment structure m reliable data transfer m flow control m connection management.
The Future r Homework questions> r The next test is coming the 19 th (just before turkey day!) r Wednesday = review + anything not done today r Friday.
EEC-484/584 Computer Networks Lecture 8 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
1 Chapter 3 Transport Layer. 2 Chapter 3 outline 3.1 Transport-layer services 3.2 Multiplexing and demultiplexing 3.3 Connectionless transport: UDP 3.4.
Data Communication and Networks
Transport Layer Congestion control. Transport Layer 3-2 Approaches towards congestion control End-to-end congestion control: r no explicit feedback.
EEC-484/584 Computer Networks Lecture 14 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
Transport Layer 3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach 5 th edition. Jim Kurose, Keith Ross Addison-Wesley, April 2009.
EEC-484/584 Computer Networks Lecture 16 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
3: Transport Layer3b-1 Principles of Congestion Control Congestion: r informally: “too many sources sending too much data too fast for network to handle”
Transport Layer 4 2: Transport Layer 4.
Transport Layer3-1 Chapter 3 outline r 3.1 Transport-layer services r 3.2 Multiplexing and demultiplexing r 3.3 Connectionless transport: UDP r 3.4 Principles.
Transport Layer3-1 Chapter 3 outline r 3.1 Transport-layer services r 3.2 Multiplexing and demultiplexing r 3.3 Connectionless transport: UDP r 3.4 Principles.
Transport Layer3-1 Chapter 3 outline r 3.1 Transport-layer services r 3.2 Multiplexing and demultiplexing r 3.3 Connectionless transport: UDP r 3.4 Principles.
Transport Layer3-1 Chapter 3 outline 3.1 Transport-layer services 3.2 Multiplexing and demultiplexing 3.3 Connectionless transport: UDP 3.4 Principles.
Transport Layer 3-1 Chapter 3 Outline r 3.5 Connection-oriented transport: TCP m segment structure m reliable data transfer m flow control m connection.
Transport Layer3-1 TCP sender (simplified) NextSeqNum = InitialSeqNum SendBase = InitialSeqNum loop (forever) { switch(event) event: data received from.
Transport Layer1 Flow and Congestion Control Ram Dantu (compiled from various text books)
Principles of Congestion Control Congestion: informally: “too many sources sending too much data too fast for network to handle” different from flow control!
Transport Layer 3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March
1 Transport Layer Lecture 10 Imran Ahmed University of Management & Technology.
Transport Layer3-1 Chapter 3 outline r 3.1 Transport-layer services r 3.2 Multiplexing and demultiplexing r 3.3 Connectionless transport: UDP r 3.4 Principles.
Transport Layer 3- Midterm score distribution. Transport Layer 3- TCP congestion control: additive increase, multiplicative decrease Approach: increase.
By N.Gopinath AP/CSE Unit: III Introduction to Transport layer.
Transport Layer3-1 Chapter 3 outline r 3.1 Transport-layer services r 3.2 Multiplexing and demultiplexing r 3.3 Connectionless transport: UDP r 3.4 Principles.
1 John Magee 20 February 2014 CS 280: Transport Layer: Congestion Control Concepts, TCP Congestion Control Most slides adapted from Kurose and Ross, Computer.
CS-1652 The slides are adapted from the publisher’s material All material copyright J.F Kurose and K.W. Ross, All Rights Reserved Jack Lange.
Transport Layer3-1 Transport Layer Our lives begin to end, the day we become silent about things that matter.
Advance Computer Networks Lecture#09 & 10 Instructor: Engr. Muhammad Mateen Yaqoob.
Transport Layer3-1 Chapter 3 outline r 3.1 Transport-layer services r 3.2 Multiplexing and demultiplexing r 3.3 Connectionless transport: UDP r 3.4 Principles.
Transport Layer3-1 Chapter 3 outline r 3.1 Transport-layer services r 3.2 Multiplexing and demultiplexing r 3.3 Connectionless transport: UDP r 3.4 Principles.
Transport Layer3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach 5 th edition. Jim Kurose, Keith Ross Addison-Wesley, April 2009.
-1- Georgia State UniversitySensorweb Research Laboratory CSC4220/6220 Computer Networks Dr. WenZhan Song Professor, Computer Science.
Transport Layer3-1 Chapter 3 outline r 3.1 Transport-layer services r 3.2 Multiplexing and demultiplexing r 3.3 Connectionless transport: UDP r 3.4 Principles.
Transport Layer session 1 TELE3118: Network Technologies Week 11: Transport Layer TCP Some slides have been taken from: r Computer Networking:
Chapter 3 outline 3.1 transport-layer services
Chapter 6 TCP Congestion Control
CS-1652 Jack Lange University of Pittsburgh
Chapter 3 outline 3.1 Transport-layer services
Flow and Congestion Control
Chapter 6 TCP Congestion Control
CSE 4213: Computer Networks II
October 1st, 2013 CS-1652 Jack Lange University of Pittsburgh
TCP Overview.
CS-1652 Congestion Control Jack Lange University of Pittsburgh
Transport Layer: Congestion Control
Chapter 3 outline 3.1 Transport-layer services
October 4th, 2011 CS-1652 Jack Lange University of Pittsburgh
Presentation transcript:

17-1 Last time □ UDP socket programming ♦ DatagramSocket, DatagramPacket □ TCP ♦ Sequence numbers, ACKs ♦ RTT, DevRTT, timeout calculations ♦ Reliable data transfer algorithm

17-2 This time □ TCP ♦ Fast retransmit ♦ Flow control ♦ Connection management ♦ Congestion control

17-3 Fast Retransmit □ Time-out period often relatively long: ♦ long delay before resending lost packet □ Detect lost segments via duplicate ACKs. ♦ Sender often sends many segments back-to- back ♦ If segment is lost, there will likely be many duplicate ACKs. □ If sender receives 3 ACKs for the same data, it supposes that segment after ACKed data was lost: ♦ fast retransmit: resend segment before timer expires

17-4 event: ACK received, with ACK field value of y if (y > SendBase) { SendBase = y if (there are currently not-yet-acknowledged segments) start timer } else { increment count of dup ACKs received for y if (count of dup ACKs received for y == 3) { resend segment with sequence number y } Fast retransmit algorithm: a duplicate ACK for already ACKed segment fast retransmit

17-5 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

17-6 TCP Flow Control □ Receive side of TCP connection has a receive buffer: □ Speed-matching service: matching the send rate to the receiving app’s drain rate □ App process may be slow at reading from buffer sender won’t overflow receiver’s buffer by transmitting too much, too fast flow control

17-7 TCP Flow control: how it works (Suppose TCP receiver discards out-of-order segments) □ spare room in buffer = RcvWindow = RcvBuffer-[LastByteRcvd - LastByteRead] □ Rcvr advertises spare room by including value of RcvWindow in segments □ Sender limits unACKed data to RcvWindow ♦ guarantees receive buffer doesn’t overflow See the applet in UW-ACE!

17-8 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

17-9 TCP Connection Management Recall: TCP sender, receiver establish “connection” before exchanging data segments □ initialize TCP variables: ♦ seq. #s ♦ buffers, flow control info (e.g. RcvWindow ) □ client: connection initiator Socket clientSocket = new Socket("hostname","port number"); □ server: contacted by client Socket connectionSocket = welcomeSocket.accept(); Three way handshake: Step 1: client host sends TCP SYN segment to server ♦ specifies initial seq # ♦ no data Step 2: server host receives SYN, replies with SYNACK segment ♦ server allocates buffers ♦ specifies server initial seq. # Step 3: client receives SYNACK, replies with ACK segment, which may contain data

17-10 TCP Connection Management (cont.) Closing a connection: client closes socket: clientSocket.close(); Step 1: client end system sends TCP FIN control segment to server. Step 2: server receives FIN, replies with ACK. Closes connection, sends FIN. client FIN server ACK FIN close closed timed wait

17-11 TCP Connection Management (cont.) Step 3: client receives FIN, replies with ACK. ♦ Enters “timed wait” - will respond with ACK to received FINs Step 4: server, receives ACK. Connection closed. Note: with small modification, can handle simultaneous FINs. client FIN server ACK FIN closing closed timed wait closed

17-12 TCP Connection Management (cont) TCP client lifecycle TCP server lifecycle

17-13 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

17-14 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!

17-15 Causes/costs of congestion: scenario 1 □ Two senders, two receivers □ One router, infinite buffers □ No retransmission □ Large delays when congested □ Maximum achievable throughput unlimited shared output link buffers Host A in : original data Host B out

17-16 Causes/costs of congestion: scenario 2 □ One router, finite buffers □ Sender retransmission of lost packet finite shared output link buffers Host A in : original data Host B out ' in : original data, plus retransmitted data

17-17 Causes/costs of congestion: scenario 2 □ Always: (goodput) □ “Perfect” retransmission only when loss: □ Retransmission of delayed (not lost) packet makes larger (than perfect case) for same in out = in out > in out “Costs” of congestion: □ More work (retransmissions) for given “goodput” □ Unneeded retransmissions: link carries multiple copies of packet R/2 in out b. R/2 in out a. R/2 in out c. R/4 R/3

17-18 Causes/costs of congestion: scenario 3 □ Four senders □ Multihop paths □ Timeout/retransmit in Q: what happens as and increase ? in finite shared output link buffers Host A in : original data Host B out ' in : original data, plus retransmitted data

17-19 Causes/costs of congestion: scenario 3 Another “cost” of congestion: □ When packet dropped, any upstream transmission capacity used for that packet was wasted! HostAHostA HostBHostB o u t

17-20 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 Two broad approaches towards congestion control:

17-21 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

17-22 TCP Congestion Control: details □ Sender limits transmission: LastByteSent-LastByteAcked  CongWin □ Roughly, □ CongWin is dynamic, function of perceived network congestion How does sender perceive congestion? □ Loss event = timeout or 3 duplicate acks □ TCP sender reduces rate ( CongWin ) after loss event three mechanisms: ♦ AIMD ♦ slow start ♦ conservative after timeout events rate = CongWin RTT Bytes/sec

17-23 TCP congestion control: additive increase, multiplicative decrease □ Approach: increase transmission rate (window size), probing for usable bandwidth, until loss occurs ♦ additive increase: increase CongWin by 1 MSS every RTT until loss detected ♦ multiplicative decrease: cut CongWin in half after loss time congestion window size Saw tooth behavior: probing for bandwidth

17-24 TCP Slow Start □ When connection begins, CongWin = 1 MSS ♦ Example: MSS = 1 kBytes & RTT = 200 msec ♦ initial rate = 40 kbps □ available bandwidth may be >> MSS/RTT ♦ desirable to quickly ramp up to respectable rate □ When connection begins, increase rate exponentially fast until first loss event

17-25 TCP Slow Start (more) □ When connection begins, increase rate exponentially until first loss event: ♦ double CongWin every RTT ♦ done by incrementing CongWin for every ACK received □ Summary: initial rate is slow but ramps up exponentially fast Host A one segment RTT Host B time two segments four segments

17-26 Refinement Q: When should the exponential increase switch to linear? A: When CongWin gets to 1/2 of its value before timeout. Implementation: □ Variable Threshold □ At loss event, Threshold is set to 1/2 of CongWin just before loss event

17-27 Refinement: inferring loss □ After 3 dup ACKs: ♦ CongWin is cut in half ♦ window then grows linearly □ But after timeout event: ♦ CongWin instead set to 1 MSS; ♦ window then grows exponentially ♦ to a threshold, then grows linearly □ 3 dup ACKs indicates network capable of delivering some segments □ Timeout indicates a “more alarming” congestion scenario Philosophy:

17-28 Summary: TCP Congestion Control □ When CongWin is below Threshold, sender in slow-start phase, window grows exponentially. □ When CongWin is above Threshold, sender is in congestion-avoidance phase, window grows linearly. □ When a triple duplicate ACK occurs, Threshold set to CongWin/2 and CongWin set to Threshold. □ When timeout occurs, Threshold set to CongWin/2 and CongWin is set to 1 MSS.

17-29 TCP sender congestion control SS or CA Congestion Avoidance (CA) Slow Start (SS) State CongWin and Threshold not changed Increment duplicate ACK count for segment being acked Duplicate ACK Enter slow startThreshold = CongWin/2, CongWin = 1 MSS, Set state to “Slow Start” Timeout Fast recovery, implementing multiplicative decrease. CongWin will not drop below 1 MSS. Threshold = CongWin/2, CongWin = Threshold, Set state to “Congestion Avoidance” Loss event detected by triple duplicate ACK Additive increase, resulting in increase of CongWin by 1 MSS every RTT CongWin = CongWin+MSS * (MSS/CongWin) ACK receipt for previously unacked data Resulting in a doubling of CongWin every RTT CongWin = CongWin + MSS, If (CongWin > Threshold) set state to “Congestion Avoidance” ACK receipt for previously unacked data CommentaryTCP Sender ActionEvent

17-30 Recap □ Fast retransmit ♦ 3 duplicate ACKs □ Flow control ♦ Receiver windows □ Connection management ♦ SYN/SYNACK/ACK, FIN/ACK, TCP states □ Congestion control ♦ General concepts □ TCP congestion control ♦ AIMD, slow start, congestion avoidance

17-31 Next time □ TCP ♦ Throughput ♦ Fairness ♦ Delay modeling □ TCP socket programming □ NAT