CS 4396 Computer Networks Lab

Slides:



Advertisements
Similar presentations
Flow control Connection management TCP, UDP
Advertisements

1 Transport Protocols & TCP CSE 3213 Fall April 2015.
NET0183 Networks and Communications Lecture 28 TCP: a transport layer protocol... the story continues... Sagan halda áfram 8/25/20091 NET0183 Networks.
1 CS492B Project #2 TCP Tutorial # Jin Hyun Ju.
Data link control. Data Link Control –Flow Control how much data may sent –Error Control How can error be detected and corrected.
Flow and Error Control. Flow Control Flow control coordinates the amount of data that can be sent before receiving acknowledgement It is one of the most.
1 TCP - Part II. 2 What is Flow/Congestion/Error Control ? Flow Control: Algorithms to prevent that the sender overruns the receiver with information.
1 TCP CSE May TCP Services Flow control Connection establishment and termination Congestion control 2.
Chapter 12 TCP Traffic Control Chapter 12 TCP Traffic Control.
Congestion Dr. Abdulaziz Almulhem. Almulhem©20012 Congestion It occurs when network resources are becoming scarce High demand Over utilized Offered load.
CSCE 515: Computer Network Programming Chin-Tser Huang University of South Carolina.
CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 13 Introduction to Computer Networks.
CSCE 515: Computer Network Programming Chin-Tser Huang University of South Carolina.
Congestion Avoidance and Control CSCI 780, Fall 2005.
Chapter 6 Errors, Error Detection, and Error Control
1 K. Salah Module 6.1: TCP Flow and Congestion Control Connection establishment & Termination Flow Control Congestion Control QoS.
TCP: flow and congestion control. Flow Control Flow Control is a technique for speed-matching of transmitter and receiver. Flow control ensures that a.
COMT 4291 Communications Protocols and TCP/IP COMT 429.
TCP Timers Chia-tai Tsai Introduction The 7 Timers for each Connection Connection-Establishment Timer Establish a new connection.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Chapter 11 Data Link Control Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction.
1 Transport Protocols (continued) Relates to Lab 5. UDP and TCP.
Chapter 5 Peer-to-Peer Protocols and Data Link Layer PART I: Peer-to-Peer Protocols ARQ Protocols and Reliable Data Transfer Flow Control.
1 Transport Layer Lecture 10 Imran Ahmed University of Management & Technology.
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.
Chapter 3: Channel Coding (part 3). Automatic repeat request (ARQ) protocols ▫Used in combination with error detection/correction ▫Block of data with.
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 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.
1 TCP - Part II. 2 What is Flow/Congestion/Error Control ? Flow Control: Algorithms to prevent that the sender overruns the receiver with information.
1 Computer Networks Congestion Avoidance. 2 Recall TCP Sliding Window Operation.
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 Timeout and Retransmission
TCP Congestion Control 컴퓨터공학과 인공지능 연구실 서 영우. TCP congestion control2 Contents 1. Introduction 2. Slow-start 3. Congestion avoidance 4. Fast retransmit.
Transport Layer: Sliding Window Reliability
Data Link Layer Flow and Error Control. Flow Control Flow Control Flow Control Specifies the amount of data can be transmitted by sender before receiving.
Retransmission. Automatic Repeat reQuest (ARQ) 2 Time Packet ACK Timeout Automatic Repeat Request –Receiver sends acknowledgment (ACK) when it receives.
TCP as a Reliable Transport. How things can go wrong… Lost packets Corrupted packets Reordered packets …Malicious packets…
CSCI 465 D ata Communications and Networks Lecture 11 Martin van Bommel CSCI 465 Data Communications & Networks 1.
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.
DATA LINK CONTROL. DATA LINK LAYER RESPONSIBILTIES  FRAMING  ERROR CONTROL  FLOW CONTROL.
Computer Networking Lecture 16 – Reliable Transport.
NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS ( NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS (PRACTICAL PART) Tutorial 4 : Chapter 7 Data & computer.
Data Link Layer.
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.
Data Link Layer Flow Control.
David Wetherall Spring 2000
TCP - Part III TCP Timers Selective Acknowledgements.
TCP Wrap-up TCP Timers Selective Acknowledgements.
Data Link Layer What does it do?
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
CS4470 Computer Networking Protocols
CS4470 Computer Networking Protocols
CS640: Introduction to Computer Networks
Lecture 18 – More TCP & Congestion Control
The Transport Layer Reliability
TCP III - Error Control TCP Error Control.
Chapter 5 Peer-to-Peer Protocols and Data Link Layer
Lecture 4 Peer-to-Peer Protocols and Data Link Layer
TCP: Transmission Control Protocol Part II : Protocol Mechanisms
Presentation transcript:

CS 4396 Computer Networks Lab TCP – Error Control

ARQ Error Control Two types of errors: Lost packets Damaged packets Most Error Control techniques are based on: 1. Error Detection Scheme (Parity checks, CRC). 2. Retransmission Scheme. Error control schemes that involve error detection and retransmission of lost or corrupted packets are referred to as Automatic Repeat Request (ARQ) error control.

Background: ARQ Error Control The most common ARQ retransmission schemes: Stop-and-Wait ARQ Go-Back-N ARQ Selective Repeat ARQ The protocol for sending ACKs in all ARQ protocols are based on the sliding window flow control scheme TCP uses a version of the Go-Back-N Protocol

Background: Go-Back-N ARQ Go-Back-N sends cumulative acknowledgments Packets 2,3,4,5 are retransmitted Timeout for Packet 2 A Packet 0 ACK 1 Packet 1 ACK 2 Packet 2 loss Packet 3 ACK 1 Packet 4 ACK 1 Packet 5 ACK 1 Packet 2 ACK 3 Packet 3 ACK 4 Packet 4 ACK 5 Packet 5 ACK 6 B

Retransmissions in TCP A TCP sender retransmits a segment when it assumes that the segment has been lost: No ACK has been received and a timeout occurs Multiple ACKs have been received for the same segment

Receiving duplicate ACKs If three or more duplicate ACKs are received in a row, the TCP sender believes that a segment has been lost. Then TCP performs a retransmission of what seems to be the missing segment, without waiting for a timeout to happen. This can fix losses of single segments

Retransmission Timer TCP sender maintains one retransmission timer for each connection When the timer reaches the retransmission timeout (RTO) value, the sender retransmits the first segment that has not been acknowledged The timer is started When a packet with payload is transmitted and timer is not running When an ACK arrives that acknowledges new data and there are other segments pending ACKs, When a segment is retransmitted The timer is stopped when All segments are acknowledged

How to set the timer Retransmission Timer: The setting of the retransmission timer is crucial for good performance of TCP Timeout value too small  results in unnecessary retransmissions Timeout value too large  long waiting time before a retransmission can be issued A problem is that the delays in the network are not fixed Therefore, the retransmission timers must be adaptive

Setting the value of RTO: The RTO value is set based on round-trip time (RTT) measurements that each TCP performs Each TCP connection measures the time difference between the transmission of a segment and the receipt of the corresponding ACK There is only one measurement ongoing at any time (i.e., measurements do not overlap) Figure on the right shows three RTT measurements

Setting the RTO value RTO is calculated based on the RTT measurements Uses an exponential moving average to calculate estimators for delay (srtt) and variance of delay (rttvar) The RTT measurements are smoothed by the following estimators srtt and rttvar: srttn+1 = a RTT + (1- a ) srttn rttvarn+1 = b ( | RTT - srttn | ) + (1- b ) rttvarn RTOn+1 = srttn+1 + 4 rttvarn+1 The gains are set to a =1/4 and b =1/8

Setting the RTO value (cont’d) Initial value for RTO: Sender should set the initial value of RTO to RTO0 = 3 seconds RTO calculation after first RTT measurements arrived srtt1 = RTT rttvar1 = RTT / 2 RTO1 = srtt1 + 4 rttvar1 When a timeout occurs, the RTO value is doubled RTOn+1 = max ( 2 RTOn, 64) seconds This is called an exponential backoff

Karn’s Algorithm Karn’s Algorithm: If an ACK for a retransmitted segment is received, the sender cannot tell if the ACK belongs to the original or the retransmission.  RTT measurements is ambiguous in this case Karn’s Algorithm: Don’t update RTT on any segments that have been retransmitted Restart RTT measurements only after an ACK is received for a segment that is not retransmitted

RTO Calculation: Example

Measuring TCP Retransmission Timers Transfer file from Argon to neon Unplug Ethernet of Argon cable in the middle of file transfer

Interpreting the Measurements The interval between retransmission attempts in seconds is: 1.03, 3, 6, 12, 24, 48, 64, 64, 64, 64, 64, 64, 64. Time between retrans-missions is doubled each time (Exponential Backoff Algorithm) Timer is not increased beyond 64 seconds TCP gives up after 13th attempt and 9 minutes.