Chapter 3 Transport Layer

Similar documents
Chapter 3 Transport Layer

CSCI Topics: Internet Programming Fall 2008

Transport Layer: outline

RSC Part III: Transport Layer 3. TCP

Lecture 08: The Transport Layer (Part 2) The Transport Layer Protocol (TCP) Dr. Anis Koubaa

32 bits. source port # dest port # sequence number acknowledgement number not used. checksum. Options (variable length)

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

Transport Layer: Outline

Chapter 3 Transport Layer

Chapter 3: Transport Layer. Chapter 3 Transport Layer. Chapter 3 outline. Transport services and protocols

CSE 4213: Computer Networks II

CC451 Computer Networks

Chapter 6 Transport Layer

Chapter 3 Transport Layer

Chapter 3 outline. 3.5 connection-oriented transport: TCP segment structure reliable data transfer flow control connection management

10 minutes survey (anonymous)

The Transport Layer: TCP & Reliable Data Transfer

CS 4390 Computer Networks. Pointers to Corresponding Section of Textbook

Computer Networking Introduction

Chapter 3 Transport Layer

CMPE 150/L : Introduction to Computer Networks. Chen Qian Computer Engineering UCSC Baskin Engineering Lecture 9

CSC 401 Data and Computer Communications Networks

Chapter III: Transport Layer

CNT 6885 Network Review on Transport Layer

CSCE 463/612 Networks and Distributed Processing Spring 2017

TCP (Part 2) Session 10 INST 346 Technologies, Infrastructure and Architecture

TCP : Fundamentals of Computer Networks Bill Nace

COMP 431 Internet Services & Protocols. Transport Layer Protocols & Services Outline. The Transport Layer Reliable data delivery & flow control in TCP

CSC 4900 Computer Networks: TCP

Lecture 8. TCP/IP Transport Layer (2)

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

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

Chapter 3 Transport Layer

Chapter 3 Transport Layer

Chapter 3 Transport Layer

The Transport Layer Reliable data delivery & flow control in TCP. Transport Layer Protocols & Services Outline

The Transport Layer Reliable data delivery & flow control in TCP. Transport Layer Protocols & Services Outline

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

TCP reliable data transfer. Chapter 3 outline. TCP sender events: TCP sender (simplified) TCP: retransmission scenarios. TCP: retransmission scenarios

Go-Back-N. Pipelining: increased utilization. Pipelined protocols. GBN: sender extended FSM

Master Course Computer Networks IN2097

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

Chapter 3 Transport Layer

Transmission Control Protocol

Chapter 3- parte B outline

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

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

CC451 Computer Networks

Lecture 12: Transport Layer TCP again

By Ossi Mokryn, Based also on slides from: the Computer Networking: A Top Down Approach Featuring the Internet by Kurose and Ross

Foundations of Telematics

Chapter 3 Transport Layer

CSCD 330 Network Programming Winter 2015

Chapter 3 outline. TDTS06 Computer networks. Principles of Reliable data transfer. Reliable data transfer: getting started

TCP. 1 Administrivia. Tom Kelliher, CS 325. Apr. 2, Announcements. Assignment. Read From Last Time

Chapter 3 Transport Layer

CS Lecture 1 Review of Basic Protocols

Chapter 3 Transport Layer

TCP. TCP: Overview. TCP Segment Structure. Maximum Segment Size (MSS) Computer Networks 10/19/2009. CSC 257/457 - Fall

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

Chapter 3 Transport Layer

Chapter III: Transport Layer

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

Computer Networks & Security 2016/2017

Chapter 3 Transport Layer

Master Course Computer Networks IN2097

Chapter 3 Transport Layer

Chapter 3: Transport Layer. Chapter 3 Transport Layer. Transport layer. Position of transport layer. Transport layer.

Lecture 5. Transport Layer. Transport Layer 1-1

Chapter 3 Transport Layer

Chapter 3 Transport Layer. Chapter 3: Transport Layer. Chapter 3 outline. Our goals: understand principles behind transport layer services:

CSCD 330 Network Programming

Chapter 3: Transport Layer. Chapter 3 Transport Layer. Chapter 3 outline. Transport services and protocols

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

CS 655 System and Network Architectures and Implementation. Module 3 - Transport

Chapter 3 Transport Layer

Chapter 3 Transport Layer

Chapter 3: Transport Layer

Transport services and protocols. Chapter 3 Transport Layer. Chapter 3: Transport Layer. Transport vs. network layer

CS 3516: Advanced Computer Networks

Chapter 3 Transport Layer

Chapter 3 Transport Layer

Chapter 3: Transport Layer. Chapter 3 Transport Layer. Chapter 3 outline. Transport services and protocols

Chapter 3: Transport Layer. Computer Networks. Transport Layer. Transport services and protocols. Chapter 3 outline. Bu-Ali Sina University, Hamedan

Computer Networks. Transport Layer

Chapter 3 Transport Layer. Chapter 3: Transport Layer. Chapter 3 outline

CSC 8560 Computer Networks: TCP

Computer Networks 1 (Mạng Máy Tính 1) Lectured by: Dr. Phạm Trần Vũ

Internet and Intranet Protocols and Applications

Distributed Systems. 5. Transport Protocols

Lecture 3 The Transport Control Protocol (TCP) Antonio Cianfrani DIET Department Networking Group netlab.uniroma1.it

CSC358 Week 5. Adapted from slides by J.F. Kurose and K. W. Ross. All material copyright J.F Kurose and K.W. Ross, All Rights Reserved

Distributed Systems. 5. Transport Protocols. Werner Nutt

Chapter 3 Transport Layer

Reliable Transport : Fundamentals of Computer Networks Bill Nace

CSCD 330 Network Programming Spring 2018 Lecture 11a Transport Layer

Chapter 3 Transport Layer

Chapter 3. Kultida Rojviboonchai, Ph.D. Dept. of Computer Engineering Faculty of Engineering Chulalongkorn University

CSC 401 Data and Computer Communications Networks

Transcription:

Chapter 3 Transport Layer A note on the use of these ppt slides: We re making these slides freely available to all (faculty, students, readers). They re in PowerPoint form so you can add, modify, and delete slides (including this one) and slide content to suit your needs. They obviously represent a lot of work on our part. In return for use, we only ask the following:! If you use these slides (e.g., in a class) in substantially unaltered form, that you mention their source (after all, we d like people to use our book!)! If you post any slides in substantially unaltered form on a www site, that you note that they are adapted from (or perhaps identical to) our slides, and note our copyright of this material. Computer Networking: A Top Down Approach 5 th edition. Jim Kurose, Keith Ross Addison-Wesley, April 2009. Thanks and enjoy! JFK/KWR All material copyright 1996-2010 J.F Kurose and K.W. Ross, All Rights Reserved Transport Layer 3-1

Chapter 3 outline 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 congestion control 3.7 TCP congestion control Transport Layer 3-2

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! initially consider simplified TCP sender: " ignore duplicate acks " ignore flow control, congestion control Transport Layer 3-3

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 Transport Layer 3-4

NextSeqNum = InitialSeqNum SendBase = InitialSeqNum loop (forever) { switch(event) event: data received from application above create TCP segment with sequence number NextSeqNum if (timer currently not running) start timer pass segment to IP NextSeqNum = NextSeqNum + length(data) event: timer timeout retransmit not-yet-acknowledged segment with smallest sequence number start timer event: ACK received, with ACK field value of y if (y > SendBase) { SendBase = y if (there are currently not-yet-acknowledged segments) start timer } } /* end of loop forever */ TCP sender (simplified) Comment: SendBase-1: last cumulatively acked byte Example: SendBase-1 = 71; y= 73, so the rcvr wants 73+ ; y > SendBase, so that new data is acked Transport Layer 3-5

TCP: retransmission scenarios Host A Host B Host A Host B Seq=92, 8 bytes data timeout SendBase = 100 time Seq=92, 8 bytes data X loss ACK=100 Seq=92, 8 bytes data ACK=100 lost ACK scenario SendBase = 100 SendBase = 120 SendBase = 120 Seq=92 timeout Seq=92 timeout time Seq=100, 20 bytes data Seq=92, 8 bytes data premature timeout Transport Layer 3-6

TCP retransmission scenarios (more) Host A Host B Seq=92, 8 bytes data timeout Seq=100, 20 bytes data X loss ACK=100 SendBase = 120 ACK=120 time Cumulative ACK scenario Transport Layer 3-7

TCP ACK generation [RFC 1122, RFC 2581] Event at Receiver Arrival of in-order segment with expected seq #. All data up to expected seq # already ACKed Arrival of in-order segment with expected seq #. One other segment has ACK pending Arrival of out-of-order segment higher-than-expect seq. #. Gap detected Arrival of segment that partially or completely fills gap TCP Receiver action Delayed ACK. Wait up to 500ms for next segment. If no next segment, send ACK Immediately send single cumulative ACK, ACKing both in-order segments Immediately send duplicate ACK, indicating seq. # of next expected byte Immediate send ACK, provided that segment starts at lower end of gap Transport Layer 3-8

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-toback " 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 Transport Layer 3-9

Host A Host B X timeout resend 2 nd segment time Figure 3.37 Resending a segment after triple duplicate ACK Transport Layer 3-10

Fast retransmit algorithm: event: ACK received, with ACK field value of y if (y > SendBase) { SendBase = y if (there are currently not-yet-acknowledged segments) start timer } else { increment count of dup ACKs received for y if (count of dup ACKs received for y = 3) { resend segment with sequence number y } a duplicate ACK for already ACKed segment fast retransmit Transport Layer 3-11

Chapter 3 outline 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 congestion control 3.7 TCP congestion control Transport Layer 3-12

TCP Flow Control! receive side of TCP connection has a receive buffer: flow control sender won t overflow receiver s buffer by transmitting too much, too fast! app process may be slow at reading from buffer! speed-matching service: matching the send rate to the receiving app s drain rate Transport Layer 3-13

TCP Flow control: how it works (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 Transport Layer 3-14

Chapter 3 outline 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 congestion control 3.7 TCP congestion control Transport Layer 3-15

TCP Connection Management Recall: TCP sender, receiver establish connection before exchanging data segments! 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 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 Transport Layer 3-16

TCP Connection Management (cont.) Closing a connection: client server client closes socket: clientsocket.close(); close FIN Step 1: client end system sends TCP FIN control segment to server ACK FIN close Step 2: server receives FIN, replies with ACK. Closes connection, sends FIN. timed wait closed ACK Transport Layer 3-17

TCP Connection Management (cont.) 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. closing client FIN ACK FIN server closing Note: with small modification, can handle simultaneous FINs. timed wait closed ACK closed Transport Layer 3-18

TCP Connection Management (cont) TCP server lifecycle TCP client lifecycle Transport Layer 3-19