Blog

LunaLink: A Reliable Communication Protocol for SCADA and Industrial IoT

· Sərvin Əliyev

lunalink-scada-industrial-iot-communication

What Is LunaLink? Reliable Communication for SCADA and Industrial IoT

Collecting data is not enough in a distributed industrial system. When connectivity at a remote site is interrupted, measurements must not be lost. Once the connection is restored, data should reach the central system in the correct order, and the same record should not be processed twice. Communication must also remain efficient on constrained networks and protected against unauthorized connections.

LunaLink is a lightweight binary communication protocol and .NET library developed by LunaSoft to address these requirements. It provides real-time data synchronization between field Nodes and a central Master in SCADA, industrial IoT, and edge computing environments.

What problem does LunaLink solve?

Manufacturing sites, pumping stations, energy facilities, and remote technology assets do not always have stable network connectivity. With a basic data-transfer approach, even a short outage can cause lost measurements, inconsistent states between field devices and the central platform, and incomplete reports.

LunaLink does not follow a simple “send and forget” model. It verifies at the application level that the Master has accepted the transmitted data, stores pending information in a local database while the connection is unavailable, and replays queued batches in order after connectivity returns.

The goal is not to make an unreliable network appear stable. It is to protect data in a controlled and verifiable way when network problems occur.

How does the LunaLink architecture work?

LunaLink is built around two primary roles:

  • Master — the server that accepts Node connections, centralizes incoming data, and routes remote write commands.
  • Node — an edge device that collects data from local PLCs, sensors, meters, and other equipment and transfers it to the Master.
PLCs and sensors → LunaLink Node ⇄ Secure network ⇄ LunaLink Master → SCADA and historian

When a Node connects to the Master, it presents its identifier, name, version, and authentication details. After registration is approved, the current state is synchronized, real-time changes are transmitted, and periodic heartbeat messages are used to monitor connection health.

How does LunaLink protect against data loss?

Local durable outbox

Tag changes accepted by a Node are written to a local SQLite-backed outbox before network transmission. As a result, unacknowledged data remains available even if the internet connection is interrupted or the process restarts.

When connectivity returns, LunaLink sends stored batches to the Master in sequence. A batch is removed from the outbox only after the Master confirms successful application-level processing.

Sequence and ACK control

Each data batch carries a monotonically increasing sequence number. The Master can:

  • accept the expected batch;
  • identify a duplicate that has already been processed;
  • report the expected sequence when it detects a gap.

This approach prevents the same data from being processed twice and makes silent packet loss detectable during reconnection and replay.

Snapshot synchronization

After an extended outage, replaying every historical change is not always the most efficient recovery strategy. LunaLink can synchronize a full snapshot of the current tag state to eliminate divergence between the Node and Master. For a large outbox, superseded changes can also be replaced with an acknowledged current-state baseline to keep recovery traffic manageable.

Efficiency on constrained networks

Instead of JSON or XML, LunaLink uses compact MessagePack binary serialization. Payloads above a defined threshold are automatically compressed with LZ4. Subscription filtering allows the Master to forward only the tag data required by each subscribed Node.

These capabilities are particularly useful with:

  • mobile 4G and 5G networks;
  • radio and long-distance links;
  • limited data plans;
  • internet connections with variable latency and quality;
  • systems where many edge devices connect to one Master.

Each frame includes the protocol version, message type, sequence number, and payload length. A CRC-16 integrity check prevents corrupted frames from being processed.

How is communication secured?

LunaLink can protect communication at several levels:

  1. An authentication token allows unauthorized Node registrations to be rejected.
  2. TLS 1.3 encrypts data in transit.
  3. With mTLS, both the Master and Node authenticate with X.509 certificates.
  4. Server certificate validation confirms that a Node is connecting to the intended Master.
  5. Frame and size validation limits invalid or excessively large packets.

In a production project, secure certificate storage, periodic token rotation, firewall rules, and industrial network segmentation should also be part of the overall security plan.

Remote monitoring and control

LunaLink is not limited to sending telemetry from a Node to the Master. The Master can issue a remote write command for an authorized tag, while the Node reports whether the command was executed successfully on the local PLC or device.

Heartbeat telemetry can expose:

  • Node online status;
  • CPU and memory usage;
  • number of connected local devices;
  • pending outbox batch and tag counts;
  • volume and age of queued data;
  • reconnection count.

Remote write support does not automatically make every operation safe. Critical control commands must still be protected by SCADA-level permissions, process interlocks, and audit rules.

Key LunaLink capabilities

CapabilityPractical result
Binary TCP protocolMore compact transfer than JSON-based communication
MessagePack and LZ4Efficient use of constrained and unreliable links
SQLite outboxLocal protection of unacknowledged data during an outage
Sequence numbers and ACKsDetection and management of gaps and duplicates
Automatic reconnectionRecovery without manual intervention when the network returns
Snapshot synchronizationRealignment of Node and Master state
Subscription filteringTransfer of only the tags each consumer requires
TLS and mTLSEncrypted, certificate-authenticated communication
Heartbeat telemetryCentral monitoring of Node health and backlog status
Remote tag writeDelivery of authorized control commands to remote devices

Where can LunaLink be used?

LunaLink is suitable for projects that require continuous data exchange between a central platform and remote assets:

  • manufacturing sites distributed across multiple locations;
  • water and wastewater pumping stations;
  • electrical substations and energy monitoring;
  • oil, gas, and pipeline infrastructure;
  • agriculture and remote irrigation facilities;
  • technical monitoring of buildings and facilities;
  • mobile and containerized production units;
  • integration between edge gateways and central IoT platforms.

Does LunaLink replace MQTT?

LunaLink and MQTT do not solve exactly the same problem. MQTT is a general-purpose publish/subscribe protocol with a broad ecosystem. LunaLink brings specific industrial requirements—SCADA tag synchronization, a durable offline outbox, application-level sequencing, snapshots, remote tag writes, and Node health—together in one library.

MQTT may be the right choice when an existing broker infrastructure and broad multi-vendor integration are the primary requirements. LunaLink offers a more purpose-built approach when controlled, durable, .NET-based communication is required between LunaSoft SCADA Nodes and a Master. Some architectures can use both protocols together.

What should be planned before implementation?

  • Master and Node roles and their network addresses;
  • a unique identifier and naming convention for every Node;
  • the tags to be transferred and their update frequency;
  • outbox capacity and retention period;
  • acceptable recovery delay after a connection outage;
  • issuance and renewal of TLS or mTLS certificates;
  • permissions and safety interlocks for remote write commands;
  • firewall, port, and network-segmentation rules;
  • alert thresholds for Node health and backlog;
  • acceptance tests for network and power-loss scenarios.

Conclusion

LunaLink makes communication between Nodes and a Master in distributed SCADA and industrial IoT systems more compact, observable, and resilient. Its local outbox, application-level acknowledgements, sequence control, and automatic recovery reduce the risk of data loss on unreliable networks. TLS, mTLS, and authentication capabilities help secure the communication channel.

The protocol was designed for the distributed architecture of LunaSoft SCADA and can also be integrated into other industrial applications as a standalone .NET library.


Planning a distributed SCADA project?

Let us assess your remote sites, network conditions, and data-reliability requirements. Contact LunaSoft to determine whether a LunaLink-based Node–Master architecture is the right fit for your project.