Transport Layer (TCP/UDP)

Similar documents
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 461 Connections. David Wetherall

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

CSEP 561 Connections. David Wetherall

CSEP 561 Connections. David Wetherall

CSE 461 The Transport Layer

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

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

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

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

TSIN02 - Internetworking

QUIZ: Longest Matching Prefix

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

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

Transport Layer (TCP/UDP)

Transport Layer (TCP/UDP)

UDP, TCP, IP multicast

Transport Layer (TCP/UDP)

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

TSIN02 - Internetworking

NT1210 Introduction to Networking. Unit 10

EEC-682/782 Computer Networks I

Different Layers Lecture 21

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

TSIN02 - Internetworking

CSE 461 Module 10. Introduction to the Transport Layer

User Datagram Protocol

OSI Transport Layer. objectives

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

TSIN02 - Internetworking

Transport Layer. Gursharan Singh Tatla. Upendra Sharma. 1

Internet and Intranet Protocols and Applications

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

ECE 650 Systems Programming & Engineering. Spring 2018

Interprocess Communication Mechanisms

shared storage These mechanisms have already been covered. examples: shared virtual memory message based signals

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

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

05 Transmission Control Protocol (TCP)

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

CSCE 463/612 Networks and Distributed Processing Spring 2018

CMPE 80N: Introduction to Networking and the Internet

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

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

Chapter 5 End-to-End Protocols

Computer Networks and Data Systems

Applied Networks & Security

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

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

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

Computer Networks (Honor Track)

CS4700/CS5700 Fundamentals of Computer Networks

The Transport Layer: TCP & Reliable Data Transfer

9th Slide Set Computer Networks

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

ECE 650 Systems Programming & Engineering. Spring 2018

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

Different Layers Lecture 20

NWEN 243. Networked Applications. Layer 4 TCP and UDP

Memory-Mapped Files. generic interface: vaddr mmap(file descriptor,fileoffset,length) munmap(vaddr,length)

JAVA SOCKET PROGRAMMING

CS457 Transport Protocols. CS 457 Fall 2014

Internet transport protocols

The Transmission Control Protocol (TCP)

Transport Layer. Chapter 3: Transport Layer

Unix Network Programming

(Refer Slide Time: 1:09)

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

Unit 2.

Announcements. No book chapter for this topic! Slides are posted online as usual Homework: Will be posted online Due 12/6

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

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

Chapter 6. The Transport Layer. The Transport Service. Services Provided to the Upper Layers. Transport Service Primitives (3) 10/7/2010

Transport Layer Review

Networking Technologies and Applications

Introduction to TCP/IP networking

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

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

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

CS519: Computer Networks. Lecture 5, Part 1: Mar 3, 2004 Transport: UDP/TCP demux and flow control / sequencing

EE 122: Transport Protocols. Kevin Lai October 16, 2002

CCNA 1 v3.11 Module 11 TCP/IP Transport and Application Layers

UNIT V. Computer Networks [10MCA32] 1

Lecture 3: The Transport Layer: UDP and TCP

Network Protocols. Transmission Control Protocol (TCP) TDC375 Autumn 2009/10 John Kristoff DePaul University 1

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

Chapter 6. (Week 12) The Transport Layer (CONTINUATION) ANDREW S. TANENBAUM COMPUTER NETWORKS FOURTH EDITION PP

Chapter III: Transport Layer

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

User Datagram Protocol (UDP):

Intro to LAN/WAN. Transport Layer

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

Transport Protocols Reading: Sections 2.5, 5.1, and 5.2

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

Reliable Transport I: Concepts and TCP Protocol

Where we are in the Course

CCNA 1 Chapter 7 v5.0 Exam Answers 2013

Transcription:

Transport Layer (TCP/UDP)

Where we are in the Course Moving on up to the Transport Layer! Application Transport Network Link Physical CSE 461 University of Washington 2

Recall Transport layer provides end-to-end connectivity across the network app app TCP TCP IP 802.11 IP 802.11 IP Ethernet IP Ethernet Host Router Host CSE 461 University of Washington 3

Recall (2) Segments carry application data across the network Segments are carried within packets within frames Segment 802.11 IP TCP App, e.g., HTTP Packet Frame CSE 461 University of Washington 4

Transport Layer Services Provide different kinds of data delivery across the network to applications Messages Bytestream Unreliable Datagrams (UDP) Reliable Streams (TCP) CSE 461 University of Washington 5

Comparison of Internet Transports TCP is full-featured, UDP is a glorified packet TCP (Streams) Connections Bytes are delivered once, reliably, and in order Arbitrary length content Flow control matches sender to receiver Congestion control matches sender to network UDP (Datagrams) Datagrams Messages may be lost, reordered, duplicated Limited message size Can send regardless of receiver state Can send regardless of network state CSE 461 University of Washington 6

Socket API Simple abstraction to use the network The network API (really Transport service) used to write all Internet apps Part of all major OSes and languages; originally Berkeley (Unix) ~1983 Supports both Internet transport services (Streams and Datagrams) CSE 461 University of Washington 7

Socket API (2) Sockets let apps attach to the local network at different ports Socket, Port #1 Socket, Port #2 CSE 461 University of Washington 8

Socket API (3) Same API used for Streams and Datagrams Only needed for Streams To/From for Datagrams Primitive Meaning SOCKET Create a new communication endpoint BIND Associate a local address (port) with a socket LISTEN Announce willingness to accept connections ACCEPT Passively establish an incoming connection CONNECT Actively attempt to establish a connection SEND(TO) Send some data over the socket RECEIVE(FROM) Receive some data over the socket CLOSE Release the socket CSE 461 University of Washington 9

Ports Application process is identified by the tuple IP address, protocol, and port Ports are 16-bit integers representing local mailboxes that a process leases Servers often bind to well-known ports <1024, require administrative privileges Clients often assigned ephemeral ports Chosen by OS, used temporarily CSE 461 University of Washington 10

Some Well-Known Ports Port Protocol Use 20, 21 FTP File transfer 22 SSH Remote login, replacement for Telnet 25 SMTP Email 80 HTTP World Wide Web 110 POP-3 Remote email access 143 IMAP Remote email access 443 HTTPS Secure Web (HTTP over SSL/TLS) 543 RTSP Media player control 631 IPP Printer sharing CSE 461 University of Washington 11

Topics Service models Socket API and ports Datagrams, Streams User Datagram Protocol (UDP) Connections (TCP) Sliding Window (TCP) Flow control (TCP) Retransmission timers (TCP) Congestion control (TCP) CSE 461 University of Washington 12

UDP

User Datagram Protocol (UDP) Used by apps that don t want reliability or bytestreams Voice-over-IP DNS, RPC DHCP (If application wants reliability and messages then it has work to do!) CSE 461 University of Washington 14

Datagram Sockets Client (host 1) Time Server (host 2) request reply CSE 461 University of Washington 15

Datagram Sockets (2) Client (host 1) Time Server (host 2) 1: socket 4: sendto request 1: socket 2: bind 3: recvfrom* 5: recvfrom* reply 6: sendto 7: close 7: close *= call blocks CSE 461 University of Washington 16

UDP Buffering Application App App App Ports Transport (TCP) Message queues Network (IP) Port Mux/Demux packet CSE 461 University of Washington 17

UDP Header Uses ports to identify sending and receiving application processes Datagram length up to 64K Checksum (16 bits) for reliability CSE 461 University of Washington 18

UDP Header (2) Optional checksum covers UDP segment and IP pseudoheader Checks key IP fields (addresses) Value of zero means no checksum CSE 461 University of Washington 19

TCP

TCP TCP Consists of 3 primary phases: Connection Establishment (Setup) Sliding Windows/Flow Control Connection Release (Teardown)

Connection Establishment Both sender and receiver must be ready before we start the transfer of data 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 Like dialing for a telephone call CSE 461 University of Washington 22

Three-Way Handshake Used in TCP; opens connection for data in both directions Each side probes the other with a fresh Initial Sequence Number (ISN) Sends on a SYNchronize segment Echo on an ACKnowledge segment Chosen to be robust even against delayed duplicates Active party (client) Passive party (server) CSE 461 University of Washington 23

Three-Way Handshake (2) Three steps: Client sends SYN(x) Server replies with SYN(y)ACK(x+1) Client replies with ACK(y+1) SYNs are retransmitted if lost Sequence and ack numbers carried on further segments Active party (client) Time 1 2 3 Passive party (server) CSE 461 University of Washington 24

Three-Way Handshake (3) Suppose delayed, duplicate copies of the SYN and ACK arrive at the server! Improbable, but anyhow Active party (client) Passive party (server) CSE 461 University of Washington 25

Three-Way Handshake (4) Suppose delayed, duplicate copies of the SYN and ACK arrive at the server! Improbable, but anyhow Connection will be cleanly rejected on both sides Active party (client) X REJECT Passive party (server) X REJECT CSE 461 University of Washington 26

TCP Connection State Machine Captures the states ([]) and transitions (->) A/B means event A triggers the transition, with action B Both parties run instances of this state machine

TCP Connections (2) Follow the path of the client:

TCP Connections (3) And the path of the server:

TCP Connections (4) Again, with states Active party (client) CLOSED SYN_SENT 1 2 Passive party (server) CLOSED LISTEN SYN_RCVD ESTABLISHED 3 Time ESTABLISHED CSE 461 University of Washington 30

TCP Connections (5) Finite state machines are a useful tool to specify and check the handling of all cases that may occur TCP allows for simultaneous open i.e., both sides open instead of the client-server pattern Try at home to confirm it works CSE 461 University of Washington 31