CSE 461 The Transport Layer

Similar documents
CSE 461 Connections. David Wetherall

CSEP 561 Connections. David Wetherall

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

CSEP 561 Connections. David Wetherall

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

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

CSE 461 Module 11. Connections

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

Transport Layer (TCP/UDP)

User Datagram Protocol

CSE 461 Module 10. Introduction to the Transport Layer

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

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

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

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

Transport Layer Marcos Vieira

CSCI-1680 Transport Layer I Rodrigo Fonseca

CSCI-1680 Transport Layer I Rodrigo Fonseca

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

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

EEC-682/782 Computer Networks I

Chapter 5 End-to-End Protocols

QUIZ: Longest Matching Prefix

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

6.2 Elements of Transport Protocols

ECE 650 Systems Programming & Engineering. Spring 2018

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

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

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

Application Service Models

Networking Technologies and Applications

Transport Layer. Gursharan Singh Tatla. Upendra Sharma. 1

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

Introduc)on to Computer Networks

TSIN02 - Internetworking

Lenuta Alboaie Computer Networks

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

Outline Computer Networking. Functionality Split. Transport Protocols

SWITCHING, FORWARDING, AND ROUTING

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

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

CS457 Transport Protocols. CS 457 Fall 2014

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

TSIN02 - Internetworking

Application. Transport. Network. Link. Physical

TSIN02 - Internetworking

TSIN02 - Internetworking

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

Transport Layer Review

UNIT IV 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

CSC 634: Networks Programming

3.5.6 TCP Connection Management

Transport Layer Chapter 6

9th Slide Set Computer Networks

What is TCP? Transport Layer Protocol

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

Internet transport protocols

Computer Network Programming. The Transport Layer. Dr. Sam Hsu Computer Science & Engineering Florida Atlantic University

NWEN 243. Networked Applications. Layer 4 TCP and UDP

Reliable Byte-Stream (TCP)

ECE 435 Network Engineering Lecture 15

Mobile Transport Layer Lesson 02 TCP Data Stream and Data Delivery

Transport Layer (TCP/UDP)

Jaringan Komputer. The Transport Layer

ELEC / COMP 177 Fall Some slides from Kurose and Ross, Computer Networking, 5 th Edition

Internet Layers. Physical Layer. Application. Application. Transport. Transport. Network. Network. Network. Network. Link. Link. Link.

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

CMSC 417. Computer Networks Prof. Ashok K Agrawala Ashok Agrawala Set 7. October 16 CMSC417 Set 7 1

UNIT IV TRANSPORT LAYER

NT1210 Introduction to Networking. Unit 10

Unit 2.

THE TRANSPORT LAYER UNIT IV

05 Transmission Control Protocol (TCP)

Lecture 3: The Transport Layer: UDP and TCP

Simulation of TCP Layer

CS 4390 Computer Networks. Transport Services and Protocols

Lecture 4: The Transport Layer and UDP

CCNA 1 Chapter 7 v5.0 Exam Answers 2013

OSI Transport Layer. objectives

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

TCP /IP Fundamentals Mr. Cantu

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

Lecture (11) OSI layer 4 protocols TCP/UDP protocols

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

Transport Protocols Reading: Sections 2.5, 5.1, and 5.2

Layer 4: UDP, TCP, and others. based on Chapter 9 of CompTIA Network+ Exam Guide, 4th ed., Mike Meyers

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

Reliable Transport I: Concepts and TCP Protocol

UDP, TCP, IP multicast

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

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

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

6. The Transport Layer and protocols

COMPUTER NETWORKS CS CS 55201

COMPUTER NETWORKS CS CS 55201

UNIT IV -- TRANSPORT LAYER

EEC-682/782 Computer Networks I

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

Introduction to Network. Topics

Transcription:

CSE 461 The Transport Layer The Transport Layer Focus How do we (reliably) connect processes? This is the transport layer Topics Naming end points UDP: unreliable transport TCP: reliable transport Connection setup / teardown Application Transport Network Link Physical 2 1

The Transport Layer Builds on the services of the Network layer TCP/IP Communication between processes running on hosts Naming/Addressing Guarantees about message delivery make (more) sense This is the first layer that is talking end-to-end djw // CSE 461, Fall 2011 3 The Layers Below: Network Network layer provides: A name space for hosts (interfaces) IP addresses Framing (message boundaries) Packets 0 or more delivery semantics Packets may be lost Packets usually aren t duplicated by the network Byte transmission No data types (except in headers) 4 2

The Layers Below: Network Network layer imposes: Not all hosts are reachable NATs Packets may arrive out of order Routing table updates Maximum packet size 65,535 bytes, including header (2 16 1) IPv6: optionally, up to 4GB Variable transmission speeds 100 s of bits/sec to 10 s of gigabits/sec Variable delays 10 s of microseconds to seconds We want the transport to work despite all this. 5 The Layers Below: Link/Physical Link layer provides: A name space MAC addresses May, or may not, provide data integrity Checks sums (in the general sense of error detection/correction) Broadcast/multicast Maybe Link layer imposes: Variable delivery probability Wired vs. wireless Maximum frame size Ethernet: 1500 bytes Jumbo: 9K 6 3

Effect on Transport Protocols A transport layer packet may traverse many different kinds of networks Functionality: Can t rely on very much from the lower layers Best effort delivery, hop by hop Performance: What can the transport layer do about delay? What can the transport layer do about throughput? Notion of a bottleneck link The hop most limiting performance 7 Internet Transport Protocols UDP Datagram abstraction between processes Reliability: Never delivers data that wasn t sent Error detection (data integrity) TCP Bytestream abstraction between processes Reliability: In order, at-most-once delivery ARQ with a sliding window Connections Flow control Throttle sender based on receiver s capabilities Congestion control (later!) Throttle sender based on network s capabilities 8 4

Comparison of TCP/UDP/IP properties TCP Connection-oriented Reliable byte-stream In-order delivery Single delivery Arbitrarily length Synchronization Flow control Congestion control UDP Datagram oriented Lost packets Reordered packets Duplicate packets Limited size packets IP Datagram oriented Lost packets Reordered packets Duplicate packets Limited size packets djw // CSE 461, Fall 2011 9 Relation to layers Transport layer sends segments in packets (in frames) Segment Segment CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011 5

Naming: IP address + port number You know these from the projects How does client determine the name of the receiver? IP address: use the DNS name service Project 4 is very like DNS; DNS is very like Project 4 We ll look at the Internet s DNS a bit later Port:? Project 4 provides a translation from a well known name to a port DNS does not (mostly) djw // CSE 461, Fall 2011 11 Determining Internet Port Numbers Servers typically bind to well-known port numbers Ports below 1024 reserved for well-known services look in /etc/services Clients use OS-assigned temporary (ephemeral) ports Above 1024, recycled by OS when client finished (Some clients try to bind to a particular ephemeral port, to act well-known within some restricted community.) djw // CSE 461, Fall 2011 12 6

Some well-known (TCP) ports Is there a mechanism to verify you ve connected to what you intended? Can a well-known server use a non-standard port? Yes. What s the security provided by using a non-standard port? None. What s the benefit of using a non-standard port? Minimal. Why are there well-known ports, again? No. CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011 TCP Socket Interface (connection-oriented) Server Socket() Block until connect Bind() Listen() Accept() Java wraps these together Connection Establishment. Client Socket() Connect() Block until data Recv() Data (request) Send() Send() Data (reply) Recv() Block until data 14 7

UDP Socket Interface (connectionless) Server Block until Data from client Socket() Bind() Recvfrom() Data (request) Client Socket() Bind() Sendto() Process request Sendto() Data (reply) Recvfrom() 15 User Datagram Protocol (UDP) Provides message delivery between processes Source port filled in by OS as message is sent Destination port identifies UDP delivery queue at endpoint 16 8

UDP checksum Checksum covers UDP segment and IP pseudoheader Fields that change in the network are zeroed out Provides an end-to-end delivery check CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011 UDP Delivery Ports Application process Application process Application process Kernel boundary Message Queues DeMux IP Packets arrive 18 9

Transmission Control Protocol (TCP) Reliable bi-directional bytestream between processes Message boundaries are not preserved Connections Conversation between endpoints with beginning and end Flow control (later) Prevents sender from over-running receiver buffers Congestion control (later) Prevents sender from over-running network buffers djw // CSE 461, Fall 2011 19 TCP Delivery Application process Application process Write bytes Read bytes TCP TCP Send buffer Receive buffer Transmit segments Segment Segment Segment djw // CSE 461, Fall 2011 20 10

The TCP Service Model Applications using TCP see only the byte stream and not the segments sent as separate IP packets Four segments, each with 512 bytes of data and carried in an IP packet 2048 bytes of data delivered to application in a single READ call CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011 TCP Header Format Ports plus IP addresses identify a connection Source Port Destination Port djw // CSE 461, Fall 2011 22 11

TCP Header Format Sequence, Ack numbers used for the sliding window Congestion control works by controlling the window size Sequence number Acknowledgement number djw // CSE 461, Fall 2011 23 TCP Header Format Flags bits may be SYN / FIN / RST / ACK, URG, and ECE / CWR Flags 24 12

TCP Header Format Advertised window is used for flow control Window size 25 Connection Establishment Both sender and receiver must be ready before we start to transfer the data Sender and receiver need to agree on a set of parameters e.g., the Maximum Segment Size (MSS) This is signaling It sets up state at the endpoints Compare to dialing in the telephone network In TCP a Three-Way Handshake is used 26 13

Three-Way Handshake Active participant (client) Passive participant (server) Opens both directions for transfer This can be viewed as two two-way handshakes improved 27 Some Comments We could abbreviate this setup, but it was chosen to be robust, especially against delayed duplicates Three-way handshake from Tomlinson 1975 Choice of changing initial sequence numbers (ISNs) minimizes the chance of hosts that crash getting confused by a previous incarnation of a connection With random ISN it proves two hosts can communicate Weak form of authentication TCP hijacking 28 14

Connection Establishment Three-way handshake protects against odd cases: a) Duplicate CR. Spurious ACK does not connect b) Duplicate CR and DATA. Same plus DATA will be rejected (wrong ACK). a) b) X X X CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011 TCP State Transitions 30 15

Again, with States Active participant (client) SYN_SENT Passive participant (server) LISTEN SYN_RCVD ESTABLISHED +data ESTABLISHED djw // CSE 461, Fall 2011 31 Simultaneous Connect Normal case Simultaneous connect CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011 16

Connection Teardown Orderly release by sender and receiver when done Delivers all pending data and hangs up Cleans up state in sender and receiver TCP provides a symmetric close Each side shuts down independently I won t be sending any more data 33 Connection Release Key problem is to ensure reliability while releasing Asymmetric release (when one side breaks connection) is abrupt and may lose data X CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011 17

Connection Release Symmetric release (both sides agree to release) can t be handled solely by the transport layer Two-army problem shows pitfall of agreement Attack? Attack? CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011 Connection Release Normal release sequence, initiated by transport user on Host 1 DR=Disconnect Request Both DRs are ACKed by the other side CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011 18

TCP Connection Teardown FIN_WAIT_1 Web server Web browser CLOSE_WAIT FIN_WAIT_2 TIME_WAIT CLOSED LAST_ACK CLOSED 37 The TIME_WAIT State We wait 2MSL (two times the maximum segment lifetime of 60 seconds) before completing the close Why? ACK might have been lost and so FIN will be resent Could interfere with a subsequent connection 38 19