MATLAB: Do I encounter issues with duplex (bi-directional) UDP communication in Simulink Real-Time R2017a or earlier

Why do I encounter issues with duplex (bi-directional) UDP communication in Simulink Real-Time R2017a or earlier?
I have connected two Simulink Real-Time target computers on a local area network (LAN) and I am testing duplex UDP communication. I try to send and receive UDP packets from the same IP address and port number, however the data does not seem to arrive at one of the targets as expected. I also notice that the target computers become unresponsive when I attempt to stop execution.

Best Answer

In (or before) the R2017a release of Simulink Real-Time, deploying a Simulink model with UDP Send and UDP Receive blocks that have the same local address and port results in ambiguous behavior. This occurs because the model is in effect creating two sockets for the same IP address and port. In such a situation, the socket that receives a packet is not defined; all sockets can send and receive.
As a workaround, use a unique IP address and port combination for each UDP send or receive block.
The ability to send and receive with the same IP address and port combination was introduced in the R2017b release.