CS4470 Computer Networking Protocols

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

24-1 Chapter 24. Congestion Control and Quality of Service (part 1) 23.1 Data Traffic 23.2 Congestion 23.3 Congestion Control 23.4 Two Examples.
Transport Layer – TCP (Part2) Dr. Sanjay P. Ahuja, Ph.D. Fidelity National Financial Distinguished Professor of CIS School of Computing, UNF.
Computer Networks: TCP Congestion Control 1 TCP Congestion Control Lecture material taken from “Computer Networks A Systems Approach”, Fourth Edition,Peterson.
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.
Transport Layer 3-1 outline r TCP m segment structure m reliable data transfer m flow control m congestion control.
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.
Transport Layer 3-1 Outline r TCP m Congestion control m Flow control.
Computer Networks: TCP Congestion Control 1 TCP Congestion Control Lecture material taken from “Computer Networks A Systems Approach”, Third Ed.,Peterson.
CSEE W4140 Networking Laboratory Lecture 7: TCP flow control and congestion control Jong Yul Kim
CSCE 515: Computer Network Programming Chin-Tser Huang University of South Carolina.
CSCE 515: Computer Network Programming Chin-Tser Huang University of South Carolina.
1 Lecture 9: TCP and Congestion Control Slides adapted from: Congestion slides for Computer Networks: A Systems Approach (Peterson and Davis) Chapter 3.
CSEE W4140 Networking Laboratory Lecture 7: TCP congestion control Jong Yul Kim
Computer Networks : TCP Congestion Control1 TCP Congestion Control.
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.
EEC-484/584 Computer Networks Lecture 14 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
Networks : TCP Congestion Control1 TCP Congestion Control.
Networks : TCP Congestion Control1 TCP Congestion Control Presented by Bob Kinicki.
Advanced Computer Networks: TCP Congestion Control 1 TCP Congestion Control Lecture material taken from “Computer Networks A Systems Approach”, Fourth.
EEC-484/584 Computer Networks Lecture 16 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
TCP: flow and congestion control. Flow Control Flow Control is a technique for speed-matching of transmitter and receiver. Flow control ensures that a.
Lect3..ppt - 09/12/04 CIS 4100 Systems Performance and Evaluation Lecture 3 by Zornitza Genova Prodanoff.
TCP CS 168 Discussion Week 6 Many thanks to past EE 122 GSIs.
Chapter 12 Transmission Control Protocol (TCP)
Copyright 2008 Kenneth M. Chipps Ph.D. Controlling Flow Last Update
Copyright © Lopamudra Roychoudhuri
1 TCP - Part II Relates to Lab 5. This is an extended module that covers TCP data transport, and flow control, congestion control, and error control in.
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 CS 4396 Computer Networks Lab TCP – Part II. 2 Flow Control Congestion Control Retransmission Timeout TCP:
ECE 4110 – Internetwork Programming
TCP Transmission Control Protocol Part 2 CH 23 Aseel Alturki.
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.
© Janice Regan, CMPT 128, CMPT 371 Data Communications and Networking Congestion Control 0.
Transmission Control Protocol (TCP) TCP Flow Control and Congestion Control CS 60008: Internet Architecture and Protocols Department of CSE, IIT Kharagpur.
CSEN 404 Transport Layer II Amr El Mougy Lamia AlBadrawy.
DMET 602: Networks and Media Lab
TCP - Part II Relates to Lab 5. This is an extended module that covers TCP flow control, congestion control, and error control in TCP.
Internet Networking recitation #9
Topics discussed in this section:
9.6 TCP Congestion Control
Transport Layer CS 381 3/7/2017.
Chapter 3 outline 3.1 transport-layer services
Chapter 6 TCP Congestion Control
Introduction to Networks
COMP 431 Internet Services & Protocols
Congestion Control.
Process-to-Process Delivery, TCP and UDP protocols
Chapter 3 outline 3.1 Transport-layer services
Precept 2: TCP Congestion Control Review
TCP - Part II Relates to Lab 5. This is an extended module that covers TCP flow control, congestion control, and error control in TCP.
TCP.
Flow and Congestion Control
Lecture 19 – TCP Performance
So far, On the networking side, we looked at mechanisms to links hosts using direct linked networks and then forming a network of these networks. We introduced.
PUSH Flag A notification from the sender to the receiver to pass all the data the receiver has to the receiving application. Some implementations of TCP.
CS4470 Computer Networking Protocols
TCP Tutorial - Part III -
Chapter 6 TCP Congestion Control
TCP Sliding Windows, Flow Control, and Congestion Control
Internet Networking recitation #10
TCP Overview.
Transport Layer: Congestion Control
Chapter 3 outline 3.1 Transport-layer services
TCP flow and congestion control
TCP Sliding Windows, Flow Control, and Congestion Control
TCP Sliding Windows, Flow Control, and Congestion Control
Presentation transcript:

CS4470 Computer Networking Protocols 4/5/2019 CS4470 Computer Networking Protocols 17. TCP 4 Huiping Guo Department of Computer Science California State University, Los Angeles

Outline Flow control TCP congestion control 17. TCP 4 CS4470

4/5/2019 TCP Flow Control Define the amount of data the sender can send before receiving an Ack from the destination Two extreme cases Send one byte and wait for Ack Extremely slow Send all of the data without waiting for Acks Speed up the process May overwhelm the receiver TCP uses a window Send as much data as defined by the window 17. TCP 4 CS4470

TCP segment structure Flow control 17. TCP 4 CS4470

TCP Sliding Window How to determine the window size? Flow control: rwnd Congestion Control: cwnd 17. TCP 4 CS4470

TCP Sliding Window The window size changes Controlled by the receiver and the congestion in the network, not the sender The receiver window is the number of bytes the other end can accept before its buffer overflows and data is discarded The congestion window is a value determined by the network to avoid congestion TCP’s sliding windows are byte oriented 17. TCP 4 CS4470

TCP Flow Control Receiver’s side of TCP connection has a receiving buffer: App. process may be slow at reading from buffer Two variables LastByteRead: the number of the last byte in the data stream read from the buffer by the application process LastByteRcvd: the number of the last byte that has arrived 17. TCP 4 CS4470

TCP Flow control: how it works Spare room in the receiver’s buffer RcvWnd = RcvBuffer-[LastByteRcvd - LastByteRead] Receiver advertises spare room by including value of RcvWnd in segments Sender limits unACKed data to RcvWindow LastByteSent-LastByteAcked<=RcvWindow guarantees receive buffer doesn’t overflow 17. TCP 4 CS4470

Exercise 1 What is the value of the receiver window (rwnd) for host A if the receiver, host B, has a buffer size of 5,000 bytes and 1,000 bytes of received and unprocessed data? Solution The value of rwnd = 5,000 − 1,000 = 4,000. Host B can receive only 4,000 bytes of data before overflowing its buffer. Host B advertises this value in its next segment to A. 17. TCP 4 CS4470

Exercise 2 What is the size of the window for host A if the value of rwnd is 3,000 bytes and the value of cwnd is 3,500 bytes? Solution The size of the window is the smaller of rwnd and cwnd, which is 3,000 bytes. 17. TCP 4 CS4470

Exercise 3 The sender has sent bytes up to 202. We assume that cwnd is 20 The receiver has sent an acknowledgment number of 200 with an rwnd of 9 bytes The size of the sender window is the minimum of rwnd and cwnd or 9 bytes. Bytes 200 to 202 are sent, but not acknowledged. Bytes 203 to 208 can be sent without worrying about acknowledgment. Bytes 209 and above cannot be sent. 17. TCP 4 CS4470

Exercise 3 17. TCP 4 CS4470

Exercise 4 Following the previous exercise, the sender receives a packet with an acknowledgment value of 202 and an rwnd of 9. The sender has already sent bytes 203, 204, and 205. The value of cwnd is still 20. Show the new window. Solution The window closes from the left and opens from the right by an equal number of bytes, so the size of the window has not been changed. The acknowledgment value, 202, declares that bytes 200 and 201 have been received and the sender needs not worry about them; the window can slide over them. 17. TCP 4 CS4470

Exercise 4 17. TCP 4 CS4470

Exercise 5 Following the previous exercise, the sender receives a packet with an acknowledgment value of 206 and an rwnd of 12. The sender has not sent any new bytes. The value of cwnd is still 20. Show the new window. Solution The value of rwnd is less than cwnd, so the size of the window is 12. Note that the window has been opened from the right by 7 and closed from the left by 4; the size of the window has increased. 17. TCP 4 CS4470

Exercise 5 17. TCP 4 CS4470

MSS Maximum segment size (MSS) Why MSS? The maximum amount of application data (in bytes) that can be put in a TCP segment Set based on the path MTU (Maximum Transmission Unit, link layer) Path MTU: the largest link layer frame that can be sent on all links from the source to destination Why MSS? Ensure that a single TCP segment (encapsulated in an IP datagram) can fit into a single link layer frame IP datagram fragmentation Fragment the data in the IP datagram into two or more smaller IP datagrams TCP prevents a segment from being fragmented by IP 17. TCP 4 CS4470

Congestion Network congestion How congestion happens The number of packets sent to the network is greater than the number of packets a network can handle How congestion happens Each interface of a router has an input and output buffer Input buffer overflow Arrival rate > processing rate Output buffer overflow Processing rate > departure rate 17. TCP 4 CS4470

Router queues 17. TCP 4 CS4470

Congestion Control What is congestion control How? Prevent congestion before it happens Remove congestion after it has happened How? Adjust the congestion window size: cwnd Let’s now ignore recWindow 17. TCP 4 CS4470

TCP Congestion Control Three phases Slow start Congestion avoidance Congestion detection The algorithms in each phase are independent Some important variables Cwnd Threshold 17. TCP 4 CS4470

Slow start algorithm The slow start phase is the phase right after the connection is established. The algorithm Cwnd starts with 1MSS Each time one new ACK arrives, cwnd is increased by 1MSS cwnd is effectively doubled per RTT “epoch” Cwnd keeps growing until Cwnd reaches threshold Or congestion occurs Cwnd starts slowly, but grows exponentially 17. TCP 4 CS4470

TCP Slow Start Slow Start Add one MSS per ACK 17. TCP 4 CS4470 Source Destination Slow Start Add one MSS per ACK 17. TCP 4 CS4470

Congestion avoidance The phase after the slow start phase Slow down the exponential growth Avoid congestion before it happens When congestion avoidance phase starts? cwnd >= Threshold The algorithm Each time the WHOLE WINDOW of packets is acknowledged, Cwin is increased by 1MSS cwnd is increased by 1/cwnd for each acknowledged segment (Additive increase) Cwin keeps growing LINEALLY until congestion happens 17. TCP 4 CS4470

Congestion avoidance 17. TCP 4 CS4470

Congestion detection Timeout 3 duplicate ACKs Strong possibility of congestion A segment has probably been dropped No news about following segments TCP reacts strongly 3 duplicate ACKs Weaker possibility of congestion A segment may have been dropped Some segments after that may have arrived safely TCP applies fast recovery algorithm 17. TCP 4 CS4470

Timeout Retransmit the lost packet Threshold = ½ cwnd Cwnd = 1 NOT threshold = ½ threshold! Cwnd = 1 Starts the slow start phase 17. TCP 4 CS4470

17. TCP 4 CS4470

Figure: Behavior of TCP Congestion Control 17. TCP 4 CS4470

Fast Retransmit Coarse timeouts remained a problem, and Fast retransmit was added. Since the receiver responds every time a packet arrives, this implies the sender will see duplicate ACKs. Basic Idea: use duplicate ACKs to signal lost packet Fast recovery: upon receipt of three duplicate ACKs, the TCP Sender retransmits the lost packet. 17. TCP 4 CS4470

Fast Retransmit Based on three duplicate ACKs 2 3 3 3 3 7 17. TCP 4 CS4470

Fast recovery When fast retransmit detects three duplicate ACKs, start the recovery process After retransmit Threshold = ½ cwnd Cwnd = threshold (multiplicative decrease) Starts the congestion avoidance phase 17. TCP 4 CS4470

Summary: TCP Congestion Control 3 dup ACKs 17. TCP 4 CS4470

Congestion control example 17. TCP 4 CS4470

TCP Congestion Window Trace 17. TCP 4 CS4470

Exercise 17. TCP 4 CS4470

Exercise Slow start time intervals Congestion avoidance interval 4/5/2019 Exercise Slow start time intervals Congestion avoidance interval At time 4, what happened? At time 4, if 3 duplicate acks are received, what’s the value of cwnd, threshold? Slow start time intervals 0-4, 5-8 Congestion avoidance interval 8- At time 4, what happened? Timeout or 3 duplicate acks are received? At time 4, if 3 duplicate acks are received, the value of cwnd, threshold? Cwnd=8, threshold=8 17. TCP 4 CS4470