Detection of ethernet link down

4 posts / 0 new
Last post
raz
Offline
Last seen: 1 week 3 days ago
Joined: 04/30/2019
Posts: 7
Detection of ethernet link down

Hi everybody,

I have an application which runs on multiple platforms (at least windows and linux) with an ethernet connection.

The application needs to know if it is disconnected from the ethernet network, e.g. if the cable is cut of.

Is it possible to get this information via DDS API? I would prefere not to call any operating system function or ping any other network device.

 

Thanks in advance

r
Offline
Last seen: 1 day 12 hours ago
Joined: 06/17/2019
Posts: 11

Hi Raz, there are at least two different ways to do this:

1. Using the liveliness QoS policy DDS will send out messages at a defined rate that inform the other applications that it is still "alive". If the other applications don't receive this message after a defined period, the other applications will have a listener event triggered. There are a few different ways to assert liveliness depending on your needs

2. Instead if your application is sending messages at a defined periodic rate (say once every 3 seconds as an example), you can use the deadline QoS policy to let other applications know they should expect to receive messages from you within a set amount of time. If too many messages are missed or they are no longer sent a listener event is triggered.

Both of these QoS settings are available in our "shapesdemo" application if you want to quickly play around with these settings to see if they will meet your needs. There is also a deadline QoS example in our getting started guide. 

 

raz
Offline
Last seen: 1 week 3 days ago
Joined: 04/30/2019
Posts: 7

Thanks for your quick and detailed reply! Unfortunately my application is some kind of redundant service which only knows its companion service instance. It is a supported case that this companion instance will fail and the liveliness or deadline events will be triggered.

Because of synchronization issues the application needs to differ between the "normal" failure of the companion instance and the disconnection from ethernet network. I can't make any assumptions about the network topology and deployment of the applications too.

I wonder if there is an event or something similar I can evaluate in order to detect such a disconnection?

r
Offline
Last seen: 1 day 12 hours ago
Joined: 06/17/2019
Posts: 11

Are you using the ownership QoS policy and the strength value as a way to support redundant publishers that fail over?
I might need a few examples of what you consider a failure use case, versus a non-failure. You can use on_publication_matched() to detect when a matching reader is detected or ceases to be detected.
So if you detect that all of your remote readers are no longer matched you might infer that your connectivity has been lost (as opposed to a single reader no longer being matched probably means that one remote reader went down or exited). But if you can't make any assumptions about the deployment of applications this becomes more difficult. 

For example:

Is it expected that remote DDS domain participants will fail/exit, and that should not trigger an event?
But if remote DDS participants fail/exit when a network connection is lost, then you should trigger an event?
Then I'm not sure DDS can do anything in this regard since you're attempting to detect an event outside of DDS, while also not being able to use any DDS features to detect it. Does your IP change, or is there anything else that DDS could detect at the transport plugin level?

Or can you leave one DDS entity online 100% of the time (with redundant fail over), and use the loss of a connection to that DDS entity as a trigger that your connection has been lost?