University of Calgary – CPSC 441.  UDP stands for User Datagram Protocol.  A protocol for the Transport Layer in the protocol Stack.  Alternative to.

Slides:



Advertisements
Similar presentations
Transport Layer3-1 Transport Overview and UDP. Transport Layer3-2 Goals r Understand transport services m Multiplexing and Demultiplexing m Reliable data.
Advertisements

Umut Girit  One of the core members of the Internet Protocol Suite, the set of network protocols used for the Internet. With UDP, computer.
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.
Intermediate TCP/IP TCP Operation.
UDP & TCP Where would we be without them!. UDP User Datagram Protocol.
1 Chapter 3 TCP and IP. Chapter 3 TCP and IP 2 Introduction Transmission Control Protocol (TCP) Transmission Control Protocol (TCP) User Datagram Protocol.
Computer Communication Digital Communication in the Modern World Transport Layer Multiplexing, UDP
Chapter 3: Transport Layer
Transport Layer3-1 Transport Layer Our goals: r understand principles behind transport layer services: m multiplexing/demultipl exing m reliable data transfer.
UDP: User Datagram Protocol. UDP: User Datagram Protocol [RFC 768] r “bare bones”, “best effort” transport protocol r connectionless: m no handshaking.
William Stallings Data and Computer Communications 7 th Edition (Selected slides used for lectures at Bina Nusantara University) Transport Layer.
8-1 Transport Layer Our goals: r understand principles behind transport layer services: m multiplexing/demultipl exing m reliable data transfer m flow.
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.
1 Transport Layer Computer Networks. 2 Where are we?
Review: –What is AS? –What is the routing algorithm in BGP? –How does it work? –Where is “policy” reflected in BGP (policy based routing)? –Give examples.
Jaringan Komputer Dasar OSI Transport Layer Aurelio Rahmadian.
© 2008 Cisco Systems, Inc. All rights reserved.Cisco ConfidentialPresentation_ID 1 Chapter 7: Transport Layer Introduction to Networking.
6.1. Transport Control Protocol (TCP) It is the most widely used transport protocol in the world. Provides reliable end to end connection between two hosts.
TCOM 509 – Internet Protocols (TCP/IP) Lecture 04_a Transport Protocols - UDP Instructor: Dr. Li-Chuan Chen Date: 09/22/2003 Based in part upon slides.
Transport Layer and UDP Tahir Azim Ref:
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 2.5 Internetworking Chapter 25 (Transport Protocols, UDP and TCP, Protocol Port Numbers)
Transport Layer1 Ram Dantu (compiled from various text books)
1 Transport Layer Lecture 7 Imran Ahmed University of Management & Technology.
Lecture91 Administrative Things r Return homework # 1 r Review some problems in homework # 1 r Questions about grading? Yona r WebCT for CSE245 is working!
Transport Layer COM211 Communications and Networks CDA College Theodoros Christophides
CPSC 441 TUTORIAL – FEB 13, 2012 TA: RUITNG ZHOU UDP REVIEW.
Transport Layer 3-1 Chapter 3 Outline r 3.1 Transport-layer services r 3.2 Multiplexing and demultiplexing r 3.3 Connectionless transport: UDP.
Chapter 3: Transport Layer Our goals: r understand principles behind transport layer services: m multiplexing/demultipl exing m reliable data transfer.
Institute of Technology Sligo - Dept of Computing Chapter 12 The Transport Layer.
CSC 600 Internetworking with TCP/IP Unit 5: IP, IP Routing, and ICMP (ch. 7, ch. 8, ch. 9, ch. 10) Dr. Cheer-Sun Yang Spring 2001.
Transport Layer3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach Featuring the Internet, 3 rd edition. Jim Kurose, Keith Ross Addison-Wesley,
Today’s topic: UDP Reliable communication over UDP.
MULTIPLEXING/DEMULTIPLEXING, CONNECTIONLESS TRANSPORT.
CSCI 330 UNIX and Network Programming Unit XIV: User Datagram Protocol.
UDP & TCP Where would we be without them!. UDP User Datagram Protocol.
1 Kyung Hee University Chapter 11 User Datagram Protocol.
1 User Datagram Protocol. 2 Transport Protocols Provide logical communication between application processes running on different hosts Run on end hosts.
UDP: User Datagram Protocol Brian Jorgage CSC /24/2004.
Data Communications and Networks Chapter 6 – IP, UDP and TCP ICT-BVF8.1- Data Communications and Network Trainer: Dr. Abbes Sebihi.
Transport Layer3-1 Chapter 3: Transport Layer Our goals: r understand principles behind transport layer services: m multiplexing/demultipl exing m reliable.
McGraw-Hill Chapter 23 Process-to-Process Delivery: UDP, TCP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Introduction 1-1 source application transport network link physical HtHt HnHn M segment HtHt datagram destination application transport network link physical.
2: Transport Layer 11 Transport Layer 1. 2: Transport Layer 12 Part 2: Transport Layer Chapter goals: r understand principles behind transport layer services:
Process-to-Process Delivery:
@Yuan Xue A special acknowledge goes to J.F Kurose and K.W. Ross Some of the slides used in this lecture are adapted from their.
Ch 3. Transport Layer Myungchul Kim
Two Transport Protocols Available Transmission Control Protocol (TCP) User Datagram Protocol (UDP) Provides unreliable transfer Requires minimal – Overhead.
Chapter 11 User Datagram Protocol
The Transport Layer Implementation Services Functions Protocols
Chapter 9: Transport Layer
Chapter 3 outline 3.1 Transport-layer services
Instructor Materials Chapter 9: Transport Layer
Transport Protocols Relates to Lab 5. An overview of the transport protocols of the TCP/IP protocol suite. Also, a short discussion of UDP.
Process-to-Process Delivery, TCP and UDP protocols
06- Transport Layer Transport Layer.
Chapter 14 User Datagram Protocol (UDP)
Transport Protocols Relates to Lab 5. An overview of the transport protocols of the TCP/IP protocol suite. Also, a short discussion of UDP.
Transport Protocols Relates to Lab 5. An overview of the transport protocols of the TCP/IP protocol suite. Also, a short discussion of UDP.
Process-to-Process Delivery:
CPEG514 Advanced Computer Networkst
Net 323 D: Networks Protocols
Process-to-Process Delivery: UDP, TCP
Computer Networks Protocols
Transport Protocols Relates to Lab 5. An overview of the transport protocols of the TCP/IP protocol suite. Also, a short discussion of UDP.
Transport Layer 9/22/2019.
Presentation transcript:

University of Calgary – CPSC 441

 UDP stands for User Datagram Protocol.  A protocol for the Transport Layer in the protocol Stack.  Alternative to the Transmission Control Protocol (TCP) and, together with IP, is also referred to as UDP/IP  Programs on networked computers can send short messages sometimes known as datagram (using datagram sockets) to one another. 2

 UDP is a minimal transport layer protocol.  Unreliable and connection-less:  UDP provides no guarantees to the upper layer protocol for message delivery  The UDP protocol retains no state of UDP messages once sent  Messages may be delivered out of order.  Provide integrity verification (via checksum) of the header and payload.  UDP provides application multiplexing (via port numbers) 3

From: 4

 The UDP header consists of 4 fields, each of which is 2 bytes.  The use of two of those is optional in IPv4 (pink background in table). In IPv6 only the source port is optional. 1. Source port number  Identifies the sender's port, should be assumed to be the port to reply to if needed.  If not used, then it should be zero. 5

2. Destination port number  Identifies the receiver's port and is required 3. Length  Specifies the length in bytes; considers the entire datagram: header and data  The minimum length is 8 bytes = the length of the header.  The field size sets a theoretical limit of 65,535 bytes (8 byte header + 65,527 bytes of data) for a UDP datagram 6

4. Checksum  The checksum field is used for error-checking of the header and data. This field is mandatory for IPv6.  If no checksum is generated by the transmitter, the field should be set to all-zeros.  UDP uses pseudo header to define the checksum. It is calculated over the combination of pseudo header and UDP message.  The pseudo header contains : the IP Source Address field, the IP Destination Address field, the IP Protocol field and the UDP Length field. 7

8

 UDP’s advantages over TCP:  UDP’s header is much smaller than TCP’s. The header is being applied to every segments, and adds up!  Generating a UDP header has much simpler processing steps.  UDP has no connection setup overhead, while TCP requires a 3- way handshake.  UDP is widely used and recommended for cases where:  Speed Is more important than reliability. An application values timely delivery over reliable delivery  Data exchanges are short and the order of reception of datagram does not matter  A best-effort for delivery is enough  Applications require multicast or broadcast transmissions, not supported by TCP. 9

 Domain Name System (DNS)  Simple network management protocol (SNMP)  Dynamic Host Configuration Protocol (DHCP)  Routing Information Protocol (RIP)  Many Multimedia applications like streaming video, VOIP  “Real-time video and audio streaming protocols are designed to handle occasional lost packets, so only slight degradation in quality occurs, rather than large delays if lost packets were retransmitted.” [Wikipedia] 10

 “Checksum is the 16-bit one's complement of the one's complement sum of a pseudo header of information from the IP header, the UDP header, and the data, padded with zero octets at the end (if necessary) to make a multiple of two octets.” [RFC 768]  Checksum is calculated for UDP header and data  IP header also has a checksum, but it doesn’t cover data.  UDP checksum test is performed only at the sender and receiver end stations  The IP checksum test is performed in every intermediate node (router).  UDP check sum is performed over a pseudo header.  In addition to UDP header and data + the source and the destination IP address  This prevent misrouting: in case the destination IP address in IP header was corrupted, and it was not discovered by the IP checksum test, the UDP datagram would arrive to the wrong IP address. UDP can detect this and silently drop the datagram. 11

From: 12

13

Sample from: “Checksum is the 16-bit one's complement of the one's complement sum of a pseudo header of information from the IP header, the UDP header, and the data, padded with zero octets at the end (if necessary) to make a multiple of two octets.” [RFC 768] 14

 A UDP server does not have to listen for and accept client connections  A UDP client does not have to connect to a server. 15

 Server: 1. Open a datagram socket with socket() 2. Name the socket with the bind() function, using a SOCKADDR structure for the address parameter 3. Exchange data with a client using the sendto() and recvfrom() functions 4. Close the connection with the closesocket() function  Client: 1. Open a datagram socket with socket() 2. Exchange data with server using sendto() and recvfrom() 3. Close the connection with the closesocket() function 16

int socketid = socket(domain, type, protocl);  socketid: socket descriptor, an integer (like a file-handle)  domain: integer, communication domain ▪ e.g., PF_INET (IPv4 protocol)  type: should be set to SOCK_DGRAM for UDP  protocol: for UDP over IP, should be set to IPPROTO_UDP or just 0 int status = bind(socketid, &addrport, size);  status: error status, -1 if bind failed, zero if successful  sockid: integer, socket descriptor  addrport: struct sockaddr, the (IP) address and port of the machine  size: the size (in bytes) of the addrport structure 17

 int sendto(int sockid, const void *sendbuf, int sendlen, int flags, const struct sockaddr *to, int tolen);  sockid: integer, socket descriptor  sendbuf: Buffer containing the data to be transmitted.  sendlen: Size in bytes of the data in the buf buffer.  flags: Indicator specifying the way in which the call is made.  to: struct sockaddr, the address of the target  tolen: the size (in bytes) of the addrport structure  int recvfrom(int sockid, const void *recvbuf, int recvlen, int flags, const struct sockaddr *from, int fromlen);  sockid and flags are same as above  recvbuf and recvlen: Buffer containing the received data and its size  from and fromlen: the address of the source and its size  Return value: If no error occurs, these function returns the total number of bytes sent/recieved, if an error occurs, SOCKET_ERROR (- 1) is returned. 18

 Word server and client  SimpleChat 19

     