CSCI Topics: Internet Programming Fall 2008

Similar documents
Chapter 3 Transport Layer

Chapter 3 Transport Layer

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

Transport Layer: outline

CSCE 463/612 Networks and Distributed Processing Spring 2017

RSC Part III: Transport Layer 3. TCP

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

Transport Layer: Outline

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

CSE 4213: Computer Networks II

The Transport Layer: TCP & Reliable Data Transfer

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

CNT 6885 Network Review on Transport Layer

Chapter 3 Transport Layer

CSC 4900 Computer Networks: TCP

Chapter 3 Transport Layer

TCP : Fundamentals of Computer Networks Bill Nace

CS 4390 Computer Networks. Pointers to Corresponding Section of Textbook

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

Computer Networking Introduction

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

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

Chapter 3 Transport Layer

10 minutes survey (anonymous)

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

CSC 401 Data and Computer Communications Networks

Lecture 8. TCP/IP Transport Layer (2)

Chapter 3 Transport Layer

CC451 Computer Networks

Chapter III: Transport Layer

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

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

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

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

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

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

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

Chapter 6 Transport Layer

Master Course Computer Networks IN2097

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

Chapter 3 Transport Layer

Lecture 12: Transport Layer TCP again

Computer Networks & Security 2016/2017

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

CSCD 330 Network Programming

Chapter 3 Transport Layer

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

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

Internet and Intranet Protocols and Applications

CSCD 330 Network Programming Winter 2015

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

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

CSCE 463/612 Networks and Distributed Processing Spring 2018

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

Chapter 3 Transport Layer

Chapter 3 Transport Layer

Chapter 3- parte B outline

CSCI Topics: Internet Programming Fall 2008

CSC 401 Data and Computer Communications Networks

Reliable Transport : Fundamentals of Computer Networks Bill Nace

CS Lecture 1 Review of Basic Protocols

CSC 8560 Computer Networks: TCP

Fall 2012: FCM 708 Bridge Foundation I

Lecture 5. Transport Layer. Transport Layer 1-1

Chapter 3 Transport Layer

Foundations of Telematics

CS 3516: Advanced Computer Networks

Transmission Control Protocol

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

Sliding Window Protocols, Connection Management, and TCP Reliability

Master Course Computer Networks IN2097

CSCI Topics: Internet Programming Fall 2008

Chapter 3 Transport Layer

Internet Protocols Fall Outline

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

Distributed Systems. 5. Transport Protocols

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

Chapter III: Transport Layer

Distributed Systems. 5. Transport Protocols. Werner Nutt

Chapter 3 Transport Layer

TCP Adaptive Retransmission Algorithm - Original TCP. TCP Adaptive Retransmission Algorithm Jacobson

CSE 461: Introduction to Computer Communication Networks. Chunjong Park

Lecture 11: Transport Layer Reliable Data Transfer and TCP

Internet transport-layer protocols. Transport services and protocols. Sending and receiving. Connection-oriented (TCP) Connection-oriented

Transport services and protocols. Chapter 3 outline. Internet transport-layer protocols Chapter 3 outline. Multiplexing/demultiplexing

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

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

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

Chapter 3 Transport Layer

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

Chapter 23 Process-to-Process Delivery: UDP, TCP, and SCTP 23.1

Chapter 3 Transport Layer

Chapter 3: Transport Layer Part A

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

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

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

Flow and Congestion Control (Hosts)

Computer Networks. 3.Transport Layer. Transport Layer - 1

Transcription:

CSCI 491-01 Topics: Internet Programming Fall 2008 Transport Layer Derek Leonard Hendrix College October 15, 2008 Original slides copyright 1996-2007 J.F Kurose and K.W. Ross 1

Chapter 3: Roadmap 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 2

TCP Reliable Data Transfer TCP creates rdt service on top of IP s unreliable service Combination of Goback-N and Selective Repeat Pipelined segments Cumulative acks TCP uses single retransmission timer For the oldest unack ed packet Retransmissions are triggered by: Timeout events Duplicate acks Initially consider simplified TCP sender: Ignore duplicate acks Ignore flow control, congestion control 3

TCP Sender Events: Data received from app: Create a segment with next 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: Timeout(n) Timeout: Retransmit segment that caused timeout Restart timer Ack received: If acknowledges previously unacked segments Update what is known to be acked Start timer if there are outstanding segments 4

NextSeqNum = InitialSeqNum // random for each transfer SendBase = InitialSeqNum // SendBase-1 is the last ack ed byte loop (forever) { switch(event) { (a) data received from application above (assuming it fits into window): create TCP segment with sequence number NextSeqNum if (timer currently not running) start timer pass segment to IP NextSeqNum = NextSeqNum + length(data) (b) timer timeout: retransmit not-yet-acknowledged segment with smallest sequence number; start timer (c) ACK received, with ACK field value of y if (y > SendBase) { SendBase = y if (there are currently not-yet-acknowledged segments) start timer else cancel timer } } } /* end of loop forever */ TCP Sender (Simplified) 5

TCP: Retransmission Scenarios Host A Host B Host A Host B 6 Seq=92, 8 bytes data Seq=92, 8 bytes data Seq=100, 20 bytes data ACK=100 ACK=120 ACK=100 X loss timeout Seq=92, 8 bytes data Seq=92, 8 bytes data ACK=120 Seq=92 timeout Seq=92 timeout ACK=100 SendBase = 100 time lost ACK scenario Sendbase = 100 SendBase = 120 SendBase = 120 time premature timeout

TCP Retransmission Scenarios (More) Host A Host B Seq=92, 8 bytes data timeout Seq=100, 20 bytes X loss ACK=100 SendBase = 120 ACK=120 time Cumulative ACK scenario 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 Immediately send ACK 8

Fast Retransmit Time-out period often relatively long: Long delay before resending lost packet Idea: infer loss via duplicate ACKs Sender often sends many segments backto-back If segment is lost, there will likely be many duplicate ACKs If sender receives 3 duplicate ACKs for the same data, it supposes that segment after ACKed data was lost: Fast Retransmit: resend segment before timer expires 9

Fast Retransmit Algorithm: event: ACK received, with ACK field value of y if (y > SendBase) { SendBase = y; dupack = 0; fast_retx = false; if (SendBase!= NextSeqNum) start timer; else cancel timer; // last pkt in window } else if (y == SendBase && fast_retx == false) { dupack++; if (dupack == 3) { fast_retx = true; resend segment with sequence number y } a duplicate ACK for already ACKed segment fast retransmit 10

Chapter 3: Roadmap 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 11

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 12

TCP Flow Control: How It Works Spare room in buffer RcvWindow = RcvBuffer [LastByteRcvd - LastByteRead] received from sender Receiver advertises spare room by including value of RcvWindow in segments Sender limits unacked data to RcvWindow Guarantees receive buffer doesn t overflow Then the effective sender window is min(sndwindow, RcvWindow) read by the application 13

Chapter 3: Roadmap 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 14

TCP Connection Management Recall: TCP sender, receiver establish a connection before exchanging data segments Purpose: Exchange initial seq. #s Exchange flow control info (i.e., RcvWindow) Negotiate options (SACK, large windows, etc.) Client: connection initiator Server: contacted by client Three way handshake: Step 1: client host sends TCP SYN segment to server Specifies initial seq # X and buffer size RcvWindow No data Step 2: server receives SYN, replies with SYN+ACK Sends server initial seq. # Y and buffer size RcvWindow No data Step 3: client receives SYN+ACK, replies with ACK segment, which may contain regular data 15

TCP Connection Management (Cont.) Closing a connection: client server Client closes socket: close(sock); closing FIN Step 1: client end system sends TCP FIN control segment to server Step 2: server receives FIN, replies with ACK. Connection in closing state, sends FIN timed wait closed ACK FIN ACK closing 16

TCP Connection Management (Cont.) Step 3: client receives FIN, replies with ACK client server Enters timed wait - will respond with ACK to received FINs Step 4: server, receives ACK. Connection closed Step 5: after timeout, client s connection is closed as well closing timed wait closed FIN ACK FIN ACK closing closed 17

TCP Connection Management (Cont) TCP server lifecycle TCP client lifecycle 18