IMD SolutionComputing LibraryShop main store

Explainer

Why Kepware to ThingWorx uses AlwaysOn, not the firewall rule

Edge computing and IIoT Published 5 min read

Short answer

KEPServerEX and ThingWorx Kepware Server communicate with ThingWorx over the AlwaysOn protocol, and a secure AlwaysOn connection can use a self-signed or a CA-signed certificate. The edge-side Kepware host initiates one outbound TCP session to the port configured in its ThingWorx connection, typically 443, so IT writes a single outbound rule and no inbound rule to the edge.

On this page
  1. AlwaysOn carries the tag data on this link
  2. The session Kepware opens
  3. A worked firewall rule
  4. Secure AlwaysOn: self-signed or CA-signed
  5. Reading the failure in the right layer
  6. The decision for IT
  7. Questions asked

Kepware talks to ThingWorx over the AlwaysOn protocol. That is the answer to give IT, and it applies to KEPServerEX and ThingWorx Kepware Server alike; a secure AlwaysOn connection can run with either a self-signed or a CA-signed certificate. The protocol name is not a port number, though. What IT needs in order to write the rule is the session geometry: the Kepware host at the edge initiates one outbound TCP session to the ThingWorx server, on the port that server is configured to answer on. This article gives the documented fields that fix the port, a worked rule with the arithmetic, and the certificate decision.

KEPServerEX and ThingWorx Kepware Server are two names for the same product — see KEPServerEX and ThingWorx Kepware Server are one product — so the protocol answer is identical whichever name is installed. On this link, AlwaysOn pushes tag values from the edge into ThingWorx, and the ThingWorx side reports the load as UpdatesPerSecond, the average number of updates being pushed to it.

AlwaysOn is neither OPC UA nor MQTT. If a diagram shows another protocol between the Kepware host and ThingWorx, it is describing a different connection with its own ports.

The session Kepware opens #

Kepware at the edge initiates the session and the ThingWorx server in the cloud answers. The ThingWorx Composer industrial-connections example gives the destination as the port on which ThingWorx responds — typically 80 or 443 — and the TLS listener a secure AlwaysOn connection targets is 443.

The deployed values sit in the connection properties of Kepware's ThingWorx native interface, and PTC's project-properties documentation defines them plainly: Port is the number of the TCP port used by the ThingWorx server, and that number is the port in the firewall rule; Resource is the URL endpoint on the ThingWorx server; Application key authenticates the connection. Two practical consequences follow. The host name inside the Resource endpoint must resolve from the edge network along the same path the rule opens, and the Kepware host needs correct time so certificate validity checks pass.

Do not confuse this port with Kepware's own service settings. The Key Service Preferred Port, valid range 1024 to 65535, serves communication within the server and never belongs in the cloud rule. Online license activation is separate traffic with its own PTC-documented policy; it does not ride the AlwaysOn session.

If the same egress path also carries an MQTT feed to a cloud broker, that protocol needs ALPN in its TLS handshake, the requirement covered in why MQTT over port 443 to a cloud needs ALPN.

A worked firewall rule #

Take example inputs: Kepware on an edge PC at 192.168.1.50, a ThingWorx server whose DNS name resolves to 203.0.113.20 in this example, and a secure AlwaysOn connection with Port at its typical value. The complete rule IT writes:

Rule element Example value Where it comes from
Source 192.168.1.50 the Kepware edge host
Destination 203.0.113.20 the ThingWorx server's resolved address
Protocol and port TCP 443 the Port field, the TLS listener
Direction outbound from the edge Kepware initiates, ThingWorx responds
Inbound to the edge none return traffic rides the established session

Before opening the rule, run the sizing check that later verifies the link. With 500 tags each averaging 1 update per second, the push rate is 500 × 1 = 500 updates per second, and every one of them rides this single session. At commissioning the ThingWorx side should report UpdatesPerSecond near 500; a reading near zero with the session established points at the tag layer, not at the firewall.

That is the entire policy for this link: one outbound rule, no port forwarding, and the Kepware host stays unreachable from the internet.

Secure AlwaysOn: self-signed or CA-signed #

Both certificate types are supported, and the choice changes how trust is established — never the protocol, the direction or the port.

Choice What trust requires What breaks it
Self-signed the Kepware side trusts that exact certificate renewal replaces the certificate and breaks trust until the new one is trusted
CA-signed the Kepware side trusts the issuing chain an expired certificate, a name mismatch or a missing intermediate

Trust is checked against the certificate the ThingWorx endpoint presents, so the checks that matter are identity — the name in the certificate matches the endpoint being called — validity dates and chain. The decision: on a link that crosses the internet, use a CA-signed certificate from a CA the company already operates or trusts, so renewal and revocation are handled by process; a self-signed certificate is defensible on a private link when the exact certificate is imported as trusted on the Kepware side and its expiry date is tracked like any other maintenance item.

Reading the failure in the right layer #

Work from the earliest failing layer: reachability, then the secure session, then the data.

Observation Failing layer Next check
Endpoint cannot be reached routing, name resolution or firewall recheck the rule's addresses, the Port value and DNS from the edge
Reachable, secure session will not establish certificate trust or identity compare the presented certificate with what the Kepware side trusts
Session established, values absent or wrong tag mapping or source item inspect the affected tag and its device independently of the connection

A TCP port test that succeeds proves the rule and nothing more — the same trap as in why gRPC ingestion fails when the TCP port test still passes, where an open port and a working session are different claims. Changing a tag cannot repair a blocked port, and opening a port cannot repair an untrusted certificate; work the layer that actually fails.

The decision for IT #

  • Name the protocol for what it is: AlwaysOn, one TCP session, initiated at the edge.
  • Take the rule's port from the Port value in the deployed Kepware connection — on a stock secure cloud link that is TCP 443 outbound.
  • Write one outbound rule from the Kepware host to the ThingWorx server; no inbound rule and no port forwarding.
  • Use a CA-signed certificate when the link crosses the internet; accept self-signed only on a private link with the certificate explicitly trusted and its expiry tracked.
  • Commission by confirming the session, comparing UpdatesPerSecond with the calculated update rate, and watching representative values update at both ends.

Questions asked

Does IT need an inbound rule or port forwarding on the edge device?

No. Kepware initiates the AlwaysOn session outbound, so a stateful firewall passes the return traffic on that established session without any inbound rule. The ThingWorx server answers; it never dials into the plant network. Adding port forwarding so the cloud side can reach the Kepware host inverts the trust direction of the design and buys nothing.

Does the Application key replace the certificate?

No. The Application key entered in the connection properties authenticates the Kepware connection to the ThingWorx server, while the certificate secures and identifies the session itself. The two are checked independently: a valid key over a certificate the Kepware side does not trust still fails the secure session, and correcting the key cannot repair certificate validation.

Is AlwaysOn the same as OPC UA or MQTT?

No. AlwaysOn is the protocol Kepware uses to communicate with ThingWorx. OPC UA and MQTT belong to other connections in a plant design, each with its own ports, handshakes and failure modes. A diagram that shows one of them between the Kepware host and ThingWorx is describing a different connection than the AlwaysOn link IT is writing rules for.

Do license activation and the data link share firewall rules?

No. PTC publishes a separate firewall policy for Kepware and ThingWorx online license activation, listing the URLs and ports to allow for it. Activation traffic is occasional and goes to licensing endpoints, while the AlwaysOn session runs continuously to the ThingWorx server. Write and test the two policies separately, because a working activation proves nothing about the data path.

Keep reading

  • How-to

    Set up the MQTT Client SL library on a CODESYS controller

    MQTT Client SL is part of the CODESYS IIoT Libraries SL package. Verify the exact controller runtime and its license, pin the library version, batch JSON per asset, and set the controller clock before opening a TLS session.

    Edge computing and IIoT

  • Troubleshooting

    Why MQTT Engine shows online status after an edge node drops

    An Info/Online tag that stays true with Good quality is not proof the edge node is alive: Engine's online state comes from the node's Sparkplug death certificate, and earlier Engine versions marked tags stale only on Engine shutdown. Read Info/Online, tag quality and Store & Forward stored metrics as three separate indicators, retest on Engine 4.0.8 with Ignition 8.0.16 or later, and compare against a node that reports correctly before escalating.

    Edge computing and IIoT

  • How-to

    Bridge a cellular tracker's TCP stream into MQTT for AWS IoT Core

    Build a small ingest service on your edge PC: it terminates the tracker's raw TCP session, decodes each stored record, and republishes one MQTT message per fix over TLS on port 8883. Acknowledge a packet only after every publish is confirmed, or a coverage-gap batch is silently lost.

    Edge computing and IIoT