Lecture 08: The Transport Layer (Part 2) The Transport Layer Protocol (TCP) Dr. Anis Koubaa

Similar documents
Transport Layer: outline

32 bits. source port # dest port # sequence number acknowledgement number not used. checksum. Options (variable length)

Transport Layer: Outline

CSE 4213: Computer Networks II

Suprakash Datta. Office: CSEB 3043 Phone: ext Course page:

10 minutes survey (anonymous)

CMPE 150/L : Introduction to Computer Networks. Chen Qian Computer Engineering UCSC Baskin Engineering Lecture 9

Chapter 3 outline. 3.5 connection-oriented transport: TCP segment structure reliable data transfer flow control connection management

Correcting mistakes. TCP: Overview RFCs: 793, 1122, 1323, 2018, TCP seq. # s and ACKs. GBN in action. TCP segment structure

Chapter 3 Transport Layer

Chapter 3 Transport Layer

Computer Networking Introduction

Lecture 8. TCP/IP Transport Layer (2)

CS 4390 Computer Networks. Pointers to Corresponding Section of Textbook

CSC 4900 Computer Networks: TCP

Chapter 3 Transport Layer

Chapter III: Transport Layer

Chapter 3 Transport Layer

CC451 Computer Networks

TCP (Part 2) Session 10 INST 346 Technologies, Infrastructure and Architecture

Chapter 3- parte B outline

CS Lecture 1 Review of Basic Protocols

CSC 401 Data and Computer Communications Networks

COMP 431 Internet Services & Protocols. Transport Layer Protocols & Services Outline. The Transport Layer Reliable data delivery & flow control in TCP

Chapter 3 outline. 3.5 Connection-oriented transport: TCP. 3.6 Principles of congestion control 3.7 TCP congestion control

TCP. TCP: Overview. TCP Segment Structure. Maximum Segment Size (MSS) Computer Networks 10/19/2009. CSC 257/457 - Fall

Chapter 3 Transport Layer

RSC Part III: Transport Layer 3. TCP

CS450 Introduc0on to Networking Lecture 14 TCP. Phu Phung Feb 13, 2015

Chapter 3 Transport Layer

CSCI Topics: Internet Programming Fall 2008

Outline. TCP: Overview RFCs: 793, 1122, 1323, 2018, Development of reliable protocol Sliding window protocols

The Transport Layer Reliable data delivery & flow control in TCP. Transport Layer Protocols & Services Outline

CSCE 463/612 Networks and Distributed Processing Spring 2017

TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581

Outline. TCP: Overview RFCs: 793, 1122, 1323, 2018, steam: r Development of reliable protocol r Sliding window protocols

The Transport Layer Reliable data delivery & flow control in TCP. Transport Layer Protocols & Services Outline

Chapter 3 Transport Layer

The Transport Layer: TCP & Reliable Data Transfer

CNT 6885 Network Review on Transport Layer

Chapter 3 outline. 3.5 Connection-oriented transport: TCP. 3.6 Principles of congestion control 3.7 TCP congestion control

TCP : Fundamentals of Computer Networks Bill Nace

CSCD 330 Network Programming

Lecture 5. Transport Layer. Transport Layer 1-1

Go-Back-N. Pipelining: increased utilization. Pipelined protocols. GBN: sender extended FSM

Fall 2012: FCM 708 Bridge Foundation I

Master Course Computer Networks IN2097

Chapter 6 Transport Layer

Foundations of Telematics

Transport layer. UDP: User Datagram Protocol [RFC 768] Review principles: Instantiation in the Internet UDP TCP

Transport layer. Review principles: Instantiation in the Internet UDP TCP. Reliable data transfer Flow control Congestion control

Transmission Control Protocol

Chapter 3 outline. TDTS06 Computer networks. Principles of Reliable data transfer. Reliable data transfer: getting started

Distributed Systems. 5. Transport Protocols

Distributed Systems. 5. Transport Protocols. Werner Nutt

Chapter 3 Transport Layer

By Ossi Mokryn, Based also on slides from: the Computer Networking: A Top Down Approach Featuring the Internet by Kurose and Ross

Chapter III: Transport Layer

Computer Communication Networks Midterm Review

Chapter 3 Transport Layer

TCP: Overview RFCs: 793,1122,1323, 2018, 2581

TCP. 1 Administrivia. Tom Kelliher, CS 325. Apr. 2, Announcements. Assignment. Read From Last Time

CSC 8560 Computer Networks: TCP

Chapter 3 Transport Layer

Lecture 12: Transport Layer TCP again

Chapter 3: Transport Layer. Chapter 3 Transport Layer. Chapter 3 outline. Transport services and protocols

Course on Computer Communication and Networks. Lecture 5 Chapter 3; Transport Layer, Part B

Master Course Computer Networks IN2097

Chapter 3 outline. Chapter 3: Transport Layer. Transport vs. network layer. Transport services and protocols. Internet transport-layer protocols

Chapter 3 Transport Layer

Computer Networking: A Top Down Approach

Routers. Session 12 INST 346 Technologies, Infrastructure and Architecture

Department of Computer and IT Engineering University of Kurdistan. Transport Layer. By: Dr. Alireza Abdollahpouri

Chapter 3: Transport Layer

Flow and Congestion Control (Hosts)

Transport Protocols and TCP

rdt3.0: channels with errors and loss

Chapter 3: Transport Layer. Chapter 3 Transport Layer. Transport layer. Position of transport layer. Transport layer.

Lecture 3 The Transport Control Protocol (TCP) Antonio Cianfrani DIET Department Networking Group netlab.uniroma1.it

Computer Communication Networks Midterm Review

TCP reliable data transfer. Chapter 3 outline. TCP sender events: TCP sender (simplified) TCP: retransmission scenarios. TCP: retransmission scenarios

Lecture 11. Transport Layer (cont d) Transport Layer 1

CS 43: Computer Networks. 18: Transmission Control Protocol October 12-29, 2018

Chapter 3 Transport Layer

Transmission Control Protocol (TCP)

Data Communications & Networks. Session 9 Main Theme Network Congestion Causes, Effects, Controls, and TCP Applications. Dr. Jean-Claude Franchitti

Chapter 3 Transport Layer

Chapter 3 Transport Layer. Chapter 3: Transport Layer. Chapter 3 outline. Our goals: understand principles behind transport layer services:

CSC358 Week 5. Adapted from slides by J.F. Kurose and K. W. Ross. All material copyright J.F Kurose and K.W. Ross, All Rights Reserved

Chapter 3 Transport Layer

Chapter 3: Transport Layer

Chapter 3: Transport Layer. Chapter 3 Transport Layer. Chapter 3 outline. Transport services and protocols

Computer Networks & Security 2016/2017

Chapter 3: Transport Layer. Chapter 3 Transport Layer. Chapter 3 outline. Transport services and protocols

Our goals: understand d principles. behind transport layer protocols in the. Internet: layer services:

Transport services and protocols. Chapter 3 Transport Layer. Chapter 3: Transport Layer. Transport vs. network layer

Chapter 3 Transport Layer

Internet and Intranet Protocols and Applications

LECTURE 3 - TRANSPORT LAYER

Chapter 3 Transport Layer. Chapter 3: Transport Layer. Chapter 3 outline

Transcription:

NET 331 Computer Networks Lecture 08: The Transport Layer (Part 2) The Transport Layer Protocol (TCP) Dr. Anis Koubaa Reformatted slides from textbook Computer Networking a top-down appraoch, Fifth Edition by Kurose and Ross, 1 (c) Pearson Education - Prentice Hall, 2011 18-Mar-12 Objectives understand principles behind transport layer services: multiplexing/demultiplexing reliable data transfer flow control congestion control learn about transport layer protocols in the Internet: UDP: connectionless transport TCP: connection-oriented transport TCP congestion control 2

Outline 3.1 Transport-layer services 3.2 Multiplexing and demultiplexing 3.3 Connectionless transport: UDP 3.4 Principles of reliable data transfer 3.5 Connection-oriented transport: TCP segment structure reliable data transfer flow control connection management 3.6 Principles of congestion control 3.7 TCP congestion control 3 TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581 full-duplex data bi-directional data flow in same connection MSS: Maximum Segment Size MTU: Maximum Transmission Unit connection-oriented handshaking(exchange of control msgs) initssender, receiver state before data exchange flow controlled sender will not overwhelm receiver socket door point-to-point one sender, one receiver reliable, in-order byte steam no message boundaries pipelined TCP congestion and flow control set window size send & receive buffers application writes data TCP send buffer segment application reads data TCP receive buffer socket door 4

TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581 5 TCP Segment Structure URG: urgent data (generally not used) ACK: ACK # valid PSH: push data now (generally not used) RST, SYN, FIN: connection estab (setup, teardown commands) counting by bytes of data (not segments!) # bytes rcvr willing to accept Internet checksum (as in UDP) 6

TCP Seq. # s and ACKs Seq. # s: byte stream number of first byte in segment s data ACKs: seq# of next byte expected from other side cumulative ACK Q: how receiver handles out-of-order segments A: TCP spec doesn t say, - up to implementor 7 TCP Round Trip Time and Timeout

TCP Round Trip Time and Timeout Q: how to set TCP timeout value? longer than RTT but RTT varies too short: premature timeout unnecessary retransmissions too long: slow reaction to segment loss Q: how to estimate RTT? SampleRTT: measured time from segment transmission until ACK receipt ignore retransmissions SampleRTTwill vary, want estimated RTT smoother average several recent measurements, not just current SampleRTT 9 TCP Round Trip Time and Timeout EstimatedRTT = (1- α)*estimatedrtt + α*samplertt Exponential weighted moving average influence of past sample decreases exponentially fast typical value: α =0.125 10

Example RTT estimation: RTT: gaia.cs.umass.edu to fantasia.eurecom.fr 350 300 nds) RTT (millisecon 250 200 150 100 1 8 15 22 29 36 43 50 57 64 71 78 85 92 99 106 time (seconnds) SampleRTT Estimated RTT 11 TCP Round Trip Time and Timeout Setting the timeout EstimatedRTT plus safety margin large variation in EstimatedRTT-> larger safety margin first estimate of how much SampleRTTdeviates from EstimatedRTT: DevRTT = (1-β)*DevRTT + β* SampleRTT-EstimatedRTT (typically, β = 0.25) Then set timeout interval: TimeoutInterval = EstimatedRTT + 4*DevRTT 12

Outline 3.1 Transport-layer services 3.2 Multiplexing and demultiplexing 3.3 Connectionless transport: UDP 3.4 Principles of reliable data transfer 3.5 Connection-oriented transport: TCP segment structure reliable data transfer flow control connection management 3.6 Principles of congestion control 3.7 TCP congestion control 13 TCP reliable data transfer TCP creates rdt service on top of IP s unreliable service pipelined segments cumulative acks TCP uses single retransmission timer retransmissions are triggered by: timeout events duplicate acks initially consider simplified TCP sender: ignore duplicate acks ignore flow control, congestion control 14

TCP sender events: data rcvd from app: Create segment with seq # seq #is byte-stream number of first data byte in segment start timer if not already running (think of timer as for oldest unacked segment) expiration interval: TimeOutInterval timeout: retransmit segment that caused timeout restart timer Ack rcvd: If acknowledges previously unacked segments update what is known to be acked start timer if there are outstanding segments 15 TCP Sender (simplified) Comment: SendBase-1: last cumulatively acked byte Example: SendBase-1 = 71; y= 73, so the rcvr wants 73+ ; y > SendBase, so that new data is acked 16

TCP: Retransmission Scenarios TCP: Retransmission Scenarios 18

TCP: Retransmission Scenarios Premature Timeout SendBase = 100 SendBase = 120 SendBase = 120 19 TCP retransmission scenarios (more) 20

TCP ACK generation [RFC 1122, RFC 2581] Event at Receiver Arrival of in-order segment with expected seq#. All data up to expected seq# already ACKed Arrival of in-order segment with expected seq#. One other segment has ACK pending Arrival of out-of-order segment higher-than-expect seq. #. Gap detected Arrival of segment that partially or completely fills gap TCP Receiver action Delayed ACK. Wait up to 500ms for next segment. If no next segment, send ACK Immediately send single cumulative ACK, ACKingboth in-order segments Immediately send duplicate ACK, indicating seq. # of next expected byte Immediate send ACK, provided that segment starts at lower end of gap 21 Fast Retransmit

Fast Retransmit time-out period often relatively long: long delay before resending lost packet detect lost segments via duplicate ACKs. sender often sends many segments back-to-back if segment is lost, there will likely be many duplicate ACKs. if sender receives 3 ACKs for the same data, it supposes that segment after ACKed data was lost: fast retransmit: resend segment before timer expires 23 Fast Retransmit 24

Fast Retransmit Algorithm: 25 Outline 3.1 Transport-layer services 3.2 Multiplexing and demultiplexing 3.3 Connectionless transport: UDP 3.4 Principles of reliable data transfer 3.5 Connection-oriented transport: TCP segment structure reliable data transfer flow control connection management 3.6 Principles of congestion control 3.7 TCP congestion control 26

TCP Flow Control receive side of TCP connection has a receive buffer: app process may be slow at reading from buffer speed-matching service: matching the send rate to the receiving app s drain rate flow control sender won t overflow receiver s buffer by transmitting too much, too fast 27 TCP Flow Control: how it works Receiver advertises spare room by including value of RcvWindowin segments sender limits unackeddata to RcvWindow guarantees receive buffer doesn t overflow (suppose TCP receiver discards out-oforder segments) spare room in buffer = RcvWindow = RcvBuffer- [LastByteRcvd LastByteRead] 28

Outline 3.1 Transport-layer services 3.2 Multiplexing and demultiplexing 3.3 Connectionless transport: UDP 3.4 Principles of reliable data transfer 3.5 Connection-oriented transport: TCP segment structure reliable data transfer flow control connection management 3.6 Principles of congestion control 3.7 TCP congestion control 29 TCP Connection Management Recall: TCP sender, receiver establish connection before exchanging data segments initialize TCP variables: seq. #s buffers, flow control info (e.g. RcvWindow) client: connection initiator Socket clientsocket = new Socket("hostname","port number"); server: contacted by client Socket connectionsocket = welcomesocket.accept(); Three way handshake: Step 1: client host sends TCP SYN segment to server specifies initial seq # no data Step 2: server host receives SYN, replies with SYNACK segment server allocates buffers specifies server initial seq. # Step 3: client receives SYNACK, replies with ACK segment, which may contain data 30

TCP Connection Management (cont.) Closing a connection: client closes socket: clientsocket.close(); Step 1:client end system sends TCP FIN control segment to server Step 2: server receives FIN, replies with ACK. Closes connection, sends FIN. 31 TCP Connection Management (cont.) Step 3: client receives FIN, replies with ACK. Enters timed wait - will respond with ACK to received FINs Step 4: server, receives ACK. Connection closed. Note: with small modification, can handle simultaneous FINs. 32

TCP Connection Management (cont) 33 TCP Connection Management (cont) 34