The Transport Layer: TCP & Reliable Data Transfer

Similar documents
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

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

Chapter 3 Transport Layer

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

TCP : Fundamentals of Computer Networks Bill Nace

Chapter 3 Transport Layer

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

CSCI Topics: Internet Programming Fall 2008

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

Transport Layer: Outline

Computer Networking Introduction

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

10 minutes survey (anonymous)

CSE 4213: Computer Networks II

Chapter 3 Transport Layer

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

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

CSC 4900 Computer Networks: TCP

Chapter III: Transport Layer

CSCD 330 Network Programming

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

Lecture 5. Transport Layer. Transport Layer 1-1

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

Lecture 8. TCP/IP Transport Layer (2)

CSC 401 Data and Computer Communications Networks

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

CS 4390 Computer Networks. Pointers to Corresponding Section of Textbook

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

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

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

Chapter 3 Transport Layer

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

Chapter 3- parte B outline

CSCE 463/612 Networks and Distributed Processing Spring 2017

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

CC451 Computer Networks

Chapter 6 Transport Layer

CNT 6885 Network Review on Transport Layer

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

Chapter 3 Transport Layer

Fall 2012: FCM 708 Bridge Foundation I

Chapter 3 Transport Layer

The Transport Layer: Review

CS Lecture 1 Review of Basic Protocols

The Transport Layer: TCP & Congestion Control

Distributed Systems. 5. Transport Protocols

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

Computer Communication Networks Midterm Review

Distributed Systems. 5. Transport Protocols. Werner Nutt

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

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

Lecture 12: Transport Layer TCP again

Lecture 11: Transport Layer Reliable Data Transfer and TCP

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

Lecture 3: The Transport Layer: UDP and TCP

Computer Networks & Security 2016/2017

CS450 Introduc0on to Networking Lecture 14 TCP. Phu Phung Feb 13, 2015

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

Chapter III: Transport Layer

Foundations of Telematics

Transport Layer. <protocol, local-addr,local-port,foreign-addr,foreign-port> ϒ Client uses ephemeral ports /10 Joseph Cordina 2005

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

Master Course Computer Networks IN2097

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

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

CCNA 1 Chapter 7 v5.0 Exam Answers 2013

Transport Layer. Gursharan Singh Tatla. Upendra Sharma. 1

Chapter 3 Transport Layer

Chapter 3 Transport Layer

Networking Technologies and Applications

CS457 Transport Protocols. CS 457 Fall 2014

Computer Communication Networks Midterm Review

Linux Networking: tcp. TCP context and interfaces

CS118 Discussion 1A, Week 4. Zengwen Yuan Dodd Hall 78, Friday 10:00 11:50 a.m.

CS4700/CS5700 Fundamentals of Computer Networks

Internet and Intranet Protocols and Applications

Problem 7. Problem 8. Problem 9

05 Transmission Control Protocol (TCP)

CS 43: Computer Networks. 18: Transmission Control Protocol October 12-29, 2018

Transmission Control Protocol (TCP)

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

The GBN sender must respond to three types of events:

NWEN 243. Networked Applications. Layer 4 TCP and UDP

INF4/MSc Computer Networking. Lectures 3-4 Transport layer protocols TCP/UDP automatic repeat request

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

CSC 8560 Computer Networks: TCP

CS321: Computer Networks Error and Flow Control in TCP

Computer Networking: A Top Down Approach

Lecture 20 Overview. Last Lecture. This Lecture. Next Lecture. Transport Control Protocol (1) Transport Control Protocol (2) Source: chapters 23, 24

Mobile Transport Layer Lesson 10 Timeout Freezing, Selective Retransmission, Transaction Oriented TCP and Explicit Notification Methods

CCNA R&S: Introduction to Networks. Chapter 7: The Transport Layer

ICS 451: Today's plan. Sliding Window Reliable Transmission Acknowledgements Windows and Bandwidth-Delay Product Retransmission Timers Connections

Sliding Window Protocols, Connection Management, and TCP Reliability

Chapter 3: Transport Layer

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

Course on Computer Communication and Networks. Lecture 5 Chapter 3; Transport Layer, Part B

Transcription:

The Transport Layer: TCP & Reliable Data Transfer Smith College, CSC 249 February 15, 2018 1 Chapter 3: Transport Layer q TCP Transport layer services: v Multiplexing/demultiplexing v Connection management v Reliable data transfer SEQ and ACK numbers v Congestion control v Flow control 2 1

TCP Connection Management: Set up Recall: TCP senders and receivers establish a connection before exchanging data segments Three way handshake: Step 1: client host sends TCP SYN segment to server v SYN for synchronize (set SYN bit to 1) v Specifies (random) initial sequence # v No data is sent Step 2: server host receives SYN, replies with SYNACK segment v Set both SYN and ACK bits to 1 v Server allocates buffers and variables v Specifies its own, server initial sequence # Step 3: client receives SYNACK, replies with ACK segment v Client allocates buffers and variables v This packet may contain data 3 TCP segment structure URG: urgent data (generally not used) ACK: ACK # valid Header length, Usually 20 bytes RST, SYN, FIN: connection estab (setup, teardown commands) Internet checksum (as in UDP) head len 32 bits source port # dest port # sequence number acknowledgement number not used checksum U A P R S F receive window options (add to the basic 20 byte header length) Urg data pointer application data (variable length) counting by bytes of data (not segments!) # bytes rcvr willing to accept (flow control) 4 2

TCP Connection Management: Set up Set Up: Step 1: client sends TCP SYN segment q Actions at self? q Sends data? setup client SYN server Step 2: server receives SYN and replies with SYNACK q Actions at self? q Sends data? Step 3: client receives SYNACK and replies with ACK q Actions at self? q Sends data? Connection! SYNACK ACK setup 5 TCP Connection Management: Close Closing a connection: client server How many steps? What are they? closed 6 3

TCP Connection Management: Close Closing a connection: client server 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. d wait closed 7 TCP Connection Management (cont.) Step 3: client receives FIN, replies with ACK. v Enters d wait client able to resend final ACK in case it is lost closing client FIN ACK FIN server closing v Why?? Step 4: server, receives ACK. Connection closed. d wait closed ACK closed 8 4

TCP possible sender events: (1) Data received from application: 1. Create a segment and assign a SEQ number v SEQ # is byte-stream number of first data byte in segment 2. Start r if it is not already running v Timer is for the oldest un-acked segment v Expiration interval: TimeOutInterval 9 TCP: SEQ and ACK numbers head len source port # dest port # sequence number acknowledgement number U A P R S F checksum receive window application data (variable length) head len source port # dest port # sequence number acknowledgement number U A P R S F checksum receive window application data (variable length) 3-10 5

TCP: Cumulative ACK r Seq=100, 20 bytes data X loss ACK=100 Cumulative ACK scenario 3-11 TCP: retransmission from out out X loss ACK=100 lost ACK scenario 3-12 6

TCP possible sender events: (1) Data received from application: 1. Create a segment and assign a SEQ number v SEQ # is byte-stream number of first data byte in segment 2. Start r if it is not already running v Timer is for the oldest un-acked segment v Expiration interval: TimeOutInterval (2) Timeout (ACK not received): 1. Retransmit segment that caused the out 2. Restart the r (3) ACK received for previously unacked segments 1. Update what is known to be acked 2. Start r if there are outstanding segments 13 Students as Transport Layer q Working in pairs, send Haiku to each other v Let each letter and space represent one byte q Using blank TCP segments v Define and use ACK and SEQ numbers for sending the segments q Once we see the involved for our person-transport-layer, define an amount of for a r, and have some out events q Communicate with your sending/receiving pairs to be able to dramatize TCP successfully 14 7

TCP: retransmission scenarios out X loss ACK=100 Seq=92 out Seq=100, 20 bytes data ACK=100 ACK=120 SendBase = 100 ACK=100 lost ACK scenario Sendbase = 100 Seq=92 out premature out 1) What is/was A s next step? 2) What does B then do? 15 TCP retransmission scenarios (more) out Seq=100, 20 bytes data X loss ACK=100 What does A do next? SendBase = 120 ACK=120 Cumulative ACK scenario 16 8

What does A do next, and when does it do it? triple duplicate ACKs seq # x1 seq # x2 seq # x3 seq # x4 seq # x5 out X ACK x1 ACK x1 ACK x1 ACK x1 Fast retransmit, before the r s out 17 Discussion Question 1 q Suppose sends two TCP segments back to back to over a TCP connection. v What might be the first sequence number? v If 20 bytes are sent, what is the second sequence number? v Suppose that the first segment is lost but the second segment arrives at B. In the acknowledgment that sends to, what will be the acknowledgment number? 18 9

Discussion Question 2 q Consider a reliable protocol that uses only NAKs (no unnecessary ACKs, since most often, things work well!) Suppose the sender sends data infrequently. Would a NAK-only protocol be preferable to a protocol that uses ACKs? Why? 19 Discussion Question 3 q Now suppose the sender has a lot of data to send and the end-to-end connection experiences few losses. In this second case, would a NAK-only protocol be preferable to a protocol that uses ACKs? Why? 20 10

Discussion Question 4: Why Wait for 3 Duplicate ACKs before retransmission? q Why did the TCP designers choose to have TCP wait until it has received three duplicate ACKs before performing a fast retransmit, rather than performing a fast retransmit after the first duplicate ACK for a segment is received? 21 Discussion Question 4: Why Wait for 3 Duplicate ACKs? q Suppose packets n, n+1, and n+2 are sent, and that packet n is received and ACKed. q 2-duplicate ACK policy: If packets n+1 and n+2 are reordered along the end-to-end-path then the receipt of packet n+2 will generate a duplicate ACK for n and would trigger a retransmission. q 3 duplicate ACK scheme: Trades-off waiting for more packets (rather than just 1) to avoid retransmitting prematurely in the face of packet reordering. v This policy could slow things down of course if packet n+1 is lost rather than reordered. 22 11

Summary q Multiplexing and demultiplexing q Error checking - checksum q Connection Management v SYN and SYNACK packets q TCP segment header format q Reliable data transfer v Sequence and acknowledgement numbers v Discuss use of NAK v Discuss the purpose of 3 duplicate ACKs 23 12