Similar documents
Network Communication

EEC-682/782 Computer Networks I

Transport Layer (TCP/UDP)

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

EEC-484/584 Computer Networks

Processes communicating. Network Communication. Sockets. Addressing processes 4/15/2013

UNIX Sockets. COS 461 Precept 1

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

Internet and Intranet Protocols and Applications

Chapter 7. The Transport Layer

Introduc)on to Computer Networks

Hybrid of client-server and P2P. Pure P2P Architecture. App-layer Protocols. Communicating Processes. Transport Service Requirements

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

Reliable transmission

CS 4390 Computer Networks. Transport Services and Protocols

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

UNIX Sockets. Developed for the Azera Group By: Joseph D. Fournier B.Sc.E.E., M.Sc.E.E.

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

CMPE 80N: Introduction to Networking and the Internet

CS457 Transport Protocols. CS 457 Fall 2014

TSIN02 - Internetworking

UDP CONNECT TO A SERVER

The Transmission Control Protocol (TCP)

Transport Layer. Gursharan Singh Tatla. Upendra Sharma. 1

Lecture 3: The Transport Layer: UDP and TCP

ETSF10 Internet Protocols Transport Layer Protocols

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

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

Ports under 1024 are often considered special, and usually require special OS privileges to use.

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

Transport Protocols Reading: Sections 2.5, 5.1, and 5.2

The User Datagram Protocol

ECE 650 Systems Programming & Engineering. Spring 2018

NT1210 Introduction to Networking. Unit 10

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

Remote Procedure Calls

CSCI 466 Midterm Networks Fall 2013

OSI Transport Layer. objectives

QUIZ: Longest Matching Prefix

Upper Layer Services. Berkeley Sockets Example of Socket Programming: Internet File Server

Sockets 15H2. Inshik Song

STUDY OF SOCKET PROGRAMMING

NWEN 243. Networked Applications. Layer 4 TCP and UDP

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

CSci Introduction to Distributed Systems. Communication: RPC

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

Different Layers Lecture 20

Chapter 3: Transport Layer

Agenda. Before we start: Assignment #1. Routing in a wide area network. Protocols more concepts. Internetworking. Congestion control

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

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

Basic Internetworking (IP)

Chapter 3: Transport Layer Part A

CSCI 1800 Cybersecurity and Interna4onal Rela4ons. Design and Opera-on of the Internet John E. Savage Brown University

Multimedia in the Internet

Group-A Assignment No. 6

Announcement. Homework 1 due last night, how is that? Will discuss some problems in the lecture next week

Lecture 2. Outline. Layering and Protocols. Network Architecture. Layering and Protocols. Layering and Protocols. Chapter 1 - Foundation

Introduction to TCP/IP networking

The TCP Protocol Stack

CSE 3214: Computer Network Protocols and Applications Transport Layer (Part 2) Chapter 3 outline. UDP checksum. Port numbers

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

xkcd.com End To End Protocols End to End Protocols This section is about Process to Process communications.

Transport layer Internet layer

Lecture 9: Transpor Layer Overview and UDP

Internet transport protocols

Multiple unconnected networks

Transport Layer Overview

ECE4110 Internetwork Programming. Introduction and Overview

Networking and socket communica2on

CCNA 1 Chapter 7 v5.0 Exam Answers 2013

CSCI-GA Operating Systems. Networking. Hubertus Franke

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

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

ICS 351: Networking Protocols

Unit 2.

4 rd class Department of Network College of IT- University of Babylon

Transport Layer. Chapter 3: Transport Layer

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

TSIN02 - Internetworking

CS 43: Computer Networks. 15: Transport Layer & UDP October 5, 2018

Chapter 6. The Transport Layer. Transport Layer 3-1

Mul$media Streaming. Digital Audio and Video Data. Digital Audio Sampling the analog signal. Challenges for Media Streaming.

Application. Transport. Network. Link. Physical

CSEP 561 Connections. David Wetherall

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

1/10/16. RPC and Clocks. Tom Anderson. Last Time. Synchroniza>on RPC. Lab 1 RPC

User Datagram Protocol

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

Jaringan Komputer. The Transport Layer

Different Layers Lecture 21

Programming Internet with Socket API. Hui Chen, Ph.D. Dept. of Engineering & Computer Science Virginia State University Petersburg, VA 23806

TCP /IP Fundamentals Mr. Cantu

Distributed Systems 8. Remote Procedure Calls

Remote Invocation. Today. Next time. l Overlay networks and P2P. l Request-reply, RPC, RMI

Today CSCI Communication. Communication in Distributed Systems. Communication in Distributed Systems. Remote Procedure Calls (RPC)

IP Packet Switching. Goals of Todayʼs Lecture. Simple Network: Nodes and a Link. Connectivity Links and nodes Circuit switching Packet switching

EE 122: IP Forwarding and Transport Protocols

COMMUNICATION PROTOCOLS: REMOTE PROCEDURE CALL (RPC)

CMPE 150 Winter 2009

Transcription:

Transport layer and UDP www.cnn.com? 12.3.4.15 CSCI 466: Networks Keith Vertanen Fall 2011

Overview Principles underlying transport layer Mul:plexing/demul:plexing Detec:ng errors Reliable delivery Flow control Major transport layer protocols: User Datagram Protocol (UDP) Simple unreliable message delivery Transmission Control Protocol (TCP) Reliable bidirec:onal stream of bytes 2

Transport layer challenges Running on best- effort network: Messages may be dropped Messages may be reordered Duplicate messages may be delivered Messages have some finite size Messages may arrive aner long delay Sender must not overrun receiver Network may be congested Hosts must support mul:ple applica:ons 3

host HTTP Internet layering model HTTP message host HTTP TCP TCP segment TCP router router IP IP packet IP IP packet IP IP packet IP Ethernet interface Ethernet interface SONET interface SONET interface Ethernet interface Ethernet interface frame frame frame 4

Segment Segments Message sent from one transport en:ty to another transport en:ty Term used by TCP, UDP, other Internet protocols AKA TPDU (Transport Protocol Data Unit) 5

Transport layer Goal: Provide end- to- end data transfer Just ge[ng to host machine isn't enough Deliver data from process on sending host to correct process on receiving host Solu:on: OS demul:plexes to correct process Port number, an abstract locater OS demuxes combining with other info UDP <port, host> TCP <source port, source IP, dest port, dest IP> 6

Simple demul:plexer User Datagram Protocol (UDP) Mapping to process using 16- bit port number Detec:ng errors: (op:onal) checksum 7

Why use UDP? Provides: Lightweight communica:on between processes Avoid overhead and delays of ordered, reliable delivery Precise control of when data is sent As soon as app writes to socket, UDP packages and sends No delay establishing a connec:on No connec:on state, scales to more clients Small packet overhead, header only 8 bytes long Does not provide: Flow control, conges:on control, or retransmission on error 8

UDP checksum UDP checksums Add up 16- bit words in one's complement Take one's complement of the sum Done on UDP header, data, IP pseudoheader Helps detect misdelivered packets Violates layers, looking into network layers UDP header IP pseudoheader 9

Port numbers How do clients know the port number? Well known port number Port mapper service Listens for request on known port number Maps service name such as "BitTorrent" to port number Port Descrip8on 20/21 FTP 22 SSH 23 Telnet 25 Simple Mail Transfer Protocol (SMTP) 53 Domain Name System (DNS) Port Descrip8on 80 HTTP 110 Post Office Protocol (POP3) 143 Internet Message Access Protocol (IMAP) 443 HTTPS 546/7 DHCP 10

Port numbers How do clients know the port number? Ini:al connec:on protocol (e.g. inetd, xinetd, launchd) Process server acts a proxy for less used services Listens on set of ports at same :me Clients specify service in connec:on request 11

Berkeley Sockets A state diagram for a simple connection management scheme. Transitions labeled in italics are caused by packet arrivals. The solid lines show the client s state sequence. The dashed lines show the server s state sequence. 12

Berkeley Sockets Server Client SOCKET SOCKET BIND CONNECT LISTEN SEND/RECEIVE ACCEPT CLOSE (SEND/RECEIVE)* CLOSE Sequence for connected sockets. Server Client SOCKET SOCKET BIND SENDTO/RECVFROM (SENDTO/RECVFROM)* CLOSE CLOSE Sequence for unconnected sockets. 13

Sending and receiving Connected sockets int send(int sockfd, const void *msg, int len, int flags); int recv(int sockfd, void *buf, int len, int flags); sockfd - socket descriptor msg - pointer to buffer to be sent/received len - length of buffer flag - normally 0 Returns bytes sent or received. NOTE: underlying protocol could be TCP or UDP 14

Sending and receiving Unconnected datagram sockets int sendto(int sockfd, const void *msg, int len, int flags, const stuct sockaddr *to, socklen_t tolen); int recvfrom(int sockfd, void *buf, int len, int flags, struct sockaddr *from, int *fromlen); sockfd - socket descriptor msg - pointer to buffer to be sent/received len - length of buffer flag - normally 0 to - address to send the datagram to from - address of who sent the datagram Returns bytes sent or received. 15

Type of UDP apps, part 1/3 Simple query protocols Overhead of connec:on establishment is overkill Easier to have applica:on retransmit if needed e.g. DNS, UDP port 53 www.cnn.com? e.g. DHCP, UDP port 67/68 12.3.4.15 DHCPDISCOVER 192.168.1.30 16

Type of UDP apps, part 2/3 Request/reply style interac:on Client sends request to server Blocks while wai:ng for reply Server responds with reply Must deal with: Iden:fy process that can handle request Possible loss of request or reply Correlate request with reply 17

Request/reply example Remote Procedure Call (RPC) Request/reply paradigm over UDP Allow programs to call procedures located on a remote host Invisible to the applica:on programmer Client code blocks while request made and response waited for from remote host Object- oriented languages: Remote Method Invoca:on(RMI), e.g. Java RMI 18

RPC mechanism Client stub Represents server procedure in client's address space Server stub Hides fact that procedure call from client is not local to the server Usually create by a stub compiler 19

RPC steps Step 1 - Client calls the client stub, a local procedure call, parameters pushed on to stack in normal way Step 2 - Client packages parameters into a message, "marshaling" Step 3 - Client OS sends the message to server machine Step 4 - Server OS passes message to server stub Step 5 - Server OS calls server procedure with unmarshaled parameters 20

RPC challenges Marshaling pointers Call by reference RPC challenges e.g. Pointer to integer Passing pointer to a complex structure, e.g. graph Parameter size may be uncertain e.g. Vector dot product using special termina:on flag Global variables Opera:ons may not be idempotent Not safe to repeat, e.g. incremen:ng a counter 21

RPC protocol must: RPC problems 1. Name space to uniquely ID each procedure 2. Match each reply with corresponding request 3. Work on a best- effort network Messages may be lost, corrupted, duplicated, delayed, may exceed size limit, etc. 22

Specifying RPC names Problem 1: Iden:fying a procedure Flat scheme Single ID field carried in RPC request Requires central authority to assign ID e.g. Simple integer ID Hierarchical Two or more level name space e.g. SunRPC, 32- bit program #, 32- bit procedure # Program number 0x00100003 = NFS Procedure number 1 = getarr, 2 = setarr, 6 = read, 23

Matching RPC replies Problem 2: Matching requests to replies Message ID on request Reply contains same message ID Simple scheme, client starts at 0 and counts up But what if client reboots? Client sends message with ID 0 Client crashes, reboots, sends new request ID 0 Servers already replied to first one Server discards as duplicate Client never gets response to new request Add boot ID from nonvola:le storage to message ID 24

Reliable RPC Problem 3: Work on best- effort network UDP/IP does not provide reliable transport Messages may get corrupted, duplicated, dropped, delayed, etc. Use :meouts and ACKs Timeline for reliable RPC protocol 25

Reliable RPC Explicit ACKs seen unnecessary Reply is implicit ACK of the request Next request is implicit ACK of the previous reply But we can't send a new request un:l previous one is done Server may block on I/O for a long :me Severely limits RPC performance Timeline for reliable RPC protocol using implicit acknowledgements. 26

Reliable RPC Concurrent logical channels Only one request per channel Mul:ple channels with different channel IDs Channel 1 Channel 2 Channel 3 27

Reliable RPC What if server crashes serving request? Client would be wai:ng forever Client could send "Are you alive?" messages Server could send "I'm alive" messages What if duplicate requests are made? Servers may implement at- most- once seman:cs Server remembers current sequence number on a par:cular channel Only service next expected request 28

Type of UDP apps, part 3/3 Mul:media streaming e.g. Voice over IP, video conferencing Time is of the essence By :me packet is retransmired, it's too late! Interac:ve applica:ons: Human- to- human interac:on e.g. conference, first- person shooters Streaming applica:ons: Computer- to- human interac:on e.g. Neulix, Spo:fy 29

RTP Real- :me Transport Protocol (RTP) Generic real- :me transport protocol How to transport audio/video data in packets Processing to play at right :me 30

RTP Real- :me Transport Protocol (RTP) Mul:plexes several real- :me streams into single UDP stream Sent to single des:na:on (unicast) or mul:ple des:na:ons (mul:cast) Provides: Number of packets Header specifying type of encoding (e.g. MP3, Time stamping of samples 31

RTP header Payload type - encoding algorithm used Sequence number - counter incremented on each packet sent Timestamp - produce by stream's source, when first sample in packet was made. Decouples playback from packet arrival. Synch. source ID - which steam this packet belongs to Contribu:ng source ID - used when mixes present 32

RTCP Real- :me Transport Control Protocol (RTCP) Provides feedback on network Delay, varia:on in delay, jirer, bandwidth, conges:on Allows RTP to adjust to different encoding schemes Interstream synchroniza:on Different streams may use different clocks Helps keep them in synch Naming of stream sources e.g. ASCII text for whoever is speaking right now 33

Playback using RTP RTP playback Packets may arrive out of order Buffer a certain amount so receiver can reorder Long buffer possible for streaming apps Short buffer needed for interac:ve apps 34

Transport layer Summary Providing end- to- end process communica:on Port numbers allow mul:ple processes per host Provide reliable transport on best- effort network User Datagram Protocol (UDP) Lightweight protocol running on top of IP Three typical classes of applica:ons: Simple queries (DNS, DHCP) Request/reply seman:cs (RPC) Real- :me data (RTP) 35