Winter 2008CS244a Handout #61 CS244a: An Introduction to Computer Networks Handout 6: The Transport Layer, Transmission Control Protocol (TCP), and User.

Slides:



Advertisements
Similar presentations
CS144 Review Session 4 April 25, 2008 Ben Nham
Advertisements

Introduction 1 Lecture 13 Transport Layer (Transmission Control Protocol) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer.
Courtesy: Nick McKeown, Stanford Umar Kalim, NIIT Robin Kravets, UIUC 1 Transmission Control Protocol (TCP), Tahir Azim.
© 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
Transmission Control Protocol (TCP)
Guide to TCP/IP, Third Edition
Fundamentals of Computer Networks ECE 478/578 Lecture #20: Transmission Control Protocol Instructor: Loukas Lazos Dept of Electrical and Computer Engineering.
UDP & TCP Where would we be without them!. UDP User Datagram Protocol.
1 CS492B Project #2 TCP Tutorial # Jin Hyun Ju.
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 Outline  The Transport Layer  The TCP Protocol (RFC 793, 1122, 1323,...)  TCP Characteristics  TCP Connection setup  TCP Segments  TCP Sequence.
Chapter 7 – Transport Layer Protocols
Computer Networks 2 Lecture 2 TCP – I - Transport Protocols: TCP Segments, Flow control and Connection Setup.
Professor Yashar Ganjali Department of Computer Science University of Toronto
CSE534 – Fundamentals of Computer Networks Lecture 8-9: Transport (UDP, but mostly TCP) Based on slides by D. Choffnes Northeastern U Revised by P. Gill.
Winter 2008CS244a Handout #21 CS244a: An Introduction to Computer Networks Handout #2: Introduction Nick McKeown Professor of Electrical Engineering and.
Transport Protocols Reading: Sections 5.1 and 5.2 COS 461: Computer Networks Spring 2011 Mike Freedman
Transport Layer 3-1 Transport Layer r To learn about transport layer protocols in the Internet: m TCP: connection-oriented protocol m Reliability protocol.
CSEE W4140 Networking Laboratory Lecture 6: TCP and UDP Jong Yul Kim
TDC375 Winter 03/04 John Kristoff - DePaul University 1 Network Protocols Transmission Control Protocol (TCP)
1 Transport Protocols Reading: Sections 2.5, 5.1, and 5.2 COS 461: Computer Networks Spring 2006 (MW 1:30-2:50 in Friend 109) Jennifer Rexford Teaching.
Computer Networks Transport Layer. Topics F Introduction  F Connection Issues F TCP.
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Transport Protocols Slide 1 Transport Protocols.
1 Reliability & Flow Control Some slides are from lectures by Nick Mckeown, Ion Stoica, Frans Kaashoek, Hari Balakrishnan, and Sam Madden Prof. Dina Katabi.
TCP. Learning objectives Reliable Transport in TCP TCP flow and Congestion Control.
Transport Layer TCP and UDP IS250 Spring 2010
1 Transport Protocols Reading: Sections 2.5, 5.1, and 5.2 COS 461: Computer Networks Spring 2008 (MW 1:30-2:50 in COS 105) Jennifer Rexford Teaching Assistants:
Gursharan Singh Tatla Transport Layer 16-May
Process-to-Process Delivery:
1 Transport Layer Computer Networks. 2 Where are we?
Protocol(TCP/IP, HTTP) 송준화 조경민 2001/03/13. Network Computing Lab.2 Layering of TCP/IP-based protocols.
TCP Transport Control Protocol Information management 2 Groep T Leuven – Information department 2/35 Introduction UDP provides the connection.
TCP : Transmission Control Protocol Computer Network System Sirak Kaewjamnong.
CS332, Ch. 26: TCP Victor Norman Calvin College 1.
SMUCSE 4344 transport layer. SMUCSE 4344 transport layer end-to-end protocols –transport code runs only on endpoint hosts encapsulates network communications.
Transport Layer Natawut Nupairoj, Ph.D. Department of Computer Engineering Chulalongkorn University.
ECE453 – Introduction to Computer Networks Lecture 14 – Transport Layer (I)
TCP1 Transmission Control Protocol (TCP). TCP2 Outline Transmission Control Protocol.
Transport Layer Moving Segments. Transport Layer Protocols Provide a logical communication link between processes running on different hosts as if directly.
T RANSPORT L AYER Dr. Nawaporn Wisitpongphan Credit: Prof. Nick McKeown
1 Introduction to Computer Networks University of ilam Dr. Mozafar Bag-Mohammadi Transport Layer.
Transport Layer Mike Freedman COS 461: Computer Networks Best-effort local packet delivery Best-effort.
81 Sidevõrgud IRT 0020 loeng okt Avo Ots telekommunikatsiooni õppetool, TTÜ raadio- ja sidetehnika inst.
1 CS 4396 Computer Networks Lab TCP – Part II. 2 Flow Control Congestion Control Retransmission Timeout TCP:
Transport Protocols.
79 Sidevõrgud IRT 4060/ IRT 0020 vooruloeng 8 / 3. nov 2004 Vooülekanne Avo Ots telekommunikatsiooni õppetool, TTÜ raadio- ja sidetehnika inst.
Retransmission. Automatic Repeat reQuest (ARQ) 2 Time Packet ACK Timeout Automatic Repeat Request –Receiver sends acknowledgment (ACK) when it receives.
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 Computer Communication & Networks Lecture 23 & 24 Transport Layer: UDP and TCP Waleed Ejaz
IT 424 Networks2 IT 424 Networks2 Ack.: Slides are adapted from the slides of the book: “Computer Networking” – J. Kurose, K. Ross Chapter 3: Transport.
Transport Layer3-1 Transport Layer If you are going through Hell Keep going.
McGraw-Hill Chapter 23 Process-to-Process Delivery: UDP, TCP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
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.
1 TCP ProtocolsLayer name DNSApplication TCP, UDPTransport IPInternet (Network ) WiFi, Ethernet Link (Physical)
Two Transport Protocols Available Transmission Control Protocol (TCP) User Datagram Protocol (UDP) Provides unreliable transfer Requires minimal – Overhead.
3. END-TO-END PROTOCOLS (PART 1) Rocky K. C. Chang Department of Computing The Hong Kong Polytechnic University 22 March
Introduction to Networks
5. End-to-end protocols (part 1)
Process-to-Process Delivery, TCP and UDP protocols
Process-to-Process Delivery
Magda El Zarki Professor, ICS UC, Irvine
Transport Protocols: TCP Segments, Flow control and Connection Setup
Introduction to Computer Networks
Transport Protocols: TCP Segments, Flow control and Connection Setup
Transport Layer 9/22/2019.
Presentation transcript:

Winter 2008CS244a Handout #61 CS244a: An Introduction to Computer Networks Handout 6: The Transport Layer, Transmission Control Protocol (TCP), and User Datagram Protocol (UDP) Nick McKeown Professor of Electrical Engineering and Computer Science, Stanford University

Winter 2008CS244a Handout #62 Outline  The Transport Layer  The TCP Protocol  TCP Characteristics  TCP Connection setup  TCP Segments  TCP Sequence Numbers  TCP Sliding Window  Timeouts and Retransmission  (Congestion Control and Avoidance)  The UDP Protocol

Winter 2008CS244a Handout #63 The Transport Layer  What is the transport layer for?  What characteristics might it have?  Reliable delivery  Flow control  …

Winter 2008CS244a Handout #64 Review of the transport layer NickDave Leland.Stanford.edu Athena.MIT.edu Network Layer Link Layer Application Layer Transport Layer O.S. HeaderDataHeaderData HD HD HD HDHD HD

Winter 2008CS244a Handout #65 Layering: The OSI Model Session Network Link Physical Application Presentation Transport Network Link Network Transport Session Presentation Application Network Link Physical Peer-layer communication layer-to-layer communication Router

Winter 2008CS244a Handout #66 Layering: Our FTP Example Network Link Transport Application Presentation Session Transport Network Link Physical The 7-layer OSI Model The 4-layer Internet model Application FTP ASCII/Binary IP TCP Ethernet

Winter 2008CS244a Handout #67 TCP Characteristics  TCP is connection-oriented.  3-way handshake used for connection setup.  TCP provides a stream-of-bytes service.  TCP is reliable:  Acknowledgements indicate delivery of data.  Checksums are used to detect corrupted data.  Sequence numbers detect missing, or mis-sequenced data.  Corrupted data is retransmitted after a timeout.  Mis-sequenced data is re-sequenced.  (Window-based) Flow control prevents over-run of receiver.  TCP uses congestion control to share network capacity among users. We’ll study this in the next lecture.

Winter 2008CS244a Handout #68 TCP is connection-oriented Connection Setup 3-way handshake (Active) Client (Passive) Server Syn Syn + Ack Ack Connection Close/Teardown 2 x 2-way handshake (Active) Client (Passive) Server Fin (Data +) Ack Fin Ack

Winter 2008CS244a Handout #69 TCP supports a “stream of bytes” service Byte 0Byte 1 Byte 2Byte 3 Byte 0Byte 1Byte 2Byte 3 Host A Host B Byte 80

Winter 2008CS244a Handout #610 …which is emulated using TCP “segments” Byte 0Byte 1 Byte 2Byte 3 Byte 0Byte 1Byte 2Byte 3 Host A Host B Byte 80 TCP Data Byte 80 Segment sent when: 1.Segment full (MSS bytes), 2.Not full, but times out, or 3.“Pushed” by application.

Winter 2008CS244a Handout #611 The TCP Segment Format IP Hdr IP Data TCP HdrTCP Data Src portDst port Sequence # Ack Sequence # HLEN 4 RSVD 6 URGACK PSH RSTSYNFIN Flags Window Size ChecksumUrg Pointer (TCP Options) TCP Data TCP Header and Data + IP Addresses Src/dst port numbers and IP addresses uniquely identify socket

Winter 2008CS244a Handout #612 Sequence Numbers Host A Host B TCP Data TCP HDR TCP HDR ISN (initial sequence number) Sequence number = 1 st byte Ack sequence number = next expected byte

Winter 2008CS244a Handout #613 Initial Sequence Numbers Connection Setup 3-way handshake (Active) Client (Passive) Server Syn +ISN A Syn + Ack +ISN B Ack

Winter 2008CS244a Handout #614 TCP Sliding Window  How much data can a TCP sender have outstanding in the network?  How much data should TCP retransmit when an error occurs? Just selectively repeat the missing data?  How does the TCP sender avoid over- running the receiver’s buffers?

Winter 2008CS244a Handout #615 TCP Sliding Window Window Size Outstanding Un-ack’d data Data OK to send Data not OK to send yet Data ACK’d  Window is meaningful to the sender.  Current window size is “advertised” by receiver (usually 4k – 8k Bytes when connection set-up).  TCP’s Retransmission policy is “Go Back N”.

Winter 2008CS244a Handout #616 TCP Sliding Window Host A Host B ACK Window Size Round-trip time (1) RTT > Window size ACK Window Size Round-trip time (2) RTT = Window size ACK Window Size ???

Winter 2008CS244a Handout #617 TCP: Retransmission and Timeouts Host A Host B ACK Round-trip time (RTT) ACK Retransmission TimeOut (RTO) Estimated RTT Data1Data2 Guard Band TCP uses an adaptive retransmission timeout value: Congestion Changes in Routing RTT changes frequently

Winter 2008CS244a Handout #618 TCP: Retransmission and Timeouts Picking the RTO is important:  Pick a values that’s too big and it will wait too long to retransmit a packet,  Pick a value too small, and it will unnecessarily retransmit packets. The original algorithm for picking RTO: 1. EstimatedRTT k =  EstimatedRTT k-1 + (1 -  ) SampleRTT 2. RTO = 2 * EstimatedRTT Characteristics of the original algorithm:  Variance is assumed to be fixed.  But in practice, variance increases as congestion increases. Determined empirically

Winter 2008CS244a Handout #619 TCP: Retransmission and Timeouts  There will be some (unknown) distribution of RTTs.  We are trying to estimate an RTO to minimize the probability of a false timeout. RTT Probability mean variance Load (Amount of traffic arriving to router) Average Queueing Delay Variance grows rapidly with load  Router queues grow when there is more traffic, until they become unstable.  As load grows, variance of delay grows rapidly.

Winter 2008CS244a Handout #620 TCP: Retransmission and Timeouts Newer Algorithm includes estimate of variance in RTT:  Difference = SampleRTT - EstimatedRTT  EstimatedRTT k = EstimatedRTT k-1 + (  *Difference)  Deviation = Deviation +  *( |Difference| - Deviation )  RTO =  * EstimatedRTT +  * Deviation   1   4 Same as before

Winter 2008CS244a Handout #621 TCP: Retransmission and Timeouts Karn’s Algorithm Retransmission Wrong RTT Sample Host AHost B Retransmission Wrong RTT Sample Host AHost B Problem: How can we estimate RTT when packets are retransmitted? Solution: On retransmission, don’t update estimated RTT (and double RTO).

Winter 2008CS244a Handout #622 User Datagram Protocol (UDP) Characteristics  UDP is a connectionless datagram service.  There is no connection establishment: packets may show up at any time.  UDP packets are self-contained.  UDP is unreliable:  No acknowledgements to indicate delivery of data.  Checksums cover the header, and only optionally cover the data.  Contains no mechanism to detect missing or mis-sequenced packets.  No mechanism for automatic retransmission.  No mechanism for flow control, and so can over-run the receiver.

Winter 2008CS244a Handout #623 User-Datagram Protocol (UDP) App A1A1 A2A2 B1B1 B2B2 UDP OS IP Like TCP, UDP uses port number to demultiplex packets

Winter 2008CS244a Handout #624 SRC port DST port checksumlength DATA User-Datagram Protocol (UDP) Packet format  Why do we have UDP?  It is used by applications that don’t need reliable delivery, or  Applications that have their own special needs, such as streaming of real-time audio/video. By default, only covers the header.