Computer Networks and Data Systems

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

Applied Networks & Security

Chapter 24. Transport-Layer Protocols

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

05 Transmission Control Protocol (TCP)

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

TSIN02 - Internetworking

TSIN02 - Internetworking

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

TSIN02 - Internetworking

Intro to LAN/WAN. Transport Layer

UNIT IV -- TRANSPORT LAYER

TSIN02 - Internetworking

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

Transport Layer Marcos Vieira

Lecture 3: The Transport Layer: UDP and TCP

8. TCP Congestion Control

ECE 435 Network Engineering Lecture 10

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

Internet and Intranet Protocols and Applications

COMP/ELEC 429/556 Introduction to Computer Networks

TCP: Flow and Error Control

User Datagram Protocol

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

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

ECE 650 Systems Programming & Engineering. Spring 2018

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

User Datagram Protocol (UDP):

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

Transport Layer (TCP/UDP)

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

Reliable Transport I: Concepts and TCP Protocol

Computer Communication Networks Midterm Review

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

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

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

Transmission Control Protocol. ITS 413 Internet Technologies and Applications

UNIT IV TRANSPORT LAYER

QUIZ: Longest Matching Prefix

Computer Networks. Homework #4: No Grading

Outline. CS5984 Mobile Computing

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

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

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

Programming Assignment 3: Transmission Control Protocol

CMPE 150 Winter 2009

CSC 634: Networks Programming

Sequence Number. Acknowledgment Number. Data

CSCI-GA Operating Systems. Networking. Hubertus Franke

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

IS370 Data Communications and Computer Networks. Chapter 5 : Transport Layer

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

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

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

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

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

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

Transport Layer: Outline

What is TCP? Transport Layer Protocol

ETSF05/ETSF10 Internet Protocols Transport Layer Protocols

CS 640 Introduction to Computer Networks Spring 2009

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

Transport Layer: outline

Communication Networks

TCP/IP Protocol Suite 1

Introduction to Networks and the Internet

Computer Networking Introduction

Networked Systems and Services, Fall 2018 Chapter 3

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

Transport Layer Protocols. Internet Transport Layer. Agenda. TCP Fundamentals

Networked Systems and Services, Fall 2017 Reliability with TCP

TCP/IP Performance ITL

Networking Technologies and Applications

Da t e: August 2 0 th a t 9: :00 SOLUTIONS

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

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

Announcements. No book chapter for this topic! Slides are posted online as usual Homework: Will be posted online Due 12/6

Introduction to Protocols

Your Name: Your student ID number:

Transport Protocols & TCP TCP

Transport Protocols and TCP: Review

CS4700/CS5700 Fundamentals of Computer Networks

Last Class. CSE 123b Communications Software. Today. Naming Processes/Services. Transmission Control Protocol (TCP) Picking Port Numbers.

CSCI Topics: Internet Programming Fall 2008

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

ECE697AA Lecture 3. Today s lecture

CSC 4900 Computer Networks: TCP

Bandwidth Allocation & TCP

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

Introduction to TCP/IP networking

Some slides courtesy David Wetherall. Communications Software. Lecture 4: Connections and Flow Control. CSE 123b. Spring 2003.

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

Announcements Computer Networking. Outline. Transport Protocols. Transport introduction. Error recovery & flow control. Mid-semester grades

Kent State University

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

UDP, TCP, IP multicast

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

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

Transcription:

Computer Networks and Data Systems Transport Layer TDC463 Winter 2011/12 John Kristoff - DePaul University 1

Why a transport layer? IP gives us end-to-end connectivity doesn't it? Why, or why not, more than one transport layer? What does a transport layer typically do? Process identification Reliability Flow control Are there times when those are unnecessary? What are the security / performance issues? TDC463 Winter 2011/12 John Kristoff - DePaul University 2

If no L4, HTTP data goes where? TDC463 Winter 2011/12 John Kristoff - DePaul University 3

Application multiplexing OS independent identifier for a network process Each process assigned a locally unique 16-bit id Server (listener) apps tend to use standard, well-known port numbers see /etc/services (UNIX / MacOS X) Client (opener) apps tend to use ephemeral (dynamic) port numbers usually >1023, range depends on OS and app See http://www.iana.org/assignments/port-numbers TDC463 Winter 2011/12 John Kristoff - DePaul University 4

User Datagram Protocol (UDP) TDC463 Winter 2011/12 John Kristoff - DePaul University 5

UDP is very simple Basically just an application multiplexer The length field is practically redundant IP total length 8 = UDP payload Source port may be zero if no reply expected Even the checksum is optional! though it is inexpensive, recommended to use it No flow control, reliability, nor connection setup Why is this good, how could this be bad? TDC463 Winter 2011/12 John Kristoff - DePaul University 6

What uses UDP? SNMP, TFTP, DHCP, syslog, NetFlow Streaming real-time media (VoIP, radio, video) some use TCP (thank you security dilettantes) DNS, NTP if not for these, UDP death by filtering likely TDC463 Winter 2011/12 John Kristoff - DePaul University 7

Common IP transport protocols UDP very common, but usually low rate of pkts TCP most common, typically most of your pkts Some usage, but not widely deployed: UDP-Lite SCTP DCCP Note, not all IP protocols considered a transport e.g. we don't think of ICMP/IGMP as a transport TDC463 Winter 2011/12 John Kristoff - DePaul University 8

IP review IP provides just enough connected-ness global addressing hop-by-hop routing IP over everything Ethernet, ATM, X.25, fiber, etc. Minimizes in-network functionality Unreliable datagram forwarding TDC463 Winter 2011/12 John Kristoff - DePaul University 9

TCP key features Sequencing Byte-stream delivery Connection-oriented Reliability Flow-control Congestion avoidance TDC463 Winter 2011/12 John Kristoff - DePaul University 10

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. TDC463 Winter 2011/12 John Kristoff - DePaul University 11

Apparent contradiction IP offers best effort (unreliable) delivery TCP uses IP TCP provides completely reliable transfer How is this possible? TDC463 Winter 2011/12 John Kristoff - DePaul University 12

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 TDC463 Winter 2011/12 John Kristoff - DePaul University 13

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. TDC463 Winter 2011/12 John Kristoff - DePaul University 14

3-way handshake illustrated TDC463 Winter 2011/12 John Kristoff - DePaul University 15

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) TDC463 Winter 2011/12 John Kristoff - DePaul University 16

Reliability illustrated *diagram courtesy of http://www.netbook.cs.purdue.edu TDC463 Winter 2011/12 John Kristoff - DePaul University 17

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 TDC463 Winter 2011/12 John Kristoff - DePaul University 18

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 TDC463 Winter 2011/12 John Kristoff - DePaul University 19

Adaptive retransmission illustrated *diagram courtesy of http://www.netbook.cs.purdue.edu TDC463 Winter 2011/12 John Kristoff - DePaul University 20

Connection shutdown illustrated TDC463 Winter 2011/12 John Kristoff - DePaul University 21

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 TDC463 Winter 2011/12 John Kristoff - DePaul University 22

Window size advertisement Each ACK carries receiver's current window size called the window advertisement (aka rwnd) 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 TDC463 Winter 2011/12 John Kristoff - DePaul University 23

Window size illustrated *diagram courtesy of http://www.netbook.cs.purdue.edu TDC463 Winter 2011/12 John Kristoff - DePaul University 24

Window size: another picture TDC463 Winter 2011/12 John Kristoff - DePaul University 25

TCP segment illustrated TDC463 Winter 2011/12 John Kristoff - DePaul University 26

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 TDC463 Winter 2011/12 John Kristoff - DePaul University 27

TCP congestion control Recall sliding window (advertised window) receiver based control of sending rate Congestion window is sender based control Sender transmits min(cwnd, rwnd) this value is the transmission window TCP sender infers network conditions and adjusts See IETF RFC 5681 TDC463 Winter 2011/12 John Kristoff - DePaul University 28

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 TDC463 Winter 2011/12 John Kristoff - DePaul University 29

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 TDC463 Winter 2011/12 John Kristoff - DePaul University 30

TCP slow start Recall that min(cwnd,rwnd) = 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! TDC463 Winter 2011/12 John Kristoff - DePaul University 31

TCP slow start illustrated TDC463 Winter 2011/12 John Kristoff - DePaul University 32

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, rwnd) as usual Do slow start until transmission window = sshtresh Thereafter, increase cwnd by 1/cwnd per ACK linear increase instead of exponential TDC463 Winter 2011/12 John Kristoff - DePaul University 33

Congestion avoidance illustrated TDC463 Winter 2011/12 John Kristoff - DePaul University 34

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 TDC463 Winter 2011/12 John Kristoff - DePaul University 35

TCP fast retransmit If sender gets >=3 dupe ACKs, assume loss Immediately retransmit, don't wait for timer to expire Goto fast recovery TDC463 Winter 2011/12 John Kristoff - DePaul University 36

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 TDC463 Winter 2011/12 John Kristoff - DePaul University 37

Other TCP stuff Selective ACK (SACK) option (re-tx optimization) Window scale option (for high capacity paths) Timestamp option (RTT measurement, PAWS) Persist timer (window probes) Keepalive timer (disabled by default, app can set) Nagle algorithm (sender side) Silly window syndrome (receiver side) TDC463 Winter 2011/12 John Kristoff - DePaul University 38