1 Chapter 6 Datagram Delivery by UDP Just as the Internet Protocol uses the services of subnetworks, transport protocols build upon the services of IP.

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

20.1 Chapter 20 Network Layer: Internet Protocol Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Umut Girit  One of the core members of the Internet Protocol Suite, the set of network protocols used for the Internet. With UDP, computer.
Chapter 7: Transport Layer
Transport Layer – TCP (Part1) Dr. Sanjay P. Ahuja, Ph.D. Fidelity National Financial Distinguished Professor of CIS School of Computing, UNF.
Chapter 7 – Transport Layer Protocols
Chapter 3: Transport Layer
UDP - User Datagram Protocol UDP – User Datagram Protocol Author : Nir Shafrir Reference The TCP/IP Guide - ( Version Version.
Transport Layer3-1 Transport Layer Our goals: r understand principles behind transport layer services: m multiplexing/demultipl exing m reliable data transfer.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Application Layer PART VI.
TCP/IP Protocol Suite 1 Chapter 11 Upon completion you will be able to: User Datagram Protocol Be able to explain process-to-process communication Know.
Ch 23 1 Based on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007 Ameera Almasoud.
Some slides are in courtesy of J. Kurose and K. Ross Review of Previous Lecture Electronic Mail: SMTP, POP3, IMAP DNS Socket programming with TCP.
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.
The Network Layer. Network Projects Must utilize sockets programming –Client and Server –Any platform Please submit one page proposal Can work individually.
University of Calgary – CPSC 441.  UDP stands for User Datagram Protocol.  A protocol for the Transport Layer in the protocol Stack.  Alternative to.
Chapter 17 Networking Dave Bremer Otago Polytechnic, N.Z. ©2008, Prentice Hall Operating Systems: Internals and Design Principles, 6/E William Stallings.
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.
Hyung-Min Lee©Networking Lab., 2001 Chapter 11 User Datagram Protocol (UDP)
TCP/IP: Basics1 User Datagram Protocol (UDP) Another protocol at transport layer is UDP. It is Connectionless protocol i.e. no need to establish & terminate.
Jozef Goetz, Application Layer PART VI Jozef Goetz, Position of application layer The application layer enables the user, whether human.
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.
TCP1 Transmission Control Protocol (TCP). TCP2 Outline Transmission Control Protocol.
User Datagram Protocol (UDP) Chapter 11. Know TCP/IP transfers datagrams around Forwarded based on destination’s IP address Forwarded based on destination’s.
Transport Layer1 Ram Dantu (compiled from various text books)
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!
The Transport Layer application transport network data link physical application transport network data link physical application transport network data.
Chapter 2 Applications and Layered Architectures Sockets.
1 UDP : User Datagram Protocol Computer Network System Sirak Kaewjamnong.
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.
Networking Basics CCNA 1 Chapter 11.
Institute of Technology Sligo - Dept of Computing Chapter 12 The Transport Layer.
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,
Socket Programming.
Advanced UNIX programming Fall 2002, lecture 16 Instructor: Ashok Srinivasan Acknowledgements: The syllabus and power point presentations are modified.
MULTIPLEXING/DEMULTIPLEXING, CONNECTIONLESS TRANSPORT.
UDP & TCP Where would we be without them!. UDP User Datagram Protocol.
1 Transport Layer: Basics Outline Intro to transport UDP Congestion control basics.
1 Kyung Hee University Chapter 11 User Datagram Protocol.
UDP: User Datagram Protocol Chapter 12. Introduction Multiple application programs can execute simultaneously on a given computer and can send and receive.
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.
Chapter 14 User Datagram Protocol (UDP) Introduction  Responsibilities of Transport Layer to create a process-to-process communication l using.
1 Network Communications A Brief Introduction. 2 Network Communications.
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:
1 K. Salah Application Layer Module K. Salah Network layer duties.
Process-to-Process Delivery:
Ch 3. Transport Layer Myungchul Kim
CSEN 404 Transport Layer I Amr El Mougy Lamia Al Badrawy.
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
SOCKET PROGRAMMING Presented By : Divya Sharma.
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 Layer Our goals:
Chapter 14 User Datagram Protocol (UDP)
Process-to-Process Delivery:
CPEG514 Advanced Computer Networkst
Process-to-Process Delivery: UDP, TCP
UDP Principles (Chapter 24) (User Datagram Protocol)
Transport Layer 9/22/2019.
Transport Layer Our goals:
Presentation transcript:

1 Chapter 6 Datagram Delivery by UDP Just as the Internet Protocol uses the services of subnetworks, transport protocols build upon the services of IP. They rely on IP to deliver packets to the right place, and then they take over. Transport protocols have two major responsibilities. First, they must distinguish the traffic of different applications within a system. The second obligation facing a transport protocol is reliability. Recall that IP cannot guarantee delivery of packets. Nor does it typically ensure that the data within those packets arrives free from corruption. Transport protocols compensate for these problems, although different transport protocols compensate in different ways, and to different degrees.

2 Chapter 6 Datagram Delivery by UDP This chapter considers the simplest level of service-- datagram delivery. Datagram delivery is not a guaranteed service, but it does protect against corruption The specific transport protocol that provides TCP/IP’s datagram delivery service is the User Datagram protocol, or UDP.

3 Chapter 6 Datagram Delivery by UDP Distinguishing Applications

4 Chapter 6 Datagram Delivery by UDP Distinguishing Applications

5 Chapter 6 Datagram Delivery by UDP Ports To identify different applications, TCP/IP protocols tag each packet with a number known as a port. Different applications use different values for port fields, and a transport protocol can use the port value to decide which application should receive a packet’s data. In this way, the port value acts like the IP next header field. The next header value distinguishes different transport protocols for IP, and the port values distinguishes different application protocols for a transport protocol.

6 Chapter 6 Datagram Delivery by UDP Ports Applications select a port in one of two ways. The two approaches correspond to the two roles that an application can play in a conversation. These roles correspond to a client and a server. When a client application needs to make a request, it must know how to get that request to a server; it must know, in advance, which port value to use for the particular application. A server, on the other hand, doesn’t have to know the port value to use for its response. It can have the client designate a port as part of the initial request.

7 Chapter 6 Datagram Delivery by UDP Ports Internet Protocol Data AP Protocol Header TCP, UDP Header IP header Ethernet header Ethernet trailer Encapsulation of data 16-bit port # 32-bit address 48-bit address

8 Chapter 6 Datagram Delivery by UDP Ports Port values that are predefined for specific applications are well-known ports.

9 Chapter 6 Datagram Delivery by UDP There are two ways for a process to have an Internet port assigned: The process can request a specific port (from 5000 ~) The process can let the system automatically assign a port For Internet Protocol: : reserved ports : ports assigned by resvport() : ports automatically assigned by system : used by user Ports

10 Chapter 6 Datagram Delivery by UDP Sockets By themselves, ports merely define application protocols. They do not identify actual application programs running in real machines. By combining port value with a network address, however, just such a distinction is possible. The combination is known as a socket. Different sockets can have the same values for both their port and network address.

11 Chapter 6 Datagram Delivery by UDP Sockets Same port, same IP address

12 Chapter 6 Datagram Delivery by UDP Sockets Socket Programming iterative server concurrent server connection-oriented protocol infrequent (Daytime) typical connectionless protocol typical infrequent (TFTP) Iterative vs. Concurrent Server Socket system calls Server create endpoint: socket() bind address: bind() specify queue: listen() wait for connection: accept() Client create endpoint: socket() bind address: bind() connect to server: connect() Transfer data: read(), write(0, recv(), send(), recvfrom(), sendto() Terminate: close(), shutdown()

13 Chapter 6 Datagram Delivery by UDP Sockets Socket Programming connection-oriented protocol socket() bind() listen() accept() read() write() socket() connect() write() read() request reply blocked until connection from client Client: connectionless protocol socket() bind() recvfrom() sendto() Client: socket() bind() sendto() recvfrom() requestreply

14 An Association {protocol, local-addr, local-process, foreign-addr, foreign-process} {udp, , 20, , 30} Chapter 6 Datagram Delivery by UDP Sockets Socket Programming protocol local-addr, foreign addr, local-process foreign-process connection-oriented server socket() bind() listen(), accept() connection-oriented client socket() connect() connectionless server socket() bind() recvfrom() connectionless client socket() bind() sendto()

15 Chapter 6 Datagram Delivery by UDP Sockets Socket Programming Typical scenario for a concurrent server (connection-oriented) int sockfd,newsockfd; if ((sockfd=socket(...))<0) err_sys("socket error"); if ((bind(sockfd,...)<0) err_sys("bind error"); if (listen(sockfd,5)<0) err_sys("listen error"); for (;;) { newsockfd=accept(sockfd,...); /* 5-tuple association determined by accept system call for newsockfd */ if (newsockfd<0) err_sys("accept error"); if (fork()==0) { close(sockfd); /*child process */ doit(newsockfd); /* process the request */ exit(0); } close(newsockfd); /* parent */ }

16 Chapter 6 Datagram Delivery by UDP Datagram Delivery UDP provides a particular type of service to applications called datagram delivery. Datagram delivery is a connectionless service, which means: each datagram exists entirely independently of all other datagrams, even datagrams between the same sockets there is no reference to tie multiple datagrams together there is no mechanism that allows a receiver to acknowledge reception of a datagram there is no reference that can establish a relative ordering of different datagrams

17 In practice, this means that UDP provides a best effort delivery. Chapter 6 Datagram Delivery by UDP Datagram Delivery That is, it does its best to transfer datagrams for its applications, but UDP makes no guarantees. Datagrams may get reordered, even lost, in transit, and the applications must be prepared for such event. UDP does provide one enhancement to the network service available from IP. It includes simple error-checking that can detect corrupted datagrams.

18 Chapter 6 Datagram Delivery by UDP Datagram Delivery The application has to handle the lost of packet 2 by itself.

19 Chapter 6 Datagram Delivery by UDP Datagram Delivery Datagrams experienced larger delay in Router B.

20 Chapter 6 Datagram Delivery by UDP User Datagram Protocol Why an application would use UDP instead of TCP. The answer lies in UDP’s simplicity. Since UDP has no connections, applications do not have to establish or clear them. When an application has data to send, it just sends them. This approach make things simpler for the application, and it can eliminate a substantial delay in communication. UDP is also ideal for those systems that are so limited that they cannot afford to implement TCP.

21 Chapter 6 Datagram Delivery by UDP User Datagram Protocol UDP header+data

22 Chapter 6 Datagram Delivery by UDP User Datagram Protocol Pseudo header With IPv4, however, a sender could effectively omit the checksum by setting its value to zero. Receivers disregarded the checksum. Even though this omission is no longer legal in IPv6, IPv6 implementations must still be prepared to receive UDP datagrams from systems using IPv4.

23 Chapter 6 Datagram Delivery by UDP User Datagram Protocol Source IP Address Destination IP Address Zero protocol(17) UDP length IPv4 UDP’s pseudo header for computing checksum

24 Chapter 6 Datagram Delivery by UDP User Datagram Protocol Constructing the UDP checksum 1. Prepend the pseudo header to the UDP datagram 2. If the application data contains an odd number of bytes, append a final byte of zero. (Do not increase the payload length or datagram length to include this byte.) 3. Set the checksum field to zero. 4. Calculate the sum of the resulting series of 16-bit values, using one’s complement arithmetic. 5. Use the complement of the summation result as the checksum.

25 Chapter 6 Datagram Delivery by UDP User Datagram Protocol Validating the UDP checksum 1. If the checksum value is zero, assume it is correct and skip the remaining steps. 2. Prepend the pseudo header to the UDP datagram 3. If the application data contains an odd number of bytes, append a final byte of zero. (Do not increase the payload length or datagram length to include this byte.) 4. Calculate the sum of the resulting series of 16-bit values, using one’s complement arithmetic. 5. If the result of this summation is 0xFFFF, the checksum is valid; otherwise, the checksum is invalid.