Chapter 3 outline. rdt2.0 has a fatal flaw! Rdt2.0: channel with bit errors. rdt2.0: FSM specification. Reliable data transfer: getting started

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

SIP: Session Initiation Protocol

Transport Layer and Data Center TCP

Transport Layer Protocols

Computer Networks. Chapter 5 Transport Protocols

Computer Networks - CS132/EECS148 - Spring

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

TCP in Wireless Mobile Networks

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

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

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

Chapter 5. Transport layer protocols

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

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

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

Computer Networks UDP and TCP

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

Transport Layer. Chapter 3.4. Think about

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

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

Ethernet. Ethernet. Network Devices

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

COMP 361 Computer Communications Networks. Fall Semester Midterm Examination

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

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

[Prof. Rupesh G Vaishnav] Page 1

Computer Networks. Data Link Layer

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

This sequence diagram was generated with EventStudio System Designer (

Visualizations and Correlations in Troubleshooting

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

15-441: Computer Networks Homework 2 Solution

Higher Layer Protocols: UDP, TCP, ATM, MPLS

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

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

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

How do I get to

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

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

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

TCP Performance Management for Dummies

Mobile Communications Chapter 9: Mobile Transport Layer

Data Networks Summer 2007 Homework #3

Transport Protocols and Distributed Applications

IP - The Internet Protocol

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

Architecture and Performance of the Internet

Computer Networks Practicum 2015

CMPE 150 Winter 2009

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

Access Control: Firewalls (1)

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

TCP for Wireless Networks

Advanced Computer Networks Project 2: File Transfer Application

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

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

Chapter 6 Congestion Control and Resource Allocation

A Survey on Congestion Control Mechanisms for Performance Improvement of TCP

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

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

Final for ECE374 05/06/13 Solution!!

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

First Workshop on Open Source and Internet Technology for Scientific Environment: with case studies from Environmental Monitoring

TCP Adaptation for MPI on Long-and-Fat Networks

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

2 TCP-like Design. Answer

Lecture Computer Networks

A Transport Protocol for Multimedia Wireless Sensor Networks

Objectives of Lecture. Network Architecture. Protocols. Contents

Lecture 5: Network Attacks I. Course Admin

How To Design A Layered Network In A Computer Network

Internet Protocols. Background CHAPTER

Congestions and Control Mechanisms n Wired and Wireless Networks

Data Link Layer. Flow Control. Flow Control

2.1 Introduction. 2.2 Voice over IP (VoIP)

Digital Audio and Video Data

Answer: that dprop equals dtrans. seconds. a) d prop. b) d trans

Protocols. Packets. What's in an IP packet

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

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

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

Improved Digital Media Delivery with Telestream HyperLaunch

Homework 3 assignment for ECE374 Posted: 03/13/15 Due: 03/27/15

Solution of Exercise Sheet 5

CS640: Introduction to Computer Networks. Applications FTP: The File Transfer Protocol

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

File Transfer And Access (FTP, TFTP, NFS) Chapter 25 By: Sang Oh Spencer Kam Atsuya Takagi

Data Link Layer(1) Principal service: Transferring data from the network layer of the source machine to the one of the destination machine

QUIC. Quick UDP Internet Connections. Multiplexed Stream Transport over UDP. IETF-88 TSV Area Presentation

Defending Computer Networks Lecture 6: TCP and Scanning. Stuart Staniford Adjunct Professor of Computer Science

Mobile Computing/ Mobile Networks

Transport layer protocols for ad hoc networks

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

Host Fingerprinting and Firewalking With hping

What is a DoS attack?

OSI Model. Application Presentation Session Transport Network Data Link Physical. EE156 Computer Network Architecture

Internet Control Protocols Reading: Chapter 3

The Transport Layer and Implica4ons for Network Monitoring. CS 410/510 Spring 2014

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

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

Transcription:

Chapter 3 outline Reliable data transfer: getting started 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 3.7 TCP We ll: incrementally develop reliable data transfer protocol (rdt) consider only unidirectional data transfer but control info will flow on both directions! use finite state machines (FSM) state: when in this state next state uniquely determined by next event state 1 event causing state transition actions taken on state transition event actions state 2 Transport ayer 3-1 Transport ayer 3-2 Rdt1.0: reliable transfer over a reliable channel underlying channel perfectly reliable no bit errors no loss of packets separate FSMs for, : packet = make_pkt(data) udt_send(packet) rdt_rcv(packet) extract (packet,data) Rdt2.0: channel with bit errors underlying channel may flip bits in packet checksum to detect bit errors the question: how to recover from errors: acknowledgements (ACKs): explicitly tells that pkt received OK negative acknowledgements (NAKs): explicitly tells that pkt had errors retransmits pkt on receipt of NAK new mechanisms in rdt2.0 (beyond rdt1.0): error detection feedback: control msgs (ACK,NAK) rcvr-> Transport ayer 3-3 Transport ayer 3-4 rdt2.0: FSM specification sndpkt = make_pkt(data, checksum) ACK or NAK isack(rcvpkt) isnak(rcvpkt) corrupt(rcvpkt) udt_send(nak) notcorrupt(rcvpkt) udt_send(ack) rdt2.0 has a fatal flaw! What happens if ACK/NAK corrupted? doesn t know what happened at! can t just retransmit: possible duplicate Handling duplicates: retransmits current pkt if ACK/NAK garbled adds sequence number to each pkt discards (doesn t deliver up) duplicate pkt stop and wait Sender sends one packet, then waits for response Transport ayer 3-5 Transport ayer 3-6 1

rdt2.1:, handles garbled ACK/NAKs && isack(rcvpkt) isnak(rcvpkt) ) sndpkt = make_pkt(0, data, checksum) call 0 from ACK or NAK 1 ACK or NAK 0 call 1 from isnak(rcvpkt) ) && isack(rcvpkt) sndpkt = make_pkt(1, data, checksum) Transport ayer 3-7 rdt2.1:, handles garbled ACK/NAKs (corrupt(rcvpkt) sndpkt = make_pkt(nak, chksum) not corrupt(rcvpkt) && has_seq1(rcvpkt) notcorrupt(rcvpkt) && has_seq0(rcvpkt) 0 from 1 from notcorrupt(rcvpkt) && has_seq1(rcvpkt) (corrupt(rcvpkt) sndpkt = make_pkt(nak, chksum) not corrupt(rcvpkt) && has_seq0(rcvpkt) Transport ayer 3-8 rdt2.2: a NAK-free protocol rdt2.2:, fragments using ACKs only instead of NAK, sends ACK for last pkt received OK must explicitly include seq # of pkt being ACKed duplicate ACK at results in same action as NAK: retransmit current pkt Transport ayer 3-9 (corrupt(rcvpkt) has_seq1(rcvpkt)) sndpkt = make_pkt(0, data, checksum) call 0 from 0 from ACK 0 FSM fragment FSM fragment notcorrupt(rcvpkt) && has_seq1(rcvpkt) sndpkt = make_pkt(ack1, chksum) isack(rcvpkt,1) ) && isack(rcvpkt,0) Transport ayer 3-10 rdt3.0: channels with errors and loss New assumption: underlying channel can also lose packets (data or ACKs) checksum, seq. #, ACKs, retransmissions will be of help, but not enough Approach: waits reasonable amount of for ACK retransmits if no ACK received in this if pkt (or ACK) just delayed (not lost): retransmission will be duplicate, but use of seq. # s already handles this must specify seq # of pkt being ACKed requires countdown r rdt3.0 call 0from && isack(rcvpkt,1) stop_r out start_r isack(rcvpkt,0) ) sndpkt = make_pkt(0, data, checksum) start_r Wait for ACK1 Wait for ACK0 call 1 from sndpkt = make_pkt(1, data, checksum) start_r isack(rcvpkt,1) ) out start_r && isack(rcvpkt,0) stop_r Transport ayer 3-11 Transport ayer 3-12 2

rdt3.0 in action rdt3.0 in action Transport ayer 3-13 Transport ayer 3-14 rdt3.0: stop-and-wait operation first packet bit transmitted, t = 0 last packet bit transmitted, t = / R RTT first packet bit arrives last packet bit arrives, send ACK Pipelined protocols pipelining: allows multiple, in-flight, yet-tobe-acknowledged pkts range of sequence numbers must be increased buffering at and/or ACK arrives, send next packet, t = RTT + / R U = / R RTT + / R =.008 30.008 = 0.00027 microsec Transport ayer 3-15 Transport ayer 3-16 Pipelining: increased utilization first packet bit transmitted, t = 0 last bit transmitted, t = / R RTT ACK arrives, send next packet, t = RTT + / R U = 3 * / R RTT + / R =.024 30.008 first packet bit arrives last packet bit arrives, send ACK last bit of 2 nd packet arrives, send ACK last bit of 3 rd packet arrives, send ACK Increase utilization by a factor of 3! = 0.0008 microsecon Pipelined Protocols Go-back-N: big picture: can have up to N unacked packets in pipeline rcvr only sends cumulative acks doesn t ack packet if there s a gap has r for oldest unacked packet if r expires, retransmit all unack ed packets Selective Repeat: big pic can have up to N unack ed packets in pipeline rcvr sends individual ack for each packet maintains r for each unacked packet when r expires, retransmit only unack ed packet Transport ayer 3-17 Transport ayer 3-18 3

GBN in action Selective Repeat individually acknowledges all correctly received pkts buffers pkts, as needed, for eventual in-order delivery to upper layer only resends pkts for which ACK not received r for each unacked pkt window N consecutive seq # s again limits seq #s of sent, unack ed pkts Transport ayer 3-19 Transport ayer 3-20 Selective repeat in action Selective repeat: dilemma Example: seq # s: 0, 1, 2, 3 window size=3 sees no difference in two scenarios! incorrectly passes duplicate data as new in (a) Q: what relationship between seq # size and window size? Transport ayer 3-21 Transport ayer 3-22 Chapter 3 outline TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581 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 3.7 TCP point-to-point: one, one reliable, in-order byte steam: 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 MSS: maximum segment size connection-oriented: handshaking (exchange of control msgs) inits, state before data exchange flow controlled: socket door application writes data TCP send buffer application reads data TCP receive buffer socket door will not overwhelm segment Transport ayer 3-23 Transport ayer 3-24 4

TCP segment structure URG: urgent data (generally not used) ACK: ACK # valid PSH: push data now (generally not used) RST, SYN, FIN: connection estab (setup, teardown commands) Internet checksum (as in UDP) 32 bits source port # dest port # sequence number acknowledgement number head not U A P R S F Receive window len used checksum Urg data pnter Options (variable length) application data (variable length) counting by bytes of data (not segments!) # bytes rcvr willing to accept Transport ayer 3-25 TCP seq. # s and ACKs Seq. # s: byte stream number of first byte in segment s data ACKs: seq # of next byte expected from other side cumulative ACK Q: how handles out-of-order segments A: TCP spec doesn t say, - up to implementor User types C host ACKs receipt of echoed C simple telnet scenario host ACKs receipt of C, echoes back C Transport ayer 3-26 TCP Round Trip Time and Timeout TCP Round Trip Time and Timeout Q: how to set TCP out value? longer than RTT but RTT varies too short: premature out unnecessary retransmissions too long: slow reaction to segment loss Q: how to estimate RTT? SampleRTT: measured from segment transmission until ACK receipt ignore retransmissions SampleRTT will vary, want estimated RTT smoother average several recent measurements, not just current SampleRTT EstimatedRTT = (1- )*EstimatedRTT + *SampleRTT Exponential weighted moving average influence of past sample decreases exponentially fast typical value: = 0.125 Transport ayer 3-27 Transport ayer 3-28 Example RTT estimation: TCP Round Trip Time and Timeout RTT (milliseconds) 350 300 250 200 RTT: gaia.cs.umass.edu to fantasia.eurecom.fr Setting the out EstimatedRTT plus safety margin large variation in EstimatedRTT -> larger safety margin first estimate of how much SampleRTT deviates from EstimatedRTT: DevRTT = (1- )*DevRTT + * SampleRTT-EstimatedRTT 150 (typically, = 0.25) Then set out interval: 100 1 8 15 22 29 36 43 50 57 64 71 78 85 92 99 106 (seconnds) TimeoutInterval = EstimatedRTT + 4*DevRTT SampleRTT Estimated RTT Transport ayer 3-29 Transport ayer 3-30 5

out Seq=92 out out Seq=92 out Chapter 3 outline TCP reliable data transfer 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 3.7 TCP TCP creates rdt service on top of IP s unreliable service pipelined segments cumulative acks TCP uses single retransmission r retransmissions are triggered by: out events duplicate acks initially consider simplified TCP : ignore duplicate acks ignore flow control, Transport ayer 3-31 Transport ayer 3-32 TCP events: data rcvd from app: Create segment with seq # seq # is byte-stream number of first data byte in segment start r if not already running (think of r as for oldest unacked segment) expiration interval: TimeOutInterval out: retransmit segment that caused out restart r Ack rcvd: If acknowledges previously unacked segments update what is known to be acked start r if there are outstanding segments Transport ayer 3-33 TCP: retransmission scenarios = 100 X loss lost ACK scenario = 100 = 120 = 120 premature out Transport ayer 3-34 TCP retransmission scenarios (more) Fast Retransmit = 120 X loss Cumulative ACK scenario -out period often relatively long: long delay before resending lost packet detect lost segments via duplicate ACKs. often sends many segments back-toback if segment is lost, there will likely be many duplicate ACKs. if receives 3 ACKs for the same data, it supposes that segment after ACKed data was lost: fast retransmit: resend segment before r expires Transport ayer 3-35 Transport ayer 3-36 6

out X Figure 3.37 Resending a segment after triple duplicate ACK Transport ayer 3-37 7