ETSF05/ETSF10 Internet Protocols Transport Layer Protocols

Similar documents
Transport Protocols & TCP TCP

Transport Protocols and TCP

Transport Protocols and TCP: Review

Transport Protocols. ISO Defined Types of Network Service: rate and acceptable rate of signaled failures.

Lecture 3: The Transport Layer: UDP and TCP

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

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

Chapter 24. Transport-Layer Protocols

ETSF10 Internet Protocols Transport Layer Protocols

UNIT IV -- TRANSPORT LAYER

User Datagram Protocol (UDP):

UNIT IV TRANSPORT LAYER

Computer Networks. Wenzhong Li. Nanjing University

Chapter 6. What happens at the Transport Layer? Services provided Transport protocols UDP TCP Flow control Congestion control

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

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

Stream Control Transmission Protocol

TSIN02 - Internetworking

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

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. The transport layer is responsible for the delivery of a message from one process to another. RSManiaol

User Datagram Protocol

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

Guide To TCP/IP, Second Edition UDP Header Source Port Number (16 bits) IP HEADER Protocol Field = 17 Destination Port Number (16 bit) 15 16

05 Transmission Control Protocol (TCP)

TCP/IP Protocol Suite 1

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

Chapter 5 End-to-End Protocols

CCNA Exploration Network Fundamentals. Chapter 04 OSI Transport Layer

TSIN02 - Internetworking

IS370 Data Communications and Computer Networks. Chapter 5 : 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

Transport Layer. Gursharan Singh Tatla. Upendra Sharma. 1

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

TRANSPORT PROTOCOLS CHAPTER Connection-Oriented Transport Protocol Mechanisms 20.2 TCP TCP Congestion Control 20.4 UDP

Transmission Control Protocol. ITS 413 Internet Technologies and Applications

Networking Technologies and Applications

TSIN02 - Internetworking

Transmission Control Protocol (TCP) TCP Services EECS 3214

CS 5520/ECE 5590NA: Network Architecture I Spring Lecture 13: UDP and TCP

Sequence Number. Acknowledgment Number. Data

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

Transport Layer Protocols TCP

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

The Transport Layer: TCP & Reliable Data Transfer

Introduction to Networks and the Internet

ITS323: Introduction to Data Communications

OSI Transport Layer. objectives

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

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

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

Computer Networking Introduction

TCP/IP. Chapter 5: Transport Layer TCP/IP Protocols

TSIN02 - Internetworking

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

CSCD 330 Network Programming Winter 2015

ECE697AA Lecture 3. Today s lecture

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

Transport Layer: outline

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

CSCE 463/612 Networks and Distributed Processing Spring 2017

TCP Congestion Control

TCP Congestion Control

Introduction to Protocols

Transport Layer: Outline

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

CSC 401 Data and Computer Communications Networks

CSC 4900 Computer Networks: TCP

Chapter 3- parte B outline

CS457 Transport Protocols. CS 457 Fall 2014

What is TCP? Transport Layer Protocol

CS4700/CS5700 Fundamentals of Computer Networks

Introduction to Networking. Operating Systems In Depth XXVII 1 Copyright 2017 Thomas W. Doeppner. All rights reserved.

Unit 2.

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

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

CSCI-GA Operating Systems. Networking. Hubertus Franke

Outline. Connecting to the access network: DHCP and mobile IP, LTE. Transport layer: UDP and TCP

Computer Communication Networks Midterm Review

Multiple unconnected networks

4.0.1 CHAPTER INTRODUCTION

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

TCP: Flow and Error Control

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

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

CNT 6885 Network Review on Transport Layer

Network Technology 1 5th - Transport Protocol. Mario Lombardo -

Information Network 1 TCP 1/2. Youki Kadobayashi NAIST

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

Application. Transport. Network. Link. Physical

Introduction to TCP/IP networking

Connectionless and Connection-Oriented Protocols OSI Layer 4 Common feature: Multiplexing Using. The Transmission Control Protocol (TCP)

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

image 3.8 KB Figure 1.6: Example Web Page

7. TCP 최양희서울대학교컴퓨터공학부

The Transmission Control Protocol (TCP)

Computer Networks and Data Systems

Internet and Intranet Protocols and Applications

TCP/IP-2. Transmission control protocol:

Transcription:

ETSF05/ETSF10 Internet Protocols Transport Layer Protocols 2016 Jens Andersson

Transport Layer Communication between applications Process-to-process delivery Client/server concept Local host Normally initialiser Remote host Normally always on server 2016-11-22 ETSF05/ETSF10 - Internet Protocols 3

IP addresses and port numbers 2016-11-22 ETSF05/ETSF10 - Internet Protocols 4

Socket addresses Combination of IP address & port number Unique for each process on the host 2016-11-22 ETSF05/ETSF10 - Internet Protocols 5

Two Transport Mechanisms Two basic types of transport service: Connectionless or Datagram Service Connection-oriented Establishment, maintenance and termination of a logical connection between TS users Has a wide variety of applications Most common Implies service is reliable 2016-11-22 ETSF05/ETSF10 - Internet Protocols 6

User Datagram Protocol (UDP) Transport-level protocol that is commonly used as part of the TCP/IP protocol suite RFC 768 Provides a connectionless service for application-level procedures Unreliable service; delivery and duplicate protection are not guaranteed Reduces overhead and may be adequate in many cases 2016-11-22 ETSF05/ETSF10 - Internet Protocols 7

User Datagram Packet format 2016-11-22 ETSF05/ETSF10 - Internet Protocols 8

IPv4 Pseudoheader for Checksum Calculation Optional for IPv4, mandatory for IPv6 Data not included in IPv6 Used also for TCP Cross Layer! 2016-11-22 ETSF05/ETSF10 - Internet Protocols 9

How to Deal with Unreliable Network Service Examples: Internetwork using IP IEEE 802.3 & 802.11 LAN using the unacknowledged connectionless LLC service Segments are occasionally lost and may arrive out of sequence due to variable transit delays 2016-11-22 ETSF05/ETSF10 - Internet Protocols 10

Issues to Address Ordered delivery Duplicate detection Retransmission strategy Flow control (sender/receiver) Connection establishment Connection termination Failure recovery 2016-11-22 ETSF05/ETSF10 - Internet Protocols 11

Ordered Delivery With an unreliable network service it is possible that segments may arrive out of order Solution: number segments sequentially TCP uses scheme where each data octet is implicitly numbered 2016-11-22 ETSF05/ETSF10 - Internet Protocols 12

Duplicate Detection Receiver must be able to recognize duplicates Segment sequence numbers help Complications arise if: A duplicate is received prior to the close of the connection Sender must not get confused if it receives multiple acknowledgments to the same segment Sequence number space must be long enough A duplicate is received after the close of the connection 2016-11-22 ETSF05/ETSF10 - Internet Protocols 13

Transport Entity A A times out and retransmits SN = 1 A times out and r etr ansmits SN = 201 Transport Entity B Max window size and number of bits for sequence number are dependent! SN = 1 AN = 601, W = 600 SN = 201 SN = 201 SN = 401 SN = 1 AN = 601, W = 600 SN = 601 AN = 801, W = 600 SN = 801 AN = 1001, W = 600 SN = 1001 AN = 1201, W = 600 SN = 1201 AN = 1401, W = 600 SN = 1401 SN = 1 Obsolete SN = 1 arrives AN = 1, W = 600 AN = 201, W = 600 Figure 15.5 Example of I ncorrect Duplicate Detection 2016-11-22 ETSF05/ETSF10 - Internet Protocols 14

Retransmission Strategy Events necessitating retransmission: Segment may be damaged in transit but still arrives at its destination Segment fails to arrive Sending entity does not know transmission was unsuccessful Receiver acknowledges successful receipt by returning a segment containing an acknowledgment number Cont. 2016-11-22 ETSF05/ETSF10 - Internet Protocols 15

Retransmission Strategy No acknowledgment if a segment does not arrive successfully A timer needs to be associated with each segment as it is sent If timer expires before acknowledgment is received, sender must retransmit See Table 15.1 for Transport Protocol Timers 2016-11-22 ETSF05/ETSF10 - Internet Protocols 16

Connection Establishment and Termination Serves three main purposes: Allows each end to assure that the other exists Allows exchange or negotiation of optional parameters Triggers allocation of transport entity resources Is by mutual agreement 2016-11-22 ETSF05/ETSF10 - Internet Protocols 17

Remarks on Connection Establishment Must take into account the unreliability of a network service Calls for the exchange of SYNs (two way handshake minimum) Could result in: Duplicate SYNs Duplicate data segments Check Figures 15.4, 15.6 15.9 for details 2016-11-22 ETSF05/ETSF10 - Internet Protocols 18

Remarks on Connection Termination Two-way handshake was found to be inadequate for an unreliable network service Out of order segments could cause the FIN segment to arrive before the last data segment To avoid this problem the next sequence number after the last octet of data can be assigned to FIN Each side must explicitly acknowledge the FIN of the other using an ACK with the sequence number of the FIN to be acknowledged 2016-11-22 ETSF05/ETSF10 - Internet Protocols 20

Remarks on Failure Recovery When the system that the transport entity is running on fails and subsequently restarts, the state information of all active connections is lost Affected connections become half open because the side that did not fail does not realize the problem Still active side of a half-open connection can close the connection using a keepalive timer Cont 2016-11-22 ETSF05/ETSF10 - Internet Protocols 22

Failure Recovery (cont.) In the event that a transport entity fails and quickly restarts, half-open connections can be terminated more quickly by the the use of the RST segment (RST = RESET) Failed side returns an RST i to every segment i that it receives RST i must be checked for validity on the other side If valid an abnormal termination occurs There is still the chance that some user data will be lost or duplicated 2016-11-22 ETSF05/ETSF10 - Internet Protocols 23

Reliable Sequencing Network Service Issues: Addressing Multiplexing Flow control Connection establishment/termination 2016-11-22 ETSF05/ETSF10 - Internet Protocols 24

Flow Control Reasons for control: User of the receiving transport entity cannot keep up with the flow Receiving transport entity itself cannot keep up with the flow of segments Complex at the transport layer: Considerable delay in the communication of flow control information Amount of the transmission delay may be highly variable, making it difficult to effectively use a timeout mechanism for retransmission of lost data 2016-11-22 ETSF05/ETSF10 - Internet Protocols 26

Alternatives to Flow Control Requirements Do nothing Segments that overflow the buffer are discarded Sending transport entity will retransmit Refuse to accept further segments from the network service Relies on network service to do the work (backpressure) Receiving transport entity can: Use a fixed sliding window protocol (Window size never changes) With a reliable network service this works quite well Use a credit scheme Receiver controls senders window size A more effective scheme to use with an unreliable network service Compare with ACK 2016-11-22 ETSF05/ETSF10 - Internet Protocols 27

Sliding Windows: Reminder Sender Receiver 2016-11-22 ETSF05/ETSF10 - Internet Protocols 28 ETSF05/ETSF10 - Internet Protocols 28

Congestion Control in Packet-Switching Networks Send control packet to some or all source nodes Requires additional traffic during congestion Rely on routing information May vary too quickly End to end probe packets Adds to overhead Add congestion information to packets in transit Either backwards or forwards 2016-11-22 ETSF05/ETSF10 - Internet Protocols 29

Congestion control methods Avoiding and eliminating congestion Open-loop = proactive Closed-loop = reactive 2016-11-22 ETSF05/ETSF10 - Internet Protocols 30

Closed-loop congestion control (1) Backpressure 2016-11-22 ETSF05/ETSF10 - Internet Protocols 31

Closed-loop congestion control (2) Choke packet 2016-11-22 ETSF05/ETSF10 - Internet Protocols 32

TCP Services RFC 793 TCP labels data as: Data stream Push Urgent data signaling Defined in terms of primitives and parameters (see Tables 15.2, 15.3 & 15.4 for details) 2016-11-22 ETSF05/ETSF10 - Internet Protocols 33

TCP header format 2016-11-22 ETSF05/ETSF10 - Internet Protocols 34

TCP Mechanisms Can be grouped into: Connection establishment Always uses a threeway handshake Connection is determined by host and port Data transfer Viewed logically as consisting of a stream of octets Flow control is exercised using credit allocation (Received ACKs open the sender window) Connection termination Each TCP user must issue a CLOSE primitive An abrupt termination occurs if the user issues an ABORT primitive 2016-11-22 ETSF05/ETSF10 - Internet Protocols 35

Active Open send SYN CLOSED Passive Open Reference Close Close SYN SENT LI STEN Receive SYN Close Send FI N ESTAB Receive SYN Send SYN Receive FIN Legend: Event Action FIN WAIT CLOSE WAIT State Receive FIN CLOSED Close Send FIN Figure 15.3 Simple Connection State Diagram 2016-11-22 ETSF05/ETSF10 - Internet Protocols 36

TCP Three Way Handshake 2016-11-22 ETSF05/ETSF10 - Internet Protocols 37

TCP Connection termination 2016-11-22 ETSF05/ETSF10 - Internet Protocols 38

TCP Half-close 2016-11-22 ETSF05/ETSF10 - Internet Protocols 39

TCP Flow Control Transport Entity A Transport Entity B...1000 1001 2400 2401......1000 1001 2400 2401... A may send 1400 octets SN = 1001 SN = 1201 B is prepared to receive 1400 octets, beginning with 1001...1000 1001 1601 2401... A shr inks its tr ansmit window with each transmission...1000 1001 2001 2401... Window decreased...1600 1601 2001 2601... A adjusts its window with each credit...1600 1601 2600 2601... A exhausts its credit Window increased...2600 2601 4000 4001... SN = 1401 SN = 1601 SN = 1801 AN = 1601,W = 1000 SN = 2001 SN = 2201 SN = 2401 AN = 2601,W = 1400...1600 1601 2601... B acknowledges 3 segments (600 octets), but is only prepared to receive 200 additional octets beyond the original budget (i.e., B will accept octets 1601 through 2600)...1600 1601 2001 2601......2600 2601 4000 4001... B acknowledges 5 segments (1000 octets) and restores the original amount of credit A receives new credit Flow controlled by receiver! Figure 15.1 Example of TCP Credit Allocation M echanism 2016-11-22 ETSF05/ETSF10 - Internet Protocols 40

TCP Implementation Policy Options Implementation opportunities: Send policy Deliver policy Accept policy Retransmit policy Acknowledge policy 2016-11-22 ETSF05/ETSF10 - Internet Protocols 41

Send Policy In the absence of both pushed data and a closed transmission window a sending TCP entity is free to transmit data at its own convenience TCP may construct a segment for each batch of data provided or it may wait until a certain amount of data accumulates before constructing and sending a segment Infrequent and large transmissions have low overhead in terms of segment generation and processing If transmissions are frequent and small, the system is providing quick response 2016-11-22 ETSF05/ETSF10 - Internet Protocols 42

Deliver Policy In the absence of a Push, a receiving TCP entity is free to deliver data to the user at its own convenience May deliver as each in-order segment is received, or may buffer data before delivery If deliveries are infrequent and large, the user is not receiving data as promptly as may be desirable If deliveries are frequent and small, there may be unnecessary processing, as well as operating system interrupts 2016-11-22 ETSF05/ETSF10 - Internet Protocols 43

Accept Policy If segments arrive out of order the receiving TCP entity has two options: In-order Accepts only segments that arrive in order; any segment that arrives out of order is discarded Makes for simple implementation but places a burden on the networking facility If a single segment is lost in transit, then all subsequent segments must be retransmitted In-window Accepts all segments that are within the receive window Requires a more complex acceptance test and a more sophisticated data storage scheme 2016-11-22 ETSF05/ETSF10 - Internet Protocols 44

Retransmit Policy Retransmission strategies: Retransmit First-only Retransmit Batch/All Retransmit Individual Maintain one retransmission timer for entire queue Efficient in terms of traffic generated Can have considerable delays Maintain one retransmission timer for entire queue Reduces the likelihood of long delays May result in unnecessary retransmissions Maintain one timer for each segment in the queue More complex implementation 2016-11-22 ETSF05/ETSF10 - Internet Protocols 45

Acknowledge Policy Timing of acknowledgment: 2016-11-22 ETSF05/ETSF10 - Internet Protocols 46

TCP Congestion Control Parallel to but separate from Flow Control Congestion window Sliding window (byte-oriented) Variable size Hybrid impl. (Go-back-N & Selective repeat) Slow start (state) Congestion avoidance (state) Congestion detection (event to act upon) 2016-11-22 ETSF05/ETSF10 - Internet Protocols 47

Table 20.1 Implementation of TCP Congestion Control Measures 2016-11-22 ETSF05/ETSF10 - Internet Protocols 48

Retransmission Timer Management Essential! Virtually all TCP implementations estimates RTT and sets timer to a somewhat higher value. Static RTT Cannot adapt to network conditions Simple average RTT Over a number of segments Works well if average is a good predictor Exponential average RTT predicting the next value on the basis of a time series of past values (RFC 793) 2016-11-22 ETSF05/ETSF10 - Internet Protocols 49

Congestion window = credit 2016-11-22 ETSF05/ETSF10 - Internet Protocols 51

Window Management The size of TCP s send window can have a critical effect on whether TCP can be used efficiently without causing congestion Two techniques found in virtually all modern implementation of TCP are: Slow start Dynamic window sizing on congestion Combined with flow control (credit) awnd = MIN[rwnd, cwnd] Credit = rwnd 2016-11-22 ETSF05/ETSF10 - Internet Protocols 52

Slow start: Exponential increase For each ACK: cwnd = cwnd +1 2016-11-22 ETSF05/ETSF10 - Internet Protocols 54

Congestion avoidance: Additive increase For each RTT/ Round : cwnd = cwnd +1 2016-11-22 ETSF05/ETSF10 - Internet Protocols 55

Reaction to Congestion Detection Detection by time-out (RTO) Probably both channels congested New slow start phase Detection by three ACK of same segment Indicates lost segment (= hole in segment sequence) Probably sending channel congested only New congestion avoidance phase RTO Retransmission Timer Overflow 2016-11-22 ETSF05/ETSF10 - Internet Protocols 56

TCP congestion policy: Summary 2016-11-22 ETSF05/ETSF10 - Internet Protocols 57

Fast Retransmit Fast Recover After three duplicate ACKs Under some circumstances improve on the performance provided by RTO Takes advantage of the rule that if a TCP entity receives a segment out of order, it must immediately issue an ACK for the last in-order segment that was received Retransmit the lost segment, cut cwnd in half, and then proceed with the linear increase of cwnd RFC 3782 modifies the fast recovery algorithm to improve the response when two segments are lost within a single window 2016-11-22 ETSF05/ETSF10 - Internet Protocols 58

TCP congestion policy: Example 2016-11-22 ETSF05/ETSF10 - Internet Protocols 59

Random Early Discard (RED) Buffers in routers can detect congestion (buffer overflow) Buffer overflow impact on TCP: Problably RTO All TCP connections affected Will return to slowstart; synkronised RED: Start discarding packets randomly before buffer overflow Single pkt loss = Fast Restransmitt, cwnd = cwnd/2 Compare with ECN flag in IP header 2016-11-22 ETSF05/ETSF10 - Internet Protocols 60

TCP operation: Summary Connection establishment Three-way handshake Data transfer Flow control ( congestion control) Error control Connection termination Three-way handshake Half-close 2016-11-22 ETSF05/ETSF10 - Internet Protocols 61