TDC561 Network Programming Camelia Zlatea, PhD Week 10: Performance Aspects of End-to-End (Transport)

Slides:



Advertisements
Similar presentations
1 Computer Networks: A Systems Approach, 5e Larry L. Peterson and Bruce S. Davie Chapter 5 End-to-End Protocols Copyright © 2010, Elsevier Inc. All rights.
Advertisements

CCNA – Network Fundamentals
© 2007 Cisco Systems, Inc. All rights reserved.Cisco Public ITE PC v4.0 Chapter 1 1 OSI Transport Layer Network Fundamentals – Chapter 4.
CSCI 4550/8556 Computer Networks
CS 6401 Transport Control Protocol Outline TCP objectives revisited TCP basics New algorithms for RTO calculation.
Computer Networks Chapter 5: End-to-End Protocols
1 Chapter 5 End-to-End Protocols Outline 5.1 UDP 5.2 TCP 5.3 Remote Procedure Call.
1 Computer Networks: A Systems Approach, 5e Larry L. Peterson and Bruce S. Davie Chapter 5 End-to-End Protocols Copyright © 2010, Elsevier Inc. All rights.
8. Transport Protocol and UDP 8.1 Transport protocol : End-to-end protocol –IP: Host to host packet delivery –Transport: Process to process communication.
BZUPAGES.COM 1 User Datagram Protocol - UDP RFC 768, Protocol 17 Provides unreliable, connectionless on top of IP Minimal overhead, high performance –No.
Transport Layer – TCP (Part1) Dr. Sanjay P. Ahuja, Ph.D. Fidelity National Financial Distinguished Professor of CIS School of Computing, UNF.
1 Reliable Byte-Stream (TCP) Outline Connection Establishment/Termination Sliding Window Revisited Flow Control Adaptive Timeout.
6-May-154/598N: Computer Networks End-to-End Protocols Underlying best-effort network –drop messages –re-orders messages –delivers duplicate copies of.
Computer Networks 2 Lecture 2 TCP – I - Transport Protocols: TCP Segments, Flow control and Connection Setup.
CSE Computer Networks Prof. Aaron Striegel Department of Computer Science & Engineering University of Notre Dame Lecture 14 – February 23, 2010.
Spring 2003CS 4611 Introduction, Continued COS 461.
© 2007 Cisco Systems, Inc. All rights reserved.Cisco Public 1 Version 4.0 OSI Transport Layer Network Fundamentals – Chapter 4.
CSE 124 Networked Services Fall 2009 B. S. Manoj, Ph.D 10/20/20091CSE 124 Networked Services Fall 2009 Some.
CSE 461: Sliding Windows & ARQ. Next Topic  We begin on the Transport layer  Focus  How do we send information reliably?  Topics  The Transport layer.
Spring 2003CS 4611 Reliable Byte-Stream (TCP) Outline Connection Establishment/Termination Sliding Window Revisited Flow Control Adaptive Timeout.
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Transport Protocols Slide 1 Transport Protocols.
TCP. Learning objectives Reliable Transport in TCP TCP flow and Congestion Control.
Spring 2002CS 4611 Reliable Byte-Stream (TCP) Outline Connection Establishment/Termination Sliding Window Revisited Flow Control Adaptive Timeout.
Gursharan Singh Tatla Transport Layer 16-May
Process-to-Process Delivery:
Fall 2009COSC 6501 Welcome to COSC650 Towson University Yanggon Kim.
1 Transport Layer Computer Networks. 2 Where are we?
1 Chapter 1 OSI Architecture The OSI 7-layer Model OSI – Open Systems Interconnection.
TCP : Transmission Control Protocol Computer Network System Sirak Kaewjamnong.
1 Internet Engineering University of ilam Dr. Mozafar Bag-Mohammadi Transport Layer.
SMUCSE 4344 transport layer. SMUCSE 4344 transport layer end-to-end protocols –transport code runs only on endpoint hosts encapsulates network communications.
Fundamentals of Computer Networks ECE 478/578 Lecture #19: Transport Layer Instructor: Loukas Lazos Dept of Electrical and Computer Engineering University.
TCP1 Transmission Control Protocol (TCP). TCP2 Outline Transmission Control Protocol.
The Transmission Control Protocol (TCP) Application Services (Telnet, FTP, , WWW) Reliable Stream Transport (TCP) Connectionless Packet Delivery.
Transport Layer Moving Segments. Transport Layer Protocols Provide a logical communication link between processes running on different hosts as if directly.
1 Introduction to Computer Networks University of ilam Dr. Mozafar Bag-Mohammadi Transport Layer.
CSE Computer Networks Prof. Aaron Striegel Department of Computer Science & Engineering University of Notre Dame Lecture 14 – February 23, 2010.
CSE 331: Introduction to Networks and Security Fall 2000 Instructor: Carl A. Gunter Slide Set 5.
Networking Basics CCNA 1 Chapter 11.
Spring 2002CS 4611 Introduction Outline Statistical Multiplexing Inter-Process Communication Network Architecture Performance Metrics Implementation Issues.
1 Reliable Byte-Stream (TCP) Outline Connection Establishment/Termination Sliding Window Revisited Flow Control Adaptive Timeout.
1 Introduction Outline Statistical Multiplexing Inter-Process Communication Network Architecture Performance Metrics Implementation Issues.
Transport Protocols.
1 Transport Layer: Basics Outline Intro to transport UDP Congestion control basics.
IP1 The Underlying Technologies. What is inside the Internet? Or What are the key underlying technologies that make it work so successfully? –Packet Switching.
1 Reliable Byte-Stream (TCP) Outline Connection Establishment/Termination Sliding Window Revisited Flow Control Adaptive Timeout.
Ilam University Dr. Mozafar Bag-Mohammadi 1 Transport Layer.
CSE/EE 461 Sliding Windows and ARQ. 2 Last Time We finished up the Network layer –Internetworks (IP) –Routing (DV/RIP, LS/OSPF) It was all about routing:
1 End-to-End Protocols UDP TCP –Connection Establishment/Termination –Sliding Window Revisited –Flow Control –Congestion Control –Adaptive Timeout.
TCP/IP1 Address Resolution Protocol Internet uses IP address to recognize a computer. But IP address needs to be translated to physical address (NIC).
11 CS716 Advanced Computer Networks By Dr. Amir Qayyum.
Ch 3. Transport Layer Myungchul Kim
3. END-TO-END PROTOCOLS (PART 1) Rocky K. C. Chang Department of Computing The Hong Kong Polytechnic University 22 March
Univ. of TehranIntroduction to Computer Network1 An Introduction Computer Networks An Introduction to Computer Networks University of Tehran Dept. of EE.
Advanced Computer Networks
Transport Control Protocol
5. End-to-end protocols (part 1)
Chapter 5 TCP Sliding Window
The University of Adelaide, School of Computer Science
TCP Overview Connection-oriented Byte-stream Full duplex
Transport Control Protocol
Advanced Computer Networks
Reliable Byte-Stream (TCP)
Ilam University Dr. Mozafar Bag-Mohammadi
The University of Adelaide, School of Computer Science
Introduction to Computer Networks
Introduction to Computer Networks
Introduction to Computer Networks
Transport Protocols: TCP Segments, Flow control and Connection Setup
Transport Layer 9/22/2019.
Presentation transcript:

TDC561 Network Programming Camelia Zlatea, PhD Week 10: Performance Aspects of End-to-End (Transport) Protocols and API Programming

Page 2 Network Programming (TDC561)Winter 2003  Underlying best-effort network –drops messages –re-orders messages –delivers duplicate copies of a given message –limits messages to some finite size –delivers messages after an arbitrarily long delay  Common end-to-end services –guarantee message delivery –deliver messages in the same order they are sent –deliver at most one copy of each message –support arbitrarily large messages –support synchronization –allow the receiver to apply flow control to the sender –support multiple application processes on each host End-to-End (Transport) Protocols

Page 3 Network Programming (TDC561)Winter 2003 Simple Demultiplexor (UDP)  Unreliable and unordered datagram service  Adds multiplexing  No flow control  Endpoints identified by ports –servers have well-known ports –see /etc/services on Unix  Optional checksum –pseudo header + udp header + data  Header format SrcPortDstPort ChecksumLength Data 01631

Page 4 Network Programming (TDC561)Winter 2003 Application process Application process Application process UDP Packets arrive Ports Queues Packets demultiplexed Simple Demultiplexor (UDP)

Page 5 Network Programming (TDC561)Winter 2003 Reliable Byte-Stream (TCP)  Connection-oriented  Byte-stream –sending process writes some number of bytes –TCP breaks into segments and sends via IP –receiving process reads some number of bytes  Full duplex  Flow control: keep sender from overrunning receiver  Congestion control: keep sender from overrunning network

Page 6 Network Programming (TDC561)Winter 2003 Application process Write bytes TCP Send buffer Segment Transmit segments Application process Read bytes TCP Receive buffer … …… Reliable Byte-Stream (TCP)

Page 7 Network Programming (TDC561)Winter 2003 End-to-End Issues Based on sliding window protocol used at data link level, but the situation is very different.  Potentially connects many different hosts –need explicit connection establishment and termination  Potentially different RTT (Round Trip Time) –need adaptive timeout mechanism  Potentially long delay in network –need to be prepared for arrival of very old packets  Potentially different capacity at destination –need to accommodate different amounts of buffering  Potentially different network capacity –need to be prepared for network congestion

Page 8 Network Programming (TDC561)Winter 2003 Segment Format  Each connection identified with 4-tuple: –  Sliding window + flow control –Acknowledgment, SequenceNum, AdvertisedWindow  Flags: SYN, FIN, RESET, PUSH, URG, ACK  Checksum: pseudo header + tcp header + data Sender Data(SequenceNum) Acknowledgment + AdvertisedWindow Receiver

Page 9 Network Programming (TDC561)Winter 2003 TCP Sliding Window Revisited Sending application LastByteWritten TCP LastByteSentLastByteAcked Receiving application LastByteRead TCP LastByteRcvdNextByteExpected (a)(b)  Relationship between TCP send buffer (a) and receive buffer (b)  Each byte has a sequence number  ACKs are cumulative

Page 10 Network Programming (TDC561)Winter 2003  Sending side –LastByteAcked <= LastByteSent –LastByteSent <= LastByteWritten –bytes between LastByteAcked and LastByteWritten must be buffered  Receiving side –LastByteRead < NextByteExpected –NextByteExpected <= LastByteRcvd + 1 –bytes between NextByteRead and LastByteRcvd must be buffered TCP Sliding Window Revisited

Page 11 Network Programming (TDC561)Winter 2003 Flow Control  Sender buffer size: MaxSendBuffer  Receive buffer size: MaxRcvBuffer  Receiving side –LastByteRcvd - NextByteRead Š MaxRcvBuffer –AdvertisedWindow = MaxRcvBuffer - (LastByteRcvd - NextByteRead)  Sending side –NextByteExpected Š LastByteRcvd + 1 –LastByteSent - LastByteAcked Š AdvertisedWindow –EffectiveWindow = AdvertisedWindow - (LastByteSent - LastByteAcked) –LastByteWritten - LastByteAcked Š MaxSendBuffer –block sender if (LastByteWritten - LastByteAcked) + y > MaxSendBuffer  Always send ACK in response to an arriving data segment  Persist when AdvertisedWindow=0

Page 12 Network Programming (TDC561)Winter 2003 Bandwidth Delay/Latency Network as a Pipe

Page 13 Network Programming (TDC561)Winter 2003 Keeping the Pipe Full  TCP Correctness and Performance Aspect –Size of the SequenceNum and AdvertizedWindow affects the correctness and performance of TCP –Wrap Around: 32-bit SequenceNum –Bandwidth & Time Until Wrap Around Bandwidth T1 (1.5Mbps) Ethernet (10Mbps) T3 (45Mbps) FDDI (100Mbps) STS-3 (155Mbps) STS-12 (622Mbps) STS-24 (1.2Gbps) Time Until Wrap Around 6.4 hours 57 minutes 13 minutes 6 minutes 4 minutes 55 seconds 28 seconds

Page 14 Network Programming (TDC561)Winter 2003  TCP Correctness and Performance Aspect –Bytes in Transit: 16-bit AdvertisedWindow ( up to 64KBytes) –AdvertisedWindow large enough to allow sender to keep the pipe full (Delay x Bandwidth) Product –Bandwidth and (Delay x Bandwidth) Product dictates how big AdvertisedWindow needs to be –Required window size for 100ms RTT  TCP protocol extensions Bandwidth T1 (1.5Mbps) Ethernet (10Mbps) T3 (45Mbps) FDDI (100Mbps) STS-3 (155Mbps) STS-12 (622Mbps) STS-24 (1.2Gbps) Delay x Bandwidth Product 18KB 122KB 549KB 1.2MB 1.8MB 7.4MB 14.8MB Keeping the Pipe Full

Page 15 Network Programming (TDC561)Winter 2003  Separate the implementation of protocols from the interface they export.  Important at the transport layer since this defines the point where application programs typically access the network.  This interface is often called the application programming interface, or API. Notes  The API is usually defined by the OS.  Example API: sockets  Defined by BSD Unix, but ported to other systems Application Programming Interface API Application Transport protocol

Page 16 Network Programming (TDC561)Winter 2003 Socket Operations  Creating a socket –int socket(int domain, int type, int protocol) –domain=AF_INET, PF_UNIX –type=SOCK_STREAM, SOCK_DGRAM  Passive open on server int bind(int socket, struct sockaddr *address, int addr_len) int listen(int socket, int backlog) int accept(int socket, struct sockaddr *address, int *addr_len)  Active open on client int connect(int socket, struct sockaddr *address, int addr_len)  Sending and receiving messages int write(int socket, char *message, int msg_len, int flags) int read(int socket, char *buffer, int buf_len, int flags)

Page 17 Network Programming (TDC561)Winter 2003 Performance

Page 18 Network Programming (TDC561)Winter 2003 Performance Overview  Bandwidth –a measure of of the width of a frequency band »voice grade telephone line supports a frequency band ranging from 300MHz to 3300MHz ; it is said to have”a bandwidth” of 3000MHZ; when given in Hz, it probably refers to the range of signals that can be accommodated. –Bandwidth of a communication link = number of bits per second that can be transmitted on that link. »ETH bandwidth is 10Mbps »available bandwidth »Measured bandwidth = number of bits per second that can be actually transmitted on that link, in practice »Throughput = Measured Performance of a system A pair of nodes connected by a link with a bandwidth of 10Mbs might achieve a throughput of 2Mbps; an application on one host could sedn data to the other host at 2Mbps. –Bandwidth requirements for an application »Number of bits per second that it needs to transmit over the network to perform acceptably

Page 19 Network Programming (TDC561)Winter , RTT (ms) 1-MB object, 1.5-Mbps link 1-MB object, 10-Mbps link 2-KB object, 1.5-Mbps link 2-KB object, 10-Mbps link 1-byte object, 1.5-Mbps link 1-byte object, 10-Mbps link Perceived latency (ms) Latency (Response Time, delay) vs. RTT Latency = Propagation + Transmit + Queue

Page 20 Network Programming (TDC561)Winter 2003 Source 1-Mbps crosscountry link Destination.1 Mb (a) 84 pipes full of data = 8.4Mb file (b) 1/12 of one pipe full of data = 8.4Mb file Source 1-Gbps crosscountry link Destination 8.4 Mb … Performance Overview Latency and Bandwidth

Page 21 Network Programming (TDC561)Winter 2003 Performance Overview  1Mbps and 1Gbps links have the same latency –limited by the speed of light  To transfer a 1MB file takes... –100ms RTTs on a 1Mbps link –doesn't fill a 1Gbps link (12.5MB delay x bandwidth)  In other words: –1MB file is to 1Gbps network what 1KB packet is to 1Mbps network Bandwidth Delay/Latency

Page 22 Network Programming (TDC561)Winter 2003 Latency/Bandwidth Tradeoff  Throughput = TransferSize / TransferTime –if it takes 10ms to transfer 1MB, then the effective throughput is 1MB/10ms = 100MBps = 800Mbps  TransferTime = Latency + 1/Bandwidth x TransferSize –if network bandwidth is 1Gbps (it takes 1/1Gbps x 1MB = 0.8ms to transmit 1MB), an end-to-end transfer that requires 1 RTT of 100ms has a total transfer time of 100.8ms –effective throughput is 1MB/100.8ms = 79.4Mbps, not 1Gbps

Page 23 Network Programming (TDC561)Winter 2003 Round-Trip Latency (  s) Per-Layer Latency (1 byte latency)  ETH + wire: 216  s  UDP/IP: 58  s Message size (bytes) UDP TCP IP PHY ETH App2 UDP App1 TCP

Page 24 Network Programming (TDC561)Winter 2003 Throughput (UDP/IP/ETH) Throughput (Mbps) Message size (KB)  Throughput improves as the message get larger, up to a limit when per-message overhead becomes insignificant = message overhead/number of bytes = ~16KB  Flattens at ~9.5Mbps < ETH 10Mbs

Page 25 Network Programming (TDC561)Winter 2003  Notes –transferring a large amount of data helps improve the effective throughput; in the limit, an infinitely large transfer size causes the effective throughput to approach the network bandwidth –having to endure more than one RTT will hurt the effective throughput for any transfer of finite size, and will be most noticeable for small transfers

Page 26 Network Programming (TDC561)Winter 2003 Implications  Congestion control –feedback based mechanisms require an RTT to adjust –can send 10MB in one 100ms RTT on a 1Gbps network –that 10MB might congest a router and lead to massive losses –can lose half a delay x bandwidth's of data during slow start –reservations work for continuous streams (e.g., video), but require an extra RTT for bulk transfers  Retransmissions –retransmitting a packet costs 1 RTT –dropping even one packet (cell) halves effective bandwidth –retransmission also implies buffering at the sender –possible solution: forward error correction (FEC)  Trading bandwidth for latency –each RTT is precious –willing to “waste” bandwidth to save latency –example: pre-fetching

Page 27 Network Programming (TDC561)Winter 2003 Host Memory Bottleneck  Issue –turning host-to-host bandwidth into application- to-application bandwidth –have to deliver data across I/O and memory buses into cache and registers

Page 28 Network Programming (TDC561)Winter 2003  Memory bandwidth –I/O bus must keep up with network speed (currently does for STS-12, assuming peak rate is achievable) –114MBps (measured number) is only slightly faster than I/O bus; can't afford to go across memory bus twice –caches are of questionable value (rather small) –lots of reason to access buffers »user/kernel boundary »certain protocols (reassembly, check-summing) »network device and its driver  Same latency/bandwidth problems as high- speed networks

Page 29 Network Programming (TDC561)Winter 2003 Integrated Services  High-speed networks have enabled new applications –they also need “deliver on time” assurances from the network  Applications that are sensitive to the timeliness of data are called real-time applications –voice –video –industrial control  Timeliness guarantees must come from inside the network –end-hosts cannot correct late packets like they can correct for lost packets  Need more than best-effort –IETF is standardizing extensions to best-effort model