Transport Protocols and TCP

Similar documents
Transport Protocols & TCP TCP

Transport Protocols and TCP: Review

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

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

Lecture 3: The Transport Layer: UDP and TCP

ETSF05/ETSF10 Internet Protocols Transport Layer Protocols

Lecture 8. TCP/IP Transport Layer (2)

Chapter 3- parte B outline

Fall 2012: FCM 708 Bridge Foundation I

Transport Layer: outline

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

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

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

Computer Networks. Wenzhong Li. Nanjing University

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

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

Transport Layer: Outline

Flow and Congestion Control (Hosts)

CSE 4213: Computer Networks II

CC451 Computer Networks

6.1 Internet Transport Layer Architecture 6.2 UDP (User Datagram Protocol) 6.3 TCP (Transmission Control Protocol) 6. Transport Layer 6-1

Computer Communication Networks Midterm Review

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

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

10 minutes survey (anonymous)

CS Lecture 1 Review of Basic Protocols

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

CSC 4900 Computer Networks: TCP

Chapter 3 Transport Layer

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 segment structure reliable data transfer flow control connection management

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

Lecture 20 Overview. Last Lecture. This Lecture. Next Lecture. Transport Control Protocol (1) Transport Control Protocol (2) Source: chapters 23, 24

Chapter 24. Transport-Layer Protocols

Transport Layer. Application / Transport Interface. Transport Layer Services. Transport Layer Connections

CSC 401 Data and Computer Communications Networks

Computer Networking Introduction

CNT 6885 Network Review on Transport Layer

Transport Protocols. Raj Jain. Washington University in St. Louis

CS457 Transport Protocols. CS 457 Fall 2014

Computer Networking Introduction

CSCI Topics: Internet Programming Fall 2008

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

Transport Protocols. ISO Defined Types of Network Service: rate and acceptable rate of signaled failures.

CSCD 330 Network Programming

CSCD 330 Network Programming Winter 2015

Chapter 3 Transport Layer

Chapter 3 Transport Layer

CS 4390 Computer Networks. Pointers to Corresponding Section of Textbook

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

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

CS 43: Computer Networks. 19: TCP Flow and Congestion Control October 31, Nov 2, 2018

Chapter 3 Transport Layer

UNIT IV -- TRANSPORT LAYER

Chapter III: Transport Layer

Foundations of Telematics

Transport Layer PREPARED BY AHMED ABDEL-RAOUF

Transmission Control Protocol. ITS 413 Internet Technologies and Applications

CMSC 417. Computer Networks Prof. Ashok K Agrawala Ashok Agrawala. October 25, 2018

CSCE 463/612 Networks and Distributed Processing Spring 2017

Transport Layer. -UDP (User Datagram Protocol) -TCP (Transport Control Protocol)

Flow and Congestion Control Marcos Vieira

Master Course Computer Networks IN2097

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

EE 122: Transport Protocols. Kevin Lai October 16, 2002

Chapter 3 Review Questions

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

Chapter III: Transport Layer

The aim of this unit is to review the main concepts related to TCP and UDP transport protocols, as well as application protocols. These concepts are

Lecture 5. Transport Layer. Transport Layer 1-1

Internet Transport Protocols UDP and TCP

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

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

Chapter 3: Transport Layer

Guide To TCP/IP, Second Edition UDP Header Source Port Number (16 bits) IP HEADER Protocol Field = 17 Destination Port Number (16 bit) 15 16

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

CSC 8560 Computer Networks: TCP

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

TSIN02 - Internetworking

05 Transmission Control Protocol (TCP)

Transmission Control Protocol (TCP) TCP Services EECS 3214

User Datagram Protocol (UDP):

TCP Congestion Control

Review Questions for Midterm Exam-2 Fall 2016

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

TCP/IP Networking. Part 4: Network and Transport Layer Protocols

9th Slide Set Computer Networks

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

Transport Layer. Gursharan Singh Tatla. Upendra Sharma. 1

image 3.8 KB Figure 1.6: Example Web Page

CS 356: Introduction to Computer Networks. Lecture 16: Transmission Control Protocol (TCP) Chap. 5.2, 6.3. Xiaowei Yang

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

Lecture 4: Congestion Control

Page 1. Review: Internet Protocol Stack. Transport Layer Services EEC173B/ECS152C. Review: TCP. Transport Layer: Connectionless Service

TCP congestion control:

Chapter 6. What happens at the Transport Layer? Services provided Transport protocols UDP TCP Flow control Congestion control

COMP/ELEC 429/556 Introduction to Computer Networks

TSIN02 - Internetworking

Page 1. Review: Internet Protocol Stack. Transport Layer Services. Design Issue EEC173B/ECS152C. Review: TCP

Transcription:

Transport Protocols and TCP Functions Connection establishment and termination Breaking message into packets Error recovery ARQ Flow control Multiplexing, de-multiplexing Transport service is end to end protocol between two systems on network 1

TP classes Class 0 Only fragmentation and de-fragmentation Class 1 Class 0+ Error recovery(arq) Class 2 Class 0 + Multiplexing but no error checking Class 3 Class 0, multiplexing, error recovery Class 4 Multiplexing, complete error control (recovery and checking) (I.e., TCP is based on) Addressing Target user specified by: User identification Usually (host, port) called a SOCKET in TCP Port represents a particular transport service (TS) user Transport entity identification Generally only one per host Host address An attached network device In an internet, a global internet address 2

Finding Addresses Three methods Know address ahead of time e.g. collection of network device stats Well known addresses(known port numbers) 80-http, 23-telnet, 22-ssh, 21-ftp, 25-smtp etc Name server, service discovery Multiplexing Multiple users employ same transport protocol User identified by port number or service access point (SAP) 3

Flow Control Longer transmission delay between transport entities compared with actual transmission time Delay in communication of flow control info Variable transmission delay Difficult to use timeouts Flow may be controlled because: The receiving user can not keep up The receiving transport entity can not keep up Network congested Results in buffer filling up Coping with Flow Control Requirements (1) Do nothing Segments that overflow are discarded Sending transport entity will fail to get ACK and will retransmit Thus further adding to incoming data Refuse further segments(not good) Use fixed sliding window protocol Works well on reliable network Failure to receive ACK is taken as flow control indication Does not work well on unreliable network Can not distinguish between lost segment and flow control Use credit scheme 4

Credit Scheme Greater control on reliable network More effective on unreliable network Decouples flow control from ACK ACK does not guarantee credit and vice versa Each octet has sequence number Each transport segment has seq number, ack number and window size in header Credit Allocation 5

Establishment and Termination Allow each end to now the other exists Negotiation of optional parameters Triggers allocation of transport entity resources By mutual agreement Connection Establishment 6

2-way handshake Problems Ordered Delivery Segments may arrive out of order, Number segments sequentially, TCP numbers each octet sequentially, Segments are numbered by the first octet number in the segment Retransmission strategy Segment damaged in transit, Segment fails to arrive, Transmitter does not know of failure, Receiver must acknowledge successful receipt, Use cumulative acknowledgement Time out waiting for ACK triggers re-transmission Duplication detection Connection establishment Connection termination Crash recovery 7

Incorrect Duplicate Detection Three Way Handshake: Examples Start segment numbers fare removed from previous connection Use SYN i Need ACK to include i Three Way Handshake 8

Connection Termination Entity in CLOSE WAIT state sends last data segment, followed by FIN FIN arrives before last data segment Receiver accepts FIN Closes connection Loses last data segment Associate sequence number with FIN Receiver waits for all segments before FIN sequence number Loss of segments and obsolete segments Must explicitly ACK FIN Graceful Close Send FIN i and receive AN i Receive FIN j and send AN j Wait twice maximum expected segment lifetime 9

Crash Recovery After restart all state info is lost Connection is half open Side that did not crash still thinks it is connected Close connection using persistence timer Wait for ACK for (time out) * (number of retries) When expired, close connection and inform user Send RST i in response to any i segment arriving User must decide whether to reconnect Problems with lost or duplicate data TCP & UDP Transmission Control Protocol Connection oriented RFC 793 User Datagram Protocol (UDP) Connectionless RFC 768 10

TCP Services Reliable communication between pairs of processes Across variety of reliable and unreliable networks and internets Two labeling facilities Data stream push TCP user can require transmission of all data up to push flag Receiver will deliver in same manner Avoids waiting for full buffers Urgent data signal Indicates urgent data is upcoming in stream User decides how to handle it TCP Header 11

Items Passed to IP TCP passes some parameters down to IP Precedence Normal delay/low delay Normal throughput/high throughput Normal reliability/high reliability Security TCP Mechanisms (1) Connection establishment Three way handshake Between pairs of ports One port can connect to multiple destinations Data transfer Logical stream of octets Octets numbered modulo 2 32 Flow control by credit allocation of number of octets Data buffered at transmitter and receiver 12

TCP Mechanisms (2) Connection termination Graceful close TCP users issues CLOSE primitive Transport entity sets FIN flag on last segment sent Abrupt termination by ABORT primitive Entity abandons all attempts to send or receive data RST segment transmitted Acknowledgement Immediate Cumulative 13

Congestion Control RFC 1122, Requirements for Internet hosts Retransmission timer management Estimate round trip delay by observing pattern of delay Set time to value somewhat greater than estimate Simple average Exponential average RTT Variance Estimation (Jacobson s algorithm) TCP Congestion Control end-end control (no network assistance) sender limits transmission: LastByteSent-LastByteAcked CongWin CongWin is dynamic, function of perceived network congestion How does sender perceive congestion? loss event = timeout or 3 duplicate acks TCP sender reduces rate (CongWin) after loss event three mechanisms: AIMD(additive increase, multiplicative decrease) slow start conservative after timeout events 14

TCP AIMD multiplicative decrease: cut CongWin in half after loss event 24 Kbytes congestion window additive increase: increase CongWin by 1 MSS every RTT in the absence of loss events: probing 16 Kbytes 8 Kbytes Long-lived TCP connection time TCP Slow Start When connection begins, CongWin = 1 MSS Example: MSS = 500 bytes & RTT = 200 msec initial rate = 20 kbps available bandwidth may be >> MSS/RTT desirable to quickly ramp up to respectable rate When connection begins, increase rate exponentially fast until first loss event 15

TCP Slow Start (more) When connection begins, increase rate exponentially until first loss event: double CongWin every RTT done by incrementing CongWin for every ACK received Summary: initial rate is slow but ramps up exponentially fast RTT Host A Host B one segment two segments four segments time Refinement (more) Q: When should the exponential increase switch to linear? A: When CongWin gets to 1/2 of its value before timeout. congestion window size (segments) 14 12 10 8 6 4 threshold Implementation: Variable Threshold At loss event, Threshold is set to 1/2 of CongWin just before loss event 2 0 TCP TCP Tahoe Reno 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Transmission round Series1 Series2 16

TCP Round Trip Time and Timeout EstimatedRTT_new = α*estimatedrtt_old + (1-α)*SampleRTT Exponential weighted moving average influence of past sample decreases exponentially fast typical value: α = 0.875 Example RTT estimation: RTT: gaia.cs.umass.edu to fantasia.eurecom.fr 350 300 RTT (milliseconds) 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 17

Use of Averaging TCP Round Trip Time and Timeout Setting the timeout EstimtedRTT plus safety margin large variation in EstimatedRTT -> larger safety margin first estimate of how much SampleRTT deviates from EstimatedRTT: DevRTT(k+1) = (1-β)*DevRTT(k) + β* SampleRTT-EstimatedRTT (typically, β = 0.25) Then set timeout interval: TimeoutInterval = EstimatedRTT + 4*DevRTT 18

Exponential RTO Backoff Since timeout is probably due to congestion (dropped packet or long round trip), maintaining RTO is not good idea RTO increased each time a segment is re-transmitted RTO = q*rto Commonly q=2 Binary exponential backoff Window Management Slow start awnd = MIN[credit, cwnd] Start connection with cwnd=1 Increment cwnd at each ACK, to some max Dynamic windows sizing on congestion When a timeout occurs Set slow start threshold to half current congestion window ssthresh=cwnd/2 Set cwnd = 1 and slow start until cwnd=ssthresh Increasing cwnd by 1 for every ACK For cwnd >=ssthresh, increase cwnd by 1 for each RTT 19

UDP User datagram protocol RFC 768 Connectionless service for application level procedures Unreliable Delivery and duplication control not guaranteed Reduced overhead e.g. network management (Chapter 19) UDP Uses Inward data collection Outward data dissemination Request-Response Real time application 20

UDP Header 21