LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is There a Limit to the Number of Bytes I Can read Using UDP Read.vi?

Is There a Limit to the Number of Bytes I Can read Using UDP Read.vi?
0 Kudos
Message 1 of 2
(4,205 Views)
This has to do with the maximum size of a datagram on the two machines involved (assuming that you are using or receive datagrams from other operating systems). This depends on the sytems involved, and the MTU (Maximum Transmission Unit). As far as I remember, all TCP/IP implementations must support a minimum IP datagram size of 576 bytes, regardless of the MTU. Assuming a 20 byte IP header, this leaves 556 bytes as a safe maximum size for UDP messages. The maximum size is 65507 bytes. Some platforms support IP fragmentation which will allow datagrams to be broken up (because of MTU values) and then re-assembled on the other end, but not all implementations support this.

Regarding buffers, the default send buffer size for UDP sockets is 65535 bytes. The def
ault receive buffer size for UDP sockets is 2147483647 bytes.

Anyway, if your "network" configuration doesn't change, you may perform some tests to tune it for the best performance. Inside a LAN, you can have larger packets comparing with Internet where it's safe to be less than 1k.

Finally, to have your application safe, consider NI's default max size value for UDP Read (548).


Hope this helps.

p.s.: for details, check RFC 768
Message 2 of 2
(4,205 Views)