Alternative endpoints

Questions regarding the use of the C++ SDK for Server or Client development or integration into customer products ...

Moderator: uasdkcpp

Post Reply
wim
Hero Member
Hero Member
Posts: 24
Joined: 13 Jul 2010, 15:20

Alternative endpoints

Post by wim »

Dear Unified Automation,

The system I have in mind has multiple servers, some of them being redundant. If I understand well, one way to achieve redundancy is to create one logical server by creating multiple physical servers (each having a different DiscoveryURL) with the same ServerURI. All of them are registering to the same LDS. For the redundant servers I can provide the alternativeEndpoints to the SDK when I call UaSession:: connect().

The system I have in mind is "dynamic", so servers come online and go offline during operation. Therefore my client calls findServers() every minute or so, to check if new physical and/or logical servers have come online. If new logical servers have come online, I can easily create a new Session to them. But if a new redundant physical server of an existing logical server has come online, I cannot update the existing session to this logical server, since I cannot access its alternativeEndpoints.

Two things I'm wondering:
- Is it possible to modify the alternativeEndpoints of an existing Session? So I can use the "bAutomaticReconnect" functionality of the SDK, and not worry about connecting a session myself after failures?
- If an existing session has been reconnected automatically to an alternative endpoint, I suppose I will be notified by the NewSessionCreated ServerState change. Do I have to take care of re-creating the subscriptions and monitored items myself in this case?

Many thanks (again)!

Wim

User avatar
Support Team
Hero Member
Hero Member
Posts: 3072
Joined: 18 Mar 2011, 15:09

Re:Alternative endpoints

Post by Support Team »

Hi Wim,

The main purpose of the alternativeEndpoints setting in the UaSession is the support for redundant networks. Since the UaSession represents also a logical Session in the server, the reconnect logic always tries to reuse a Session that was already created in the server to also reuse existing Subscriptions. This works fine in the case of redundant networks since only a new transport connection will be created through another network path but the logical Session and the Subscriptions in the server can be re-used.
It is currently not possible to change the list in alternativeEndpoints.

If you specify different physical servers in the alternativeEndpoints, this will always force a creation of a new Session in the server, including the NewSessionCreated event. In this case you must also recreate the Subscriptions in the Server. This would be a poor man use of redundant servers.

The expectation for redundant servers is that a fully active session is created with one server and, depending on the server redundancy mode (cold, warm, hot), a parallel session / subscription is created with a second server. The operation mode of the parallel connection depends on the mode supported by the server and the level the client wants to reach.

Therefore it is expected that more than one UaSession object will be used for redundant servers and alternativeEndpoints is mainly used for network redundancy.

Best Regards,
Unified Automation Support Team
Best regards
Unified Automation Support Team

wim
Hero Member
Hero Member
Posts: 24
Joined: 13 Jul 2010, 15:20

Re:Alternative endpoints

Post by wim »

Hello Unified Automation,

Thank you for the explanation, I didn't realize that alternative endpoints are only meant for network redundancy and not for server redundancy.

I think the main reason of my confusion is that I assumed that redundant physical servers could (should?) have the same "logical" server URI (so that a client could query a DS for a logical server URI and may receive a list of endpoints of potentially different physical servers).

Could you confirm that my assumption is wrong and that redundant servers always should have different server URIs, please?

Thanks a lot,

Wim

User avatar
Support Team
Hero Member
Hero Member
Posts: 3072
Joined: 18 Mar 2011, 15:09

Re:Alternative endpoints

Post by Support Team »

Hi Wim,

I hope the documentation for alternativeEndpointUrls is clear enough:
UaStringArray UaClientSdk::SessionConnectInfo::alternativeEndpointUrls
A list of alternative Endpoint URLs to connect to for network redundancy.
This configuration option allows to specify endpoints for the same server connected to with the URL parameter passed to UaSession::connect(). It can be used for redundant networks used to connect to a server with the same ServerUri and Server certificate. Specifying URLs of different servers with different certificates will cause a connection error when using a security policy other than NONE.
I think your assumption is wrong.

Different physical servers have only the same ServerURI in the case of transparent redundancy. But in this case they have also all the same network address (EndpointUrl) and alternativeEndpointUrls is not necessary.

Here is a description of transparent redundancy:
http://www.unified-automation.com/forum ... ndancy.htm

For non-transparent redundancy, every redundant server has a unique ServerURI and also unique EndpointUrl.

Best Regards,
Unified Automation Support Team
Best regards
Unified Automation Support Team

wim
Hero Member
Hero Member
Posts: 24
Joined: 13 Jul 2010, 15:20

Re:Alternative endpoints

Post by wim »

Thanks a lot for the clear answer! It makes sense now.

Kind regards,

Wim

Post Reply