Lecture 3: The Transport Layer: UDP and TCP

Similar documents
Lecture 4: The Transport Layer and UDP

Transport Protocols and TCP

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

TSIN02 - Internetworking

TSIN02 - Internetworking

TSIN02 - Internetworking

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

TSIN02 - Internetworking

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

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

Networking Technologies and Applications

Computer Networks. Wenzhong Li. Nanjing University

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

ETSF05/ETSF10 Internet Protocols Transport Layer Protocols

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

Transport Layer. Gursharan Singh Tatla. Upendra Sharma. 1

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

Transport Protocols & TCP TCP

OSI Transport Layer. objectives

Transport Layer. <protocol, local-addr,local-port,foreign-addr,foreign-port> ϒ Client uses ephemeral ports /10 Joseph Cordina 2005

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

ECE 650 Systems Programming & Engineering. Spring 2018

EEC-682/782 Computer Networks I

Chapter 24. Transport-Layer Protocols

Internet and Intranet Protocols and Applications

Introduction to Networks and the Internet

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

05 Transmission Control Protocol (TCP)

User Datagram Protocol (UDP):

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

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

Transmission Control Protocol. ITS 413 Internet Technologies and Applications

The Transport Layer: TCP & Reliable Data Transfer

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

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

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

Transport Protocols and TCP: Review

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

CCNA Exploration Network Fundamentals. Chapter 04 OSI Transport Layer

ITS323: Introduction to Data Communications

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

Transport Layer Protocols. Internet Transport Layer. Agenda. TCP Fundamentals

Computer Communication Networks Midterm Review

Transmission Control Protocol (TCP)

Transport Layer: outline

Unit 2.

Transport Layer Protocols TCP

User Datagram Protocol

Chapter 5 End-to-End Protocols

Fall 2012: FCM 708 Bridge Foundation I

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

ECE 435 Network Engineering Lecture 15

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

CSE 4213: Computer Networks II

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

Different Layers Lecture 20

6. The Transport Layer and protocols

UNIT IV TRANSPORT LAYER

TCP : Fundamentals of Computer Networks Bill Nace

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

Sequence Number. Acknowledgment Number. Data

ECE697AA Lecture 3. Today s lecture

CSC 401 Data and Computer Communications Networks

Introduction to TCP/IP networking

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

UNIT IV -- TRANSPORT LAYER

TCP /IP Fundamentals Mr. Cantu

Development of reliable protocol Sliding window protocols. C = channel capacity in bps I = interrupt/service time + propagation delay

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

Transport Layer: Outline

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

CMPE 80N: Introduction to Networking and the Internet

Kent State University

TCP Congestion Control

TCP Congestion Control

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

Chapter 7. The Transport Layer

CSC 4900 Computer Networks: TCP

Simulation of TCP Layer

What is TCP? Transport Layer Protocol

Transport Layer Marcos Vieira

Lecture 5. Transport Layer. Transport Layer 1-1

CCNA 1 Chapter 7 v5.0 Exam Answers 2013

Two approaches to Flow Control. Cranking up to speed. Sliding windows in action

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

Computer Networking Introduction

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

CS457 Transport Protocols. CS 457 Fall 2014

Chapter 6 Transport Layer

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

TCP/IP Protocol Suite 1

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

CSCI-GA Operating Systems. Networking. Hubertus Franke

10 minutes survey (anonymous)

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

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

Application. Transport. Network. Link. Physical

Transcription:

Lecture 3: The Transport Layer: UDP and TCP Prof. Shervin Shirmohammadi SITE, University of Ottawa Prof. Shervin Shirmohammadi CEG 4395 3-1

The Transport Layer Provides efficient and robust end-to-end service to upper layers. Not all services need to be provided! Uses services provided by the network layer. End-to-end delivery of entire message. Connection Prof. Shervin Shirmohammadi CEG 4395 3-2

End-to-End Delivery Transport layer Networking layer Services are done from an end-to-end perspective Error control, flow control, Connectionless or connection-oriented Prof. Shervin Shirmohammadi CEG 4395 3-3

Addressing Service Access Point (SAP), also referred to as Ports at the transport layer. Prof. Shervin Shirmohammadi CEG 4395 3-4

Reliable Delivery Note that it is not compulsory for a transport layer protocol to provide such services. The idea is that if any of these services are to be provided in an end-to-end sense, then the transport layer is where you would implement them. Prof. Shervin Shirmohammadi CEG 4395 3-5

Error Control Error checking is done for the Transport Layer PDU (T-PDU). Even though T-PDU is put into the N-PDU as payload, the networking layer may or may not provide error control for it. What does IP do? error checked at networking error checked at networking error checked at networking Prof. Shervin Shirmohammadi CEG 4395 3-6

Sequence Control Prof. Shervin Shirmohammadi CEG 4395 3-7

Loss Control Prof. Shervin Shirmohammadi CEG 4395 3-8

Duplication Control What can cause duplication? Prof. Shervin Shirmohammadi CEG 4395 3-9

Flow Control Controls the flow of information, again from an end-to-end perspective. Factors affecting this are the end host, but also the network. Prof. Shervin Shirmohammadi CEG 4395 3-10

Multiplexing and Demultiplexing Data Link Networking Transport Prof. Shervin Shirmohammadi CEG 4395 3-11

App1 App2 App3 Multiplexing data data data 123 250 125 TCP UDP SPort=125 SPort=123 SPort=250 App 3 data App 1 data App 2 data Protocol=TCP Protocol=TCP Protocol=UDP IP TCP data TCP data UDP data to data Link layer Prof. Shervin Shirmohammadi CEG 4395 3-12 Protocol=TCP TCP data

App1 App2 App3 Demultiplexing data data data 560 440 1090 TCP UDP DPort=1090 DPort=560 DPort=440 App 3 data App 1 data App 2 data Protocol=TCP Protocol=UDP Protocol=TCP Protocol=TCP IP TCP data UDP data TCP data TCP data From data Link layer Prof. Shervin Shirmohammadi CEG 4395 3-13

Connection Obviously required only if we re talking about a connection-oriented transport protocol. Otherwise just send the packet and hope for the best. Need two protocols really: connection establishment connection release Prof. Shervin Shirmohammadi CEG 4395 3-14

User Datagram Protocol (UDP) Defined in RFC 768. Connectionless service Multiplexing/Demultiplexing Error Detection (not really error control) Detection only, no recovery; and even the detection is optional No flow control No congestion control What does it do then? Used by SNMP, DNS, RTP, Multicasting. Prof. Shervin Shirmohammadi CEG 4395 3-15

Multiplexing/Demultiplexing Uses Port numbers Also used for addressing Prof. Shervin Shirmohammadi CEG 4395 3-16

ICANN Ranges Internet Corporation for Assigned Names and Numbers http://www.icann.org/ 13: daytime 53: name server 69: TFTP 111: RPC 161 SNMP Prof. Shervin Shirmohammadi CEG 4395 3-17

UDP Packet Format There is also a pseudo-header that is created and computed. The pseudo-header does not really exist as a header! Prof. Shervin Shirmohammadi CEG 4395 3-18

Pseudoheader This is done to detect wrong delivery of the packet by the Networking layer. Prof. Shervin Shirmohammadi CEG 4395 3-19

Checksum One s complement of the one s complement sum modulo Prof. Shervin Shirmohammadi CEG 4395 3-20

Multicasting The ability to send a packet to more than one destination. (send once, receive at multiple destinations). Uses the IP multicasting (class D) addresses. Interested parties must join a multicast group. Network infrastructure (routers, bridges, ) must support IP Multicast for this to happen Mostly not supported on the Internet. Prof. Shervin Shirmohammadi CEG 4395 3-21

Transmission Control Protocol (TCP) Prof. Shervin Shirmohammadi CEG 4395 3-22

TCP - Transmission Control Protocol Provides reliable end-to-end byte stream over unreliable IP subnet. Designed to dynamically adapt to properties of subnet (bandwidth, delay, loss) and for robust handling of failures. Initial definition in standard RFC 793. Updates in RFC 1122, RFC 1323, RFC 2001 TCP accepts user data from local processes, splits into pieces no larger than 64K bytes (usually about 1500 bytes in practice), and sends each piece as a separate IP datagram. When IP datagrams arrive at the destination, TCP reconstructs the original byte stream. Prof. Shervin Shirmohammadi CEG 4395 3-23

The Service TCP Provides Connection-oriented Connection release Point-to-point communication Addressing, Multiplexing and Demultiplexing Complete reliability Full-duplex communication Reliable connection startup and shutdown 3-way handshake Flow Control Congestion Control Prof. Shervin Shirmohammadi CEG 4395 3-24

Port Numbers Prof. Shervin Shirmohammadi CEG 4395 3-25

Reserved TCP Port Numbers Prof. Shervin Shirmohammadi CEG 4395 3-26

TCP Error Control Sources of error: Segment damaged in transit Segment fails to arrive Transmitter does not know of failure Receiver must acknowledge successful receipt Too many ACKs if sent for each segment Use cumulative acknowledgement Time out waiting for ACK triggers retransmission (retransmission timer) Prof. Shervin Shirmohammadi CEG 4395 3-27

Duplication Detection If ACK lost, segment is re-transmitted Causes duplication Receiver must recognize duplicates Duplicate received prior to closing connection Receiver assumes ACK lost and ACKs duplicate Sender must not get confused with multiple ACKs Sequence number space large enough to not cycle within maximum life of segment Duplicate received after closing connection Prof. Shervin Shirmohammadi CEG 4395 3-28

Flow Control: Credit Allocation Prof. Shervin Shirmohammadi CEG 4395 3-29

Congestion Caused by too much traffic going through a network; more than the network can handle. Results in Routers dropping packets. Causes time-outs: equally likely from lost messages due to unreliable transmission media, as from congestion. Simply retransmitting a lost message makes congestion worst. Why? There needs to be a way to control congestion. Prof. Shervin Shirmohammadi CEG 4395 3-30

TCP Congestion Control RFC 1122, Requirements for Internet hosts Retransmission timer management Estimate round trip delay by observing pattern of delay Set time to value somewhat greater than estimate Simple average Exponential average RTT Variance Estimation (Jacobson s algorithm) Prof. Shervin Shirmohammadi CEG 4395 3-31

Window Management Slow start awnd = MIN[credit, cwnd] Start connection with cwnd=1 Increment cwnd (double) with ACK, to some threshold Increment cwnd by 1 with ACK after the threshold Dynamic windows sizing on congestion When a timeout occurs Set slow start threshold to half current window ssthresh=cwnd/2 Set cwnd = 1 and slow start until cwnd=ssthresh Increasing cwnd by 1 for every ACK For cwnd >=ssthresh, increase cwnd by 1 for each RTT Prof. Shervin Shirmohammadi CEG 4395 3-32

TCP Slow Start Prof. Shervin Shirmohammadi CEG 4395 3-33

TCP Data Transfer Connection is a stream of bytes, not messages. Four messages of 512 bytes may be sent by TCP as any combination of pieces totaling 2048 bytes: 1 2048 bytes 2 1024 bytes 4 512 bytes 8 256 bytes... When application sends data to TCP, it may not be sent immediately: TCP may decide to collect more data before transmission. TCP PUSH flag is used to request no transmission delay. TCP URGENT flag immediately sends all pending data, and causes receiver to send an interrupt to its user. Prof. Shervin Shirmohammadi CEG 4395 3-34

TCP Header Prof. Shervin Shirmohammadi CEG 4395 3-35

Control Field Prof. Shervin Shirmohammadi CEG 4395 3-36

TCP Header Fields Source and destination ports: 16 bit address of local port (socket). Sequence and acknowledgment numbers: Every byte is numbered in a TCP stream. Acknowledgment number is next byte number expected. 32 bits each. Header length: Needed because options field can vary in length. Number of 32 bits words in header. URG: set to 1 if urgent pointer in use Pointer indicates offset from current sequence number at which urgent data ends. Meaning that the receiving program should be notified of its arrival as soon as possible. Prof. Shervin Shirmohammadi CEG 4395 3-37

TCP Header Fields (cont d) ACK: Set to 1 to indicate acknowledgment number is valid If 0, no acknowledgment in this segment. PSH: Set to 1 to indicate pushed data. Force delivery of bytes currently in the stream without waiting for buffer to fill. RST: Set to 1 to indicate reset. Host has become confused due to crash or for other reason. Also used to reject a connection, or refuse an invalid segment. SYN: used to establish connections. SYN = 1, ACK = 0 in connection request. SYN = 1, ACK = 1 in connection acceptance. FIN: set to 1 to indicate end of user data. Used to close connection. May continue to receive data. Prof. Shervin Shirmohammadi CEG 4395 3-38

TCP Pseudo-header 00000000 TCP Error Checking Protocol = 6 Source address Destination address 32 bits TCP segment length Checksum field provides error detection information for TCP segment header, plus the pseudo-header shown above. Checksum computation: Set checksum field to all zeros. Pad user data with extra 0 byte, if needed, so that user data has an even number of bytes. Add all 16 bit words in 1 s complement, and take 1 s complement of the sum. When receiver performs this computation, including checksum field, result should be 0. Prof. Shervin Shirmohammadi CEG 4395 3-39

Additional Timer Issues TCP persistence timer: Prevents deadlock when current window size is 0, and acknowledgment increasing window size is lost. When persistence timer expires, ask receiver for window size. TCP keep alive timer: Timer expires after long interval with no messages. On expiry, send a message to receiver asking are you still there? Connection terminated if no response. TCP close timer ensures all packets die on connection termination. Prof. Shervin Shirmohammadi CEG 4395 3-40