OpenDDS / OpenDDS

OpenDDS is an open source C++ implementation of the Object Management Group (OMG) Data Distribution Service (DDS). OpenDDS also supports Java bindings through JNI.
http://www.opendds.org
Other
1.33k stars 474 forks source link

RtpsRelay - Run On Local (no docker) #4678

Open amielc1 opened 4 months ago

amielc1 commented 4 months ago

I need to run RtpsRelay from my computer (not from docker) I tried to run the RtpsRelay tool RtpsRelay -Id id5555
I got an error :

C:\Users\amielc\Downloads\install\OpenDDS\OpenDDS-3.28.1\bin> RtpsRelay -Id id (61688|98344) EXCEPTION, ERROR: InfoRepoDiscovery::add_domain_participant: system exception, ID 'IDL:omg.org/CORBA/TRANSIENT:1.0' OMG minor code (2), described as 'No usable profile in IOR.', completed = NO

(61688|98344) ERROR: Failed to create relay participant

Do I need to run DCPSInfoRepo -o repo.ior in parallel? if it's true - I got another exception. Do you have a guide to use RtpsRealy on local ? i use : This presentation This aricle and this

Thanks a lot for your support! Amiel

Edit from @jrw972

The long-term goal should be to run the RtpsRelay without a config file. This is now possible since environment variables and arguments can be used. A user can specify a file if they wish. Before starting, the configuration should be checked for mandatory config.

mitza-oci commented 4 months ago

Do not start DCPSInfoRepo. Probably need to pass a config file -DCPSConfigFile to the RtpsRelay. Take a look at tests/DCPS/RtpsRelay/Smoke/run_test.pl - you can build and run this test locally.

jrw972 commented 3 months ago

See slide 27 in the presentation.

I'm going to repurpose this issue towards eliminating the need for a config file.

amielc1 commented 3 months ago

@mitza-oci @jrw972 - thank!

I want to connect Pub&Sub application to RtpsRelays, I Use RtpsRelay & Pub Sub configurations from tests/DCPS/RtpsRelay/Smoke all the ini configs taken from this folder(I didn't change noting) I run_test.pl but tests failed.

  1. I can't find monitor & metachecker application

ERROR: executable "monitor" does not exist; subdir: ./; basename: monitor ; dirname: . ERROR: executable "metachecker" does not exist; subdir: ./; basename: metachecker ; dirname: . runRtpsLogs.txt

  1. I got this error from rtpsRelay1

    2024-06-10 15:38:39.676@LM_ERROR@(6092|32656) ERROR: could not open RelayHttpMetaDiscovery relay1.log

  2. I take a look in pub_rtps.inifile. about DataRtpsRelayAddress=127.0.0.1:4446, the meaning is to where we send the messages (my idls). in which we need to configure to receive this message, or, I thought to find who listens to this port, to receive the messages - but I didn't find anything.

Snag_1361dc73

  1. How do you offer me to capture this Test Wirshark output? because it is not only RTPS protocol, I thought about a filter like this : udp.port == 4445 || udp.port == 5444 || udp.port == 5445 || udp.port == 5446 || udp.port == 4444 || udp.port == 4446 .there is smarter way?

relay2.log publisher.log subscriber.log

amielc1 commented 3 months ago

@jrw972 - Your presentation is great 🥇 , but you didnt show how to use. its very usefull 🙏

mitza-oci commented 3 months ago

executable "monitor" does not exist => Build the tests before attempting to run them.

amielc1 commented 3 months ago

@mitza-oci yes. I already built the full solution, with the test, but I didn't find the monitor.exe

Adam, can you help me with the rest of the questions please.

I appreciate you!

mitza-oci commented 3 months ago

@mitza-oci yes. I already built the full solution, with the test, but I didn't find the monitor.exe

https://opendds.readthedocs.io/en/latest-release/devguide/building/index.html#tests

jrw972 commented 3 months ago

For (2), See the MetaDiscovery options in https://opendds.readthedocs.io/en/latest-release/devguide/internet_enabled_rtps.html#usage.

For (3), The relay from the example listens on localhost ports 4444 (SPDP), 4445 (SEDP), and 4446 (DATA). The publisher and subscriber both need to be configured to access the relay at those ports.

For (4), I don't know of a smarter way. I usually capture everything and then filter it down.

amielc1 commented 3 months ago

Thanks @jrw972 , This is the iniconfiguration for the publisher and subscriber, (this is yours files), they both didn't configured to access the relay at those ports. Why ?

Thanks Justin - I appreciate your help 💯

pub_rtps - Copy.txt sub_rtps - Copy.txt

jrw972 commented 3 months ago

The Smoke Test is intentionally complicated to test the clustering abilities of the RtpsRelay. It assumes that two RtpsRelay instances are running. The publisher connects to one and the subscriber to the other. If everything works, a message from the publisher is sent to the first relay, then from the first relay to the second relay, and then from the second relay to the subscriber. If you are just running one relay, then use the same ip/ports in both your pub and sub config files or just use a single config file.

amielc1 commented 3 months ago

@jrw972 i exactly try to run 2 Relay & PubSub. So I don't understand why I should have a different configuration. It should be exactly the same configuration as you have in SMOKE. And so I ask, why am I getting the error

2024-06-10 15:38:39.676@LM_ERROR@(6092|32656) ERROR: could not open RelayHttpMetaDiscovery

while you didn't work with MetaDiscovery options

jrw972 commented 3 months ago

If you want to run exactly like the smoke test, then you should run the smoke test ./run_test.pl. It will print out the command lines for both relays, the publisher, the subscriber, the monitor, and the metachecker. You don't need monitor or the metachecker, they are for the test. Start the two relays, then start the publisher and then the subscriber.

Because the MetaDiscovery options were added after the presentation.

amielc1 commented 3 months ago

@jrw972 @mitza-oci , I'm confuse, I succeded run all my apps & relays but I can get messages from publisher. All my applications work in domain 42. I run the PubSub from Visual Studio Am I need to run these apps with security parameters? The relays I run from cmd (without yours perl's script)

This is my Publisher in :

[common] DCPSGlobalTransportConfig=$file DCPSThreadStatusInterval=1 DCPSDebugLevel=10 ORBLogFile=HelloWorldRtpsPublisher.log ORBDebugLevel=10

[domain/42] DiscoveryConfig=rtps_discovery

[rtps_discovery/rtps_discovery] InteropMulticastOverride=239.255.0.2 SedpMulticast=0 SpdpRtpsRelayAddress=127.0.0.1:5444 SedpRtpsRelayAddress=127.0.0.1:5445 RtpsRelayOnly=1 SedpMaxMessageSize=1400

[transport/pub_rtps] transport_type=rtps_udp use_multicast=0 DataRtpsRelayAddress=127.0.0.1:5446 RtpsRelayOnly=1 max_message_size=1400

This is My Subscriber ini :

[common] DCPSGlobalTransportConfig=$file DCPSThreadStatusInterval=1 DCPSDebugLevel=10 ORBLogFile=HelloWorldRtpsSubscriber.log ORBDebugLevel=10

[domain/42] DiscoveryConfig=rtps_discovery

[rtps_discovery/rtps_discovery] InteropMulticastOverride=239.255.0.2 SedpMulticast=0 SpdpRtpsRelayAddress=127.0.0.1:4444 SedpRtpsRelayAddress=127.0.0.1:4445 RtpsRelayOnly=1 SedpMaxMessageSize=1400

[transport/pub_rtps] transport_type=rtps_udp use_multicast=0 DataRtpsRelayAddress=127.0.0.1:4446 RtpsRelayOnly=1 max_message_size=1400

The RtpsRelay1 ini :

[common] DCPSGlobalTransportConfig=$file DCPSThreadStatusInterval=2

[domain/0] DiscoveryConfig=relay_rtps_discovery

[rtps_discovery/relay_rtps_discovery] SedpMulticast=0

[transport/relay1] transport_type=rtps_udp use_multicast=0

[domain/42] DiscoveryConfig=application_rtps_discovery

[rtps_discovery/application_rtps_discovery] SedpMulticast=0 SpdpRtpsRelayAddress=127.0.0.1:4444 SedpRtpsRelayAddress=127.0.0.1:4445 RtpsRelayOnly=1 SedpMaxMessageSize=1400 UndirectedSpdp=0 PeriodicDirectedSpdp=1

The RtpsRelay2 ini :

[common] DCPSGlobalTransportConfig=$file DCPSThreadStatusInterval=2

[domain/0] DiscoveryConfig=relay_rtps_discovery

[rtps_discovery/relay_rtps_discovery] SedpMulticast=0

[transport/relay2] transport_type=rtps_udp use_multicast=0

[domain/42] DiscoveryConfig=application_rtps_discovery

[rtps_discovery/application_rtps_discovery] SedpMulticast=0 SpdpRtpsRelayAddress=127.0.0.1:5444 SedpRtpsRelayAddress=127.0.0.1:5445 RtpsRelayOnly=1 SedpMaxMessageSize=1400 UndirectedSpdp=0 PeriodicDirectedSpdp=1

I run the relays from cmd:

RtpsRelay.EXE -Id relay1 -UserData relay1 -DCPSConfigFile relay1.ini -ApplicationDomain 42 -ORBLogFile relay1.log -VerticalAddress 127.0.0.1:4444 -HorizontalAddress 127.0.0.1:11444 -MetaDiscoveryAddress 127.0.0.1:8082 -DCPSDebugLevel 1 -DCPSSecurityDebugLevel 2 -LogDiscovery 1 -LogActivity 1 -LogThreadStatus 1 -LogRelayStatistics 3 -LogParticipantStatistics 1 -ORBVerboseLogging 1 -DCPSPendingTimeout 3

RtpsRelay.EXE -Id relay2 -UserData relay2 -DCPSConfigFile relay2.ini -ApplicationDomain 42 -ORBLogFile relay2.log -VerticalAddress 127.0.0.1:5444 -HorizontalAddress 127.0.0.1:11544 -DCPSDebugLevel 1 -DCPSSecurityDebugLevel 2 -LogDiscovery 1 -LogActivity 1 -LogThreadStatus 1 -LogRelayStatistics 3 -LogParticipantStatistics 1 -ORBVerboseLogging 1 -DCPSPendingTimeout 3

jrw972 commented 3 months ago

You might not need security parameters but you do need all of the parameters printed by run_test.pl. There should be log files which will probably indicate what the issue is.

amielc1 commented 3 months ago

can you tell me witch logs can I send you? I have 4, publisher. subscriber, relay1, relay2. is there something else?

jrw972 commented 3 months ago

Post them all as attachments.

amielc1 commented 3 months ago

@jrw972 & @mitza-oci - Thanks a lot for yours support! These are logs, HelloWorldRtpsSubscriber.log HelloWorldRtpsPublisher.log relay1.log relay2.log

Note : In this case, I try to use :

jrw972 commented 3 months ago

OpenDDS 3.25 had a bug that affected the RtpsRelay. I'm assuming that OpenDDSSharp is based on 3.25 so just upgrading to 3.28.1 is not an option. In that case, you may need to manually apply the changes from https://github.com/OpenDDS/OpenDDS/pull/4485 to solve your issue.

amielc1 commented 3 months ago

@jrw972 , @mitza-oci thank you!

  1. do you mean I must compile the OpenDDSSharp solution with these changes?
  2. If I understand you, the problem is just in the RtpsRelay code, so if I use OpenDDS v3.28.1 exe's for RtpsRelay, and my PubSub application uses OpenDDSharp - is it OK?
jrw972 commented 3 months ago

You need to compile the OpenDDS used by OpenDDSSharp with those changes.

The problem is not in the RtpsRelay, it is in the version used by the publisher and subscriber. Fixing (1) should address the issue.

amielc1 commented 3 months ago

@jrw972 - Thank you a lot! you awesome! I opened an issue at OpenDDSSharp, I will work with Jmmorato.

amielc1 commented 3 months ago

Hi @jrw972 @mitza-oci
I Use the latest OpenDDSharp, 3.281.1 - for my publisher & subscriber via your Rtps Relay - as I described in the previous comments - still doesn't work. can you give me some advice?

logs relay1.log relay2.log Publisher.log Subscriber.log

config ini relay1.txt relay2.txt rtps_pub.txt rtps_sub.txt

jrw972 commented 3 months ago

Try adding CheckSourceIp=false like so

[common]
DCPSGlobalTransportConfig=$file
DCPSThreadStatusInterval=2

[domain/0]
DiscoveryConfig=relay_rtps_discovery

[rtps_discovery/relay_rtps_discovery]
SedpMulticast=0

[transport/relay1]
transport_type=rtps_udp
use_multicast=0

[domain/42]
DiscoveryConfig=application_rtps_discovery

[rtps_discovery/application_rtps_discovery]
SedpMulticast=0
SpdpRtpsRelayAddress=127.0.0.1:4444
SedpRtpsRelayAddress=127.0.0.1:4445
RtpsRelayOnly=1
SedpMaxMessageSize=1400
UndirectedSpdp=0
PeriodicDirectedSpdp=1
CheckSourceIp=false

I'll create an issue to add this to the smoke test.

jrw972 commented 3 months ago

BTW - the logs show that your publisher and subscriber are sending messages to the relay. Look for record_activity.

amielc1 commented 3 months ago

@jrw972 it still doesn't work - my subscriber didn't get any message (with multicast everything ok)

where is the point?

jrw972 commented 3 months ago

I should have been more specific, you need to add CheckSourceIp=false to both relay configuration files. At the very bottom as shown in the example will work.

Lines containing record_activity will occur in the logs produced by the relay.