Understand principles behind transport layer services

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

Transport Layer Protocols

Computer Networks. Chapter 5 Transport Protocols

Transport Layer and Data Center TCP

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

TCP in Wireless Mobile Networks

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

Computer Networks - CS132/EECS148 - Spring

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

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

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

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

SIP: Session Initiation Protocol

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

Computer Networks UDP and TCP

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

Chapter 5. Transport layer protocols

Final for ECE374 05/06/13 Solution!!

Visualizations and Correlations in Troubleshooting

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)

This sequence diagram was generated with EventStudio System Designer (

[Prof. Rupesh G Vaishnav] Page 1

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

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

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

15-441: Computer Networks Homework 2 Solution

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

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

IP - The Internet Protocol

Chapter 6 Congestion Control and Resource Allocation

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

Transport layer protocols for ad hoc networks

Higher Layer Protocols: UDP, TCP, ATM, MPLS

Ethernet. Ethernet. Network Devices

Computer Networks. Data Link Layer

COMP 361 Computer Communications Networks. Fall Semester Midterm Examination

Access Control: Firewalls (1)

A Survey on Congestion Control Mechanisms for Performance Improvement of TCP

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

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

Architecture and Performance of the Internet

Transport Layer. Chapter 3.4. Think about

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

Mobile Communications Chapter 9: Mobile Transport Layer

Networking Overview. (as usual, thanks to Dave Wagner and Vern Paxson)

Advanced Computer Networks Project 2: File Transfer Application

Congestions and Control Mechanisms n Wired and Wireless Networks

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

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

Digital Audio and Video Data

How do I get to

Improved Digital Media Delivery with Telestream HyperLaunch

Final Exam. Route Computation: One reason why link state routing is preferable to distance vector style routing.

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

Internet Control Protocols Reading: Chapter 3

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

2 TCP-like Design. Answer

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

Voice over IP. Demonstration 1: VoIP Protocols. Network Environment

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

TCP for Wireless Networks

TCP in Wireless Networks

Chapter 11. User Datagram Protocol (UDP)

TCP Performance Management for Dummies

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

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

Lecture Computer Networks

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

Application Level Congestion Control Enhancements in High BDP Networks. Anupama Sundaresan

CS268 Exam Solutions. 1) End-to-End (20 pts)

Homework 2 assignment for ECE374 Posted: 02/21/14 Due: 02/28/14

TCP Adaptation for MPI on Long-and-Fat Networks

Computer Networks Homework 1

Internet Protocols. Background CHAPTER

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

CMPE 150 Winter 2009

Recent advances in transport protocols

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

A Transport Protocol for Multimedia Wireless Sensor Networks

Network Layer: Network Layer and IP Protocol

The OSI model has seven layers. The principles that were applied to arrive at the seven layers can be briefly summarized as follows:

Transport layer issues in ad hoc wireless networks Dmitrij Lagutin,

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

Data Networks Summer 2007 Homework #3

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

Low-rate TCP-targeted Denial of Service Attack Defense

Per-Flow Queuing Allot's Approach to Bandwidth Management

High Speed Internet Access Using Satellite-Based DVB Networks

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

Objectives of Lecture. Network Architecture. Protocols. Contents

Networks: IP and TCP. Internet Protocol

The present and the future of TCP/IP

An enhanced TCP mechanism Fast-TCP in IP networks with wireless links

TCP over Wireless Networks

SELECTIVE-TCP FOR WIRED/WIRELESS NETWORKS

Basic Networking Concepts. 1. Introduction 2. Protocols 3. Protocol Layers 4. Network Interconnection/Internet

Data Communication & Networks G

(Refer Slide Time: 02:17)

Networking part 3: the transport layer

Transcription:

1 Introduction Introduction Understand principles behind transport layer services transport layer multiplexing/demultiplexing reliable data transfer flow control congestion control Learn about transport layer protocols in the Internet UDP: connectionless transport TCP: connection-oriented transport with flow control and congestion control Transport Layer Communication Transport layer data packet: Segment Multiplexing/Demultiplexing Delivering data in a segment to the correct socket is called demultiplexing Gathering data from sockets, creating segments and passing them on to the network layer is called multiplexing

Transport Layer Segment Structure Connectionless Multiplexing/Demultiplexing Two-tuple: destination port and destination IP address Connection-Oriented Multiplexing/Demultiplexing Four-tuple: source and destination port and IP address 2

2 UDP User Datagram Protocol http://www.faqs.org/rfcs/rfc768.html (1980) No frills, bare bones Internet transport protocol Best effort service, UDP segments may be lost delivered out of order Connectionless no handshaking between UDP sender, receiver each UDP segment handled independently of others Why is there a UDP? no connection establishment simple: no connection state at sender, receiver small segment header no congestion control: UDP can blast away as fast as desired UDP uses Often used for streaming multimedia apps loss tolerant rate sensitive Other UDP uses 3

DNS SNMP NFS (mostly version 2) Reliable transfer over UDP: add reliability at application layer application-specific error recovery! UDP Segment Structure UDP Checksum Goal: detect errors (e.g. flipped bits) in transmitted segment Sender treat segment contents as sequence of 16-bit integers checksum: addition (1 s complement sum) of segment contents sender puts checksum value into UDP checksum field Receiver 3 RDT compute checksum of received segment check if computed checksum equals checksum field value no error recovery, only discarding or warning checksum not always used by sender (if not used, set to all zero) Principles of Reliable Data Transfer We will now: Incrementally develop sender, receiver sides of reliable data transfer protocol (RDT) Consider only unidirectional data transfer Use finite state machines (FSM) to specify sender, receiver 4

RDT RDT1.0 Reliable transfer over a reliable channel RDT2.0 Bit errors! Underlying channel may flip bits in packet checksum to detect bit errors How to recover from errors? acknowledgements (ACKs): receiver explicitly tells sender that pkt received OK negative acknowledgements (NAKs): receiver explicitly tells sender that pkt had errors sender retransmits pkt on receipt of NAK 5

New mechanisms in rdt2.0 (beyond rdt1.0) error detection receiver feedback: control msgs (ACK,NAK) rcvr sender RDT2.0 RDT2.0 What happens if ACK/NAK corrupted? sender doesn t know what happened at receiver! can t just retransmit: possible duplicate Handling duplicates sender adds sequence number to each pkt sender retransmits current pkt if ACK/NAK garbled receiver discards (doesn t deliver up) duplicate pkt RDT2.1 Sender 6

RDT2.1 Receiver RDT2.1 Discussion Sender seq # added to pkt two seq. # s (0,1) will suffice, why? must check if received ACK/NAK corrupted twice as many states state must remember whether current pkt has 0 or 1 seq # Receiver must check if received packet is duplicate state indicates whether 0 or 1 is expected pkt seq # 7

RDT2.2 ACKs only - Sender RDT2.2 ACKs only - Receiver RDT3.0 Bit errors and loss! Approach: sender waits reasonable amount of time for ACK retransmits if no ACK received in this time if pkt (or ACK) just delayed (not lost) retransmission will be duplicate, but use of seq # s already handles this receiver must specify seq # of pkt being ACKed requires countdown timer 8

RDT3.0 4 Pipelining Pipelining RDT3.0 works, but performance stinks! (see figure 3.17) Range of sequence numbers must be increased Buffering at sender and/or receiver Go-Back-N or selective repeat Stop-and-wait vs. Pipelining 9

5 Go-Back-N Go-Back-N k-bit seq # in pkt header window of up to N, consecutive unack ed pkts allowed ACK(n): ACKs all pkts up to, including seq # n - cumulative ACK may receive duplicate ACKs (see receiver) timer for each in-flight pkt timeout(n): retransmit pkt n and all higher seq # pkts in window Go-Back-N ACK-only: always send ACK for correctly-received pkt with highest inorder seq # may generate duplicate ACKs need only remember expectedseqnum Out-of-order pkt discard (don t buffer) no receiver buffering! re-ack pkt with highest in-order seq # 10

Go-Back-N 6 Selective Repeat Selective Repeat Receiver individually acknowledges all correctly received pkts buffers pkts, as needed, for eventual in-order delivery to upper layer Sender only resends pkts for which ACK not received sender timer for each unacked pkt Sender window N consecutive seq # s again limits seq # s of sent, unacked pkts Selective Repeat 11

Selective Repeat: Sender Data from above if next available seq # in window, send pkt Timeout(n) resend pkt n, restart timer ACK(n) in [sendbase,sendbase+n] mark pkt n as received if n smallest unacked pkt, advance window base to next unacked seq # Selective Repeat: Receiver pkt n in [rcvbase, rcvbase+n-1] send ACK(n) out-of-order: buffer in-order: deliver (also deliver buffered, in-order pkts), advance window to next not-yet-received pkt pkt n in [rcvbase-n,rcvbase-1] ACK(n) otherwise ignore 12

Selective Repeat Selective Repeat Dilemma 7 RDT Summary RDT Summary 13

8 TCP Intro TCP Overview RFCs: 793, 1122, 1323, 2018, 2581 Point-to-point Reliable, in-order byte stream no message boundaries Pipelined TCP congestion and flow control set window size Send & receive buffers Full duplex data bi-directional data flow in same connection Connection-oriented handshaking (exchange of control msgs) init s sender, receiver state before data exchange Flow controlled sender will not overwhelm receiver 14

TCP Segment Structure TCP Seq# & ACK MSS: maximum segment size, e.g. 1000 bytes Seq # s byte stream number of first byte in segment s data ACKs seq # of next byte expected from other side cumulative ACK How does receiver handle out-of-order segments? the RFCs dont say, more later... TCP Seq# & ACK 15

TCP RTT & Timeout How to set TCP timeout value? longer than RTT but RTT varies too short: premature timeout unnecessary retransmissions too long: slow reaction to segment loss How to estimate RTT? SampleRTT: measured time from segment transmission until ACK receipt (ignore retransmissions) SampleRTT will vary, want estimated RTT smoother average several recent measurements, not just current SampleRTT TCP EstimatedRTT EstimatedRTT = (1 α) EstimatedRTT + α SampleRTT 16

TCP Setting the Timeout EstimtedRTT plus safety margin large variation in EstimatedRTT larger safety margin First estimate of how much SampleRTT deviates from EstimatedRTT DevRTT = (1 β) DevRTT + β SampleRTT EstimatedRTT Then set timeout interval: TimeoutInterval = EstimatedRTT + 4 DevRTT 9 TCP RDT TCP Reliable Data Transfer TCP creates RDT service on top of IP s unreliable service Pipelined segments Cumulative ACKs TCP uses single retransmission timer Retransmissions are triggered by timeout events duplicate ACKs TCP Sender Events Data rcvd from app create segment with seq # seq # is byte-stream number of first data byte in segment start timer if not already running (think of timer as for oldest unacked segment) expiration interval: TimeOutInterval Timeout retransmit segment that caused timeout restart timer ACK rcvd if acknowledges previously unacked segments update what is known to be ACKed start timer if there are outstanding segments 17

Scenario 1 Scenario 2 Scenario 3 18

TCP ACK Generation TCP Fast Retransmit Time-out period often relatively long long delay before resending lost packet Detect lost segments via duplicate ACKs Sender often sends many segments back-to-back If segment is lost, there will likely be many duplicate ACKs If sender receives 3 ACKs for the same data, it supposes that segment after ACKed data was lost fast retransmit: resend segment before timer expires 19

10 TCP Flow Control TCP Flow Control App process may be slow at reading from buffer Speed-matching service: matching the send rate to the receiving app s drain rate (Suppose TCP receiver discards out-of-order segments) Spare room in buffer = RcvWindow = RcvBuffer [LastByteRcvd LastByteRead] Rcvr advertises spare room by including value of RcvWindow in segments Sender limits unacked data to RcvWindow guarantees receive buffer doesn t overflow TCP Flow Control 11 TCP Connection Management TCP Connection Establishment Initialize TCP variables seq #s buffers, flow control info (e.g. RcvWindow) Client: connection initiator Socket clientsocket = new Socket("hostname","port number"); Server: contacted by client Socket connectionsocket = welcomesocket.accept(); Three way handshake step 1: client host sends TCP SYN segment to server specifies initial seq # no data 20

step 2: server host receives SYN, replies with SYNACK segment server allocates buffers specifies server initial seq # step 3: client receives SYNACK, replies with ACK segment, which may contain data TCP Connection Establishment TCP Connection Tear-Down Client closes socket step 1: client end system sends TCP FIN control segment to server step 2: server receives FIN, replies with ACK. Closes connection, sends FIN step 3: client receives FIN, replies with ACK enters timed wait - will respond with ACK to received FINs step 4: server, receives ACK. Connection closed TCP Connection Tear-Down 21

TCP Client States TCP Server States 22

12 Congestion Control Principles of Congestion Control Informally: too many sources sending too much data too fast for network to handle Different from flow control! Manifestations lost packets (buffer overflow at routers) long delays (queueing in router buffers) Costs of Congestion Control Large queing delays as the packet-arrivel rate nears the link capacity sender must retransmit due to buffer overflow unneeded retransmissions: link carries multiple copies of pkt When packet dropped, any upstream transmission capacity used for that packet was wasted! Approaches to Congestion Control End-end congestion control no explicit feedback from network congestion inferred from end-system observed loss, delay approach taken by TCP Network-assisted congestion control routers provide feedback to end systems single bit indicating congestion explicit rate sender should send at 13 TCP Congestion Control TCP Congestion Control End-end control (no network assistance) Sender limits transmission LastByteSent LastByteAcked min{congwin,rcvwindow} Roughly rate = CongWin RTT Bytes/sec 23

CongWin is dynamic, function of perceived network congestion Loss event: timeout or 3 duplicate acks TCP sender reduces rate (CongWin) after loss event Three mechanisms AIMD TCP AIMD slow start conservative after timeout events Multiplicative decrease: cut CongWin in half after loss event Additive increase: increase CongWin by 1 MSS every RTT in the absence of loss events: probing TCP Slow Start When connection begins, CongWin = 1MSS 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 double CongWin every RTT done by incrementing CongWin for every ACK received Summary: initial rate is slow but ramps up exponentially fast 24

TCP Timeouts After 3 dup ACKs CongWin is cut in half window then grows linearly But after timeout event CongWin instead set to 1 MSS window then grows exponentially up to a threshold, then grows linearly Philosophy 3 dup ACKs indicates network capable of delivering some segments timeout before 3 dup ACKs is more alarming TCP Timeouts When should the exponential increase switch to linear? When CongWin gets to 1/2 of its value before timeout TCP Sender Congestion Control 25

TCP Fairness Additive increase gives slope of 1, as throughout increases Multiplicative decrease decreases throughput proportionally Other Fairness? Multimedia apps often do not use TCP do not want rate throttled by congestion control Instead use UDP pump audio/video at constant rate, tolerate packet loss Fairness and parallel TCP connections nothing prevents app from opening parallel cnctions between 2 hosts web browsers do this 26

14 Next Week Next Week Into the network core - the Network Layer Chp 4.1-4.6 27