CSE 461 Connections. David Wetherall

Similar documents
CSEP 561 Connections. David Wetherall

CSEP 561 Connections. David Wetherall

CSE 461 The Transport Layer

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

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

CSE 461 Module 11. Connections

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

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

Transport Layer (TCP/UDP)

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

User Datagram Protocol

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

EEC-682/782 Computer Networks I

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

Transport Layer. Gursharan Singh Tatla. Upendra Sharma. 1

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

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

CSE 461 Module 10. Introduction to the Transport Layer

Chapter 5 End-to-End Protocols

ECE 650 Systems Programming & Engineering. Spring 2018

SWITCHING, FORWARDING, AND ROUTING

Transport Layer Marcos Vieira

Application Service Models

UDP and TCP. Introduction. So far we have studied some data link layer protocols such as PPP which are responsible for getting data

QUIZ: Longest Matching Prefix

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

CSCI-1680 Transport Layer I Rodrigo Fonseca

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

CSCI-1680 Transport Layer I Rodrigo Fonseca

Lenuta Alboaie Computer Networks

TSIN02 - Internetworking

TSIN02 - Internetworking

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

TSIN02 - Internetworking

TSIN02 - Internetworking

Networking Technologies and Applications

6.2 Elements of Transport Protocols

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

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

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

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

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

9th Slide Set Computer Networks

Transport Layer Chapter 6

Transport Layer Review

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

OSI Transport Layer. Network Fundamentals Chapter 4. Version Cisco Systems, Inc. All rights reserved. Cisco Public 1

CSC 634: Networks Programming

UNIT V. Computer Networks [10MCA32] 1

Unit 2.

Lecture 3: The Transport Layer: UDP and TCP

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

Outline Computer Networking. Functionality Split. Transport Protocols

OSI Transport Layer. objectives

05 Transmission Control Protocol (TCP)

CS457 Transport Protocols. CS 457 Fall 2014

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

Computer Networks. Transmission Control Protocol. Jianping Pan Spring /3/17 CSC361 1

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

UNIT IV TRANSPORT LAYER

What is TCP? Transport Layer Protocol

NT1210 Introduction to Networking. Unit 10

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

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

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

CCNA 1 Chapter 7 v5.0 Exam Answers 2013

Application. Transport. Network. Link. Physical

UDP, TCP, IP multicast

6. The Transport Layer and protocols

Internet and Intranet Protocols and Applications

TCP/IP Transport Layer Protocols, TCP and UDP

Transport Layer (TCP/UDP)

THE TRANSPORT LAYER UNIT IV

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

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

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

Lecture 4: The Transport Layer and UDP

Internet transport protocols

Introduction to Network. Topics

CMSC 417. Computer Networks Prof. Ashok K Agrawala Ashok Agrawala Set 7. April 12 CMSC417 Set 7 1

CMSC 417. Computer Networks Prof. Ashok K Agrawala Ashok Agrawala Set 7. November 14 CMSC417 Set 7 1

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

Information Network 1 TCP 1/2

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

Chapter 2 - Part 1. The TCP/IP Protocol: The Language of the Internet

Simulation of TCP Layer

UNIT IV -- TRANSPORT LAYER

ECE 435 Network Engineering Lecture 9

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

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

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

User Datagram Protocol (UDP):

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

ECE 435 Network Engineering Lecture 15

CCNA Exploration Network Fundamentals. Chapter 04 OSI Transport Layer

Jaringan Komputer. The Transport Layer

Reliable Transport I: Concepts and TCP Protocol

Transcription:

CSE 461 Connections David Wetherall djw@cs.washington.edu

Connections Focus How do we (reliably) connect processes? This is the transport layer Topics Naming processes TCP / UDP Connection setup / teardown Application Transport Network Link Physical djw // CSE 461, Fall 2011 2

The Transport Layer Builds on the services of the Network layer TCP/IP Communication between processes running on hosts Naming/Addressing Stronger guarantees of message delivery make sense Many applications want reliable connection and data transfer This is the first layer that is talking end-to-end djw // CSE 461, Fall 2011 3

Internet ttransport tprotocols UDP Datagram abstraction between processes With error detection TCP Bytestream (bitpipe) abstraction between processes With reliability y( (ARQ with a sliding window, connections) Plus flow and congestion control (later!) djw // CSE 461, Fall 2011 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 5

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

Naming Processes/Services Process here is an abstract term for your Web browser (HTTP), Email servers (SMTP), hostname translation (DNS), RealAudio player (RTSP), etc. How do we identify for remote communication? Process id or memory address are OS-specific and transient So TCP and UDP use Ports 16-bit integers representing mailboxes that processes rent Identify process uniquely as (IP address, protocol, port) djw // CSE 461, Fall 2011 7

Picking Port Numbers We still have the problem of allocating port numbers What port should a Web server use on host X? To what port should you send to contact that Web server? 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 y( (ephemeral) )ports Above 1024, recycled by OS when client finished djw // CSE 461, Fall 2011 8

Some well-known TCP ports Popular servers run on well-known ports CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011

Berkeley Sockets Networking protocols implemented in OS OS must expose a programming API to applications most OSs use the socket interface originally provided by BSD 4.1c in ~1982. Principle i abstraction is a socket a point at which an application attaches to the network defines operations for creating connections, attaching to network, sending and receiving data, closing connections djw // CSE 461, Fall 2011 10

Overall pieces djw // CSE 461, Fall 2011 11

Berkeley Sockets API djw // CSE 461, Fall 2011 12

TCP (connection-oriented) i t Server Socket() Bind() Block until connect Process request Listen() Accept() Recv() Send() djw // CSE 461, Fall 2011 Connection Establishment. Dt Data (request) Data (reply) Client Socket() Connect() Send() Recv() 13

UDP (connectionless) Server Socket() Bind() Client Socket() Recvfrom() Bind() Block until Data from client Data (request) Sendto() Process request Sendto() djw // CSE 461, Fall 2011 Data (reply) Recvfrom() 14

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 djw // CSE 461, Fall 2011 15

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 Application Application process process process Kernel boundary Message Queues DeMux djw // CSE 461, Fall 2011 Packets arrive 17

UDP Checksum UDP includes optional protection against errors Checksum intended as an end-to-end check on delivery So it covers data, UDP header, and IP pseudoheader UDP checksum djw // CSE 461, Fall 2011 18

Transmission i 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 Send buffer TCP Receive buffer Transmit segments Segment Segment Segment djw // CSE 461, Fall 2011 20

The TCP Service Model Applications using TCP see only the byte stream [right] and not the segments [left] 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

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 djw // CSE 461, Fall 2011 24

TCP Header Format Advertised window is used for flow control Window size djw // CSE 461, Fall 2011 25

Connection Establishment t 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 djw // CSE 461, Fall 2011 26

Three-Way Handshake Opens both directions for transfer Active participant (client) Passive participant (server) djw // CSE 461, Fall 2011 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 djw // CSE 461, Fall 2011 28

Connection Establishment (4) 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) X b) X X CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011

TCP State t Transitions Wow! djw // CSE 461, Fall 2011 30

Again, with States t Active participant (client) SYN_ SENT Passive participant (server) LISTEN SYN_RCVD ESTABLISHED +data ESTABLISHED djw // CSE 461, Fall 2011 31

TCP Connections simultaneous connect TCP sets up connections with the three-way handshake Normal case Simultaneous connect CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011

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 both sides shutdown independently djw // CSE 461, Fall 2011 33

Connection Release (1) 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

Connection Release (2) Symmetric release (both sides agree to release) can t be handled d solely l by the transport t layer Two-army problem shows pitfall of agreement Attack? Attack? CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011

Connection Release (3) 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

TCP Connection Teardown FIN_ WAIT_ 1 Web server Web browser CLOSE_WAIT FIN_WAIT_2 TIME_WAIT CLOSED LAST_ACKACK CLOSED djw // CSE 461, Fall 2011 37

The TIME_WAIT State t 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 djw // CSE 461, Fall 2011 38