Max. user data per UDP datagram

UDP data is transferred via Ethernet. The maximum block size of a UDP datagram is 1500 bytes; this is also referred to as the MTU (maximum transmission unit). The MTU for AMK controllers is set to 1500 bytes. The MTU can be smaller for third-party manufacturer devices.

 

As UDP runs over the Internet protocol (IP), a header of 20 bytes is transferred by the IP message frame. The UDP message frame adds an 8-byte header to the UDP datagram and the 'UDP' function blocks adds another 8 bytes of transfer information. This results in the following:

 

1500 bytes UDP datagram

-20 bytes IP header

-8 bytes UDP header

-8 bytes transfer information

--------------

= 1464 bytes for user data (AMK controllers).

 

For connections with third-party manufacturer devices, the following applies:

MTU (device) – 32 bytes = maximum number of user data in one message frame.

 

If the dataset to be sent exceeds the maximum number of user data (MTU – 32) of one of the two communication partners, the data is automatically broken down into data packets (segmentation). As the 'UDP' transfer service is unreliable, there is an increased chance of data packets being lost in the event of segmentation. Lost data packets are detected from the transfer information at the receiver; they are output as errors (data not written to receive buffer).

Therefore, the maximum number of user data should not exceed MTU – 32 bytes.