TCP: Transmission Control Protocol Overview Connection set-up and termination Interactive Bulk transfer Timers Improvements.

Slides:



Advertisements
Similar presentations
CS144 Review Session 4 April 25, 2008 Ben Nham
Advertisements

LOGO Transmission Control Protocol 12 (TCP) Data Flow.
Flow control Connection management TCP, UDP
1 Transport Protocols & TCP CSE 3213 Fall April 2015.
CSCI 4550/8556 Computer Networks
1 TCP - Part I Relates to Lab 5. First module on TCP which covers packet format, data transfer, and connection management.
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.
Transport Layer – TCP (Part1) Dr. Sanjay P. Ahuja, Ph.D. Fidelity National Financial Distinguished Professor of CIS School of Computing, UNF.
1 TCP - Part II. 2 What is Flow/Congestion/Error Control ? Flow Control: Algorithms to prevent that the sender overruns the receiver with information.
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 Layer 3-1 Transport Layer r To learn about transport layer protocols in the Internet: m TCP: connection-oriented protocol m Reliability protocol.
CSCE 515: Computer Network Programming Chin-Tser Huang University of South Carolina.
Transport Layer 3-1 Transport Layer r To learn about transport layer protocols in the Internet: m TCP: connection-oriented protocol m Reliability protocol.
CSCE 515: Computer Network Programming Chin-Tser Huang University of South Carolina.
TDC375 Winter 03/04 John Kristoff - DePaul University 1 Network Protocols Transmission Control Protocol (TCP)
1 K. Salah Module 6.1: TCP Flow and Congestion Control Connection establishment & Termination Flow Control Congestion Control QoS.
TCP. Learning objectives Reliable Transport in TCP TCP flow and Congestion Control.
COMT 4291 Communications Protocols and TCP/IP COMT 429.
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 Transport Control Protocol Information management 2 Groep T Leuven – Information department 2/35 Introduction UDP provides the connection.
1 Transport Protocols (continued) Relates to Lab 5. UDP and TCP.
TCP : Transmission Control Protocol Computer Network System Sirak Kaewjamnong.
TCP Lecture 13 November 13, TCP Background Transmission Control Protocol (TCP) TCP provides much of the functionality that IP lacks: reliable service.
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.
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
What is TCP? Connection-oriented reliable transfer Stream paradigm
CS640: Introduction to Computer Networks Aditya Akella Lecture 15 TCP – III Reliability and Implementation Issues.
Computer Networking Lecture 18 – More TCP & Congestion Control.
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 Timeout And Retransmission Chapter 21 TCP sets a timeout when it sends data and if data is not acknowledged before timeout expires it retransmits.
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.
CS 6401 Congestion Control in TCP Outline Overview of RENO TCP Reacting to Congestion SS/AIMD example.
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.
CSEN 404 Transport Layer II Amr El Mougy Lamia AlBadrawy.
11 CS716 Advanced Computer Networks By Dr. Amir Qayyum.
1 TCP ProtocolsLayer name DNSApplication TCP, UDPTransport IPInternet (Network ) WiFi, Ethernet Link (Physical)
DMET 602: Networks and Media Lab Amr El Mougy Yasmeen EssamAlaa Tarek.
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.
TCP Lecture 4.
TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581 full duplex data:
Chapter 3 outline 3.1 transport-layer services
Introduction to Networks
Transmission Control Protocol (TCP)
Chapter 17 and 18: TCP is connection oriented
Transmission Control Protocol (TCP)
TCP.
TCP.
TCP.
TCP - Part I Karim El Defrawy
Transmission Control Protocol (TCP)
TCP - Part II Relates to Lab 5. This is an extended module that covers TCP flow control, congestion control, and error control in TCP.
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.
CS640: Introduction to Computer Networks
TCP - Part I Relates to Lab 5. First module on TCP which covers packet format, data transfer, and connection management.
The Transmission Control Protocol (TCP)
Transport Layer: Congestion Control
TCP flow and congestion control
TCP: Transmission Control Protocol Part II : Protocol Mechanisms
Presentation transcript:

TCP: Transmission Control Protocol Overview Connection set-up and termination Interactive Bulk transfer Timers Improvements

TCP: Overview Connection oriented, byte stream service Full or half duplex service Reliability (ARQ) – Sliding window with variable sized window – Stream is sent in segments (IP datagrams) – SN for bytes – Receiver buffer reorders bytes – Checksum on header and data – Discards duplicate data – Flow control

TCP: Overview AB Data from A Acks from A Data from B Acks from B

TCP: Overview IP HeaderTCP HeaderTCP Data TCP segment Source port #Destination port # Sequence # Acknowledgement # HLreservflagsWindow size ChecksumUrgent pointer Options if any =65495

TCP: Flags URG: The urgent pointer is used ACK: The acknowledgement number is valid PSH: The receiver should pass this data to the application as soon as possible RST: Reset the connection SYN: Synchronize sequence numbers to initiate a connection. FIN: The sender is finished sending data

TCP: Flags SYN When starting a TCP connection this bit is set Sequence # = Initial sequence number (ISN) URG byte offset of urgent data are to be found Urgent Ptr + SN = last byte of urgent data Options Example, maximum segment size (MSS) Max sized segment each end wants to receive Default = 536 byte payload + 20, SUN 1500

TCP: Set-Up Syn=1 Ack = 0 A:SYN, MSS, SN=ISN B: SYN, MSS, SN=ISN Syn1 ack 1 B: ACK A: ACK AB Full duplex

TCP: Termination A:FIN B: ack of FIN B: FIN A: ack of FIN AB Both sides close

TCP: Termination, Half Close FIN ack of FIN data ack of data appl shutdown appl write deliver eof of appl appl shutdown FIN ack of FIN deliver eof of appl

TCP Reset segments: sent whenever a segment is received that doesn’t appear correct for the referenced connection – To indicate wrong port – To indicate an abortive release –16 bit window size –T3 = Mbps – 12 msec –If Rrt = 50ms –Left Shift up to 14 bit – by agreement

TCP: Interactive Data Flow data byte ack of data byte echo of data byte ack of echoed byte Key stroke Echo PSH=1

TCP: Interactive Data Flow Telnet and rlogin carry small chunks of data Typically 10 bytes or less IP header = 20 bytes TCP header = 20 bytes data = 1 byte Nagle algorithm: Only one outstanding segment In the meantime bytes are collected. Stop and wait Inefficient!

TCP: Interactive Data Flow Delayed ACKs. Acks are delayed approx 200ms This allows them to be accumulated before being piggybacked on a segment Nagle algorithm: Only one outstanding segment In the meantime bytes are collected. Stop and wait

TCP: Interactive Data Flow data ack of data byte Collect incoming bytes data Self clocking = data rate is inversely dependent on rate at which acks return

Nagle Alg. Default in telnet or rlogin What about in X windows?

TCP: Bulk Data Flow TCP is a sliding window protocol What big should the window be? – The bigger the window, the higher throughput – Not too big since it’ll swamp resources and cause packet loss – Bandwidth delay product capacity (bits) = bw (bits/s) x round trip time (sec) Start from small window If under bw, increase window size (probing) If over bw (lose packets), decrease window size (backoff)

Bulk Transfer Dynamic sliding window Offered window: Advertised by the receiver in segments Amount of buffer space at receiver Congestion window (cwnd): Set by sender Local to the sender Dynamically adjusted to optimize performance

TCP windows sent and acked sent but not acked can send asap offered window usable window

TCP windows sent and acked sent but not acked can send asap min{offered window from receiver, cwnd} usable window Actually,

Bulk Transfer: cwnd Congestion window (cwnd) is dynamically adjusted to optimize performance Slow Start: F = # bytes in a frame, set by receiver Initially, cwnd = F Each time an ack is received, cwnd = cwnd + F Self-clocking: acks are generated at the same rate as they are being received, with the same kind of spacing in time.

Bulk Transfer: cwnd 1 cwnd 1 ack ack2 ack Doubling every RT!

Bandwidth Delay Product Recall for sliding window Throughput R= min{C, W/T} This used to be 1 W = window sizeC = bandwidth T = round trip time We want R = C, thus W/T = C W = C x T = bandwidth x delay

TCP Timeout and Retransmission Each data has a retransmission timer It is initialized by the retransmission time out (RTO) value When the timer expires, a time out occurs and the data is retransmitted If a retransmission fails then the time-out doubles i.e., exponential backoff. It’s important to find a good RTO value

TCP RTO RTO = R , R = RTT round trip time estimate  recommended to be 2 Original Round trip time measurement Update: R = axR + (1-a)xM, a = fraction, recommendation =.9 M = measured RTT Not a good estimator due to high variance in meas.

Jacobson RTO estimate M = Measured RTT A = Averaged estimate of RTT Err = M - A D = Averaged |Err| value A = A + g*Errg = 1/8 D = D +h*(|Err| - D)h = 1/4 RTO = A + 4D

Congestion Avoidance variables: cwnd = current window ssthresh = estimate of the “best” window i.e., largest window that won’t cause loss Packet loss is indicated by time out or the receipt of duplicate acks (3) 1. Initialization: cwnd = bytes for a segment ssthresh = 65535

Congestion Avoidance 2. When congestion is detected (packet loss detected, i.e, TO or duplicate ACK): ssthresh = max{ current window/2, 2} Additionally, if timeout, cwnd = 1 (begin slow start) 3. When new data is acknowledged if cwnd <= ssthresh then slow start if cwnd > ssthresh then congestion avoidance

Congestion Avoidance Slow Start: Upon receiving ack, cwnd++ Exponentially increasing Congestion Avoidance: Upon receiving ack, cwnd += 1/cwnd Linearly increasing cwnd acks acks 102

AlgorithmSlow StartCongestion Avoidance When to Runcwnd <= sstresh cwnd > sstresh Window Growth by 1 segment, if ACK received 1/cwnd, if ACK received Rate of GrowthExponentiallyAdditive

Fast Retransmit and Fast Recovery If tree or more duplicate packet, likely to have lost packet Should we wait RTO? If one or two duplicate packet, reordered It is with congestion avoidance rather than slow start

Fast Retransmit and Fast Recovery Fast retransmit: Avoid timeouts and slow start. 1. When a third duplicate ack is received set ssthresh = current window/2 retransmit the missing segment cwnd = ssthresh + 3 x segment size - avoidance 2. Each time another duplicate ack arrives increment cwnd by the segment size transmit a packet when window reaches new packets

Fast Retransmit and Fast Recovery 2. Each time another duplicate ack arrives cwnd = cwnd + segment size transmit a packet if window covers new packets 3. When the ack arrives that acknowledges new data cwnd = ssthresh. stuck sent but not acked can send asap

TCP Slow start: cwnd =1 cwnd exponentially increasing Congestion avoidance: cwnd reaches ssthresh, cwnd linearly increasing

TCP 3 dup acks, fast retransmit of packet Packets old cwnd ssthresh = cwnd/2, cwnd = ssthresh + 3 cwnd increments by 1 per duplicate ack. Note no transmissions while cwnd <= old cwnd Thus, oldcwnd/2 packets are in the pipe When an ack for new data arrives, ssthresh = cwnd and --> congestion avoidance

Additive Increase -- Multiplicative Decrease Helps fairness C R1 R2 R1 R2 R1+R2 = C additive increase multiplicative decrease Tends to converge to R1 = R2

TCP: Tahoe and Reno Tahoe: slow start + congestion avoidance Reno: fast retransmit + fast recovery

Predict Congestion?

Improvements: TCP Vegas x D W T R = transm rate C min round trip delay (x = 0) window size measured round trip delay W = packets in flight + x = RD + x Router (single bottleneck) x = W - RD measured D = min{T} = transm. rate router backlog

Improvements: TCP Vegas x D W T Router (single bottleneck) TCP Vegas: keep x at 2 for all flows (x = W - RD) if W - RD <= 1 then increase W if W - RD >= 3 then decrease W Leads to fair bandwidth allocation at router.

cwnd E(T) Back Traffic

Vegas cwnd E(T) Back Traffic

Improvements -- TCP Reno Improvements by Janey Hoe (New Reno): sstresh is initially too big: 65K ssthresh should be estimate of bw x delay TCP Reno does not work well with multiple losses Bandwidth estimate: send three closely spaced packets. Measure the times between their acks 1/times is approximate measure of bw of bottleneck link Delay estimate: Round trip time estimates

Improvements -- TCP Reno Multiple losses: TCP Reno retransmits one packet per RTT under fast retransmit. (Note a packet is retransmitted only under fast retransmit (3 dup acks) or TO/slow start) Improvement: Fast retransmit Sometimes it can get stuck -- window doesn’t cover new packets, and no more acks.

Improved Fast Retransmit Packets 3 dup acks window max packet sent = sndMax (i) ssthresh = cwnd/2 cwnd = 1 segment save_cwnd = ssthresh+1 (ii) Retransmit everything in using slow start Upon receiving 2 dup acks, send a new packet This phase is over when an ack is recvd for sndMax

TCP Timers Keep alive timer: periodically transmit a message (no data) to see if other end is alive. Application telnet (client just turns off PC) Persist timer: If windows go to zero, TCP is stuck Window probes query receivers to see if window has increased (1 byte of data beyond window) TCP has a 500 ms timer (crude) Time Outs have exponential backoff. Silly window syndrome: avoid small windows