Network Protocols. Transmission Control Protocol (TCP) TDC375 Autumn 2009/10 John Kristoff DePaul University 1

Similar documents
Computer Networks and Data Systems

Applied Networks & Security

Chapter 24. Transport-Layer Protocols

05 Transmission Control Protocol (TCP)

8. TCP Congestion Control

UNIT IV -- TRANSPORT LAYER

TSIN02 - Internetworking

TSIN02 - Internetworking

Transport Layer Marcos Vieira

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

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

TSIN02 - Internetworking

TSIN02 - Internetworking

COMP/ELEC 429/556 Introduction to Computer Networks

TCP and Congestion Control (Day 1) Yoshifumi Nishida Sony Computer Science Labs, Inc. Today's Lecture

User Datagram Protocol

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

Intro to LAN/WAN. Transport Layer

TCP: Flow and Error Control

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

Fast Retransmit. Problem: coarsegrain. timeouts lead to idle periods Fast retransmit: use duplicate ACKs to trigger retransmission

User Datagram Protocol (UDP):

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

Lecture 3: The Transport Layer: UDP and TCP

Transmission Control Protocol. ITS 413 Internet Technologies and Applications

Reliable Transport I: Concepts and TCP Protocol

Topics. TCP sliding window protocol TCP PUSH flag TCP slow start Bulk data throughput

Outline. CS5984 Mobile Computing

Transport Over IP. CSCI 690 Michael Hutt New York Institute of Technology

Sequence Number. Acknowledgment Number. Data

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

CS 5520/ECE 5590NA: Network Architecture I Spring Lecture 13: UDP and TCP

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

Transport Layer Protocols TCP

Connection-oriented (virtual circuit) Reliable Transfer Buffered Transfer Unstructured Stream Full Duplex Point-to-point Connection End-to-end service

23-3 TCP. Topics discussed in this section: TCP Services TCP Features Segment A TCP Connection Flow Control Error Control 23.22

7. TCP 최양희서울대학교컴퓨터공학부

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

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

Kent State University

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

Computer Networking Introduction

Islamic University of Gaza Faculty of Engineering Department of Computer Engineering ECOM 4021: Networks Discussion. Chapter 5 - Part 2

CSC 634: Networks Programming

TCP Adaptive Retransmission Algorithm - Original TCP. TCP Adaptive Retransmission Algorithm Jacobson

Transport Protocols & TCP TCP

Transport Protocols and TCP: Review

Mobile Transport Layer Lesson 10 Timeout Freezing, Selective Retransmission, Transaction Oriented TCP and Explicit Notification Methods

Lecture 5: Flow Control. CSE 123: Computer Networks Alex C. Snoeren

CS419: Computer Networks. Lecture 10, Part 3: Apr 13, 2005 Transport: TCP performance

Bandwidth Allocation & TCP

ECE 650 Systems Programming & Engineering. Spring 2018

MIDTERM EXAMINATION #2 OPERATING SYSTEM CONCEPTS U N I V E R S I T Y O F W I N D S O R S C H O O L O F C O M P U T E R S C I E N C E

Fall 2012: FCM 708 Bridge Foundation I

CSCI-GA Operating Systems. Networking. Hubertus Franke

Transport Layer (TCP/UDP)

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

TCP Strategies. Keepalive Timer. implementations do not have it as it is occasionally regarded as controversial. between source and destination

Transport Layer: Outline

Internet and Intranet Protocols and Applications

What is TCP? Transport Layer Protocol

TCP/IP Performance ITL

TCP. CSU CS557, Spring 2018 Instructor: Lorenzo De Carli (Slides by Christos Papadopoulos, remixed by Lorenzo De Carli)

EECS 122, Lecture 19. Reliable Delivery. An Example. Improving over Stop & Wait. Picture of Go-back-n/Sliding Window. Send Window Maintenance

Communication Networks

ECE697AA Lecture 3. Today s lecture

CS519: Computer Networks. Lecture 5, Part 1: Mar 3, 2004 Transport: UDP/TCP demux and flow control / sequencing

CS 716: Introduction to communication networks th class; 7 th Oct Instructor: Sridhar Iyer IIT Bombay

Networked Systems and Services, Fall 2018 Chapter 3

Networked Systems and Services, Fall 2017 Reliability with TCP

Outline. Connecting to the access network: DHCP and mobile IP, LTE. Transport layer: UDP and TCP

Transport Layer: outline

TCP Congestion Control

TCP Congestion Control

CS321: Computer Networks Congestion Control in TCP

Introduction to Protocols

Outline. User Datagram Protocol (UDP) Transmission Control Protocol (TCP) Transport layer (cont.) Transport layer. Background UDP.

ETSF05/ETSF10 Internet Protocols Transport Layer Protocols

CS519: Computer Networks. Lecture 5, Part 4: Mar 29, 2004 Transport: TCP congestion control

TCP/IP. Chapter 5: Transport Layer TCP/IP Protocols

CSE 461. TCP and network congestion

Chapter 23 Process-to-Process Delivery: UDP, TCP, and SCTP 23.1

CS4700/CS5700 Fundamentals of Computer Networks

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

ECE 435 Network Engineering Lecture 10

Transport Protocols and TCP

End-to-End Protocols. End-to-End Protocols

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

Congestion / Flow Control in TCP

Introduction to Networks and the Internet

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

Recap. TCP connection setup/teardown Sliding window, flow control Retransmission timeouts Fairness, max-min fairness AIMD achieves max-min fairness

UNIT IV TRANSPORT LAYER

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

CS457 Transport Protocols. CS 457 Fall 2014

image 3.8 KB Figure 1.6: Example Web Page

Internet Protocols Fall Outline

C H A P T E R 15 TRA N SM I SSI O N C O N T RO L P RO T O C O L (T C P ) SUM M A RY

TCP Basics : Computer Networking. Overview. What s Different From Link Layers? Introduction to TCP. TCP reliability Assigned reading

Transcription:

Network Protocols Transmission Control Protocol (TCP) TDC375 Autumn 2009/10 John Kristoff DePaul University 1

IP review IP provides just enough connected ness Global addressing Hop by hop routing IP over everything Ethernet, ATM, X.25, fiber, etc. Minimizes network state Unreliable datagram forwarding TDC375 Autumn 2009/10 John Kristoff DePaul University 2

TCP key features Sequencing Byte stream delivery Connection oriented Reliability Flow control Congestion avoidance TDC375 Autumn 2009/10 John Kristoff DePaul University 3

TCP feature summary Provides a completely reliable (no data duplication or loss), connection oriented, full duplex byte stream transport service that allows two application programs to form a connection, send data in either direction simultaneously and then terminate the connection. TDC375 Autumn 2009/10 John Kristoff DePaul University 4

Apparent contradiction IP offers best effort (unreliable) delivery TCP uses IP TCP provides completely reliable transfer How is this possible? TDC375 Autumn 2009/10 John Kristoff DePaul University 5

Achieving reliability Reliable connection start up Reliable data transfer Sender starts a timer Receiver sends ACK when data arrives Sender retransmits if timer expires before ACK is returned Reliable connection shutdown TDC375 Autumn 2009/10 John Kristoff DePaul University 6

Reliability illustrated *diagram courtesy of http://www.netbook.cs.purdue.edu TDC375 Autumn 2009/10 John Kristoff DePaul University 7

When do you retransmit? The time for an ACK to return depends on: Distance between endpoints (propagation delay) Network traffic conditions (congestion) End system conditions (CPU, buffers) Packets can be lost, damaged or fragmented Network traffic conditions can change rapidly TDC375 Autumn 2009/10 John Kristoff DePaul University 8

Solving retransmission problem Keep running average of round trip time (RTT) Current average determines retransmission timer This is known as adaptive retransmission This is key to TCP's success How does each RTT sample affect the average? What weight to you give each sample? Higher weight means timer changes quickly Lower weight means timer changes slowly TDC375 Autumn 2009/10 John Kristoff DePaul University 9

Adaptive retransmission illustrated *diagram courtesy of http://www.netbook.cs.purdue.edu TDC375 Autumn 2009/10 John Kristoff DePaul University 10

Flow control Match the sending rate with allowable receiver rate TCP uses a sliding window Receiver advertises available buffer space Also known as the window Sender can transmit a full window without receiving an ACK for that transmitted data Ideally the window size allows pipe to remain full TDC375 Autumn 2009/10 John Kristoff DePaul University 11

Window size advertisement Each ACK carries receiver's current window size Called the window advertisement If zero, window is closed, no data can be sent Interpretation of window advertisement: Receiver: I can accept X octets or less unless I tell you otherwise TDC375 Autumn 2009/10 John Kristoff DePaul University 12

Window size illustrated *diagram courtesy of http://www.netbook.cs.purdue.edu TDC375 Autumn 2009/10 John Kristoff DePaul University 13

Window size: another picture TDC375 Autumn 2009/10 John Kristoff DePaul University 14

Byte stream sequencing Each segment carries a sequence number Sequencing helps ensure in order delivery TCP sequence numbers are fixed at 32 bits Byte stream is not limited to 2 32 bytes Sequence number space can wrap Each side has an initial sequence number (ISN) Exchanged during connection establishment Receiver ACKs cumulative octets (bytes) TDC375 Autumn 2009/10 John Kristoff DePaul University 15

TCP segment illustrated TDC375 Autumn 2009/10 John Kristoff DePaul University 16

Application multiplexing OS independent identifier for a network app Each app assigned a locally unique 16 bit id src or dst port number, see /etc/services Server (listener) apps Tend to use standard, well known ports Client (opener) tends to ephemeral (dynamic) port Usually >1023, but depends on OS and app See http://www.iana.org/assignments/port numbers TDC375 Autumn 2009/10 John Kristoff DePaul University 17

TCP connection start up A three way handshake is used Servers use a passive open Application sits waiting on an open port Clients use an active open Application requests a connection to server Initial sequence number (ISN) exchange is the primary goal Other parameters/options can also be exchanged e.g. Window scale, maximum segment size, etc. TDC375 Autumn 2009/10 John Kristoff DePaul University 18

3 way handshake illustrated TDC375 Autumn 2009/10 John Kristoff DePaul University 19

Connection shutdown illustrated TDC375 Autumn 2009/10 John Kristoff DePaul University 20

Congestion principles Flow control Matching the sending and receiving rates Congestion control Active response to network overload conditions End hosts cannot control congestion per se Network devices (routers) do this Congestion avoidance Cautionary response to presumed conditions TCP does this TDC375 Autumn 2009/10 John Kristoff DePaul University 21

TCP congestion control Recall sliding window (advertised window) Receiver based control of sending rate Congestion window is sender based control Sender transmits min(cwnd, advertised window) This value is the transmission window TCP sender infers network conditions and adjusts TDC375 Autumn 2009/10 John Kristoff DePaul University 22

TCP retransmission TCP starts timer after sending a segment If ACK returns, reset timer If time out occurs, retransmit and increase timer This is a back off process Can't retransmit forever, need some upper bound Eventually TCP would give up Maximum time out must be at least 60 seconds TDC375 Autumn 2009/10 John Kristoff DePaul University 23

Estimating round trip time (RTT) TCP measures RTT for which to calculate timers If ACKs return quickly, timers should be short If loss occurs, recovery happens quickly If ACKs return slowly, timers should be long If delays occur, retransmits not sent needlessly Keep a smoothed running average of RTT Smoothed RTT used to adjust retransmit timer Karn's algorith says ignore ACKs of retransmits TDC375 Autumn 2009/10 John Kristoff DePaul University 24

TCP slow start Recall that min(cwnd,awnd) = transmission window Rather than sending a full window at start up... Initialize cwnd to 1 maximum segment size (MSS) Increase cwnd by 1 MSS for every ACK returned Obviously don't go past advertised window! This can actually be quite fast, exponential! TDC375 Autumn 2009/10 John Kristoff DePaul University 25

TCP slow start illustrated TDC375 Autumn 2009/10 John Kristoff DePaul University 26

TCP congestion avoidance If a retransmission timer expires, slow down Set slow start threshold = transmission window x ½ This is sshthresh Set cwnd back to 1 MSS Transmit min(cwnd, advertised window) as usual Do slow start until transmission window = sshtresh Thereafter, increase cwnd by 1/cwnd per ACK Linear increase instead of exponential TDC375 Autumn 2009/10 John Kristoff DePaul University 27

Congestion avoidance illustrated TDC375 Autumn 2009/10 John Kristoff DePaul University 28

Duplicate ACKs Recall ACKs acknowledge cumulative octets TCP receiver sends an immediate ACK if it receives an out of order segment This is a duplicate ACK This dupe ACK informs the sender and tells it what sequence number the receiver expected Its unclear whether dupe ACKs indicate loss or simply packet re ordering on the network But, multiple duplicate ACKs probably indicate loss TDC375 Autumn 2009/10 John Kristoff DePaul University 29

TCP fast retransmit If sender gets >=3 dupe ACKs, assume loss Immediately retransmit, don't wait for timer to expire Goto fast recovery TDC375 Autumn 2009/10 John Kristoff DePaul University 30

TCP fast recovery Duplicate ACKs indicate data is still flowing If there was a loss event, it was probably temporary Go directly to congestion avoidance Not all the way into slow start! Don't want to start off with just a 1 MSS window This is the fast recovery algorithm Minus a few minor details TDC375 Autumn 2009/10 John Kristoff DePaul University 31

Other TCP stuff Selective ACK (SACK) option Window scale option Timestamp option Persist timer (window probes) Silly window syndrome Keepalive timer Nagle algorithm TDC375 Autumn 2009/10 John Kristoff DePaul University 32