CS419: Computer Networks. Lecture 10, Part 2: Apr 11, 2005 Transport: TCP mechanics (RFCs: 793, 1122, 1323, 2018, 2581)

Similar documents
User Datagram Protocol

CSCI-1680 Transport Layer I Rodrigo Fonseca

TCP Overview. Connection-oriented Byte-stream

CSCI-1680 Transport Layer I Rodrigo Fonseca

Internet Protocols Fall Outline

Introduc)on to Computer Networks

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

Mobile Transport Layer Lesson 02 TCP Data Stream and Data Delivery

TCP : Fundamentals of Computer Networks Bill Nace

Outline Computer Networking. Functionality Split. Transport Protocols

Internet transport protocols

TCP Review. Carey Williamson Department of Computer Science University of Calgary Winter 2018

Connections. Topics. Focus. Presentation Session. Application. Data Link. Transport. Physical. Network

Reliable Byte-Stream (TCP)

Some slides courtesy David Wetherall. Communications Software. Lecture 4: Connections and Flow Control. CSE 123b. Spring 2003.

Last Class. CSE 123b Communications Software. Today. Naming Processes/Services. Transmission Control Protocol (TCP) Picking Port Numbers.

ECE 435 Network Engineering Lecture 9

Transport Layer: Outline

Transport Layer: outline

Transport Layer Marcos Vieira

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

Computer Networking Introduction

10 minutes survey (anonymous)

CSE/EE 461 Lecture 12 TCP. A brief Internet history...

CSC 401 Data and Computer Communications Networks

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

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

Chapter 3 Transport Layer

Application Service Models

Chapter 3 Transport Layer

Chapter III: Transport Layer

Sequence Number. Acknowledgment Number. Checksum. Urgent Pointer plus Sequence Number indicates end of some URGENT data in the packet

CSE/EE 461 Lecture 13 Connections and Fragmentation. TCP Connection Management

CSCE 463/612 Networks and Distributed Processing Spring 2017

ECE 435 Network Engineering Lecture 10

End-to-End Protocols. End-to-End Protocols

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

CSE/EE 461 Lecture 14. Connections. Last Time. This Time. We began on the Transport layer. Focus How do we send information reliably?

CSE 461 Module 11. Connections

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

TCP: Transmission Control Protocol RFC 793,1122,1223. Prof. Lin Weiguo Copyleft 2009~2017, School of Computing, CUC

The Transport Layer: TCP & Reliable Data Transfer

Operating Systems and Networks. Network Lecture 8: Transport Layer. Adrian Perrig Network Security Group ETH Zürich

Operating Systems and Networks. Network Lecture 8: Transport Layer. Where we are in the Course. Recall. Transport Layer Services.

Basic Reliable Transport Protocols

Lecture 22: TCP & NAT. CSE 123: Computer Networks Alex C. Snoeren

CS419: Computer Networks. Lecture 10, Part 3: Apr 13, 2005 Transport: TCP performance

TCP: Transmission Control Protocol UDP: User Datagram Protocol TCP - 1

TCP. CSU CS557, Spring 2018 Instructor: Lorenzo De Carli (Slides by Christos Papadopoulos, remixed by Lorenzo De Carli)

CMSC 417. Computer Networks Prof. Ashok K Agrawala Ashok Agrawala. October 25, 2018

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

Transport Layer (TCP/UDP)

Transmission Control Protocol (TCP)

CS457 Transport Protocols. CS 457 Fall 2014

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

CS 4390 Computer Networks. Pointers to Corresponding Section of Textbook

TCP Strategies. Keepalive Timer. implementations do not have it as it is occasionally regarded as controversial. between source and destination

Chapter 3- parte B outline

CSCD 330 Network Programming

Transport: How Applications Communicate

CSE 461 The 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

TCP Basics : Computer Networking. Overview. What s Different From Link Layers? Introduction to TCP. TCP reliability Assigned reading

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

TCP = Transmission Control Protocol Connection-oriented protocol Provides a reliable unicast end-to-end byte stream over an unreliable internetwork.

Transport Protocols. Raj Jain. Washington University in St. Louis

Outline Computer Networking. TCP slow start. TCP modeling. TCP details AIMD. Congestion Avoidance. Lecture 18 TCP Performance Peter Steenkiste

TCP/IP Networking. Part 4: Network and Transport Layer Protocols

Functionality Split Computer Networking. Transport Protocols. Overview. Multiplexing & Demultiplexing

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

RSC Part III: Transport Layer 3. TCP

CS 356: Computer Network Architectures. Lecture 17: End-to-end Protocols and Lab 3 Chapter 5.1, 5.2. Xiaowei Yang

CSCI Topics: Internet Programming Fall 2008

TSIN02 - Internetworking

Transmission Control Protocol (TCP)

TCP Service Model. Today s Lecture. TCP Support for Reliable Delivery. EE 122:TCP, Connection Setup, Reliability

CS4700/CS5700 Fundamentals of Computer Networks

Announcements Computer Networking. Outline. Transport Protocols. Transport introduction. Error recovery & flow control. Mid-semester grades

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

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

Islamic University of Gaza Faculty of Engineering Department of Computer Engineering ECOM 4021: Networks Discussion. Chapter 5 - Part 2

Overview. Internetworking and Reliable Transmission. CSE 561 Lecture 3, Spring David Wetherall. Internetworking. Reliable Transmission

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

CS519: Computer Networks. Lecture 5, Part 1: Mar 3, 2004 Transport: UDP/TCP demux and flow control / sequencing

COMP/ELEC 429/556 Introduction to Computer Networks

Transport Protocols Reading: Sections 2.5, 5.1, and 5.2. Goals for Todayʼs Lecture. Role of Transport Layer

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

TSIN02 - Internetworking

Transport Protocols Reading: Sections 2.5, 5.1, and 5.2

Kent State University

Internet and Intranet Protocols and Applications

Networking Technologies and Applications

Chapter 3 Transport Layer

ECE 435 Network Engineering Lecture 9

TSIN02 - Internetworking

Chapter 3 Transport Layer

TCP and Congestion Control (Day 1) Yoshifumi Nishida Sony Computer Science Labs, Inc. Today's Lecture

CSE 4213: Computer Networks II

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

Transcription:

: Computer Networks Lecture 10, Part 2: Apr 11, 2005 Transport: TCP mechanics (RFCs: 793, 1122, 1323, 2018, 2581)

TCP as seen from above the socket The TCP socket interface consists of: Commands to start the connection connect(), listen(), accept() Commands to send to and receive from the connection read(), write() Commands to end the connection close(), (but also read(), write()!)

TCP as a marked stream Think of TCP as having start-of-stream and an end-of-stream tags EOS means no more data will be sent And, you got all the data that was sent

TCP as a marked stream The first read() that returns data implies reception of SOS TCP SYN can be thought of as SOS close() generates the EOS (TCP FIN) read()==0 signals reception of the EOS A connection can end without an EOS read()==-1 or write()==-1 In this case, some sent bytes may not have been received

TCP keepalive A TCP connection can stay up forever even without sending any packets Indeed, if one end crashes silently, the other end won t notice until it sends a packet Sometime called a half-open connection TCP implementations have a keepalive option Settable through sockopts()

TCP keepalive Periodically sends a TCP packet with no data The other end responds with an ACK if it is alive If not, the other end is declared down, and a pending read() is returned with -1 This is not part of the TCP spec per se This can just as well be done at the application layer

Some TCP issues we ll look at TCP uses a sliding window as we saw with link protocols However, TCP must contend with different issues Round trip may vary (so don t know how best to fill the pipe) The network may be congested (so may need to go even slower than receive window allows) Packets may not arrive in order A TCP connection has to synchronize the beginning and end (SOS and EOS)

TCP bytes and segments Application process Application process Write bytes Read bytes TCP Send buffer TCP Receive buffer Segment Segment Segment Transmit segments

TCP Header (segment) Flags: SYN FIN RESET PUSH URG ACK Source port Destination port Sequence number Acknowledgement Hdr len 0 Flags Advertised window Checksum Urgent pointer Options (variable) Data

Connection Establishment (with Initial Sequence Numbers) (Active) Client (Passive) Server Syn +ISN A Syn + Ack +ISN B Ack Connection Setup 3-way handshake

Connection terminate Connection establish is fairly straightforward Connection terminate is more complex Because both sides must fully close One side can close while the other still sends the last of its data Or both can close at once

TCP Connection terminate Closing a connection: client closes socket: clientsocket.close(); close client FIN server 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

TCP Connection Terminate Step 3: client receives FIN, replies with ACK. Enters timed wait - will respond with ACK to received FINs close client FIN server Step 4: server, receives ACK. Connection closed. ACK FIN close Note: with small modification, can handle simultaneous FINs. timed wait closed ACK

Typical Client Transitions CLOSED Typical Server Transitions Passive open Close LISTEN Close Active open/syn SYN/ SYN_RCVD /SYN + ACK Send/SYN SYN/SYN + ACK SYN_SENT ACK SYN+ACK/ /ACK Close/FIN ESTABLISHED: data transfer! FIN_WAIT_1 ACK Close/FIN FIN/ACK ACK + FIN/ACK FIN/ACK CLOSE_WAIT Close/FIN FIN_WAIT_2 CLOSING LAST_ACK FIN/ACK ACK TIME_WAIT Timeout after two segment lifetimes ACK CLOSED

TIME_WAIT state On client, Wait 2 times Maximum Segment Lifetime (2 MSL) Provides protection against delayed segments from an earlier incarnation of a connection being interpreted as for a new connection Maximum time segment can exist in the network before being discarded Time-To-Live field in IP is expressed in terms of hops not time TCP estimates it as 2 minutes

TIME_WAIT state During this time, combination of client IP and port, server IP and port cannot be reused Some implementations say local port cannot be reused at all while it is involved in time wait state even to establish a connection to different dest IP/port combo

TCP advertised window (the receive window) In TCP, the receiver sends its receive window to the sender Note that both ends are both sender and receiver The receiver sends its receive window with every ACK The sender sets its send window to that of the receive window Therefore, we only really speak of one window, the send window

TCP advertised window Why does the TCP receiver need to convey its receive window, whereas in the link-layer sliding window, we didn t need that?

TCP advertised window Why does the TCP receiver need to convey its receive window, whereas in the link-layer sliding window, we didn t need that? ANS: because the TCP layer can ACK data even though the application hasn t read it

TCP advertised window

TCP flow control

TCP retransmission mechanism originally Go-back-N Say sender sends bytes 1000 1499, in 5 100-byte packets Receiver ACKs up to 1100 Sender knows that receiver missed packet 1100-1199, but doesn t know about other three packets Sender goes back to 1100, and starts retransmitting everything It may therefore resend received packets Lots of them, if the pipe is long and fat

Later TCP added Selective Acknowledgement (SACK) Use TCP option space during ESTABLISHED state to send hints about data received ahead of acknowledged data TCP option that says SACK enabled on SYN => I am a SACK enabled sender, receiver feel free to send selective ack info Normal ACK field still authoritative! SACK usage is growing, but still not universal

SACK Details Format: +--------+--------+ Kind=5 Length +--------+--------+--------+--------+ Left Edge of 1st Block +--------+--------+--------+--------+ Right Edge of 1st Block +--------+--------+--------+--------+ /... / +--------+--------+--------+--------+ Left Edge of nth Block +--------+--------+--------+--------+ Right Edge of nth Block +--------+--------+--------+--------+ TCP option 5 In 40 bytes of option can specify a max of 4 blocks If used with other options space reduced Ex. With Timestamp option (10 bytes), max 3 blocks

TCP sliding window Window Size Data ACK d Outstanding Un-ack d data Data OK to send Data not OK to send yet

Big Fat Pipes and TCP TCP has a 32-bit sequence number space, and a 16-bit window size (65Kbytes) At 1.2 Gbps: the seq number can wrap in 28 seconds The delay x BW at 100ms is 14.8MB 200 window s worth!!!

TCP extensions for big fat pipes (RFC 1323) Timestamp extension Allows the sender to put a 32-bit timestamp in the header Mainly for RTT estimation Receiver echoes it back, sender gets an accurate RTT But receiver can also use it to detect wraparound Window scaling extension Negotiate to interpret window as power-of-2 factor (i.e., left-shift window X bits)