USER DATAGRAM PROTOCOL (UDP) Prof. Crista Lopes. What is UDP ?  an unreliable transport protocol that can be used in the Internet.  an 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
Chapter 7 – Transport Layer Protocols
S305 – Network Infrastructure Chapter 5 Network and Transport Layers Part 2.
– 1 – CSCE 517 Sum 03 Slides for Today July 14 are not Quite Complete; but close enough to post Test 2 will be returned and …
The Domain Name System. CeylonLinux DNS concepts using BIND 2 Hostnames IP Addresses are great for computers –IP address includes information used for.
UDP - User Datagram Protocol UDP – User Datagram Protocol Author : Nir Shafrir Reference The TCP/IP Guide - ( Version Version.
Network Architectures Week 3 Part 2. Comparing The Internet & OSI.
1 K. Salah Module 6.0: Transport Layer Protocols UDP & TCP Chapter 23 & 24.
Domain Name System: DNS
TCP/IP Protocol Suite 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 19 Domain Name System (DNS)
1 DNS,NFS & RPC Rizwan Rehman, CCS, DU. Netprog: DNS and name lookups 2 Hostnames IP Addresses are great for computers –IP address includes information.
25.1 Chapter 25 Domain Name System Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Domain Name System ( DNS )  DNS is the system that provides name to address mapping for the internet.
TCP/IP Protocol Suite 1 Chapter 17 Upon completion you will be able to: Domain Name System: DNS Understand how the DNS is organized Know the domains in.
DNS. Outline r Domain Name System r DNS Hierarchy r Resolution.
Chapter 25 Domain Name System
Gursharan Singh Tatla Transport Layer 16-May
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.
Netprog: DNS and name lookups1 Address Conversion Functions and The Domain Name System Refs: Chapter 9 RFC 1034 RFC 1035.
University of Calgary – CPSC 441.  UDP stands for User Datagram Protocol.  A protocol for the Transport Layer in the protocol Stack.  Alternative to.
25.1 Chapter 25 Domain Name System Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Chapter 17 Domain Name System
1 Chapter Overview TCP/IP DoD model. 2 Network Layer Protocols Responsible for end-to-end communications on an internetwork Contrast with data-link layer.
Hyung-Min Lee©Networking Lab., 2001 Chapter 11 User Datagram Protocol (UDP)
Jaringan Komputer Dasar OSI Transport Layer Aurelio Rahmadian.
TCP/IP Protocol Suite 1 Chapter 17 Upon completion you will be able to: Domain Name System: DNS Understand how the DNS is organized Know the domains in.
Domain Name System CH 25 Aseel Alturki
Chapter Three Network Protocols By JD McGuire ARP Address Resolution Protocol Address Resolution Protocol The core protocol in the TCP/IP suite that.
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.
Netprog: DNS and name lookups1 Address Conversion Functions and The Domain Name System Refs: Chapter 9 RFC 1034 RFC 1035.
TCP/IP Transport and Application (Topic 6)
Chapter 6-2 the TCP/IP Layers. The four layers of the TCP/IP model are listed in Table 6-2. The layers are The four layers of the TCP/IP model are listed.
Transport Layer3-1 Chapter 3 Transport Layer These ppt slides are originally from the Kurose and Ross’s book. But some slides are deleted and added for.
Internetworking Internet: A network among networks, or a network of networks Allows accommodation of multiple network technologies Universal Service Routers.
1 Kyung Hee University Chapter 18 Domain Name System.
Domain Name System Refs: Chapter 9 RFC 1034 RFC 1035.
Transport Layer COM211 Communications and Networks CDA College Theodoros Christophides
CPSC 441 TUTORIAL – FEB 13, 2012 TA: RUITNG ZHOU UDP REVIEW.
TCP/IP Protocol Suite 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 19 Domain Name System (DNS)
Institute of Technology Sligo - Dept of Computing Chapter 12 The Transport Layer.
TCP/IP Protocol Suite 1 Chapter 17 Upon completion you will be able to: Domain Name System: DNS Understand how the DNS is organized Know the domains in.
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.
1 Computer Communication & Networks Lecture 23 & 24 Transport Layer: UDP and TCP Waleed Ejaz
McGraw-Hill Chapter 23 Process-to-Process Delivery: UDP, TCP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Process-to-Process Delivery:
TCP/IP Protocol Suite 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Internet Protocol Version4 (IPv4)
Chapter 11 User Datagram Protocol
The Transport Layer Implementation Services Functions 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.
Chapter 5 Network and Transport Layers
TCP Transport layer Er. Vikram Dhiman LPU.
Subject Name: Computer Communication Networks Subject Code: 10EC71
Chapter 5 Network and Transport Layers
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:
Transport Protocols An overview of the transport protocols of the TCP/IP protocol suite. Also, a short discussion of UDP.
TCP/IP Protocol Suite: Review
Domain Name System Refs: Chapter 9 RFC 1034 RFC 1035.
Domain Name System: DNS
Process-to-Process Delivery: UDP, TCP
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:

USER DATAGRAM PROTOCOL (UDP) Prof. Crista Lopes

What is UDP ?  an unreliable transport protocol that can be used in the Internet.  an alternative to the Transmission Control Protocol(TCP).  UDP uses the Internet Protocol to get a data unit (datagram) from one computer to another.  a connectionless transport layer protocol in the TCP/IP protocol stack.

Position of UDP in the OSI model

UDP(cont’d)  UDP does not provide:  flow or error control  connection management  guaranteed in-order packet delivery  UDP is almost a “null” transport layer.  UDP is often used for time-sensitive applications where missing data is preferred to late-arriving data.(i.e. Domain Name Server (DNS))

Why UDP ?  No connection needs to be set up.  Throughput may be higher because UDP packets are easier to process, especially at the source.  The user doesn’t care if the data is transmitted reliably.  Example: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.

TCP and UDP Functional Comparison FunctionTCPUDP Ordered data transfer This involves a continuous stream of ordered data. Does not reorder received data. Multiplexing using ports Receiving hosts decide the correct application for which the data is destined, based on the port number. Same as TCP. Reliable transfer Acknowledgment of data uses the Sequence and Acknowledgment fields in the TCP header. This is not a feature of UDP. Flow control This process is used to protect buffer space and routing devices. This is not a feature of UDP. Connections This process is used to initialize port numbers and other TCP header fields. UDP is connectionless.

IP addresses versus port numbers

UDP header format

 Source port :This field identifies the sending port.  Destination port: This field identifies the destination port and is required.  Length :16-bit field that specifies the length in bytes of the entire datagram: header and data.  Checksum: The 16-bit checksum field is used for error-checking of the header and data

Checksum calculation  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.

IPv4 PSEUDO-HEADER

Checksum calculation

Encapsulation and decapsulation

Notes  UDP packets are called user datagrams and have a fixed-size header of 8 bytes.  UDP length = IP length − IP header’s length  Port numbers obtained by Internet Assigned Numbers Authority (IANA):

Some well-known ports used with UDP PortProtocolDescription 7EchoEchoes a received datagram back to sender 9DiscardDiscards diagrams that are received 13DaytimeReturns date and time 17Quote of the DayServer returns a short arbitrary message to the client 23Message Send Protocolused to send a short message between nodes on a network. 53Domain Name Systemtranslates a host name into an IP address. 68Bootstrap Protocol (BOOTP) Clientused by a network client to obtain an IP address from a configuration server (DHCP). 69Trivial File Transfer Protocol a very basic form of File Transfer Protocol (FTP)

Domain Name System(DNS)  IP addresses are tough for humans to remember.  IP addresses are impossible to guess.  The domain name system is usually used to translate a host name into an IP address.  Domain names comprise a hierarchy so that names are unique, yet easy to remember.

DNS and UDP  DNS primarily uses User Datagram Protocol (UDP) on port number 53 to serve requests.  Single UDP request from the client followed by a single UDP reply from the server.  In Domain Name System (DNS), queries must be fast and only consist of a single request followed by a single reply packet

Domain Name  The domain name for a host is the sequence of labels that lead from the host (leaf node in the naming tree) to the top of the worldwide naming tree.  A domain is a subtree of the worldwide naming tree.  Top Level Domains : edu, gov, com, net, org  Countries each have a top level domain (2 letter domain name).

Host name structure  Each host name is made up of a sequence of labels separated by periods.  Each label can be up to 63 characters  The total name can be at most 255 characters.  Examples:  whitehouse.gov  isr.ics.uci.edu

DNS Organization  Distributed Database  The organization that owns a domain name is responsible for running a DNS server that can provide the mapping between hostnames within the domain to IP addresses.  some machine run by UCI is responsible for everything within the uci.edu domain.

DNS Distributed Database  There is one primary server for a domain, and typically a number of secondary servers containing replicated databases. uci.edu DNS server rpi.edu DNS DB rpi.edu DNS DB uci.edu DNS DB uci.edu DNS DB ReplicasAuthoritative

UDP or TCP  Both UDP and TCP are used in DNS:  Generally UDP is used to serve requests.  If the response data size exceeds 512 bytes, requestor resubmits request using TCP( i.e. zone transfers).

DNS Clients  A DNS client is called a resolver.  A call to gethostbyname() is handled by a resolver (typically part of the client).  Most Unix workstations have the file /etc/resolv.conf that contains the local domain and the addresses of DNS servers for that domain.

/etc/resolv.conf domain ics.uci.edu

The Root DNS Server  the official DNS root is administered by the Internet Corporation for Assigned Names and Numbers (ICANN).  The root server needs to know the address of 1st (and many 2nd) level domain nameservers. ics educomorgjp ucsd uci eng

DNS Servers  Servers handle requests for their domain directly.  If a server has no clue about where to find the address for a hostname, asks the root server. The root server will tell you what nameserver to contact.  A request may get forwarded a few times.  Servers cache external mappings(since root servers are bottleneck for trillions of queries placed every day)

Address resolution mechanism 1-the root server address is often stored in a file of root hints, which are updated periodically by an administrator from a reliable source. 2-ask the root server to find the server authoritative for the top- level domain. 3-ask the obtained Top Level Domain DNS server for the second-level domain. 4-Repeating the previous step

UDP Client and Server Example in Java  The server continuously receives datagram packets over a datagram socket.  Each datagram packet received by the server indicates a client request for a quotation.  When the server receives a datagram, it replies by sending a datagram packet that contains a one-line "quote of the moment" back to the client.  Two classes implement the server application: QuoteServer and QuoteServerThread. A single class implements the client application: QuoteClient.

QuoteServer Class import java.io.*; public class QuoteServer { public static void main(String[] args) throws IOException { new QuoteServerThread().start(); }

The QuoteServerThread Class public class QuoteServerThread extends Thread {... super(name); socket = new DatagramSocket(4445); public void run() { while (moreQuotes) { try { byte[] buf = new byte[256]; // receive request DatagramPacket packet = new DatagramPacket(buf, buf.length); socket.receive(packet); // figure out response String dString = null; dString = getNextQuote(); … buf = dString.getBytes(); // send the response to the client at "address" and "port“ InetAddress address = packet.getAddress(); int port = packet.getPort(); packet = new DatagramPacket(buf, buf.length, address, port); socket.send(packet); }...}}

The QuoteClient Class public class QuoteClient { public static void main(String[] args) throws IOException { if (args.length != 1) { System.out.println("Usage: java QuoteClient "); return; } // get a datagram socket DatagramSocket socket = new DatagramSocket(); // send request byte[] buf = new byte[256]; InetAddress address = InetAddress.getByName(args[0]); DatagramPacket packet = new DatagramPacket(buf, buf.length, address, 4445); socket.send(packet); // get response packet = new DatagramPacket(buf, buf.length); socket.receive(packet); // display response String received = new String(packet.getData(), 0, packet.getLength()); System.out.println("Quote of the Moment: " + received); socket.close(); }