Transportation Protocols: UDP, TCP & RTP

Slides:



Advertisements
Similar presentations
Umut Girit  One of the core members of the Internet Protocol Suite, the set of network protocols used for the Internet. With UDP, computer.
Advertisements

© 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas.
CCNA – Network Fundamentals
© 2007 Cisco Systems, Inc. All rights reserved.Cisco Public ITE PC v4.0 Chapter 1 1 OSI Transport Layer Network Fundamentals – Chapter 4.
CSCI 4550/8556 Computer Networks
Transmission Control Protocol (TCP)
Intermediate TCP/IP TCP Operation.
Guide to TCP/IP, Third Edition
Lecture 7 Transport Layer
CS3505 The Internet and Info Hiway transport layer protocols : TCP/UDP.
BZUPAGES.COM 1 User Datagram Protocol - UDP RFC 768, Protocol 17 Provides unreliable, connectionless on top of IP Minimal overhead, high performance –No.
TELE202 Lecture 14 TCP/UDP (2) 1 Lecturer Dr Z. Huang Overview ¥Last Lecture »TCP/UDP (1) »Source: chapter 17 ¥This Lecture »TCP/UDP (2) »Source: chapter.
© 2007 Cisco Systems, Inc. All rights reserved.Cisco Public 1 Version 4.0 OSI Transport Layer Network Fundamentals – Chapter 4.
UNIT 07 Process – to – Process Delivery: UDP,TCP and SCTP
Autumn 2000John Kristoff1 Transport Layer Computer Networks.
CMPE 80N - Introduction to Networks and the Internet 1 CMPE 80N Spring 2003 Week 8 Introduction to Networks and the Internet.
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Transport Protocols Slide 1 Transport Protocols.
TCP. Learning objectives Reliable Transport in TCP TCP flow and Congestion Control.
Gursharan Singh Tatla Transport Layer 16-May
What Can IP Do? Deliver datagrams to hosts – The IP address in a datagram header identify a host IP treats a computer as an endpoint of communication Best.
Process-to-Process Delivery:
TRANSPORT LAYER T.Najah Al-Subaie Kingdom of Saudi Arabia Prince Norah bint Abdul Rahman University College of Computer Since and Information System NET331.
The Transport Layer.
1 Chapter Internetworking Part 4 (Transport Protocols, UDP and TCP, Protocol Port Numbers)
Transportation Protocols: UDP, TCP & RTP
1 Transport Layer Computer Networks. 2 Where are we?
1 Semester 2 Module 10 Intermediate TCP/IP Yuda college of business James Chen
IP and Errors IP Best Effort Datagrams can be: –Lost –Delayed –Duplicated –Delivered out of order –Corrupted.
IP and Errors IP Best Effort Datagrams can be: –Lost –Delayed –Duplicated –Delivered out of order –Corrupted.
TCP : Transmission Control Protocol Computer Network System Sirak Kaewjamnong.
TCP Lecture 13 November 13, TCP Background Transmission Control Protocol (TCP) TCP provides much of the functionality that IP lacks: reliable service.
University of the Western Cape Chapter 12: The Transport Layer.
SMUCSE 4344 transport layer. SMUCSE 4344 transport layer end-to-end protocols –transport code runs only on endpoint hosts encapsulates network communications.
ECE453 – Introduction to Computer Networks Lecture 14 – Transport Layer (I)
TCP/IP Transport and Application (Topic 6)
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 2.5 Internetworking Chapter 25 (Transport Protocols, UDP and TCP, Protocol Port Numbers)
TCP1 Transmission Control Protocol (TCP). TCP2 Outline Transmission Control Protocol.
Transport Layer Moving Segments. Transport Layer Protocols Provide a logical communication link between processes running on different hosts as if directly.
1 Introduction to Computer Networks University of ilam Dr. Mozafar Bag-Mohammadi Transport Layer.
Transport Control Protocol (TCP) Features of TCP, packet loss and retransmission, adaptive retransmission, flow control, three way handshake, congestion.
CCNA 1 v3.0 Module 11 TCP/IP Transport and Application Layers.
1 TCP: Reliable Transport Service. 2 Transmission Control Protocol (TCP) Major transport protocol used in Internet Heavily used Completely reliable transfer.
Networking Basics CCNA 1 Chapter 11.
Chapter 24 Transport Control Protocol (TCP) Layer 4 protocol Responsible for reliable end-to-end transmission Provides illusion of reliable network to.
Computer Networks23-1 PART 5 Transport Layer. Computer Networks23-2 Position of Transport Layer Responsible for the delivery of a message from one process.
Transmission Control Protocol (TCP) BSAD 146 Dave Novak Sources: Network+ Guide to Networks, Dean 2013.
1 End-to-End Protocols User Datagram Protocol (UDP) Transmission Control Protocol(TCP)
4343 X2 – The Transport Layer Tanenbaum Ch.6.
IP1 The Underlying Technologies. What is inside the Internet? Or What are the key underlying technologies that make it work so successfully? –Packet Switching.
McGraw-Hill Chapter 23 Process-to-Process Delivery: UDP, TCP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
TCP/IP1 Address Resolution Protocol Internet uses IP address to recognize a computer. But IP address needs to be translated to physical address (NIC).
1 TCP ProtocolsLayer name DNSApplication TCP, UDPTransport IPInternet (Network ) WiFi, Ethernet Link (Physical)
Chapter 5 Peer-to-Peer Protocols and Data Link Layer Timing Recovery.
Two Transport Protocols Available Transmission Control Protocol (TCP) User Datagram Protocol (UDP) Provides unreliable transfer Requires minimal – Overhead.
3. END-TO-END PROTOCOLS (PART 1) Rocky K. C. Chang Department of Computing The Hong Kong Polytechnic University 22 March
1 Chapter 24 Internetworking Part 4 (Transport Protocols, UDP and TCP, Protocol Port Numbers)
The Transport Layer Implementation Services Functions Protocols
Chapter 9: Transport Layer
Instructor Materials Chapter 9: Transport Layer
5. End-to-end protocols (part 1)
Module 1 UDP & TCP.
Process-to-Process Delivery, TCP and UDP protocols
PART 5 Transport Layer Computer Networks.
Internet and Intranet Protocols and Applications
Transport Layer Unit 5.
Process-to-Process Delivery:
Lecture 21 and 22 5/29/2019.
Process-to-Process Delivery: UDP, TCP
Computer Networks Protocols
Presentation transcript:

Transportation Protocols: UDP, TCP & RTP Lecture 11 Transportation Protocols: UDP, TCP & RTP Transportation Functions UDP (User Datagram Protocol) Port Number to Identify Different Applications Server and Client as well as Port TCP (Transmission Control Protocol) - TCP Segment Format and Delivery - TCP Reliability Control - TCP Flow Control - TCP Congestion Control - TCP Connection Control Comparison between UDP and TCP RTP (Realtime Transport Protocol)

Transportation Functions Computer A Computer B Appli- cation 1 Appli- cation 2 Appli- cation k Appli- cation 1 Appli- cation 2 Appli- cation k ports applica-to-applica/end-to-end ports Transportation UDP/TCP/RTP Transportation UDP/TCP/RTP host-to-host/computer-to-computer IP IP Data link Data link Internet Physical Physical IP functions - Computer-to-computer connectionless communication using IP address - Unreliable datagram service: corrupted, lost, duplicated, disordered Transportation functions - Application-to-application communication using port number, application address - Support multiple applications simultaneously using multiplexing - Optional functions: reliability, flow control, congestion control, connection service

PhyHead+IPHead+UDPHead+Data Applications UDP Port Numbers Buffers UDP De/Multiplexer De/Multiplexer IP IP Internet PhyHead+IPHead+UDPHead+Data UDP (User Datagram Protocol) - Identifies different applications using port numbers - Connectionless service, UDP datagrams are delivered independently - Unreliable delivery: packet loss, corruption, duplication, disorder

UDP Header Format and Port Number UDP datagram UDP Header Application Message Data 1 16 32 UDP header UDP Source Port UDP Destination Port UDP Message Length UDP Checksum Port Name Description 7 echo Echo input back to sender 9 discard Discard input 11 systat System statistics 13 daytime Time of day (ASCII) 17 quote Quote of the day 19 chargen Character generator 37 time System time (seconds since 1970) 53 domain Domain Name Server (DNS) 69 tftp Trivial File Transfer Protocol (TFTP) 123 ntp Network Time Protocol (NTP) 161 snmp Simple Network Management Protocol Source - application sending message destination - application receiving data Port number: 2 byte integer from 0~65535 0 to 1023: reserved, well-known 1024 to 49151: registered ports 49152 to 65535: dynamic ports Source & destination port numbers may be different

Server, Client and Port Example - A program in a remote or local machine - Executed first and passively waits connection from clients - Accepts request from client and reply to the client Client - A program in a local machine - executed late and actively initiates connection to server - Sends request to server and accepts reply from server DNS (domain name system) Example: - DNS server port number: 53 (fixed) - DNS client port number: 28900 (changeable) - DNS client connects to DNS server request IP address of wwwcis.k.hosei.ac.jp - UDP datagram from client to server - source port number: 28900 - destination port number: 53 - Server reply IP address 133.25.82.120 in a UDP datagram to client - UDP datagram from server to client - source port number: 53 - destination port number: 28900

PhyHead+IPHead+TCPHead+Data Applications TCP Port Numbers Buffers De/Multiplexer De/Multiplexer Connection Control Reliability Control Flow/cong. Control TCP Connection Control Reliablility Control Flow/cong. Control IP IP Internet PhyHead+IPHead+TCPHead+Data TCP (Transmission Control Protocol) - Identifies different applications using port numbers like UDP - Connection oriented service: connection establishment and termination - Full duplex and stream connection - Reliable delivery: no packet loss, error, duplication, disorder

TCP Segment Format and Delivery Application Data H H H Segment 1 Segment 2 Segment m TCP Segments Port number: 2 byte (0~65535), FTP: 20, Telnet: 23, HTTP: 80, Servlet: 8080 Sequence number: unique ID number to identify order/location of a segment Codes: signal types of TCP segment: 010000 (ACK), 000010 (SYN), 000001 (FIN) TCP uses IP for data delivery like UDP, routers only forward IP datagram

TCP Reliable Data Transmission IP datagram can be corrupted, lost, duplicated and disordered Duplicated and disordered segments are overcome by unique sequence number Corrupted and lost segments are overcome using acknowledge and retransmission technique Positive acknowledgement - Receiver returns short message when data arrives - Called acknowledge - May acknowledge multiple segments Retransmission - Senders starts timer whenever message is transmitted - If timer expires before acknowledge arrives, sender retransmits message How to set timeout ??

Setting Appropriate Value of Timeout Inappropriate timeout can cause poor performance: - Too long: sender waits longer than necessary before re-transmitting - Too short: sender generates unnecessary traffic Timeout must be different for each connection and set dynamically - Host on same LAN should have shorter timeout than host 20 hops away - Delivery time across internet may change over time; timeout must accommodate changes RTO (Retransmission TimeOut) RTT (Round Trip Time) = sending_time – Ack_receiving_time Estimate of RTT on each connection Estimate of RTT change RTO >~ RTT Called adaptive retransmission Key to TCP’s success !

Adaptive Retransmission Algorithm Timeout should be based on round trip time (RTT) Sender can't know RTT of any packet before transmission Sender picks retransmission timeout (RTO) based on previous RTTs Specific method is call adaptive retransmission algorithm Weighted average for RTT: RTT(n+1)= α RTT(n) + (1-α)RTTn where RTTn is RTT of the nth segment Computation of RTO RTO(n+1)= β RTT(n+1) where 0< α <1 and 1.3< β <2.0 RTO(n+1) is RTO for (n+1)th segment Initial value RTT(0) decided in connection establishment When packet lost  no RTTn RTO(n+1) = 2 RTO(n) RTT(n+1)=RTT(n) - Proposed by Karn - called exponential backoff

TCP Flow Control Flow control TCP uses slide window control Receiver Lecture 11 TCP Flow Control Flow control - overcome data overrun when sending data fast than receiver can processed TCP uses slide window control Receiver - inform available buffer space – window - Each acknowledgement carries new window information called window advertisement - Maximum Window: buffer size - Minimum window: zero (closed window) Sender - Can send data up to entire window before ack arrives Interpretation I have received up through X, and can take Y more octets/bytes

TCP Congestion Control Excessive traffic can cause packet loss - Transport protocols respond with retransmission - Excessive retransmission can cause congestion collapse TCP interprets packet loss as an indicator of congestion Sender uses TCP congestion control and slows transmission of packets - Sends single packet - If acknowledgment returns without loss, sends two packets - When TCP sends one-half window size, rate of increase slows

TCP Connection Control: Startup & Shutdown Lecture 11 TCP Connection Control: Startup & Shutdown TCP is connection-oriented. - A connection must be established, called startup, before data communications - A connection must be terminated, called shutdown, if no data to be sent. Connect start must be reliable and shutdown must graceful Difficult because segments can be - lost - duplicated - delayed - delivered out of order - Either side can crash - Either side can reboot Needed to avoid duplicated “shutdown” message from affecting later connection

TCP Three-Way Handshake TCP uses three-message exchanges called 3-way handshake to startup/shutdown Synchronization segment (SYN) to describe messages in startup connection Finish segment (FIN) to describe message in shutdown connection Host 1 sends segment with SYN/FIN bit set and a random sequence number Host 2 responds with segment with SYN/FIN bit set, acknowledgment to Host 1, and the random sequence number Host 1 responds with acknowledgment Remember TCP segment will retransmit lost, duplicated, delayed 3-way handshake ensures unambiguous, reliable, graceful startup/shutdown despite packet loss, duplication and delay Animation Animation

Comparison between UDP and TCP - Connectionless service, UDP datagrams are delivered independently - Unreliable delivery: packet loss, corruption, duplication, disorder - relatively fast as compared with TCP - simple request-response communication with little concern with internal flow and error control, or with internal flow and error control in a application (TFTP) - some data (e.g., audio/video) with a certain toleration of errors - multicasting and broadcasting TCP - Connection oriented service: connection establishment and termination - Full duplex and stream connection - Reliable delivery: no packet loss, error, duplication, disorder - Connection overhead - Relatively slow because of retransmission and flow control - Heavily used like ftp, email, Web service, …

RTP (Realtime Transport Protocol) RTP (RFC 1889) provides end-to-end transport functions for applications that require real time transmissions, such as audio and video over unicast or multicast packet network services RTP normally runs on top of UDP but not limits to this RTP does not provide QoS guarantees RTP deals with jitter, loss, timing recovery and inter-media synchronization RTP is often used together with RTP control protocol (RTCP) which monitors the transmission quality and conveys information about participants RTP is not implemented as a separated layer, but can be incorporated into the application processing  JMF (Java Media Framework) API Real time play music or watch movie (unicast) Internet telephony (unicast) Audio conference (multicast) Audiovisual conference (multicast) Note 1: a pair of consecutive port numbers for one medium - medium (audio/video) stream - RTCP stream Note 2: audio and video use different port pairs because of their different features

V P X CC M Payload_T Sequence number RTP Message Format 15 31 V P X CC M Payload_T Sequence number Timestamp SSRC identifier CSRC identifier Data Version (V, 2B): RTP version (2 in current) Padding (P, 1B): optional bytes followed the payload Extension (X, 1B): optional header field CSRC count (CC, 4B): Numbers of CSRC identifiers Marker (M, 1B): mark significant event such as video frame Payload type (P, 7B): format of RTP data Sequence number (16B): detect packet order and loss Timestamp (16B): sampling instant for synchronization SSRC (16B): distinguish synchronization sources in a session CSRC list (16B): specify contributing sources for the payload

Exercise Lecture 11 1. Explain similarities and differences between UDP and TCP protocols 2. The following is a TCP header in hexadecimal format.    05320017 00000001 00000000 501007FF 00000000 a. What are the source and destination port numbers? b. What is the sequence number? c. What is the acknowledgement number? d. What is the length of the header? e. What is is the type of the segment? f. What is the window size? 3. A computer uses TCP to send a data to the other computer. The data is 100 bytes. Calculate the efficiency ( ratio of useful bytes to total bytes) first at the TCP level (no optional field), then at the IP level (no option field), and finally at Ethernet link layer ( no option field), respectively. 4. Corrupted and lost segments are overcome using acknowledge and retransmission technique in TCP. In the adaptive retransmission technique, timeout setting is very important and use the algorithm RTO(n+1)= β RTT(n+1) where RTT(n+1)= α RTT(n) + (1-α)RTTn. Suppose α =0.8, β=1.5 and RTT(0) = 500ms, calculate RTO(1) ~ RTO (5) for RTT1=600ms, RTT2=400ms, RTT3 (lost), and RTT4=500ms. 5. Suppose two programs use TCP to establish a connection, communicate, terminate the connection, and then open a new connection. Further suppose a FIN message sent to shut down the first connection is duplicated and delayed until the second connection has nee established. If a copy of the old FIN is delivered, will TCP terminate the new connection? Why?