How to select Ethernet connection for UDP send/receive

7 views (last 30 days)
Hello,
I'm trying to send and receive data over ethernet (UDP) using a second ethernet adapter on my workstation. As a standard, Simulink always sends data over the Built-in Ethernet. Since this is connected to a VPN network, my counterpart cannot receive the data.
Is it possible to define the Ethernet connection, that should be used for the UDP send/ recieve Block to commnicate with?
I've tried the UDP send from the "DSP System Toolbox - 2", from the "Instrument Control Toolbox -2" as well as the UDP send from the "Simulink Reatime - 8" Blockset. I was not succesful.
I really would appreciate any idea how to solve this - thank you in advance
Christian

Answers (2)

Christian Rübsam
Christian Rübsam on 2 Nov 2022
Hello,
is there anybody, who may have an idea, that could help?
THX in advance

Walter Roberson
Walter Roberson on 2 Nov 2022
As a standard, Simulink always sends data over the Built-in Ethernet.
No, as a standard, Simulink relies on the operating system to send the data. The operating system chooses the adapter according to the IP address of the destination and according to the configuration of the ethernet interfaces.
When there are multiple physical interfaces, they are typically configured with different subnet ranges, and the destination interface is chosen according to the subnet. If they are configured with the same subnet range and the destination is in the same subnet, then the operating system sets out IPv4 ARP packets and hopes for something to rely with the MAC address to use; the operating system then sends out according to which interface the reply came through.
In most cases, VPNs are configured to not translate for local addresses; that is something that is part of the VPN exception list.
If you have VPN software that is deliberately configured to translate local addresses, then that is a matter of Policy being imposed by your IT staff, and in such a case, connecting to a local device through Simulink would be in violation of policy; you would need to get your IT staff to make an exemption to connect to the device if that is your situation.
There is an exception to all of this, a case where Simulink does (in practice) choose which interface to use. That exception is if you are using Simulink Real-Time; see the discussion at https://www.mathworks.com/matlabcentral/answers/1765995-real-time-udp-send-and-receive-block?s_tid=srchtitle
  1 Comment
Christian Rübsam
Christian Rübsam on 7 Nov 2022
Hello Walter,
Thank you for your feedback. Since I'm not working on a Real Time HW, it seems there is currently no solution for my issue.
I'm trying to get in touch with our IT to find a solution.
Thanks again for your contribution.
Regards Christian

Sign in to comment.

Products


Release

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!