Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1-1 TCP Shivkumar Kalyanaraman Rensselaer Polytechnic Institute

Slides:



Advertisements
Similar presentations
Computer Networks Transport Layer. Topics F Introduction (6.1)  F Connection Issues ( ) F TCP (6.4)
Advertisements

CSCI 4550/8556 Computer Networks
1 CS492B Project #2 TCP Tutorial # Jin Hyun Ju.
Rensselaer Polytechnic Institute © Shivkumar Kalvanaraman & © Biplab Sikdar1 ECSE-4670: Computer Communication Networks (CCN) Chapter 3: TCP Shivkumar.
1 TCP Congestion Control. 2 TCP Segment Structure source port # dest port # 32 bits application data (variable length) sequence number acknowledgement.
TCP: Transmission Control Protocol Overview Connection set-up and termination Interactive Bulk transfer Timers Improvements.
1 TCP - Part II. 2 What is Flow/Congestion/Error Control ? Flow Control: Algorithms to prevent that the sender overruns the receiver with information.
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”
Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1 TCP (Part II) Shivkumar Kalyanaraman Rensselaer Polytechnic Institute
TDC365 Spring 2001John Kristoff - DePaul University1 Internetworking Technologies Transmission Control Protocol (TCP)
Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1 UDP, TCP (Part I) Shivkumar Kalyanaraman Rensselaer Polytechnic Institute
Transport Layer 3-1 Transport Layer r To learn about transport layer protocols in the Internet: m TCP: connection-oriented protocol m Reliability protocol.
Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1 TCP Congestion Control: AIMD and Binomial Shivkumar Kalyanaraman Rensselaer Polytechnic Institute.
CSEE W4140 Networking Laboratory Lecture 7: TCP flow control and congestion control Jong Yul Kim
1 TCP Transport Control Protocol Reliable In-order delivery Flow control Responds to congestion “Nice” Protocol.
CSEE W4140 Networking Laboratory Lecture 7: TCP congestion control Jong Yul Kim
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 UDP, TCP (Part I) Shivkumar Kalyanaraman Rensselaer Polytechnic Institute
Computer Networks Transport Layer. Topics F Introduction  F Connection Issues F TCP.
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Transport Protocols Slide 1 Transport Protocols.
TCP. Learning objectives Reliable Transport in TCP TCP flow and Congestion Control.
Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1 UDP, TCP (Part I) Shivkumar Kalyanaraman Rensselaer Polytechnic Institute
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 Chapter Internetworking Part 4 (Transport Protocols, UDP and TCP, Protocol Port Numbers)
1 Transport Layer Computer Networks. 2 Where are we?
3: Transport Layer3b-1 TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581 r full duplex data: m bi-directional data flow in same connection m MSS: maximum.
TCOM 509 – Internet Protocols (TCP/IP) Lecture 04_b Transport Protocols - TCP Instructor: Dr. Li-Chuan Chen Date: 09/22/2003 Based in part upon slides.
TCP : Transmission Control Protocol Computer Network System Sirak Kaewjamnong.
SMUCSE 4344 transport layer. SMUCSE 4344 transport layer end-to-end protocols –transport code runs only on endpoint hosts encapsulates network communications.
ECE453 – Introduction to Computer Networks Lecture 14 – Transport Layer (I)
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 2.5 Internetworking Chapter 25 (Transport Protocols, UDP and TCP, Protocol Port Numbers)
TCP1 Transmission Control Protocol (TCP). TCP2 Outline Transmission Control Protocol.
1 TCP: Reliable Transport Service. 2 Transmission Control Protocol (TCP) Major transport protocol used in Internet Heavily used Completely reliable transfer.
TCP: Transmission Control Protocol Overview Connection set-up and termination Interactive Bulk transfer Timers Improvements.
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.
Chapter 24 Transport Control Protocol (TCP) Layer 4 protocol Responsible for reliable end-to-end transmission Provides illusion of reliable network to.
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 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.
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.
Fall 2004FSU CIS 5930 Internet Protocols1 TCP – Data Exchange Reading: Section 24.4.
IP1 The Underlying Technologies. What is inside the Internet? Or What are the key underlying technologies that make it work so successfully? –Packet Switching.
Peer-to-Peer Networks 13 Internet – The Underlay Network
Transmission Control Protocol (TCP) connection-oriented stream data transfer data sent as an unstructured stream of bytes reliability acknowledgements.
Transport Layer3-1 Transport Layer If you are going through Hell Keep going.
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.
1 TCP ProtocolsLayer name DNSApplication TCP, UDPTransport IPInternet (Network ) WiFi, Ethernet Link (Physical)
1 Chapter 24 Internetworking Part 4 (Transport Protocols, UDP and TCP, Protocol Port Numbers)
TCP - Part II.
Chapter 3 outline 3.1 transport-layer services
Internet and Intranet Protocols and Applications
Chapter 17. Transport Protocols
Transport Layer: Congestion Control
TCP: Transmission Control Protocol Part II : Protocol Mechanisms
Presentation transcript:

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1-1 TCP Shivkumar Kalyanaraman Rensselaer Polytechnic Institute Based in part upon the slides of Prof. Raj Jain (OSU), K. Vastola (RPI)

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1-2 q TCP Services q Reliability mechanisms: soft state, sequence numbers, retransmissions, timeouts, 3-way handshake q Congestion Control: dynamic windows, robust stability issues. Overview

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1-3 TCP: Key features q Connection-oriented q Point-to-point: 2 end-points (no broadcast or multicast) q Reliable transfer: Data is delivered in-order q Full duplex communication q Byte-stream interface: sequence of octets q Reliable startup: Data on old connection does not confuse new connections q Graceful shutdown: Data sent before closing a connection is not lost. Reset or immediate shutdown also possible.

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1-4 Reliability q Reliability provided by: q Reliable connection startup: Data on old connection does not confuse new connections q Graceful connection shutdown: Data sent before closing a connection is not lost. q Data segmented for transmission and acknowledged by destination. Timeout + Retransmission provided if data unacknowledged. This is formally called “soft-state” q Checksum provided to catch errors. q Re-sequencing of out-of-order data; discarding of duplicate data. q Window flow control => sender cannot overrun receiver buffers

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1-5 TCP Header Format Source Port Dest Port Seq No Ack No Header length ControlWindowResvd 4616 xySize in bits Check- sum UrgentOptionsPadData

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1-6 TCP Header q Source Port (16 bits): Identifies source user process 20 = FTP, 23 = Telnet, 53 = DNS, 80 = HTTP,... q Destination Port (16 bits) q Sequence Number (32 bits): Sequence number of the first byte in the segment. If SYN is present, this is the initial sequence number (ISN) and the first data byte is ISN+1. q Ack number (32 bits): Next byte expected

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1-7 Three-Way Handshake q 3-way handshake: necessary and sufficient for unambiguous setup/teardown even under conditions of loss, duplication, and delay

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1-8 TCP Interactive Data Flow q Problems: q Overhead: 40 bytes header + 1 byte data q To batch or not to batch: response time important q Batching acks: q Delay-ack timer: piggyback ack on echo q 200 ms timer (fig 19.3) 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 1-9 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) q Receiver window field: q Reduced if TCP receiver short on buffers

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1-10 TCP Bulk Data Flow (Contd) 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 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 1-11 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 1-12 Ans: None of the above solves congestion ! q Congestion: Demand > Capacity q It is a dynamic problem => Static solutions are not sufficient q TCP provides a dynamic solution A B S C D Scenario: All links 1 Gb/s. A & B send to C. q c) Processors become cheap (fast routers switches)?

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1-13 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”) 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 1-14 Dynamics q Rate of acks = rate of packets at the bottleneck: “Self-clocking” property. 100 Mbps10 Mbps Router Q 1st RTT 2nd RTT3rd RTT4th RTT

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1-15 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 1-16 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.

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1-17 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 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

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1-18 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 1-19 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 1-20 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 back off and Karn’s algo during retransmission q Go-back-N or Selective retransmission q Cumulative and Selective acknowledgements q Timeout avoidance: FRR q Drop policies, scheduling and ECN

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1-21 Summary q TCP reliability model and mechanisms q Congestion control mechanisms