Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1 TCP (Part II) Shivkumar Kalyanaraman Rensselaer Polytechnic Institute

Slides:



Advertisements
Similar presentations
LOGO Transmission Control Protocol 12 (TCP) Data Flow.
Advertisements

1 TCP Congestion Control. 2 TCP Segment Structure source port # dest port # 32 bits application data (variable length) sequence number acknowledgement.
Improving TCP Performance over Mobile Ad Hoc Networks by Exploiting Cross- Layer Information Awareness Xin Yu Department Of Computer Science New York University,
1 TCP - Part II. 2 What is Flow/Congestion/Error Control ? Flow Control: Algorithms to prevent that the sender overruns the receiver with information.
Fundamentals of Computer Networks ECE 478/578 Lecture #21: TCP Window Mechanism Instructor: Loukas Lazos Dept of Electrical and Computer Engineering University.
School of Information Technologies TCP Congestion Control NETS3303/3603 Week 9.
Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1 ECSE-4690: Experimental Networking Informal Quiz: TCP Shiv Kalyanaraman:
Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1 ECSE-6600: Internet Protocols Informal Quiz #07 Shivkumar Kalyanaraman: GOOGLE: “Shiv RPI”
Congestion Control Tanenbaum 5.3, /12/2015Congestion Control (A Loss Based Technique: TCP)2 What? Why? Congestion occurs when –there is no reservation.
Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1 TCP Congestion Control: AIMD and Binomial Shivkumar Kalyanaraman Rensselaer Polytechnic Institute.
CSCE 515: Computer Network Programming Chin-Tser Huang University of South Carolina.
CSCE 515: Computer Network Programming Chin-Tser Huang University of South Carolina.
Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1 TCP (Part III: Miscl) Shivkumar Kalyanaraman Rensselaer Polytechnic Institute
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.
TDC375 Winter 03/04 John Kristoff - DePaul University 1 Network Protocols Transmission Control Protocol (TCP)
Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1-1 TCP Shivkumar Kalyanaraman Rensselaer Polytechnic Institute
Advanced Computer Networks: TCP Congestion Control 1 TCP Congestion Control Lecture material taken from “Computer Networks A Systems Approach”, Fourth.
CMPE 257 Spring CMPE 257: Wireless and Mobile Networking Spring 2005 E2E Protocols (point-to-point)
Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1 TCP (Part II) Shivkumar Kalyanaraman Rensselaer Polytechnic Institute
Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1 TCP (Part II) Shivkumar Kalyanaraman Rensselaer Polytechnic Institute
TCP: flow and congestion control. Flow Control Flow Control is a technique for speed-matching of transmitter and receiver. Flow control ensures that a.
1 #6 in Mid-Term  Most answered:  many users thru the same bottleneck -> increased queueing delay -> increased e2e latency  Possible reasons behind.
3: Transport Layer3b-1 Principles of Congestion Control Congestion: r informally: “too many sources sending too much data too fast for network to handle”
Networks Lab, Rensselaer Polytechnic Institute 1 LT-TCP: End-to-End Framework to Improve TCP Performance over Networks with Lossy Channels Omesh Tickoo,
CS 356: Introduction to Computer Networks Lecture 16: Transmission Control Protocol (TCP) Xiaowei Yang
COMT 4291 Communications Protocols and TCP/IP COMT 429.
CS 4396 Computer Networks Lab
Copyright © Lopamudra Roychoudhuri
1 Transport Protocols (continued) Relates to Lab 5. UDP and TCP.
1 Lecture 14 High-speed TCP connections Wraparound Keeping the pipeline full Estimating RTT Fairness of TCP congestion control Internet resource allocation.
Chapter 12 Transmission Control Protocol (TCP)
TCP: Transmission Control Protocol Overview Connection set-up and termination Interactive Bulk transfer Timers Improvements.
1 TCP III - Error Control TCP Error Control. 2 ARQ Error Control Two types of errors: –Lost packets –Damaged packets Most Error Control techniques are.
Malathi Veeraraghavan Originals by Jörg Liebeherr 1 Error Control Congestion Control Timers.
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.
Lecture 9 – More TCP & Congestion Control
CS640: Introduction to Computer Networks Aditya Akella Lecture 15 TCP – III Reliability and Implementation Issues.
Computer Networking Lecture 18 – More TCP & Congestion Control.
Lab The network simulator ns The network simulator ns Allows us to watch evolution of parameters like cwnd and ssthresh Allows us to watch evolution of.
TCP: Transmission Control Protocol Part II : Protocol Mechanisms Computer Network System Sirak Kaewjamnong Semester 1st, 2004.
1 CS 4396 Computer Networks Lab TCP – Part II. 2 Flow Control Congestion Control Retransmission Timeout TCP:
1 Sonia FahmyPurdue University TCP Congestion Control Sonia Fahmy Department of Computer Sciences Purdue University
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.
CS640: Introduction to Computer Networks Aditya Akella Lecture 15 TCP – III Reliability and Implementation Issues.
1 TCP - Part II. 2 What is Flow/Congestion/Error Control ? Flow Control: Algorithms to prevent that the sender overruns the receiver with information.
TCP OVER ADHOC NETWORK. TCP Basics TCP (Transmission Control Protocol) was designed to provide reliable end-to-end delivery of data over unreliable networks.
Internet Networking recitation #11
ECE 4110 – Internetwork Programming
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 TCP.
TCP continued. Discussion – TCP Throughput TCP will most likely generate the saw tooth type of traffic. – A rough estimate is that the congestion window.
Peer-to-Peer Networks 13 Internet – The Underlay Network
TCP/IP1 Address Resolution Protocol Internet uses IP address to recognize a computer. But IP address needs to be translated to physical address (NIC).
Transmission Control Protocol (TCP) TCP Flow Control and Congestion Control CS 60008: Internet Architecture and Protocols Department of CSE, IIT Kharagpur.
Computer Networking Lecture 16 – Reliable Transport.
Karn’s Algorithm Do not use measured RTT to update SRTT and SDEV Calculate backoff RTO when a retransmission occurs Use backoff RTO for segments until.
TCP - Part II.
TCP - Part II Relates to Lab 5. This is an extended module that covers TCP flow control, congestion control, and error control in TCP.
Chapter 5 TCP Sequence Numbers & TCP Transmission Control
Internet Networking recitation #9
Chapter 3 outline 3.1 transport-layer services
Computer Networks Bhushan Trivedi, Director, MCA Programme, at the GLS Institute of Computer Technology, Ahmadabad.
Hojun Lee TCP enhancements Hojun Lee 11/8/2018.
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 - Part II Suman Banerjee CS 640, UW-Madison
CS640: Introduction to Computer Networks
Internet Networking recitation #10
Transport Layer: Congestion Control
TCP: Transmission Control Protocol Part II : Protocol Mechanisms
Presentation transcript:

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1 TCP (Part II) Shivkumar Kalyanaraman Rensselaer Polytechnic Institute

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 2 q TCP interactive data flow q TCP bulk data flow q TCP congestion control q TCP timers q TCP futures and performance Ref: Chap 19-24; RFC 793, 1323, 2001, papers by Jacobson, Chiu/Jain, Karn/Partridge Overview

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 3 Reliability Models q Reliability => requires redundancy to recover from uncertain loss or other failure modes. q Two types of redundancy: q Spatial redundancy: independent backup copies q Forward error correction (FEC) codes q Problem: requires huge overhead, since the FEC is also part of the packet(s) it cannot recover from erasure of all packets q Temporal redundancy: retransmit if packets lost/error q Lazy: trades off response time for reliability q Design of status reports and retransmission optimization (see next slide) important

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 4 Temporal Redundancy Model Packets Sequence Numbers CRC or Checksum Status Reports ACKs NAKs, SACKs Bitmaps Packets FEC information Retransmissions Timeout

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 5 Status Report Design q Cumulative acks: q Robust to losses on the reverse channel q Can work with go-back-N retransmission q Cannot pinpoint blocks of data which are lost q The first lost packet can be pinpointed because the receiver would generate duplicate acks

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 6 Status Report Design (Continued) q Selective acks: (SACKs) q For a byte-stream model like TCP, need to specify ranges of bytes received (requires large overhead) q SACK is a TCP option over-and-above the cumulative acks q Bitmaps: identify received and lost information q Not efficient for TCP: a bit is needed for every byte! q NAKs have same problems like SACKs and bitmaps, but also are not robust to reverse channel losses

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 7 Retransmission Optimization q Default retransmission: q Go-back-N: I.e. retransmit the entire window. q Triggered by timeout or persistent loss in TCP q Not efficient if windows are large: high speed n/ws

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 8 Retransmission Optimization (Continued) q Selective retransmission: q Retransmit one packet based upon duplicate acks q Recovers quickly from isolated loss, but not from burst loss q TCP-SACK is an enhancement which identifies a block of packets to be retransmitted. q Such retransmitted packets must finally be confirmed by acks since SACK is only an option and not reliable

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 9 TCP Interactive Data Flow q Problems: q Overhead: 40 bytes header + 1 byte data q Packets: To batch or not to batch: response time important q Batching acknowledgements: q Delay-ack timer: piggyback ack on reverse traffic if available q 200 ms timer (fig 19.3) if no reverse traffic

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 10 TCP Interactive Data Flow q Batching data: q Nagle’s algo: Don’t send packet until next ack is received. q Developed because of congestion in WANs

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 11 TCP Bulk Data Flow q Sliding window: q Send multiple packets while waiting for acks (fig 20.1) upto a limit (W) q Receiver need not ack every packet q Acks are cumulative. q Ack # = Largest consecutive sequence number received + 1 q Two transfers of the data can have different dynamics (eg: fig 20.1 vs fig 20.2)

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 12 TCP Bulk Data Flow (Continued) q Receiver window field: q Reduced if TCP receiver short on buffers q End-to-end flow control q Window update acks: receiver ready q Default buffer sizes: 4096 to bytes. q Ideal: window and receiver buffer = bandwidth- delay product

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 13 TCP Bulk Data Flow (Continued) q TCP window terminology: figs 20.4, 20.5, 20.6 q Right edge, Left edge, usable window q “closes” => left edge (snd_una) advances q “opens” => right edge advances (receiver buffer freed => receiver window increases) q “shrinks” => right edge moves to left (rare)

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 14 The Congestion Problem q Problem: demand outstrips available capacity … q Q: Will the “congestion” problem be solved when: q a) Memory becomes cheap (infinite memory)? No buffer Too late All links 19.2 kb/s Replace with 1 Mb/s S S S S S S S S S S S S S S S S File Transfer Time = 7 hours File Transfer time = 5 mins q b) Links become cheap (high speed links)?

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 15 A B S C D Scenario: All links 1 Gb/s. A & B send to C. The Congestion Problem (Continued) q c) Processors become cheap (fast routers switches)?

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 16 i  ii q If information about i, and  is known in a central location where control of i can be effected with zero time delays, q the congestion problem is solved! The Congestion Problem (Continued) 1 n Capacity Demand

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 17 The Congestion Problem (Continued) q Problems: q Incomplete information (eg: loss indications) q Distributed solution required q Congestion and control/measurement locations different q Time-varying, heterogeneous time-delay

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 18 TCP Congestion Control q Window flow control: avoid receiver overrun q Dynamic window congestion control: avoid/control network overrun q Observation: Not a good idea to start with a large window and dump packets into network q Treat network like a black box and start from a window of 1 segment (“slow start”)

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 19 TCP Congestion Control (Continued) q Dynamic window congestion control: avoid/control network overrun (Continued). q Increase window size exponentially (“exponential increase”) over successive RTTs => quickly grow to claim available capacity. q Technique: Every ack: increase cwnd (new window variable) by 1 segment. q Effective window = Min(cwnd, Wrcvr)

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 20 Dynamics q Rate of acks = rate of packets at the bottleneck: “Self-clocking” property. 100 Mbps 10 Mbps Router Q 1st RTT 2nd RTT3rd RTT4th RTT

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 21 Congestion Detection q Packet loss as an indicator of congestion. q Set slow start threshold (ssthresh) to min(cwnd, Wrcvr)/2 q Retransmit pkt, set cwnd to 1 (reenter slow start) Time (units of RTTs) Congestion Window (cwnd) Receiver Window Idle Interval Timeout 1 ssthresh

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 22 Congestion Avoidance q Increment cwnd by 1 per ack until ssthresh q Increment by 1/cwnd per ack afterwards (“Congestion avoidance” or “linear increase”) q Idea: ssthresh estimates the bandwidth-delay product for the connection. q Initialization: ssthresh = Receiver window or default bytes. Larger values thru options. q If source is idle for a long time, cwnd is reset to one MSS.

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 23 q Implications of using packet loss as congestion indicator q Late congestion detection if the buffer sizes larger q Higher speed links or large buffers => larger windows => higher probability of burst loss q Interactions with retransmission algorithm and timeouts Congestion Avoidance (Continued)

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 24 Congestion Avoidance (Continued) q Implications of ack-clocking q More batching of acks => bursty traffic (harder to manage) q Less batching leads to a large fraction of Internet traffic being just acks (huge overhead) q Additive Increase/Multiplicative Decrease Dynamics: q TCP approximates these dynamics

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 25 Timeout and RTT Estimation q Timeout: for robust detection of packet loss q Problem: How long should timeout be ? q Too long => underutilization; too short => wasteful retransmissions q Solution: adaptive timeout: based on RTT

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 26 Timeout and RTT Estimation (Continued) q RTT estimation: q Early method: exponential averaging: q R   *R + (1 -  )*M { M =measured RTT} q RTO =  *R {  = delay variance factor} q Suggested values:  = 0.9,  = 2 q Jacobson [1988]: this method has problems w/ large RTT fluctuations

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 27 RTT Estimation q New method: Use mean & deviation of RTT q A = smoothed average RTT q D = smoothed mean deviation q Err = M - A { M = measured RTT} q A  A + g*Err {g = gain = 0.125} q D  D + h*(|Err| - D) {h = gain = 0.25} q RTO = A + 4D q Integer arithmetic used throughout. Complex initialization process...

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 28 Timer Backoff/Karn’s Algorithm q Timer backoff: If timeout, RTO = 2*RTO {exponential backoff} q Retransmission ambiguity problem: q During retransmission, it is unclear whether an ack refers to a packet or its retransmission. Problem for RTT estimation q Karn/Partridge: don’t update RTT estimators during retransmission. q Restart RTO only after an ack received for a segment that is not retransmitted

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 29 TCP Performance Optimization q SACK: selective acknowledgments: specifies blocks of packets received at destination. q Random early drop (RED) scheme spreads the dropping of packets more uniformly and reduces average queue length and packet loss rate. q Scheduling mechanisms protect well-behaved flows from rogue flows. q Explicit Congestion Notification (ECN): routers use a explicit bit-indication for congestion instead of loss indications.

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 30 Congestion Control Summary q Sliding window limited by receiver window. q Dynamic windows: slow start (exponential rise), congestion avoidance (linear rise), multiplicative decrease. q Adaptive timeout: need mean RTT & deviation q Timer backoff and Karn’s algo during retransmission

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 31 Congestion Control Summary (Continued) q Go-back-N or Selective retransmission q Cumulative and Selective acknowledgements q Advanced topics: q Timeout avoidance: Fast Retransmit q Drop policies q Scheduling q ECN: Explicit congestion notification

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 32 Gigabit Networks q “Higher Bandwidth Networks” q Propagation latency unchanged. q Increasing bandwidth from 1.5Mb/s to 45 Mb/s (factor of 29) decreases file transfer time of 1MB by a factor of 25. q But, increasing from 1 Gb/s to 2 Gb/s gives an improvement of only 10% ! q Transfer time = propagation time + transmission time + queueing/processing. q Design networks to minimize delay (queueing, processing, reduce retransmission latency)

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 33 q Long Fat Pipe Networks (LFN): Satellite links q Need very large window sizes. q Normally, Max window = 2 16 = 64 KBytes q Window scale: Window = W × 2 Scale Window Scaling Option Kind = 3Length = 3Scale q Max window = 2 16 × q Option sent only in SYN and SYN + Ack segments. q RFC 1323

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 34 Timestamp Option q For LFNs, need accurate and more frequent RTT estimates. q Timestamp option: q Place a timestamp value in any segment. q Receiver echoes timestamp value in ack q If acks are delayed, the timestamp value returned corresponds to the earliest segment being acked. q Segments lost/retransmitted => RTT overestimated

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 35 PAWS: Protection against wrapped sequence numbers q Largest receiver window = 2^30 = 1 GB q “Lost” segment may reappear before MSL, and the sequence numbers may have wrapped around

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 36 PAWS: Protection against wrapped sequence numbers (Continued) q The receiver considers the timestamp as an extension of the sequence number => discard out-of-sequence segment based on both seq # and timestamp. q Reqt: timestamp values need to be monotonically increasing, and need to increase by at least one per window

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 37 Summary q Interactive and bulk TCP flow q TCP congestion control q Informal exercises: Perform some of the experiments described in chaps to see various facets of TCP in action