User`s guide

User Datagram Protocol (UDP)
3-15
User Datagram Protocol (UDP)
xPC Target supports communication with another system using User
Datagram Protocol (UDP) packets. UDP is a transport protocol similar to TCP.
However, unlike TCP, UDP provides a direct method to send and receive
packets over an IP network. UDP uses this direct method at the expense of
reliability by limiting error checking and recovery.
This section includes the following topics:
What Is UDP?
Why UDP?
UDP Communication Setup
UDP Receive Block
UDP Send Block
UDP Pack Block
UDP Unpack Block
UDP Example
What Is UDP?
The User Datagram Protocol (UDP) is a transport protocol layered on top of the
Internet Protocol (IP) and is commonly known as UDP/IP. It is analogous to
TCP/IP. A convenient way to present the details of UDP/IP is by comparison to
TCP/IP as presented below:
Connection Versus Connectionless — TCP is a connection based protocol,
while UDP is a connectionless protocol. In TCP, the two ends of the
communication link must be connected at all times during the
communication. An application using UDP prepares a packet and sends it to
the receiver’s address without first checking to see if the receiver is ready to
receive a packet. If the receiving end is not ready to receive a packet, the
packet is lost
Stream Versus Packet — TCP is a stream-oriented protocol, while UDP is a
packet-oriented protocol. This means that TCP is considered to be a long
stream of data that is transmitted from one end to the other with another
long stream of data flowing in the other direction. The TCP/IP stack is
responsible for breaking the stream of data into packets and sending those