Transport Layer Marcos Vieira

Similar documents
Introduc)on to Computer Networks

CSCI-1680 Transport Layer I Rodrigo Fonseca

CSCI-1680 Transport Layer I Rodrigo Fonseca

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

User Datagram Protocol

CSEP 561 Connections. David Wetherall

CSEP 561 Connections. David Wetherall

Reliable Byte-Stream (TCP)

Reliable Transport I: Concepts and TCP Protocol

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

COMP/ELEC 429/556 Introduction to Computer Networks

Transport Layer. Gursharan Singh Tatla. Upendra Sharma. 1

Applied Networks & Security

Transport: How Applications Communicate

Transmission Control Protocol (TCP)

ECE 650 Systems Programming & Engineering. Spring 2018

CS4700/CS5700 Fundamentals of Computer Networks

Mobile Transport Layer Lesson 02 TCP Data Stream and Data Delivery

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

CSCD 330 Network Programming

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

Introduction to Networking. Operating Systems In Depth XXVII 1 Copyright 2017 Thomas W. Doeppner. All rights reserved.

Flow Control, and Congestion Control

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

TCP : Fundamentals of Computer Networks Bill Nace

Networking Technologies and Applications

CS419: Computer Networks. Lecture 10, Part 2: Apr 11, 2005 Transport: TCP mechanics (RFCs: 793, 1122, 1323, 2018, 2581)

The Transport Layer Reliability

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

Connections. Topics. Focus. Presentation Session. Application. Data Link. Transport. Physical. Network

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

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

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

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

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

10 minutes survey (anonymous)

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

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

CSE 461 The Transport Layer

CS 640 Introduction to Computer Networks. Role of data link layer. Today s lecture. Lecture16

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

CSCI-1680 Link Layer I Rodrigo Fonseca

Chapter 3 Transport Layer

Lecture 3: The Transport Layer: UDP and TCP

UNIT IV -- TRANSPORT LAYER

Transport Layer. <protocol, local-addr,local-port,foreign-addr,foreign-port> ϒ Client uses ephemeral ports /10 Joseph Cordina 2005

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

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

Computer Networks and Data Systems

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

CSC 4900 Computer Networks: TCP

Computer Networking Introduction

Reliable Transport I: Concepts and TCP Protocol

Introduc)on to Computer Networks

TCP. Sliding Windows, Flow Control, and Congestion Control. Networks : TCP Sliding Windows 1

ECE697AA Lecture 3. Today s lecture

UDP and TCP. Introduction. So far we have studied some data link layer protocols such as PPP which are responsible for getting data

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

Introduction to TCP/IP networking

QUIZ: Longest Matching Prefix

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

Chapter III: Transport Layer

User Datagram Protocol (UDP):

Kent State University

05 Transmission Control Protocol (TCP)

Application Service Models

CSCI-1680 Link Layer Reliability John Jannotti

Transport Layer: outline

TSIN02 - Internetworking

Chapter 3 Transport Layer

CSCI-1680 Link Layer Reliability Rodrigo Fonseca

TCP Overview. Connection-oriented Byte-stream

Flow Control, and Congestion Control

CS 455: INTRODUCTION TO DISTRIBUTED SYSTEMS [NETWORKING] Frequently asked questions from the previous class surveys

The Transport Layer: TCP & Reliable Data Transfer

TCP: Transmission Control Protocol RFC 793,1122,1223. Prof. Lin Weiguo Copyleft 2009~2017, School of Computing, CUC

Chapter 5 End-to-End Protocols

COMPUTER NETWORKS CS CS 55201

TSIN02 - Internetworking

COMPUTER NETWORKS CS CS 55201

Introduction to Networks and the Internet

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

UNIT V. Computer Networks [10MCA32] 1

TCP Service Model. Today s Lecture. TCP Support for Reliable Delivery. EE 122:TCP, Connection Setup, Reliability

CS 4390 Computer Networks. Pointers to Corresponding Section of Textbook

Transport Layer (TCP/UDP)

Transmission Control Protocol. ITS 413 Internet Technologies and Applications

EE 122: Transport Protocols: UDP and TCP

TSIN02 - Internetworking

Fundamentals of Computer Networks ECE 478/578. Transport Layer. End- to- End Protocols 4/16/13. Spring Application. Application.

CSE 461 Connections. David Wetherall

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

NT1210 Introduction to Networking. Unit 10

Stream Control Transmission Protocol

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

EEC-682/782 Computer Networks I

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

ECE 435 Network Engineering Lecture 15

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

Transcription:

Transport Layer 2014 Marcos Vieira

Transport Layer Transport protocols sit on top of network layer and provide Application-level multiplexing ( ports ) Error detection, reliability, etc.

UDP User Datagram Protocol Unreliable, unordered datagram service Adds multiplexing, checksum End points identified by ports Scope is an IP address (interface) Checksum aids in error detection http://en.wikipedia.org/wiki/user_datagram_protocol

UDP Header

Reliable Delivery Error detection can discard bad packets Problem: if bad packets are lost, how can we ensure reliable delivery? Exactly-once semantics = at least once + at most once

At Least Once Semantics How can the sender know packet arrived at least once? Acknowledgments + Timeout Stop and Wait Protocol S: Send packet, wait R: Receive packet, send ACK S: Receive ACK, send next packet S: No ACK, timeout and retransmit

Stop and Wait Problems Duplicate data Duplicate acks Can t fill pipe Difficult to set the timeout value

At Most Once Semantics How to avoid duplicates? Uniquely identify each packet Have receiver and sender remember Stop and Wait: add 1 bit to the header Why is it enough?

Sliding Window Protocol Still have the problem of keeping pipe full Generalize approach with > 1-bit counter Allow multiple outstanding (unacked) frames Upper bound on unacked frames, called window

Sliding Window Sender Assign sequence number (SeqNum) to each frame Maintain three state variables send window size (SWS) last acknowledgment received (LAR) last frame send (LFS) Maintain invariant: LFS LAR SWS Advance LAR when ACK arrives Buffer up to SWS frames

Sliding Window Receiver Maintain three state variables: receive window size (RWS) largest acceptable frame (LAF) last frame received (LFR) Maintain invariant: LAF LFR RWS Frame SeqNum arrives: if LFR < SeqNum LAF, accept if SeqNum LFR or SeqNum > LAF, discard Send cumulative ACKs

Next Problem: Reliability Problem Dropped Packets Duplicate Packets Packets out of order Keeping the pipe full Mechanism Acknowledgments + Timeout Sequence Numbers Receiver Window Sliding Window (Pipelining)

Transport Layer Reliability Extra difficulties Multiple hosts Multiple hops Multiple potential paths Need for connection establishment, tear down Analogy: dialing a number versus a direct line Varying RTTs Both across connections and during a connection Why do they vary? What do they influence?

Extra Difficulties (cont.) Out of order packets Not only because of drops/retransmissions Can get very old packets (up to 120s), must not get confused Unknown resources at other end Must be able to discover receiver buffer: flow control Unknown resources in the network Should not overload the network But should use as much as safely possible Congestion Control

TCP Transmission Control Protocol Service model: reliable, connection oriented, full duplex byte stream Endpoints: <IP Address, Port> Flow control If one end stops reading, writes at other eventually stop/fail Congestion control Keeps sender from overloading the network

TCP Specification RFC 793 (1981), RFC 1222 (1989, some corrections), RFC 5681 (2009, congestion control), Was born coupled with IP, later factored out We talked about this, don t always need everything! End-to-end protocol Minimal assumptions on the network All mechanisms run on the end points Alternative idea: Provide reliability, flow control, etc, link-by-link Does it work?

TCP Header 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Source Port Destination Port +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Sequence Number +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Acknowledgment Number +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Data U A P R S F Offset Reserved R C S S Y I Window G K H T N N +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Checksum Urgent Pointer +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Options Padding +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ data

Header Fields Ports: multiplexing Sequence number Correspond to bytes, not packets! Acknowledgment Number Next expected sequence number Window: willing to receive Lets receiver limit SWS (even to 0) for flow control Data Offset: # of 4 byte header + option bytes Flags, Checksum, Urgent Pointer

Establishing a Connection Connect Listen, Accept Accept returns Three-way handshake Two sides agree on respective initial sequence nums If no one is listening on port: server sends RST If server is overloaded: ignore SYN If no SYN-ACK: retry, timeout

2MSL Connection Termination FIN bit says no more data to send Caused by close or shutdown Both sides must send FIN to close a connection Typical close Close FIN_WAIT_1 CLOSE_WAIT FIN_WAIT_2 TIME_WAIT Close LAST_ACK CLOSED CLOSED

Connection Termination Two Army problem

Connection Establishment Summary of TCP States Unsynchronized Synchronized Active close: Can still receive Passive close: Can still send!

TIME_WAIT Why do you have to wait for 2MSL in TIME_WAIT? What if last ack is severely delayed, AND Same port pair is immediately reused for a new connection? Solution: active closer goes into TIME_WAIT Waits for 2MSL (Maximum Segment Lifetime)

Reliable Delivery TCP retransmits if data corrupted or dropped Also retransmit if ACK lost When should TCP retransmit? Challenges in estimating RTT Dynamic No additional traffic

Smoothing RTT RTT measurement can have large variation Need to smooth the samples One RTT measurement = one sample Some ways to smooth the sample Average of the whole sequence Windowed Mean Problems?

EWMA EWMA: Exponentially Weighted Moving Average Give greater weight to recent samples Why? http://en.wikipedia.org/wiki/moving_average

EWMA Estimate RTT RTT(t) = α RTT(t-1) + (1-α) newest α = 0.8 Time RTT newest 0-10 1 8.0 12 2 6.4+2.4=8.6 10 3 6.9+2=8.9

EWMA Estimate RTT RTT(t) = α RTT(t-1) + (1-α) newest α = 0.8 Time RTT newest 0-10 1 8.0 12 2 6.4+2.4=8.6 10 3 6.9+2=8.9

First Goal We should not send more data than the receiver can take: flow control Data is sent in MSS-sized segments Chosen to avoid fragmentation Sender can delay sends to get larger segments When to send data? How much data to send?

Flow Control Producer Consumer problem

Flow Control Part of TCP specification (even before 1988) Goal: not send more data than the receiver can handle Sliding window protocol Receiver uses window header field to tell sender how much space it has

Second goal We should not send more data than the network can take: congestion control

Congestion Control Goal: pipes full Set rate accordingly to bottleneck