This is an old revision of the document!
We recommend to use UDP instead of TCP if possible because the benefit of the TCP to get the correct message in or in the worst case a error is not fully guaranteed by now (23.02.2011 Empoli SP1). The aplication must take care of the transfer control (Adding a checksum or similar to check for correctness and sending and evaluating of acknowledgments).
TCP (Transmission_Control_Protocol) and UDP (User Datagram Protocol) are protocols to send messages and datas over the internet.
TCP | UDP | |
---|---|---|
limitations with LabVIEW embedded | The TCP functions never time out. They can only be interrupted by a timed loop with higher priority. Therefore a complex framework has to be implemented Messages can get lost or corrupt without notification (Empoli SP1) | The Zsystem targets cannot receive packets larger than 1480 bytes (Fragmented IP packets are not fully supported) Sending of larger data packets is no poblem. |
packet order | organized by the protocol | must be organized by the application if required |
protocol overhead | moderate (~4 seconds to open a connection receive a message send a answer and close the connection again) The transmission is much faster when the connection is held open | minimal |
unknown packet size | the packet size has to be sent first so that the receiver knows how many bytes will folllow | entire packets are received |
Wikipedia compares the two protocols as follows: (state: 25.01.2011)
TCP is a connection-oriented protocol, which means that it requires handshaking to set up end-to-end communications. Once a connection is set up user data may be sent bi-directionally over the connection.
UDP is a simpler message-based connectionless protocol. Connectionless protocols do not set up a dedicated end-to-end connection. Communication is achieved by transmitting information in one direction from source to destination without verifying the readiness or state of the receiver.