user development programing in networking UDP.pptx
1. WOLKITE UNIVERSITY
College of Computing and Informatics
Department of Software engineering
Presentation on user datagram protocol (UDP)
Computer science and engineering
March 22, 2022, WKU
2. Group members
1. Teka Mohammed
2. Wondimu Kibatu
3. Nejato Aliye
4. Getnete Degemu
5. Kebede Demiss
6. Temesgen Habtamu
3. Contents
Definition UDP
Properties of UDP
UDP Protocol
Features of UDP protocol
UDP Header Format
Limitations of UDP
Limitations of UDP
UDP security
Real-Life Examples of UDP
4. What is User Datagram Protocol (UDP)
It is a transport layer protocol. It is an unreliable and connectionless
protocol.
It is much faster, simpler, and efficient than TCP. However, it
doesn’t check errors due to which Bandwidth is saved.
It is widely used in real-time services like videogame, voice, or
video communication
The packets sent by the UDP are called user datagrams
5. Cont..
In communications using UDP,
a client program sends a
message packet to a destination
server where in the destination
server also runs on UDP.
6. Properties of UDP
The UDP does not provide guaranteed delivery of message packets.
Since there is no guarantee of assured delivery of messages, UDP is considered an
unreliable protocol.
The underlying mechanisms that implement UDP involve no connection-based
communication. There is no streaming of data between a UDP server or and an UDP
Client.
An UDP client can send "n" number of distinct packets to an UDP server and it could
also receive "n" number of distinct packets as replies from the UDP server.
Since UDP is connectionless protocol the overhead involved in UDP is less compared to
a connection based protocol like TCP.
8. UDP Protocol
protocol, so it is a standard protocol over the internet. The UDP protocol allows the
computer applications to send the messages in the form of datagrams from one
machine to another machine over the Internet Protocol (IP)
network. The UDP is an alternative communication protocol to the TCP protocol
(transmission control protocol). Like TCP, UDP provides a set of rules that governs
how the data should be exchanged over the internet. The UDP works by encapsulating
the data into the packet and providing its own header information to the packet. Then,
this UDP packet is encapsulated to the IP packet and sent off to its destination. Both
the TCP and UDP
protocols send the data over the internet protocol network, so it is also known
as TCP/IP
9. UDP Protocol
and UDP/IP. There are many differences between these two protocols. UDP enables
the process to process communication, whereas the TCP provides host to host
communication. Since UDP sends the messages in the form of datagrams, it is
considered the best-effort mode of communication. TCP
sends the individual packets, so it is a reliable transport medium. Another difference
is that the TCP is a connection-oriented protocol whereas, the UDP is a
connectionless protocol as it does not require any virtual circuit to transfer the data.
UDP also provides a different port number to distinguish different user requests and
also provides the checksum capability to verify whether the complete data has arrived
or not
10. Features of UDP protocol
Transport layer protocol
UDP is the simplest transport layer communication protocol
. It contains a minimum amount of communication mechanisms. It is considered an unreliable protocol, and
it is based on best-effort delivery services. UDP provides no acknowledgment mechanism, which means that
the receiver does not send the acknowledgment for the received packet, and the sender also does not wait for
the acknowledgment for the packet that it has sent.
Connectionless
The UDP is a connectionless protocol as it does not create a virtual path to transfer the data. It does not use
the virtual path, so packets are sent in different paths between the sender and the receiver, which leads to the
loss of packets or received out of order.
Ports
The UDP protocol uses different port numbers so that the data can be sent to the correct destination. The port
numbers are defined between 0 and 102
11. Features of UDP protocol
Faster transmission
UDP enables faster transmission as it is a connectionless protocol, i.e., no virtual path is required to transfer the
data
Acknowledgment mechanism
The UDP does have any acknowledgment mechanism, i.e., there is no handshaking between the UDP sender
and UDP receiver. If the message is sent in TCP, then the receiver acknowledges that I am ready, then the sender
sends the data. In the case of TCP, the handshaking occurs between the sender and the receiver, whereas in UDP,
there is no handshaking between the sender and the receiver.
Segments are handled independently
Each UDP segment is handled individually of others as each segment takes different path to reach the
destination. The UDP segments can be lost or delivered out of order to reach the destination as there is no
connection setup between the sender and the receiver.
12. UDP Header Format
In UDP, the header size is 8 bytes, and the
packet size is upto 65,535 bytes. But this
packet size is not possible as the data needs
to be encapsulated in the IP datagram, and
an IP packet, the header size can be 20 bytes;
therefore, the maximum of UDP would be
65,535 minus 20. The size of the data that
the UDP packet can carry would be 65,535
minus 28 as 8 bytes for the header of the
UDP packet and 20 bytes for IP header.
13. The UDP header contains four fields:
Source port number: It is 16-bit information that identifies which port is going t send the packet.
Destination port number: It identifies which port is going to accept the information. It is 16-bit
information which is used to identify application-level service on the destination machine.
Length: It is 16-bit field that specifies the entire length of the UDP packet that includes the header also.
The minimum value would be 8-byte as the size of the header is 8 bytes.
Checksum: It is a 16-bits field, and it is an optional field. This checksum field checks whether the
information is accurate or not as there is the possibility that the information can be corrupted while
transmission. It is an optional field, which means that it depends upon the application, whether it wants
to write the checksum or not. If it does not want to write the checksum, then all the 16 bits are zero;
otherwise, it writes the checksum. In UDP, the checksum field is applied to the entire packet, i.e., header
as well as data part whereas, in IP, the checksum field is applied to only the header field.
14. Limitations of UDP
It provides an unreliable connection delivery service. It does not
provide any services of IP except that it provides process-to-
process communication.
The UDP message can be lost, delayed, duplicated, or can be out of
order.
It does not provide a reliable transport delivery service. It does not
provide any acknowledgment or flow control mechanism.
However, it does provide error control to some extent.
15. How UDP work
UDP uses IP to get a datagram from one computer to another. UDP works by
gathering data in a UDP packet and adding its own header information to the
packet. This data consists of the source and destination ports on which to
communicate, the packet length and a checksum. After UDP packets are
encapsulated in an IP packet, they're sent off to their destinations.
Unlike TCP, UDP doesn't guarantee the packets will get to the right
destinations. This means UDP doesn't connect to the receiving computer
directly, which TCP does. Rather, it sends the data out and relies on the
devices in between the sending and receiving computers to correctly get the
data where it's supposed to go.
16. How UDP work
Most applications wait for any replies they expect to receive as a result of packets
sent using UDP. If an application doesn't receive a reply within a certain time
frame, the application sends the packet again, or it stops trying.
UDP uses a simple transmission model that doesn't include handshaking
dialogues to provide reliability, ordering or data integrity. Consequently, UDP's
service is unreliable. Packets may arrive out of order, appear to have duplicates or
disappear without warning.
Although this transmission method doesn't guarantee that the data being sent will
reach its destination, it does have low overhead and is popular for services that
don't absolutely have to work the first time.
17. UDP security
While UDP is easy to implement and it has less overhead, it also leaves your devices more vulnerable to
cyber attacks.
Since TCP establishes a direct connection and provides a sequence number, it’s more difficult for
someone to send a packet to a specific application. With UDP, it’s easier to intercept, alter, and replicate
data packets to attack a device, application, or network.
Additionally, botnets (massive networks of hacked computers, including IoT devices) can use UDP to
send fraudulent packets to a computer. Bots will often spam transmissions to nonexistent ports, and the
computer then has to send a response that the port is unavailable. This quickly takes network resources
from legitimate data transmissions and can bring down the network.
With UDP, you need to be proactive about IoT security and be confident that your hardware and
network-level security can protect your customers’ data and prevent your devices from becoming
liabilities.
18. Real-Life Examples of UDP
Online Games
Most of the online games we play use the services of User Datagram Protocol.
Since any amount of delay cannot be tolerated in online games UDP is widely
used over TCP which is quite slower. UDP doesn’t retransmit the lost data and
is a connectionless protocol due to which it is much faster.
Ex : All online games
Video Conferencing –
Video Conferencing apps like Skype, Gmeet, Zoom, all use the services of
UDP due to the fact that they are real-time applications and any delay in
receiving the data cannot be tolerated.
Ex: Skype, Google Meet, zoom, and Facetime.
19. Real-Life Examples of UDP
Voice Over IP(VoIP) –
It is similar to Video Conferencing, where apps like Viber, Whatsapp, Google
Hangouts use UDP for converting our voice to digital data and transmit it over
the network, hence the name VoIP.
Ex : Viber, Whatsapp Voice calling, Wi-Fi calling.
Domain Name System(DNS) –
It is a service used for mapping domain names to their corresponding IP
address. It is used by the application layer. It can also be looked at as a
distributed DataBase that has a hierarchical name Server. DNS uses UDP for
fetching the corresponding IP address due to the following reasons: