Running a HELICS co-simulation on a single machine with the default settings requires almost no network configuration—the ZMQ core opens two localhost ports and all federates connect without any explicit addressing. Once a co-simulation spans multiple compute nodes, though, the defaults are no longer sufficient: federates on remote machines need to know where to find the broker, firewalls need to allow the right ports, and in some environments the number of ports that ZMQ opens by default becomes a liability. This page covers how to configure HELICS networking for multi-machine deployments, which core type to choose for complex environments, how to use encryption, and what environment variables control networking behaviour.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/GMLC-TDC/HELICS/llms.txt
Use this file to discover all available pages before exploring further.
Default operation with the ZMQ core
When a ZMQ-based broker starts with no explicit networking arguments, it opens two ports on the local machine:- Port 23405: high-priority traffic channel.
- Port 23406: low-priority traffic channel.
Specialty cores for complex networks
zmq_ss core
The zmq_ss (ZMQ single-socket) core is a variant of the ZMQ core that limits itself to a single socket regardless of how many federates are connected. This directly addresses the port proliferation problem and simplifies firewall rules to a single port. Use it when:
- You are approaching the per-machine port limit with a large number of federates.
- Firewall rules make opening many ports impractical.
- You want to stay with ZMQ semantics but need a simpler networking footprint.
tcp_ss core
The tcp_ss (TCP single-socket) core is similar to zmq_ss but uses raw TCP rather than the ZMQ library. It is the recommended core for complex networking environments because:
- It uses exactly one socket (IP address + port) per broker.
- The broker can initiate outgoing connections to federates, which is critical in environments where firewalls block inbound connections to federate machines.
- It removes the ZMQ dependency, which can simplify deployment in environments where only standard TCP is available.
Key networking options
These options are available on brokers, sub-brokers, and federates regardless of core type.| Option | Where to use | Description |
|---|---|---|
broker_address | Federates and sub-brokers | IP address (and optionally port) of the parent broker to connect to |
broker_port | Federates and sub-brokers | Port number on the parent broker to connect to |
local_interface | Brokers, sub-brokers, federates | IP address/socket this component listens on for incoming connections |
local_port | Brokers, sub-brokers, federates | Port this component listens on |
--ipv4 | Brokers | Opens ports on all external IPv4 interfaces (shortcut for multi-machine setups) |
broker_address option can include the port by appending it after the IP: tcp://192.168.1.10:23405. When you do this, broker_port does not need to be set separately.
Setting options in JSON configuration files
All networking options can be set in a federate’s JSON configuration file, as part of thecoreInit string, or in the broker_init_string when creating a broker via API:
Multi-machine setup
Start the broker on the broker machine
Add The default port (23405) is used here. To use a non-default port, add
--ipv4 to open external-facing ports. The broker machine’s IP address is 10.0.0.1 in this example:--port=<number>:Configure remote federates with broker_address
Each federate on a different machine must be told where to find the broker. Add If the broker is using a non-default port:
broker_address to the federate’s JSON configuration:Address and port configuration reference
For brokers
For federates
Network interface selection
By default, HELICS brokers listen only on localhost. To accept connections from other machines:--ipv4: listen on all IPv4 interfaces.--local_interface=<IP>: listen on a specific interface by its IP address.--external: similar to--ipv4but also used in some webserver contexts.
--local_interface prevents HELICS from binding to an unintended network interface.
Firewall rules
The ports that need to be open depend on the core type:- ZMQ core (default)
- zmq_ss or tcp_ss core
The broker opens two well-known ports by default:
- Inbound TCP on port 23405 (high-priority channel)
- Inbound TCP on port 23406 (low-priority channel)
- A permissive firewall rule for a range of high ports, or
- Switching to
zmq_ssto eliminate the per-federate ports.
Encrypted communication
HELICS TCP and TCPSS cores support TLS/SSL encryption via OpenSSL. Encryption is useful when federates communicate across institutional boundaries or over the public internet.Enabling encryption
- Command line
- Environment variables
- JSON config file
- C++ federate code
Encryption configuration file
The encryption config JSON file specifies the certificate and key material:| Field | Description |
|---|---|
verify_file | Certificate Authority (CA) file used to verify connecting peers |
certificate_chain_file | Certificate file sent to other federates/brokers |
private_key_file | Private key matching the certificate |
tmp_dh_file | Optional Diffie-Hellman parameters file |
password | Password to decrypt the private key file |
Mixing encrypted and unencrypted federates
Use the multi-protocol broker to bridge encrypted and unencrypted connections simultaneously:Environment variables for networking
| Variable | Description |
|---|---|
HELICS_ENCRYPTION | Set to true to enable encryption without the --encrypted flag |
HELICS_ENCRYPTION_CONFIG | Path to the encryption configuration JSON file |
HELICS_HTTP_PORT | Override the default HTTP webserver port (43542) |
HELICS_WEBSOCKET_PORT | Override the default WebSocket server port |
Debugging connection problems
Verify basic connectivity without encryption
If encryption is enabled, first disable it by removing
--encrypted from all components. If the simulation still fails to connect, the problem is in the basic network configuration (wrong IP, wrong port, firewall).Check that the broker is reachable
From the federate machine, test that the broker’s port is open:Or for TCP:
Increase log verbosity
Run the broker and federates with
--loglevel=debug or --loglevel=trace to see detailed connection attempts: