Utilisateur
UDP means -- User Datagram Protocol
Layer 4 protocol → transport protocol
The Main features of UDP are
-Low overhead generated (a.k.a. simple)
-Low latency (a.k.a. fast)
-65535 bytes payload minus headers
RFC stands for “Request for Comments.”RFCs are documents published by the Internet Engineering Task Force (IETF) or other organizations, describing various aspects of the internet, such as protocols, procedures, programs, and concepts
RFC 768: https://tools.ietf.org/html/rfc768 (Only 3 pages long!!!)
• Published in 1980
• It is because UDP is a simple protocol and never needed to be revised
UDP is designed to do as little as possible
it Takes data from upper layer and forward down to the IP (layer 3) for transmission
thats it
The basic steps for transmission using UDP are:
Higher-layer data transfer
An application sends a message to the UDP software
UDP message encapsulation
The higher-layer message is encapsulated into the Data field of a UDP message.
The headers of the UDP messages are filled including the source Port of the application and the destination Port of the intended recipient
The checksum value may also be calculated
Transfering of message to IP
The UDP message is passed to IP for transmission
UDP does not establish connections before sending data. It just packages it and... off it goes
• UDP does not provide acknowledgments to show that data was received (Connection-less protocol)
• UDP does not provide any guarantees that its messages will arrive
• UDP does not detect lost messages and retransmit them
• UDP does not ensure that data is received in the same order that they were sent
• UDP does not provide any mechanism to manage the flow of data between devices, or handle congestion
Source Port
• Optional field (If not used a value of 0 is used)
• Indicates the port of the sending process
• Length: 16 bits
Destination Port
• Port number of the process that is the ultimate intended recipient of the message on the destination device
• This will usually be a well-known/registered port number
• Length: 16 bits
Length
• The length of the entire UDP datagram including the header and the payload (Data Field)
• Length of this field: 16 bits
Checksum
• This field is optional
• Computed of the entire UDP datagram plus a special pseudo header
• Length of this field: 16 bits
The UDP pseudo header is a virtual header used in UDP (User Datagram Protocol) to calculate the checksum for the UDP packet.
It includes certain fields from the IP header, such as the:
source and destination IP addresses
the protocol number
the UDP length.
This pseudo header is not actually transmitted along with the UDP packet but is used in the checksum calculation to ensure data integrity.
UDP Is used with
Data where performance is more important than completeness .. such asin Multimedia applications (Video/Audio streaming...)
Data exchanges that are Short and Sweet
• such as Management protocols (syslog, SNMP, NTP...)
If multicast is need
• UDP would be the de facto Layer 4 protocol used for multicast applications
P= protocol
(P) Domain Name Server on port -53
it Uses a simple request/reply messaging system for most exchanges (but also uses TCP for longer ones)
(P) Dynamic Host Configuration Protocol on port 67/68
Host configuration protocols that consist of short request and reply exchanges
(P) Trivial File Transfer Protocol on port 69
TFTP is designed for the quick and easy transfer of small files
(P) Simple Network Management Protocol on port 161/162
An administrative protocol that uses relatively short messages
(P) Voice Over -Carry voice over IP
TCP
Connection
TCP is a connection-oriented protocol
Acknowledgement
Acknowledgement segments
Handshake
SYN, SYN-ACK, ACK
Checksum
Checksum used for integrity
Error Checking
TCP does error checking
Reliability
There is absolute guarantee that the data transferred remains intact and arrives in the same order in which it was sent
Header size
TCP header size is 20 bytes
Ordering of data packets
TCP rearranges data packets in the order specified
Speed of transfer
The speed for TCP is slower than UDP
Usage
TCP is suited for applications that require high reliability, and transmission time is relatively less critical
Used by these protocols
HTTP, HTTPS, FTP, SMTP, Telnet
Function
As a message makes its way across the internet from one computer to another. This is connection based
Stream of data
Data is read as a byte stream, no distinguishing indications are transmitted to signal message (segment) boundaries
Weight
TCP is heavy-weight. TCP requires three packets to set up a socket connection, before any user data can be sent. TCP handles reliability and congestion
TCP
Data Flow Control
TCP does Flow Control. TCP requires thre packets to set up a socket connection, before any user data can be sent. TCP handles reliability and congestion control
UDP
UDP is a connectionless protocol
No Acknowledgement
No handshake (connectionless protocol)
Checksum used to detect errors
UDP does error checking, but no recovery options
There is no guarantee that the messages or packets sent would reach at all
UDP Header size is 8 bytes
UDP has no inherent order as all packets are independent of each other. If ordering is required, it has to be managed by the application layer
UDP is faster because there is no error- checking for packets
UDP is suitable for applications that need fast, efficient transmission, such as games. UDP's stateless nature is also useful for servers that answer small queries from huge numbers of clients
DNS, DHCP, TFTP, SNMP, RIP, VOIP
UDP is also a protocol used in message transport or transfer. This is not connection based which means that one program can send a load of packets to another and that would be the end of the relationship
Packets are sent individually and are checked for integrity only if they arrive. Packets have definite boundaries which are honored upon receipt, meaning a read operation at the receiver socket will yield an entire message as it was originally sent
UDP is lightweight. There is no ordering of messages, no tracking connections, etc. It is a small transport layer designed on top of IP
UDP does not have an option for flow control
32 bits
Source port #. Dest port #
Sequence number
Acknowledgment number
Header length Unused URG -ACK-PSH-RST-SYN-FIN Receive . window
Internet checksum. Urgent data pointer
Options
Data
(32 Bits)
Source Port. Destination Port
Length. Checksum
Data