Transport Protocols. CSCI 363 Computer Networks Department of Computer Science

Similar documents
Problem. Chapter Outline. Chapter Goal. End-to-end Protocols. End-to-end Protocols. Chapter 5. End-to-End Protocols

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

COMPUTER NETWORKS CS CS 55201

COMPUTER NETWORKS CS CS 55201

Fundamentals of Computer Networks ECE 478/578. Transport Layer. End- to- End Protocols 4/16/13. Spring Application. Application.

11/24/2009. Fundamentals of Computer Networks ECE 478/578. Flow Control in TCP

EE 122: Transport Protocols. Kevin Lai October 16, 2002

Transport Protocols CS 640 1

End-to-End Protocols: UDP and TCP. Hui Chen, Ph.D. Dept. of Engineering & Computer Science Virginia State University Petersburg, VA 23806

Reliable Byte-Stream (TCP)

Internet transport protocols

EE 122: Transport Protocols: UDP and TCP

TCP Overview. Connection-oriented Byte-stream

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

UNIT V. Computer Networks [10MCA32] 1

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

End-to-End Protocols. Transport Protocols. User Datagram Protocol (UDP) Application Layer Expectations

ECE 650 Systems Programming & Engineering. Spring 2018

CS 455: INTRODUCTION TO DISTRIBUTED SYSTEMS [NETWORKING] Frequently asked questions from the previous class surveys

CS457 Transport Protocols. CS 457 Fall 2014

CSE/EE 461. Sliding Windows and ARQ. Last Time. This Time. We finished up the Network layer Internetworks (IP) Routing (DV/RIP, LS/OSPF)

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

Application Service Models

User Datagram Protocol (UDP):

User Datagram Protocol

xkcd.com End To End Protocols End to End Protocols This section is about Process to Process communications.

CS 356: Introduction to Computer Networks. Lecture 16: Transmission Control Protocol (TCP) Chap. 5.2, 6.3. Xiaowei Yang

TCP. Sliding Windows, Flow Control, and Congestion Control. Networks : TCP Sliding Windows 1

Internet Protocols Fall Outline

Flow Control, and Congestion Control

Intro to LAN/WAN. Transport Layer

CSCI-1680 Transport Layer II Data over TCP Rodrigo Fonseca

Transport Layer: outline

TCP & UDP. Transport Layer. Transport. Network. Functions. End-to-end Reliable Byte Stream. Unreliable End-to-end. C.K. Kim

Page 1. Goals for Today" Placing Network Functionality" Basic Observation" CS162 Operating Systems and Systems Programming Lecture 15

TCP : Fundamentals of Computer Networks Bill Nace

TSIN02 - Internetworking

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

Lecture 5: Flow Control. CSE 123: Computer Networks Alex C. Snoeren

Transport Layer: Outline

CSC 4900 Computer Networks: TCP

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

Transport Protocols Reading: Sections 2.5, 5.1, and 5.2

TSIN02 - Internetworking

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

The Transport Layer: TCP & Reliable Data Transfer

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

UNIT IV. UDP TCP Adaptive Flow Control-Adaptive Retransmission Congestion Control Congestion avoidance QoS.

Reliable Transport I: Concepts and TCP Protocol

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

Chapter 5 End-to-End Protocols

Networking Technologies and Applications

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

TSIN02 - Internetworking

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

Transport Protocols Reading: Sections 2.5, 5.1, and 5.2

TSIN02 - Internetworking


Fast Retransmit. Problem: coarsegrain. timeouts lead to idle periods Fast retransmit: use duplicate ACKs to trigger retransmission

Flow Control, and Congestion Control

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

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

CSCI Topics: Internet Programming Fall 2008

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

Flow and Congestion Control Marcos Vieira

6.1 Internet Transport Layer Architecture 6.2 UDP (User Datagram Protocol) 6.3 TCP (Transmission Control Protocol) 6. Transport Layer 6-1

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

CSCD 330 Network Programming

05 Transmission Control Protocol (TCP)

Computer Networking Introduction

Transport Over IP. CSCI 690 Michael Hutt New York Institute of Technology

CSCE 463/612 Networks and Distributed Processing Spring 2017

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

The aim of this unit is to review the main concepts related to TCP and UDP transport protocols, as well as application protocols. These concepts are

CSE 4213: Computer Networks II

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

CSCD 330 Network Programming Winter 2015

Reliable Transport I: Concepts and TCP Protocol

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

Transport Protocols and TCP

Introduc)on to Computer Networks

Chapter 3 Transport Layer

Chapter 3 Transport Layer

Fall 2012: FCM 708 Bridge Foundation I

Transport layer. UDP: User Datagram Protocol [RFC 768] Review principles: Instantiation in the Internet UDP TCP

Transport Layer Marcos Vieira

Kent State University

Transport layer. Review principles: Instantiation in the Internet UDP TCP. Reliable data transfer Flow control Congestion control

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

Chapter III: Transport Layer

10 minutes survey (anonymous)

Mobile Transport Layer Lesson 02 TCP Data Stream and Data Delivery

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

PROBLEMSAND EXERCISES

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

Programming Assignment 3: Transmission Control Protocol

RSC Part III: Transport Layer 3. TCP

Transport Layer. -UDP (User Datagram Protocol) -TCP (Transport Control Protocol)

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

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

Transcription:

Transport Protocols CSCI 363 Computer Networks Department of Computer Science

Expected Properties Guaranteed message delivery Message order preservation No duplication of messages Support for arbitrarily large messages Support for sender/receiver synchronization Receiver based flow control Support multiple application processes per host 2

Relationship with other layers Application What are the expectations of the functionality provided by underlying layers? Higher layers Transport Add to the functionality provided by Transport Provides end-to-end features Network May drop, reorder, or duplicate messages. May introduce arbitrarily long delays. May limit the size of messages to a maximum value. 3

Transport Algorithms Simple asynchronous demultiplexing service Reliable byte-stream service Request/reply service 4

Simple Asynchronous Demultiplexing: UDP UDP PDU format 5

Reliable Byte Stream: TCP Application process Application process Write bytes Read bytes TCP Send buffer TCP Receive buffer Segment Segment Segment Transmit segments Use the concept of ports to demultiplex streams to the same host. Guarantees reliable, inorder delivery of a stream of bytes without duplication. Implements flow-control allowing the receiver to throttle the volume of data transmitted by the sender. Question: What is the difference between flowcontrol and congestion-control? 6

Segment Format TCP is a byte-oriented protocol. Question: What are the performance considerations that drive the implementation of such a protocol? 7

TCP Connection Establishment Active participant (client) SYN, SequenceNum = x (server) SYN+ACK, SequenceNum=y, Acknowledgment =x+1 ACK, Acknowledgment =y+1 Three-Way Handshake It takes 3 TCP segments to establish a connection. 8

TCP Connection Termination (client) (server) close (active close) FIN, SequenceNum=M ACK,Acknowledgement=M+1 FIN,SequenceNum=N (passive close) read returns 0 close ACK, Acknowledgement=N+1 It takes 4 TCP segments to terminate a connection. 9

Socket Functions TCP Client socket() socket() bind() listen() TCP Server connect() write() TCP 3-way handshake data (request) accept() block until connection from client read() process request read() close() data (reply) end-of-file notification write() read() close() 10

State Transition Diagram Question: How do your implement such a complex protocol? Question: How do you verify that your implementation conforms to the specifications? Note: Arcs are labeled with event/action. 11

Sliding Window TCP s sliding window algorithm: 1. Guarantees reliable delivery. 2. Guarantees in-order delivery. 3. Enforces flow control. Look again at the TCP segment header: The receiver tells the sender the number of unacknowledged bytes of data it will allow (based on buffer size). 12

Flow Control LastByteAcked<=LastByteSent LastByteSent<=LastByteWritten LastByteSent-LastByteAcked<=AdvertisedWindow EffectiveWindow=AdvertisedWindow- (LastByteSent-LastByteAcked) LastByteRead<NextByteExpected NextByteExpected<=LastByteRcvd+1 LastByteRcvd LastByteRead<=MaxRcvBuffer AdvertisedWindow =MaxRcvBuffer ((NextByteExpected-1)-LastByteRead) LastByteWritten LastByteAcked<=MaxSendBuffer 13

When The Window Hits Zero If the AdvertisedWindow reaches zero, the sender is not permitted to send any more data. TCP always sends a segment in response to a received data segment with the latest values for Acknowledge and AdvertisedWindow. The receiver doesn t, however, send a spontaneous segment with this information. Question: How does would the sender learn that the AdvertisedWindow has become greater than zero? 14

Triggering Transmission Question: How should TCP decide to send a segment? Sending application TCP 1. As soon as MSS (maximum segment size) bytes have been collected from sender. 2. Whenever the sending application explicitly requests it (push). 3. Whenever a timer fires and then however many bytes have been buffered so far are sent. 15

State Transition Diagram Question: How do your implement such a complex protocol? Question: How do you verify that your implementation conforms to the specifications? Note: Arcs are labeled with event/action. 16

Sliding Window TCP s sliding window algorithm: 1) Guarantees reliable delivery. 2) Guarantees in-order delivery. 3) Enforces flow control. Look again at the TCP segment header: The receiver tells the sender the number of unacknowledged bytes of data it will allow (based on buffer size). 17

When The Window Hits Zero If the AdvertisedWindow reaches zero, the sender is not permitted to send any more data. TCP always sends a segment in response to a received data segment with the latest values for Acknowledge and AdvertisedWindow. The receiver doesn t, however, send a spontaneous segment with this information. Question: How does would the sender learn that the AdvertisedWindow has become greater than zero? 18

Maximum Segment Size (MSS) Rule of thumb: Usually set to the size of the largest segment TCP can send without causing the local IP to fragment. IP header TCP header MSS= sizeof(mtu) - sizeof(ip header) sizeof(tcp header) MTU of the directly connected network 19

Aggressive Send Now, consider what happens in the presence of flow control: AdvertisedWindow=0, so the sender is accumulating bytes to send. ACK arrives and AdvertisedWindow=MSS/2. Question: Should the sender go ahead and send MSS/2 or wait for AdvertisedWindow to increase all the way to MSS? 20

Silly Window Syndrome Consequence of aggressively taking advantage of any available window. Think of the TCP stream as a conveyor belt: full data containers Sender Receiver empty data containers (ACKs) If the sender fills an empty container as soon as it arrives, the any small container introduced into the system remains indefinitely: it is immediately filled and emptied in each end. 21

Nagle s Algorithm Goal: Make the sender application wait long enough so that small containers are coalesced into larger ones, but not so much that interactive applications will suffer. Algorithm when (application has data to send) { if (available data>mss) && (AdvertisedWindow>MSS) send full segment else if (unacked data in transit) buffer the new data until an ACK arrives else send all the new data immediately } PS: On by default on a TCP socket; option TCP_NODELAY turns it off. 22

Adaptive Retransmissions Sender 5 Receiver Sender starts a timer, pushes the packet to receiver, and waits for ACK. If timer expires, the sender retransmits the packet. ACK arrives at Sender; if timer running, then turn off timer. Question: If the packets sent from the sender are identical, to which one does the ACK correspond? Question: What should the setting of the timer be? 5 CSCI 363 Computer Networks 23

Original Timeout Algorithm Goal: To keep a running average of the RTT between two host and use this value to set the timer. Sender 5 t t 5 Receiver Question: What should be? CSCI 363 Computer Networks 24

Karn/Partridge Algorithm ACK doesn t acknowledge a particular transmission. ACK acknowledges the receipt of data. Question: If you don t know which transmission is being ACKed, how do you compute SampleRTT? CSCI 363 Computer Networks 25

Solution: Karn/Partridge Algorithm Compute RTT only for the first transmission of a packet. Each time TCP retransmits a packet, set the timeout value to 2xTimeOut. Rationale: If packets are being lost, this is likely to be the consequence of congestion, so the sender should be less aggressive. CSCI 363 Computer Networks 26

Jacobson/Karels Algorithm RTT variance in the original computation should be considered: if it s small then EstimatedRTT is a trusted number and there is no need to use 2xTimeOut on retransmissions. CSCI 363 Computer Networks 27

Record Boundaries Problem: If TCP provides the abstraction of a byte stream, how can the receiver identify individual records? 1. Use the UrgentPtr and URG flag to mark the record boundary. 2. Use the PUSH flag: this means that whatever bytes sent to the receiver must be flushed out of the buffer. (The receiving side must support this option note that the socket API doesn t. 3. The application can insert its own markers in the data stream. CSCI 363 Computer Networks 28

TCP Extensions Since the header has variable length, it can be used to carry additional information. Not all hosts need to recognize the extensions, but when both sender and receiver do, they should agree to use them during the connection establishment. CSCI 363 Computer Networks 29

Extension 1: Better RTT Estimate Write a 32-bit timestamp on the outgoing segment. The receiver echoes the timestamp back to the sender in ACK segments. The sender can read its clock when it receives the ACK and computer a more accurate estimate of RTT. CSCI 363 Computer Networks 30

Extension 2: SeqNo Wrap Around Write a 32-bit timestamp on the outgoing segment. Using the 32-bit SequenceNumber field together with the timestamp increases the range to 64-bits. Note that timestamp is monotonically increasing and so it can be used to detect two different incarnations of the same SequenceNumber. CSCI 363 Computer Networks 31

Extension 3: Scale AdvertisedWindow High-speed networks have larger delay x bandwidth pipes. In order to keep them full, one may need more the a 32-bit AdvertisedWindow. A scaling factor can be used together with AdvertisedWindow. If the scaling factor is 2, then AdvertisedWindow states how many unacknowledged 16-bits the sends can push out. CSCI 363 Computer Networks 32

Remote Procedure Call 33

RPC Concepts Remote Procedure Call is a mechanism for structuring distributed systems. It is based on the semantics of a local procedure call: The application program makes a call intro a procedure without regard for whether it is executed locally or remotely and blocks until the call returns. Remember that the network between caller and callee (client and server) may not be reliable (duplicated or lost messages) and that there may be significant architectural differences between the two hosts (different data representation). 34

RPC Mechanism The major components in RPC are: 1. A protocol between caller and callee that makes up for the undesirable properties of the network. 2. Programming language and compiler support: the arguments of a call must be put into a request message and then translated to the callee s conventions. The returned data goes through a similar process. 35

RPC Protocol Design The RPC protocol must provide several different functions, mainly: Fragmenting and reassembling large messages, Synchronizing request and reply messages, and Dispatching request messages to the correct process. 36

A Simple RPC Protocol Stack RPC is a generic term, not a specific standard like UDP, or TCP. This gives us the opportunity to design our own RPC protocol from scratch. Our design will be based on three microprotocols: BLAST: fragmentation and reassembly, CHAN: synchronization of reply and request messages, and SELECT: dispatching of request messages to the correct process. 37

BLAST The design principle behind BLAST is to send all fragments to the receiver without waiting for each one to be acknowledged individually. The receiver uses a selective retransmission request (SRR) as partial acknowledgements. Format for BLAST message header: Spend a few minutes discussing with your group how we can make BLAST work. Also, think of what you would need to store in its message header. 38

CHAN Microprotocol CHAN implements synchronization in the request/reply algorithm. It must also guarantee reliable message delivery (no loss, no duplication). The protocol preserves the semantics at-mostonce: for every request message, either zero or one copy is delivered to the server. When replies come almost immediately after request, implicit acknowledgements can be used. 39

CHAN Format for CHAN message header: Spend a few minutes brainstorming with your group. Try to provide answers to the following questions: What message types CHAN needs? How can CHAN distinguish a dead server from a slow server? If you use message identifiers, how would CHAN deal with hosts that reboot and reset the identifier to the same old starting value? How would CHAN implement synchronization? 40

SELECT Microprotocol SELECT must dispatch request messages to the appropriate procedure in the server host. Brainstorm with your group and attempt to identify the issues that drive an implementation of SELECT. Two important points to consider are: The addressing scheme used to identify each procedure. SELECT is a good place to manage concurrency: if client (or caller) is multi-threaded, since CHAN allows only one outstanding call at a time, SELECT should allow for calls made from independent threads to execute concurrently rather than sequentially. 41