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

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

EEC-484/584 Computer Networks. Lecture 16. Wenbing Zhao

Transport Layer. Gursharan Singh Tatla. Upendra Sharma. 1

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

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

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 23.1

Transport Protocols and TCP

Lecture 3: The Transport Layer: UDP and TCP

User Datagram Protocol (UDP):

05 Transmission Control Protocol (TCP)

Chapter 24. Transport-Layer Protocols

Internet and Intranet Protocols and Applications

ETSF05/ETSF10 Internet Protocols Transport Layer Protocols

Transport Protocols and TCP: Review

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

UNIT IV -- TRANSPORT LAYER

TSIN02 - Internetworking

Transport Protocols & TCP TCP

User Datagram Protocol

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

TSIN02 - Internetworking

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

QUIZ: Longest Matching Prefix

TSIN02 - Internetworking

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

The Transmission Control Protocol (TCP)

CS4700/CS5700 Fundamentals of Computer Networks

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

Networking Technologies and Applications

TSIN02 - Internetworking

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

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

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)

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

Introduction to Networks and the Internet

OSI Transport Layer. objectives

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

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

ECE 650 Systems Programming & Engineering. Spring 2018

Intro to LAN/WAN. Transport Layer

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

EEC-682/782 Computer Networks I

CS457 Transport Protocols. CS 457 Fall 2014

COMP/ELEC 429/556 Introduction to Computer Networks

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

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

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

Computer Communication Networks Midterm Review

Stream Control Transmission Protocol

Transport Layer. The transport layer is responsible for the delivery of a message from one process to another. RSManiaol

6. The Transport Layer and protocols

NWEN 243. Networked Applications. Layer 4 TCP and UDP

Transport Layer Marcos Vieira

Introduction to Protocols

Connection-oriented (virtual circuit) Reliable Transfer Buffered Transfer Unstructured Stream Full Duplex Point-to-point Connection End-to-end service

Information Network 1 TCP 1/2. Youki Kadobayashi NAIST

Transmission Control Protocol. ITS 413 Internet Technologies and Applications

The Transport Layer: TCP & Reliable Data Transfer

Page 1. Goals for Today" Discussion" Example: Reliable File Transfer" CS162 Operating Systems and Systems Programming Lecture 11

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

TCP/IP Protocol Suite 1

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

CMPE 150 Winter 2009

TCP : Fundamentals of Computer Networks Bill Nace

CSCE 463/612 Networks and Distributed Processing Spring 2017

CS 716: Introduction to communication networks th class; 7 th Oct Instructor: Sridhar Iyer IIT Bombay

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

Introduction to TCP/IP networking

Unit 2.

CSE 4213: Computer Networks II

CSCI-GA Operating Systems. Networking. Hubertus Franke

9th Slide Set Computer Networks

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

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

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

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

ECE697AA Lecture 3. Today s lecture

Computer Networks. Wenzhong Li. Nanjing University

UNIT IV TRANSPORT LAYER

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

Unix Network Programming

CS321: Computer Networks Error and Flow Control in TCP

Sequence Number. Acknowledgment Number. Data

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

ITS323: Introduction to Data Communications

Fall 2012: FCM 708 Bridge Foundation I

CSC 4900 Computer Networks: TCP

TRANSMISSION CONTROL PROTOCOL. ETI 2506 TELECOMMUNICATION SYSTEMS Monday, 7 November 2016

Information Network 1 TCP 1/2

10 minutes survey (anonymous)

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

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

Chapter 3- parte B outline

What is TCP? Transport Layer Protocol

NT1210 Introduction to Networking. Unit 10

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

CMPE 80N: Introduction to Networking and the Internet

Transcription:

Lecture 20 Overview Last Lecture Transport Control Protocol (1) This Lecture Transport Control Protocol (2) Source: chapters 23, 24 Next Lecture Internet Applications Source: chapter 26 COSC244 & TELE202 Lecture 20 - Transport Control Protocol 2 1

Error Control TCP is a reliable transport layer protocol Deliver a stream of data in order, without error, and without any part lost or duplicated Provide mechanisms for detecting Duplicated segments Lost segments Out-of order segments Corrupted segments Provide a mechanism for error correction Error detection and correction in TCP is achieved by Checksum Acknowledgement Time-out and retransmission COSC244 & TELE202 Lecture 20 - Transport Control Protocol 2 2

TCP Segment Header Data HLEN 4 bits Source port address 16 bits Reserved 6 bits U R G Checksum 16 bits A C K Destination port address 16 bits Sequence number 32 bits Acknowledgement number 32 bits P S H R S T S Y N F I N Options and Padding Window size 16 bits Urgent pointer 16 bits COSC244 & TELE202 Lecture 20 - Transport Control Protocol 2 3

Error Control (cont.) Checksum Each segment includes a checksum field to check for a corrupted segment A corrupted segment is discarded and considered as lost Acknowledgement Each segment except ACK segment is acknowledged on receipt Retransmission Retransmission time-out (RTO) timer: retransmit when the timer expires. The timer is set based on the round-trip time (RTT). Three-duplicate-ACKs rule: retransmit after receiving three duplicate ACK segments. This is applied when the receiver receives many out-of-order segments that can not be buffered. This feature is referred to as fast retransmission. COSC244 & TELE202 Lecture 20 - Transport Control Protocol 2 4

Duplicate Segments Duplicate segments can be detected and discarded using sequence number. Entity 1 Entity 2 old duplicate SYN seq: 8000 SYN+ACK seq: 15000 ack: 8001 The same for data segments REJECT seq: 8000 ack:15001 COSC244 & TELE202 Lecture 20 - Transport Control Protocol 2 5

Out-of-order Segments Out-of-order segments can be detected using the sequence number. Out-of-order segments are not discarded. Instead the receiver maintains a sliding window that temporally buffers the out-oforder segments until the missing segment arrives. Out-of-order segments will not be delivered to the process. COSC244 & TELE202 Lecture 20 - Transport Control Protocol 2 6

Lost/corrupted Segments A lost segment and a corrupted segment are treated in the same way by the receiver. Both are considered lost. Time-out + Retransmission The sender sets the RTO timer when sending a segment. If the sender does not receive the corresponding acknowledgement when the timer fires, it assumes the segment is lost and retransmits the segment. What will happen if the FIN and ACK segments in threeway handshaking for connection termination are lost? COSC244 & TELE202 Lecture 20 - Transport Control Protocol 2 7

The Two Army Problem The set-up A white army is encamped in a valley. On both of the surrounding hillsides are blue armies. The white army is larger than either of the blue armies alone, but together they are larger than the white army. If either blue army attacks by itself, it will be defeated, but if both blue armies attack simultaneously, they will be victorious. The communication medium between the two blue armies is to send messengers on foot down into the valley, where they might be captured and the message lost. COSC244 & TELE202 Lecture 20 - Transport Control Protocol 2 8

The Two Army Problem (cont.) The question Is there a protocol that guarantees the blue armies will win? COSC244 & TELE202 Lecture 20 - Transport Control Protocol 2 9

Three-way Handshake Disconnect with a Timer Timer is used - If there is no TPDU from the other party for some time, disconnect anyway. The protocol can fail if all transmissions except the initial connection request are all lost. The sender will give up and delete the connection, while the other side knows nothing about the attempts to disconnect and is still fully active. This situation is called half-open connection. COSC244 & TELE202 Lecture 20 - Transport Control Protocol 2 10

COSC244 & TELE202 Lecture 20 - Transport Control Protocol 2 11

Flow Control Transport protocols resemble the data link protocols Flow control, error control A sliding window is used for flow control Why cannot use the same flow control scheme at data link layer? A router usually has only a few links to others, while a transport entity may have numerous connections. This difference makes it impractical to implement a data link buffering strategy in the transport layer. COSC244 & TELE202 Lecture 20 - Transport Control Protocol 2 12

Flow Control (cont. ) TCP sliding window is byte-oriented, not frame-oriented has a variable size. Window size = minimum (rwnd, cwnd) n-1 n n+1 m-1 m m+1 The size of the window is determined by: Receiver window (rwnd) Congestion window (cwnd) The sliding window protocol in TCP looks like the Selective Repeat protocol as the receiver holds the out-of-order segments. COSC244 & TELE202 Lecture 20 - Transport Control Protocol 2 13

Flow Control (cont.) Dynamic buffer management - credit mechanism Initially, the sender requests a certain number of buffers (credit), based on its perceived needs. The receiver grants as many of these as it can afford. Every time the sender transmits a TPDU, it decreases its allocation (credit), stopping when the allocation (credit) reaches zero. The receiver returns both acknowledgments and buffer allocations (credit). May be piggybacked COSC244 & TELE202 Lecture 20 - Transport Control Protocol 2 14

Flow Control (cont.) COSC244 & TELE202 Lecture 20 - Transport Control Protocol 2 15

Flow Control (cont.) Assume that when the connection is established, entities A and B have initial sequence numbers 100 and 700 respectively, and each entity agrees to a credit of 200 bytes. Assume entities send 100 bytes in each TPDU. A starts by sending two TPDUs and then waits because it has used up its credit. At time t2, B removes the first received TPDU from the buffer and also finds 100 more bytes of buffer space; so B now has 200 bytes space available and tells A in the credit field of a TPDU. After A receives the 200 bytes credit, it can send two additional TPDUs. COSC244 & TELE202 Lecture 20 - Transport Control Protocol 2 16

Congestion Control in TCP Congestion policy has three phases: Slow start The cwnd starts with one maximum segment size (MSS) The cwnd increases one MSS each time an ACK is received. Start slowly, but grows exponentially. Congestion avoidance Use additive increase instead of exponential increase. When the size of the congestion window reaches the slow-start threshold, the slow-start phase stops, and the additive phase begins. Congestion detection Multiplicative decrease: the size of the threshold is dropped to one-half. COSC244 & TELE202 Lecture 20 - Transport Control Protocol 2 17

Congestion Control in TCP (cont.) cwnd Threshold=20 time-out Threshold=16 Threshold=10 time COSC244 & TELE202 Lecture 20 - Transport Control Protocol 2 18

User Datagram Protocol (UDP) Connectionless unreliable transport protocol SMTP FTP TELNET DNS Application layer TCP UDP Transport layer IP and ICMP Lower layer protocols Network layer Data link layer Simple interface between IP and higher layer protocols Add nothing to the services of IP except to provide process to process communication. Why needs this protocol? A simple protocol using a minimum of overhead Useful in applications that require simple request-response communication with little concern for flow and error control. COSC244 & TELE202 Lecture 20 - Transport Control Protocol 2 19

User Datagram Protocol (cont.) User datagram format Header Data Source port address 16 bits Total length 16 bits Destination port address 16 bits Checksum 16 bits No flow control mechanism No error control mechanism except the checksum COSC244 & TELE202 Lecture 20 - Transport Control Protocol 2 20

How to Develop the Program? Socket Programming What is a socket? telephone network Sockets represent endpoints in a line of communication. A socket is a software component characterized by a unique combination of Local socket address: local IP address and port number Remote socket address: only for TCP sockets Protocol: TCP, UDP COSC244 & TELE202 Lecture 20 - Transport Control Protocol 2 21

Socket Programming Socket Address: the combination of an IP address and a port number (a 16-bit unsigned integer, ranging from 0 to 65535). Socket API: an application programming interface, usually provided by the operating system. COSC244 & TELE202 Lecture 20 - Transport Control Protocol 2 22

Socket Programming (cont.) Primitives for socket socket - create a communication end point (bind - attach a local address to a socket) (listen - wait for a connection) accept - accept a connection request (connect - attempt to establish a connection) send/write - send data over the connection recv/read - receive data from the connection close - close the connection COSC244 & TELE202 Lecture 20 - Transport Control Protocol 2 23

Summary Concepts TCP TCP segment and its format Credit mechanism UDP Socket Flow control and error control in transport layer Differences of flow control between transport and data link layers Why error control in transport layer Sockets COSC244 & TELE202 Lecture 20 - Transport Control Protocol 2 24