CSCE 463/612 Networks and Distributed Processing Spring 2016

Similar documents
Transport Layer Protocols

Computer Networks. Chapter 5 Transport Protocols

Transport Layer and Data Center TCP

TCP Flow Control. TCP Receiver Window. Sliding Window. Computer Networks. Lecture 30: Flow Control, Reliable Delivery

Chapter 5. Transport layer protocols

B-2 Analyzing TCP/IP Networks with Wireshark. Ray Tompkins Founder of Gearbit

ICOM : Computer Networks Chapter 6: The Transport Layer. By Dr Yi Qian Department of Electronic and Computer Engineering Fall 2006 UPRM

COMP 3331/9331: Computer Networks and Applications. Lab Exercise 3: TCP and UDP (Solutions)

CSE 473 Introduction to Computer Networks. Exam 2 Solutions. Your name: 10/31/2013

La couche transport dans l'internet (la suite TCP/IP)

TCP in Wireless Mobile Networks

Outline. TCP connection setup/data transfer Computer Networking. TCP Reliability. Congestion sources and collapse. Congestion control basics

Computer Networks UDP and TCP

La couche transport dans l'internet (la suite TCP/IP)

TCP/IP Optimization for Wide Area Storage Networks. Dr. Joseph L White Juniper Networks

TCP over Multi-hop Wireless Networks * Overview of Transmission Control Protocol / Internet Protocol (TCP/IP) Internet Protocol (IP)

[Prof. Rupesh G Vaishnav] Page 1

Transport Layer. Chapter 3.4. Think about

Data Communications & Networks. Session 6 Main Theme Reliable Data Transfer. Dr. Jean-Claude Franchitti

q Connection establishment (if connection-oriented) q Data transfer q Connection release (if conn-oriented) q Addressing the transport user

Names & Addresses. Names & Addresses. Hop-by-Hop Packet Forwarding. Longest-Prefix-Match Forwarding. Longest-Prefix-Match Forwarding

TCP/IP Networking for Wireless Systems. Integrated Communication Systems Group Ilmenau University of Technology

Prefix AggregaNon. Company X and Company Y connect to the same ISP, and they are assigned the prefixes:

Higher Layer Protocols: UDP, TCP, ATM, MPLS

Transport layer protocols for ad hoc networks

Computer Networks - CS132/EECS148 - Spring

This sequence diagram was generated with EventStudio System Designer (

TCP Performance Management for Dummies

Visualizations and Correlations in Troubleshooting

IP Network Layer. Datagram ID FLAG Fragment Offset. IP Datagrams. IP Addresses. IP Addresses. CSCE 515: Computer Network Programming TCP/IP

COMP 361 Computer Communications Networks. Fall Semester Midterm Examination

How do I get to

First Midterm for ECE374 03/09/12 Solution!!

Computer Networks. Data Link Layer

Access Control: Firewalls (1)

CSE331: Introduction to Networks and Security. Lecture 9 Fall 2006

Ethernet. Ethernet. Network Devices

Improving the Performance of TCP Using Window Adjustment Procedure and Bandwidth Estimation

Internet Protocols. Background CHAPTER

Midterm Exam CMPSCI 453: Computer Networks Fall 2011 Prof. Jim Kurose

Simulation-Based Comparisons of Solutions for TCP Packet Reordering in Wireless Network

Data Networks Summer 2007 Homework #3

Mobile Communications Chapter 9: Mobile Transport Layer

IP - The Internet Protocol

Overview. Securing TCP/IP. Introduction to TCP/IP (cont d) Introduction to TCP/IP

TCP/IP Fundamentals. OSI Seven Layer Model & Seminar Outline

Final for ECE374 05/06/13 Solution!!

SIP: Session Initiation Protocol

What is a DoS attack?

Architecture and Performance of the Internet

Multipath TCP in Practice (Work in Progress) Mark Handley Damon Wischik Costin Raiciu Alan Ford

Chapter 11. User Datagram Protocol (UDP)

TCP and Wireless Networks Classical Approaches Optimizations TCP for 2.5G/3G Systems. Lehrstuhl für Informatik 4 Kommunikation und verteilte Systeme

Advanced Computer Networks Project 2: File Transfer Application

TCP over Wireless Networks

Computer Networks Practicum 2015

A Survey on Congestion Control Mechanisms for Performance Improvement of TCP

SELECTIVE-TCP FOR WIRED/WIRELESS NETWORKS

CS551 End-to-End Internet Packet Dynamics [Paxson99b]

1 An application in BPC: a Web-Server

TCP Westwood for Wireless

Recent advances in transport protocols

Pig Laboratory. Additional documentation for the laboratory. Exercises and Rules. Tstat Data

Lecture 15: Congestion Control. CSE 123: Computer Networks Stefan Savage

Lecture Objectives. Lecture 07 Mobile Networks: TCP in Wireless Networks. Agenda. TCP Flow Control. Flow Control Can Limit Throughput (1)

EITF25 Internet Techniques and Applications L5: Wide Area Networks (WAN) Stefan Höst

Protocols and Architecture. Protocol Architecture.

Networks: IP and TCP. Internet Protocol

Overview of TCP/IP. TCP/IP and Internet

Mobile Computing/ Mobile Networks

Chapter 8 Security Pt 2

Configuring TCP Intercept (Preventing Denial-of-Service Attacks)

TCP Adaptation for MPI on Long-and-Fat Networks

First Midterm for ECE374 03/24/11 Solution!!

First Midterm for ECE374 02/25/15 Solution!!

IP address format: Dotted decimal notation:

Introduction to TCP/IP

Servicesin ns-3. Outline SIMULACIÓN DE PROTOCOLOS DE ENRUTAMIENTO PARA REDES MÓVILES AD-HOC MEDIANTE HERRRAMIENTA DE SIMULACIÓN NS-3

Stop And Wait. ACK received; transmit frame 2 CS 455 3

1. The subnet must prevent additional packets from entering the congested region until those already present can be processed.

ECSE-6600: Internet Protocols Exam 2

Final exam review, Fall 2005 FSU (CIS-5357) Network Security

8-bit Microcontroller. Application Note. AVR460: Embedded Web Server. Introduction. System Description

Based on Computer Networking, 4 th Edition by Kurose and Ross

A Transport Protocol for Multimedia Wireless Sensor Networks

Indian Institute of Technology Kharagpur. TCP/IP Part I. Prof Indranil Sengupta Computer Science and Engineering Indian Institute of Technology

Network Security: Workshop. Dr. Anat Bremler-Barr. Assignment #2 Analyze dump files Solution Taken from

TCP for Wireless Networks

Improving Effective WAN Throughput for Large Data Flows By Peter Sevcik and Rebecca Wetzel November 2008

The present and the future of TCP/IP

15-441: Computer Networks Homework 2 Solution

Lecture Computer Networks

Course Overview: Learn the essential skills needed to set up, configure, support, and troubleshoot your TCP/IP-based network.

Note! The problem set consists of two parts: Part I: The problem specifications pages Part II: The answer pages

Transcription:

CSCE 463/612 Networks and Distributed Processing Spring 2016 Transport Layer IV Dmitri Loguinov Texas A&M University March 10, 2016 Original slides copyright 1996-2004 J.F Kurose and K.W. Ross 1

Chapter 3: Roadmap 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 2

TCP: Overview [RFCs: : 793, 1122, 1323, 2001, 2018, 2581, 3390, 5681] Point-to-point (unicast): One sender, one receiver Reliable, in-order byte stream: Packet boundaries are not visible to the application Pipelined: TCP congestion and flow control set window size Send & receive buffers socket door application writes data TCP send buffer segment application reads data TCP receive buffer Full duplex data: Bi-directional data flow in same connection MSS: maximum segment size (excluding headers) Connection-oriented: Handshaking (exchange of control msgs) initializes sender/receiver state before data exchange Flow controlled: socket door Sender will not overwhelm receiver 3

Chapter 3: Roadmap 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 4

TCP Segment Structure Sequence/ACK numbers Count bytes, not segments ACKs piggybacked on data packets Flags (U-A-P-R-S-F) Urgent data (not used) ACK field is valid PUSH (not used) RST (reset connection) SYN (connection request) FIN (connection close) 32 bits source port # dest port # sequence number acknowledgement number UAP R S F checksum Hdr length in DWORDs (4-bit field) Normally 20 bytes, but longer if options are present hdr len not used application data (variable length) receiver window Urg data pointer Options (variable length)

TCP Seq. # S S and ACKs Seq. # s: Sequence number of the first byte in segment s data ACKs: Seq # of next byte expected from sender Cumulative ACK Q: how receiver handles out-oforder segments? A: TCP spec doesn t say, up to implementor User types C host ACKs receipt of echoed C Host A Host B Seq=42, ACK=79, data = C Seq=79, ACK=43, data = C Seq=43, ACK=80 Simple telnet scenario host ACKs receipt of C, echoes back C time 6

TCP Round Trip Time and Timeout Q: how to set TCP timeout value (RTO)? Want it slightly larger than the next RTT But the RTT varies Too short: premature timeout Unnecessary retransmissions Too long: slow reaction to segment loss Protocol may stall often, exhibit low performance Idea: dynamically measure RTT, average these samples, then add safety margin SampleRTT: measured time from segment transmission until ACK receipt Ignore retransmissions, why? SampleRTT will vary, want estimated RTT smoother Average several recent measurements, not just current SampleRTT 7

TCP Round Trip Time and Timeout EstimatedRTT(n) = (1-α)*EstimatedRTT(n-1) + α*samplertt(n) Exponentially weighted moving average (EWMA) Influence of past sample decreases exponentially fast Typical value: α = 0.125 = 1/8 Task: derive a non-recursive formula for EstimatedRTT(n) Assume EstimatedRTT(0) = SampleRTT(0) Let Y(n) = EstimatedRTT(n) and y(n) = SampleRTT(n) 8

Example RTT Estimation: 300 250 RTT (ms) 200 150 sampled RTT estimated RTT 100 0 10 20 30 40 50 60 sample number 9

TCP Round Trip Time and Timeout Setting the timeout: EstimatedRTT plus a safety margin Larger variation in EstimatedRTT larger safety margin First estimate how much SampleRTT deviates from EstimatedRTT (typically, β = 0.25): DevRTT(n) = (1-β)*DevRTT(n-1) + β * SampleRTT(n)-EstimatedRTT(n) Then set retransmission timeout (RTO): RTO(n) = EstimatedRTT(n) + 4*DevRTT(n) 10

Example Timeout Estimation: 400 350 300 RTT (ms) 250 200 150 100 sampled RTT estimated RTT timeout 0 10 20 30 40 50 60 sample number 11

Chapter 3: Roadmap 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 12

TCP Reliable Data Transfer TCP creates rdt service on top of IP s unreliable service Hybrid of Go-back-N and Selective Repeat Pipelined segments Cumulative acks TCP uses single retransmission timer For the oldest unack ed packet Retransmissions are triggered by: Timeout events Duplicate acks Initially consider simplified TCP sender: Ignore duplicate acks Ignore flow control, congestion control 13

NextSeqNum = InitialSeqNum // random for each transfer SendBase = InitialSeqNum // SendBase-1 is the last ack ed byte loop (forever) { switch(event) { (a) data received from application above (assuming it fits into window): create TCP segment with sequence number NextSeqNum if (timer currently not running) start timer pass segment to IP NextSeqNum = NextSeqNum + length(data) (b) timeout: retransmit pending segment with smallest sequence number (i.e., SendBase); restart timer (c) ACK received, with ACK field value of y if (y > SendBase) { SendBase = y if (there are currently not-yet-acknowledged segments) restart timer with latest RTO else cancel timer } } } /* end of loop forever */ TCP Sender (Simplified)

TCP Seq. # S S and ACKs FTP Example: Suppose MSS = 1,000 bytes and the sender has a large file to transmit (we ignore seq field in ACKs and ACK field in data pkts) What is the sender window size? Host A Host B seq = 0 seq = 1000 seq = 2000 ACK = 1000 ACK = 2000 seq = 3000 seq = 4000 RTO ACK = 2000 seq = 2000 ACK = 2000 ACK = 5000 15

TCP ACK Generation [RFC 1122, RFC 2581] Receiver immediately ACKs the base of its window in all cases except Nagle s algorithm: For in-order arrival of packets, send ACKs for every pair of segments; if second segment of a pair not received in 500ms, ACK the first one alone seq = 0 seq = 1000 delayed seq = 0 seq = 1000 delayed seq = 2000 ACK = 2000 seq = 2000 500 ms RTO seq = 3000 seq = 4000 seq = 2000 ACK = 2000 ACK = 2000 ACK = 1000 ACK = 5000 16

Fast Retransmit Time-out period often relatively long Especially in the beginning of transfer (3 seconds in RFC 1122) Idea: infer loss via duplicate ACKs Sender often sends many segments backto-back If segment is lost, there will likely be many duplicate ACKs If sender receives 3 duplicate ACKs for its base, it assumes this packet was lost Fast Retransmit: resend the base segment immediately (i.e., without waiting for RTO) Note that reordering may trigger unnecessary retx To combat this problem, modern routers avoid loadbalancing packets of same flow along multiple paths 17

Fast Retransmit Algorithm: (c) event: ACK received, with ACK field value of y if (y > SendBase) { SendBase = y; dupack = 0; if (SendBase!= NextSeqNum) restart timer with latest RTO; else cancel timer; // last pkt in window } else if (y == SendBase) { dupack++; if (dupack == 3) { resend segment with sequence y; restart timer} } a duplicate ACK for already ACKed segment fast retransmit 18

Chapter 3: Roadmap 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 19

TCP Flow Control Assume packets received without loss, but the application does not call recv() How to prevent sender from overflowing TCP buffer? Flow control Sender won t overflow receiver buffer by transmitting too much, too fast Speed-matching service: sender rate to suit the receiving app s ability to process incoming data 20

TCP Flow Control: How It Works Spare room in buffer RcvWin = RcvBuffer [LastByteReceivedInOrder - LastByteDelivered] last ACK-1 went to application Receiver advertises spare room by including value of RcvWin in segments Sender enforces seq < ACK + RcvWin Guarantees receive buffer doesn t overflow Combining both constraints (sender, receiver): seq < min(sndbase+sndwin, ACK+RcvWin) 21

Chapter 3: Roadmap 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 22

TCP Connection Management Purpose of connection establishment: Exchange initial seq #s Exchange flow control info (i.e., RcvWin) Negotiate options (SACK, large windows, etc.) Three way handshake: Step 1: client sends TCP SYN to server Specifies initial seq # X and buffer size RcvWin No data, ACK = 0 Step 2: server gets SYN, replies with SYN+ACK Sends server initial seq # Y and buffer size RcvWin No data, ACK = X+1 Step 3: client receives SYN+ACK, replies with ACK segment Seq = X+1, ACK = Y+1 May contain regular data, but many servers will break Step 4: regular packets Seq = X+1, ACK = Y+1 23

TCP Connection Management (Cont.) Closing a connection: originator other side Closing a socket: closesocket(sock); closing FIN Step 1: originator end system sends TCP FIN control segment to server Step 2: other side receives FIN, replies with ACK. Connection in closing state, sends FIN ACK TCP initiates a close when it has all ACKs for the transmitted data closing 24

TCP Connection Management (Cont.) Step 3: originator receives FIN, replies with ACK Enters timed wait - will respond with ACK to received FINs Step 4: other side receives ACK; its connection considered closed Step 5: after a timeout (TIME_WAIT state lasts 240 seconds), originator s connection is closed as well closing timed wait closed originator FIN ACK FIN ACK other side closing closed 1) FIN-ACK possible instead of two middle packets 2) birectional transfer means both sides must agree to close 25