Multiple unconnected networks

Similar documents
CS457 Transport Protocols. CS 457 Fall 2014

Flow and Congestion Control

Transport Protocols Reading: Sections 2.5, 5.1, and 5.2. Goals for Todayʼs Lecture. Role of Transport Layer

Transport Protocols Reading: Sections 2.5, 5.1, and 5.2

Transmission Control Protocol. ITS 413 Internet Technologies and Applications

Transport Protocols Reading: Sections 2.5, 5.1, and 5.2

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

User Datagram Protocol

User Datagram Protocol (UDP):

Transport layer. UDP: User Datagram Protocol [RFC 768] Review principles: Instantiation in the Internet UDP TCP

Transport layer. Review principles: Instantiation in the Internet UDP TCP. Reliable data transfer Flow control Congestion control

Goals for Today s Lecture

6.1 Internet Transport Layer Architecture 6.2 UDP (User Datagram Protocol) 6.3 TCP (Transmission Control Protocol) 6. Transport Layer 6-1

Announcements Computer Networking. Outline. Transport Protocols. Transport introduction. Error recovery & flow control. Mid-semester grades

CNT 6885 Network Review on Transport Layer

Outline. TCP: Overview RFCs: 793, 1122, 1323, 2018, steam: r Development of reliable protocol r Sliding window protocols

Outline. TCP: Overview RFCs: 793, 1122, 1323, 2018, Development of reliable protocol Sliding window protocols

Introduction to TCP/IP networking

Lecture 8. TCP/IP Transport Layer (2)

CSCI-GA Operating Systems. Networking. Hubertus Franke

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

EE 122: Transport Protocols. Kevin Lai October 16, 2002

TSIN02 - Internetworking

ECE 650 Systems Programming & Engineering. Spring 2018

Introduction to Networks and the Internet

Congestion / Flow Control in TCP

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

Fall 2012: FCM 708 Bridge Foundation I

Outline Computer Networking. Functionality Split. Transport Protocols

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

IP Packet Switching. Goals of Todayʼs Lecture. Simple Network: Nodes and a Link. Connectivity Links and nodes Circuit switching Packet switching

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

CSCD 330 Network Programming Winter 2015

Communication Networks

Chapter 3 outline. 3.5 Connection-oriented transport: TCP. 3.6 Principles of congestion control 3.7 TCP congestion control

TCP : Fundamentals of Computer Networks Bill Nace

COMP/ELEC 429/556 Introduction to Computer Networks

Announcements. IP Forwarding & Transport Protocols. Goals of Today s Lecture. Are 32-bit Addresses Enough? Summary of IP Addressing.

UNIT IV -- TRANSPORT LAYER

CS 5520/ECE 5590NA: Network Architecture I Spring Lecture 13: UDP and TCP

Transport Over IP. CSCI 690 Michael Hutt New York Institute of Technology

CS4700/CS5700 Fundamentals of Computer Networks

EE 122: IP Forwarding and Transport Protocols

ECE 333: Introduction to Communication Networks Fall 2001

Department of Computer and IT Engineering University of Kurdistan. Transport Layer. By: Dr. Alireza Abdollahpouri

Announcements Computer Networking. What was hard. Midterm. Lecture 16 Transport Protocols. Avg: 62 Med: 67 STD: 13.

TCP Review. Carey Williamson Department of Computer Science University of Calgary Winter 2018

TSIN02 - Internetworking

Suprakash Datta. Office: CSEB 3043 Phone: ext Course page:

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

Sequence Number. Acknowledgment Number. Data

Lecture 5. Transport Layer. Transport Layer 1-1

Information Network 1 TCP 1/2. Youki Kadobayashi NAIST

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

Correcting mistakes. TCP: Overview RFCs: 793, 1122, 1323, 2018, TCP seq. # s and ACKs. GBN in action. TCP segment structure

CS 43: Computer Networks. 19: TCP Flow and Congestion Control October 31, Nov 2, 2018

ITS323: Introduction to Data Communications

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

CSC 634: Networks Programming

CSC 401 Data and Computer Communications Networks

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

Transport Protocols and TCP

Flow and Congestion Control (Hosts)

Lecture 11. Transport Layer (cont d) Transport Layer 1

Chapter 2 - Part 1. The TCP/IP Protocol: The Language of the Internet

ADVANCED COMPUTER NETWORKS

TCP. CSU CS557, Spring 2018 Instructor: Lorenzo De Carli (Slides by Christos Papadopoulos, remixed by Lorenzo De Carli)

Outline Computer Networking. TCP slow start. TCP modeling. TCP details AIMD. Congestion Avoidance. Lecture 18 TCP Performance Peter Steenkiste

Transmission Control Protocol (TCP)

ECE4110 Internetwork Programming. Introduction and Overview

Two approaches to Flow Control. Cranking up to speed. Sliding windows in action

Conges'on Control Reading: Sec'ons

Networking Technologies and Applications

Chapter 3- parte B outline

ETSF05/ETSF10 Internet Protocols Transport Layer Protocols

Lecture 3: The Transport Layer: UDP and TCP

Communication Networks

Chapter 5 End-to-End Protocols

Application. Transport. Network. Link. Physical

The Transport Layer: TCP & Reliable Data Transfer

The Transmission Control Protocol (TCP)

Overview. Internetworking and Reliable Transmission. CSE 561 Lecture 3, Spring David Wetherall. Internetworking. Reliable Transmission

TCP Basics : Computer Networking. Overview. What s Different From Link Layers? Introduction to TCP. TCP reliability Assigned reading

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

TCP/IP Protocol Suite 1

Computer Networking Introduction

TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581

CC451 Computer Networks

Transport Layer: Outline

05 Transmission Control Protocol (TCP)

Different Layers Lecture 20

CE693 Advanced Computer Networks

CCNA 1 Chapter 7 v5.0 Exam Answers 2013

TCP so far Computer Networking Outline. How Was TCP Able to Evolve

Transport Layer: outline

Recap. TCP connection setup/teardown Sliding window, flow control Retransmission timeouts Fairness, max-min fairness AIMD achieves max-min fairness

Transport Protocols & TCP TCP

What is TCP? Transport Layer Protocol

No book chapter for this topic! Slides are posted online as usual Homework: Will be posted online Due 12/6

Transport protocols. Transport Layer 3-1

Transcription:

TCP/IP

Life in the Early 1970s Multiple unconnected networks ARPAnet Data-over-cable Packet satellite (Aloha) Packet radio ARPAnet satellite net

Differences Across Packet-Switched Networks Addressing Maximum packet size Timing for handling success/failure of delivery Handling of lost or corrupted data Routing, fault detection, status information, ARPAnet satellite net

Where to Handle Heterogeneity? Application process? End host? Packet switches? Someplace else? Compatible process and host conventions Obviate the need to support all combinations Retain the unique features of each network Avoid changing the local network components Introduce the notion of a gateway

Gateways Between Different Kinds of Networks Internetwork layer Internetwork appears as a single, uniform entity Despite the heterogeneity of the local networks Network of networks Gateway Embed internetwork packets in local packet format or extract them Route (at internetwork level) to next gateway gateway ARPAnet satellite net

Internetwork Packet Format internetwork header local header source address dest. address seq. # byte count flag field text checksum Internetwork header in standard format Interpreted by the gateways and end hosts Source and destination addresses Uniformly and uniquely identify every end point Ensure proper sequencing of the data Include a sequence number and byte count

Process-Level Communication Enable pairs of processes to communicate Full duplex Unbounded but finite-length messages E.g., keystrokes or a file Key ideas Port numbers to (de)multiplex packets Breaking messages into segments Sequence numbers and reassembly Retransmission and duplicate detection Window-based flow control

Differences in Max Packet Size Select smallest packet size as the new max? Coordinate to determine max size on a path? Enable gateway to fragment a large packet? Reassembly by the next gateway? The receiver? Design trade-offs Coordination overhead for identifying the max Overhead of sending many small packets Overhead of buffering packets for reassembly

Separating IP from TCP Original implementation Only supported ordered reliable byte stream Fine for file transfer and remote login Less appropriate for other applications Interactive applications like voice Let application decide whether/how to handle loss Reorganization of the original TCP IP: addressing/forwarding of individual packets TCP: services such as flow control & loss recovery Alternative transport protocols, e.g., UDP

IP Packets

IP Packet Structure (for IPv4 Packets) 4-bit Version 4-bit Header Length 8-bit Type of Service (TOS) 16-bit Total Length (Bytes) 16-bit Identification 3-bit Flags 13-bit Fragment Offset 8-bit Time to Live (TTL) 8-bit Protocol 16-bit Header Checksum 32-bit Source IP Address 32-bit Destination IP Address Options (if any) Payload

IP Header: Version, Length, ToS Version number (4 bits) Indicates the version of the IP protocol Necessary to know what other fields to expect E.g. 4 (for IPv4), and sometimes 6 (for IPv6) Header length (4 bits) Number of 32-bit words in the header Typically 5 (for a 20-byte IPv4 header) Can be more when IP options are used Type-of-Service (8 bits) Allow differential treatment of packets E.g., low delay versus high bandwidth

IP Header: Length, Fragments, TTL Total length (16 bits) Number of bytes in the packet Maximum size is 63,535 bytes (2 16-1) though underlying link may impose harder limits Fragmentation information (32 bits) Packet identifier, flags, and fragment offset Supports dividing a large IP packet into fragments in case a link cannot handle a large IP packet Time-To-Live (8 bits) Used to identify packets stuck in forwarding loops and eventually discard them from the network

IP Header Fields: Transport Protocol Protocol (8 bits) Identifies the higher-level protocol E.g., 6 for Transmission Control Protocol E.g., 17 for the User Datagram Protocol Needed for demultiplexing at receiving host Indicates what kind of header to expect next protocol=6 IP header TCP header protocol=17 IP header UDP header

IP Header: Checksum on the Header Checksum (16 bits) Sum of all 16-bit words in the IP packet header If any bits of the header are corrupted in transit the checksum won t match at receiving host Receiving host discards corrupted packets Sending host will retransmit the packet, if needed 134 + 212 = 346 134 + 216 = 350 Mismatch!

IP Header: To and From Addresses Two IP addresses Source IP address (32 bits) Destination IP address (32 bits) Destination address Unique identifier for the receiving host Each node can make forwarding decisions Source address Unique identifier for the sending host Recipient decides whether to accept packet Enables recipient to reply back to source

Transport Protocols

Role of Transport Layer Application layer Between applications (e.g., browsers and servers) E.g., HyperText Transfer Protocol, File Transfer Protocol, Network News Transfer Protocol, Transport layer Between processes (e.g., sockets) Relies on network layer, & serves application layer E.g., TCP and UDP Network layer Between nodes (e.g., routers and hosts) Hides details of the link technology E.g., IP

Two Basic Transport Features Demultiplexing: port numbers Client host Client Service request for 128.2.194.242:80 (i.e., the Web server) Server host 128.2.194.242 OS Web server (port 80) Echo server (port 7) Error detection: checksums IP payload detect corruption

User Datagram Protocol (UDP) Datagram messaging service Demultiplexing of messages: port numbers Detecting corrupted messages: checksum Lightweight communication between processes Send messages to and receive them from a socket Avoid overhead and delays of ordered, reliable delivery SRC port checksum DST port length DATA

Why Would Anyone Use UDP? Fine control over whether and when data are sent As soon as an application process writes into the socket UDP will package the data and send the packet No delay for connection establishment UDP just blasts away without any formal preliminaries which avoids introducing any unnecessary delays No connection state No allocation of buffers, parameters, sequence #s, etc. making it easier to handle many active clients at once Small packet header overhead UDP header is only eight-bytes long

Transmission Control Protocol (TCP) Stream-of-bytes service Sends and receives a stream of bytes, not messages Reliable, in-order delivery Checksums to detect corrupted data Sequence numbers to detect losses and reorder data Acknowledgments & retransmissions for reliable delivery Connection oriented Explicit set-up and tear-down of TCP session Flow control Prevent overflow of the receiver s buffer space Congestion control (came in late 1980s) Adapt to network congestion for the greater good

Transmission Control Protocol (TCP)

TCP Segment IP Data TCP Data (segment) TCP Hdr IP Hdr IP packet No bigger than Maximum Transmission Unit (MTU) E.g., up to 1500 bytes on an Ethernet TCP packet IP packet with a TCP header and data inside TCP header is typically 20 bytes long TCP segment No more than Maximum Segment Size (MSS) bytes E.g., up to 1460 consecutive bytes from the stream

TCP Header Source port Destination port Flags: SYN FIN RST PSH URG ACK Sequence number Acknowledgment HdrLen 0 Flags Advertised window Checksum Urgent pointer Options (variable) Data

TCP Header: Ports and Seq/Ack Numbers Identifying the process end-point Source port Destination port Delivering ordered reliable byte stream Sequence number: # of first byte in the segment Acknowledgment: # of next expected byte Sequence number = 1 st byte TCP Data Acknowledgment number = next byte

Header length TCP Header: Length and Flags Size of the TCP header Usually 20 bytes, but higher if options are used Flags to piggyback information SYN: open connection FIN: close connection RST: abort connection ACK: acknowledgment (in acknowledgement #) PSH: not important URG: not important (relates to Urgent pointer)

TCP Header: Checksum and Window Checksum Detect corruption of the TCP header and segment Advertised window Additional data the receiver can receive Window Size Data ACK d Outstanding Un-ack d data Data OK to send Data not OK to send yet

TCP Support for Reliable Delivery Detect missing data: sequence number Used to detect a gap in the stream of bytes... and for putting the data back in order Detect bit errors: checksum Used to detect corrupted data at the receiver leading the receiver to drop the packet Recover from lost data: retransmission Sender retransmits lost or corrupted data Two main ways to detect lost packets Retransmission timeout and fast retransmission

Automatic Repeat request (ARQ) Automatic Repeat request Receiver sends acknowledgment (ACK) when it receives packet Sender waits for ACK and timeouts if it does not arrive within some time period Simplest ARQ protocol Stop and wait Send a packet, stop and wait until ACK arrives Time Sender Timeout Receiver

Reasons for Retransmission Timeout Timeout Timeout Timeout Timeout Timeout Packet lost ACK lost DUPLICATE PACKET Early timeout DUPLICATE PACKETS

Fast Retransmission Better solution possible under sliding window Although packet n might have been lost packets n+1, n+2, and so on might get through Idea: have the receiver send ACK packets ACK says that receiver is still awaiting n th packet And repeated ACKs suggest later packets have arrived Sender can view the duplicate ACKs as an early hint that the n th packet must have been lost and perform the retransmission early Fast retransmission Sender retransmits data after the triple duplicate ACK

TCP Congestion Control

Congestion is Unavoidable in IP Best-effort delivery Let everybody send Try to deliver what you can and just drop the rest If many packets arrive in short period of time The node cannot keep up with the arriving traffic and the buffer may eventually overflow

The Problem of Congestion What is congestion? Load is higher than capacity What do IP routers do? Drop the excess packets Why is this bad? Wasted bandwidth for retransmissions Goodput Load congestion collapse Increase in load that results in a decrease in useful work done.

Many Important Questions How does the sender know there is congestion? Explicit feedback from the network? Inference based on network performance? How should the sender adapt? Explicit sending rate computed by the network? End host coordinates with other hosts? End host thinks globally but acts locally? What is the performance objective? Maximizing goodput, even if some users suffer more? Fairness? How fast should new TCP senders send?

Inferring From Implicit Feedback? What does the end host see? Round-trip loss Round-trip delay

Host Adapts Sending Rate Over Time Congestion window Maximum number of bytes to have in transit I.e., # of bytes still awaiting acknowledgments Upon detecting congestion Decrease the window size (e.g., divide in half) End host does its part to alleviate the congestion Upon not detecting congestion Increase the window size, a little at a time And see if the packets are successfully delivered End host learns whether conditions have changed

Leads to the TCP Sawtooth Window size Loss halved Time

Receiver Window vs. Congestion Window Flow control Keep a fast sender from overwhelming a slow receiver Congestion control Keep a set of senders from overloading the network Different concepts, but similar mechanisms TCP flow control: receiver window TCP congestion control: congestion window TCP window: min{congestion window, receiver window}

How Should a New Flow Start Need to start with a small CWND to avoid overloading the network. Window But, could take a long time to get started! t

Slow Start Phase Start with a small congestion window Initially, CWND is 1 Max Segment Size (MSS) So, initial sending rate is MSS/RTT That could be pretty wasteful Might be much less than the actual bandwidth Linear increase takes a long time to accelerate Slow-start phase Sender starts at a slow rate (hence the name) but increases the rate exponentially until the first loss event

Slow Start and the TCP Sawtooth Window Loss Exponential slow start Why is it called slow-start? Because TCP originally had no congestion control mechanism. The source would just start by sending a whole receiver window s worth of data. t

Timeout Two Kinds of Loss in TCP Packet n is lost and detected via a timeout E.g., because all packets in flight were lost After timeout, blasting away for the entire CWND would trigger a very large burst in traffic So, better to start over with a low CWND Triple duplicate ACK Packet n is lost, but packets n+1, n+2, etc. arrive Receiver sends duplicate acknowledgments And the sender retransmits packet n quickly Do a multiplicative decrease and keep going

Repeating Slow Start After Timeout Window timeout Slow start in operation until it reaches half of previous cwnd. Slow-start restart: Go back to CWND of 1, but take advantage of knowing the previous value of CWND. t

What About Inefficiency? TCP congestion control is not very efficient The sawtooth behavior is wasteful Short flows never ramp up to max rate Poor performance on high-bandwidth paths Poor performance on long-rtt paths Ongoing work on improvements to TCP Better information about network conditions Measurement of available bandwidth on a path Explicit feedback from the routers Better performance under high bandwidth-delay product (e.g., bulk data transfer between labs)

What About Cheating? Some folks are more fair than others Running multiple TCP connections in parallel Modifying the TCP implementation in the OS Use the User Datagram Protocol (UDP) What is the impact Good guys slow down to make room for you You get an unfair share of the bandwidth Possible solutions? Routers detect cheating and drop excess packets? Peer pressure? Move congestion control to the network?

Limitations on TCP Performance Round-trip time Throughput proportional to 1/RTT Receiver window Throughput is limited by window/rtt Slow start and additive increase Certain number of RTTs needed to send the data, even in the absence of any congestion Packet loss and congestion window decreases Throughput proportional to 1/sqrt(loss) Duplicate ACKs don t happen for short transfers and bursty loss, and timeout losses are expensive

Questions About Congestion Control What should be the goal? Efficient use of network resources? Fair division of the network resources across flows? (With or without consideration of RTTs?) Minimizing the time for flows to complete? How should sources infer congestion? Packet loss (as in TCP Reno)? Packet delay (as in TCP Vegas and FAST TCP)? Probing to measure available bandwidth? How should sources adapt sending rates? Additive increase, multiplicative decrease? Explicit instruction from the network?

Questions About Router Support Should routers help sources infer congestion? Only implicitly by dropping and delaying packets? Dropping packets early to warn of congestion? Should routers give explicit feedback? Marking packets early to warn of congestion? Multiple bits to signal the level of congestion? Should routers help in adapting sending rates? Explicit assignment of sending rates to sources? Should routers schedule packets at the flow level? From FIFO queuing to weighted fair queuing? Should routers move traffic to other paths? Load-sensitive routing to alleviate congestion?

Measurement and Modeling of TCP Rich area of research Measurement of congestion control Simulation of variants of TCP congestion control Modeling of throughput as a function of loss Reverse engineering and design using optimization theory and control theory Models of fairness from the economics literature