CSC 4900 Computer Networks: TCP

Similar documents
CSC 8560 Computer Networks: TCP

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

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

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

10 minutes survey (anonymous)

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

Transport Layer: outline

Computer Networking Introduction

Chapter III: Transport Layer

Chapter 3 Transport Layer

Chapter 3 Transport Layer

CSC 401 Data and Computer Communications Networks

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

Transport Layer: Outline

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

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

CS 4390 Computer Networks. Pointers to Corresponding Section of Textbook

Chapter 3- parte B outline

CSE 4213: Computer Networks II

Chapter 3 Transport Layer

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

Lecture 8. TCP/IP Transport Layer (2)

CSCE 463/612 Networks and Distributed Processing Spring 2017

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

Chapter 3 Transport Layer

RSC Part III: Transport Layer 3. TCP

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

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

Computer Networking: A Top Down Approach

Lecture 12: Transport Layer TCP again

CSCI Topics: Internet Programming Fall 2008

Chapter 3 Transport Layer

CC451 Computer Networks

CSCD 330 Network Programming

Computer Communication Networks Midterm Review

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

Chapter III: Transport Layer

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

Fall 2012: FCM 708 Bridge Foundation I

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

The Transport Layer: TCP & Reliable Data Transfer

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

Chapter 3 Transport Layer

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

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

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

TCP : Fundamentals of Computer Networks Bill Nace

LECTURE 3 - TRANSPORT LAYER

CS Lecture 1 Review of Basic Protocols

Chapter 3 Transport Layer

Chapter 3 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

CNT 6885 Network Review on Transport Layer

Chapter 6 Transport Layer

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

Chapter 3 Transport Layer

Distributed Systems. 5. Transport Protocols

Distributed Systems. 5. Transport Protocols. Werner Nutt

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

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

CS321: Computer Networks Error and Flow Control in TCP

Transport Protocols and TCP

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

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

rdt3.0: channels with errors and loss

Computer Communication Networks Midterm Review

Master Course Computer Networks IN2097

Chapter 3 Transport Layer

NWEN 243. Networked Applications. Layer 4 TCP and UDP

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

Foundations of Telematics

Chapter 3 outline. Chapter 3: Transport Layer. Transport vs. network layer. Transport services and protocols. Internet transport-layer protocols

Routers. Session 12 INST 346 Technologies, Infrastructure and Architecture

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

Different Layers Lecture 20

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

Internet and Intranet Protocols and Applications

Transmission Control Protocol (TCP)

Transmission Control Protocol

UNIT IV -- TRANSPORT LAYER

ECE697AA Lecture 3. Today s lecture

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

CS4700/CS5700 Fundamentals of Computer Networks

Chapter 3: Transport Layer Part A

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

Sliding Window Protocols, Connection Management, and TCP Reliability

Pipelined protocols: overview

Transport Layer PREPARED BY AHMED ABDEL-RAOUF

Flow and Congestion Control (Hosts)

Chapter 24. Transport-Layer Protocols

Lecture 3: The Transport Layer: UDP and TCP

CSC 4900 Computer Networks: Reliable Data Transport

NT1210 Introduction to Networking. Unit 10

Lecture 11: Transport Layer Reliable Data Transfer and TCP

Transport Layer Marcos Vieira

IS370 Data Communications and Computer Networks. Chapter 5 : Transport Layer

23-3 TCP. Topics discussed in this section: TCP Services TCP Features Segment A TCP Connection Flow Control Error Control 23.22

Transcription:

CSC 4900 Computer Networks: TCP Professor Henry Carter Fall 2017

Project 2: mymusic You will be building an application that allows you to synchronize your music across machines. The details of which are on the course website. You must work as a pair. You will both receive the same grade, so work hard. Make sure your design is extensible. Future projects will possibly build on this infrastructure. 2

Last Time Discussed a variety of algorithms that can give us guarantees of reliable delivery. What were they? How do they differ? Finite State Machines (FSMs) are a powerful means of representing protocols. 3

Review: Go-Back-N vs Selective Repeat 4

Review: Selective repeat: dilemma Example: seq # s: 0, 1, 2, 3 window size=3 receiver sees no difference in two scenarios! incorrectly passes duplicate data as new in (a) Q: what relationship between seq # size and window size? 5

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 6

TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581 point-to-point: one sender, one receiver reliable, in-order byte steam: no message boundaries pipelined: TCP congestion and flow control set window size full duplex data: bi-directional data flow in same connection MSS: maximum segment size connection-oriented: handshaking (exchange of control msgs) init s sender, receiver state before data exchange flow controlled: sender will not overwhelm receiver 7

TCP segment structure 8

TCP seq. # s and ACKs Seq. # s: byte stream number of first byte in segment s data ACKs: seq # of next byte expected from other side cumulative ACK Q: how receiver handles out-of-order segments A: TCP spec doesn t say, - up to implementor 9

TCP Sequence Numbers, Acks 10

TCP Round Trip Time and Timeout Q: how to set TCP timeout value? longer than RTT but RTT varies too short: premature timeout unnecessary retransmissions Q: how to estimate RTT? SampleRTT: measured time from segment transmission until ACK receipt ignore retransmissions SampleRTT will vary, want estimated RTT smoother average several recent measurements, not just current SampleRTT too long: slow reaction to segment loss 11

TCP Round Trip Time and Timeout EstimatedRTT = (1- a)*estimatedrtt + a*samplertt Exponential weighted moving average influence of past sample decreases exponentially fast typical value: α = 0.125 12

Example RTT estimation: 13

TCP Round Trip Time and Timeout Setting the timeout EstimtedRTT plus safety margin large variation in EstimatedRTT -> larger safety margin first estimate of how much SampleRTT deviates from EstimatedRTT: Then set timeout interval: DevRTT = (1-b)*DevRTT + b* SampleRTT-EstimatedRTT (typically, b = 0.25) TimeoutInterval = EstimatedRTT + 4*DevRTT 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 15

TCP reliable data transfer TCP creates rdt service on top of IP s unreliable service Pipelined segments Cumulative acks Single retransmission timer 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 16

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 17

TCP sender (simplified) 18

TCP: retransmission scenarios 19

TCP retransmission scenarios (more) 20

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 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 Arrival of segment that partially or completely fills gap Immediate send ACK, provided that segment starts at lower end of gap 21

Fast Retransmit Time-out period often relatively long: long delay before resending lost packet Detect lost segments via 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 Sender often sends many segments back-to-back If segment is lost, there will likely be many duplicate ACKs. 22

Fast Retransmit 23

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 24

TCP Flow Control flow control receiver controls sender, so sender won t overflow receiver s buffer by transmitting too much, too fast 25

TCP Flow control: how it works Receiver advertises free buffer space by including rwnd value in TCP header of receiver-to-sender segments RcvBuffer size set via socket options (typical default is 4096 bytes) many operating systems autoadjust RcvBuffer sender limits amount of unacked ( inflight ) data to receiver s rwnd value guarantees receive buffer will not overflow 26

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 27

TCP Connection Management Before exchanging data, sender/receiver handshake : agree to establish connection (each knowing the other willing to establish connection) agree on connection parameters 28

Agreeing to Establish a Connection Q: Will 2-way handshake always work in network? variable delays retransmitted messages (e.g. req_conn(x)) due to message loss message reordering can t see other side 29

Agreeing to Establish a Connection 30

TCP 3-Way Handshake 31

TCP 3-Way Handshake: FSM 32

TCP: Closing a Connection Client, Server each close their side of the connection Send TCP segment with FIN bit = 1 Respond to received FIN with FIN, ACK 33

TCP Connection Management (cont.) 34

SYN Flooding Classic Internet attack sends a huge number of SYN packets to a host, but never responds with the third handshake message. In so doing, an adversary forces a receiver to dedicate a huge amount of resources to bogus requests. And therefore makes those resources unavailable to legitimate users. There are ways to prevent this (SYN Cookies), but a surprising number of systems are still vulnerable. 35

Next Time... Textbook Chapter 3.7 Remember, you need to read it BEFORE you come to class! Homework Project #2 is posted! Start now! 36