7.4. Endpoints and Discovery

An OPC UA connection is initiated by an OPC UA client contacting an OPC UA server. Each client connection is made to the endpoint URL that the OPC UA server makes available. To establish a connection, the OPC UA client must either know the endpoint URL of the OPC UA server in advance, or it needs to discover it.

To facilitate discovery, an OPC UA server can offer a Local Discovery Server, or LDS connection. The LDS is identified by the computer host name, and it always uses port 4840. Thus, as long as the OPC UA client knows the host name of the computer, it can connect to the LDS. Once connected, the LDS provides the endpoint URL for the OPC UA server. Based on that information, the OPC UA client connects to the OPC UA server.

Of course, if the endpoint URL is known, then that can be entered directly in the OPC UA client configuration, and the connection will be made directly.

Endpoint URL Syntax

The syntax for an endpoint URL is as follows:

Protocol://ComputerName:PortNumber/EndpointName
Protocol

Defined by the UA Server. The client may only connect using one of the protocols offered by the server. The OPC UA protocols are represented in endpoints as follows:

  • TCP - opc.tcp

  • HTTP - http

  • HTTPS - https

ComputerName

The network name, IP address or fully qualified domain name of the computer you are trying to reach. It is dependent on the client-side computer.

PortNumber

Usually defined by the UA Server, though you may need to change it if your network connection includes a NAT that is remapping the IP address of the UA Server.

EndpointName

Defined by the UA Server.

Examples:

opc.tcp://My-PC:4840/MyComputer/MyUAServer
http://AcmeServer:52601/UADiscovery
https://175.252.04.21:443/Rsources/TargetUAServer

OPC UA Protocols

OPC UA specifies three data communication protocols. The DataHub program supports all of them:

TCP is envisioned as the primary and normal protocol for OPC UA, while HTTPS was implemented to support special cases such as Internet communications. HTTP can be used when web services are necessary and resources are sufficient.