Watch and operate a federation
microrti-cli is the operator tool of MicroRTI, the HLA 4 RTI. It connects to the RTI over the Federate
Protocol, as a federate would, and uses the standard HLA services. With it you can list federation
executions and their members, print the traffic of a federation execution as it happens, send an
interaction, check that the RTI answers and remove an abandoned federation execution. This page runs
each command against two chat federates, then explains what the microrti server writes in its own
log.
Get microrti-cli
microrti-cli has its own installers and archives for macOS, Windows and Linux. You can also build it
with cargo install --locked microrti-cli or run it from a clone with cargo run -p microrti-cli --
followed by the arguments. See Install and run the RTI for the commands and
downloads.
At a terminal, microrti-cli checks GitHub at most once a day and prints an update command on
standard error when a newer release is available. The check is skipped when standard output or
standard error is redirected, with --json, or when CI is set. Set MICRORTI_NO_UPDATE_CHECK=1
to turn it off.
Every command takes the same connection options:
| Option | Meaning |
|---|---|
--rti URL | the RTI address: tcp://HOST[:PORT], tls://, ws://HOST[:PORT][/PATH] or wss://; default tcp://localhost:15164 |
--password PASSWORD | sent as HLAplainTextPassword credentials; the environment variable MICRORTI_PASSWORD works too. Leave both out for an RTI without authorisation, which refuses any password |
--tls-trust-anchors FILE | PEM file the RTI’s certificate must chain to, for tls:// and wss:// |
--setting KEY=VALUE | a connection setting such as FED_TIMEOUT_CONNECT=3; may be repeated. A setting the tool cannot use is refused before it connects |
--json | one JSON object per line instead of text |
The exit status is 0 on success, 1 on failure (the reason is on the standard error) and 2 for a wrong command line. TLS and authorisation shows these options against a protected RTI.
A federation to watch
The chat example is a chat room: each line you type is sent as an interaction of class
Communication, and each participant registers an object instance of class Participant. It comes
with the repository, not with the release archives. Start an RTI and two chat federates, each in its
own terminal:
# terminal 1: the RTI
microrti --listen tcp://127.0.0.1:15164
# terminals 2 and 3, from the clone
cargo run -p microrti-examples --bin chat -- --name alice
cargo run -p microrti-examples --bin chat -- --name bobType a few lines in each. By the end of the session on this page, alice’s terminal showed this (the lines alice typed herself are not echoed back):
* alice joined Chat at tcp://localhost:15164; type a line to say it, end the input (Ctrl-D) to leave
* bob joined
<bob> hi alice
<operator> lunch is ready
<bob> see you there
<operator> closing at six
* left ChatThe <operator> lines were sent by microrti-cli, further down.
Follow the traffic: monitor
monitor joins the federation execution as an observer, subscribes to every class of the FOM and
prints what it receives: object instances discovered, attributes reflected, interactions, object
instances removed. To name and decode what it sees, it reads the current FOM of the federation execution
(the FDD) from the RTI once it has joined, through the attribute HLAcurrentFDD of the Management Object
Model (4.1.4.2). In a fourth terminal:
microrti-cli monitor Chatmonitoring Chat: 1 object class, 1 interaction class
discover alice class=HLAobjectRoot.Participant federate=alice
discover bob class=HLAobjectRoot.Participant federate=bob
interaction HLAinteractionRoot.Communication federate=alice Sender="alice" Message="hi bob"
interaction HLAinteractionRoot.Communication federate=bob Sender="bob" Message="hi alice"
interaction HLAinteractionRoot.Communication federate=alice Sender="alice" Message="lunch at noon?"
interaction HLAinteractionRoot.Communication federate=federate 00000004 Sender="operator" Message="lunch is ready"
interaction HLAinteractionRoot.Communication federate=bob Sender="bob" Message="see you there"
interaction HLAinteractionRoot.Communication federate=federate 00000006 Sender="operator" Message="closing at six"
remove alice class=HLAobjectRoot.Participant federate=alice
remove bob class=HLAobjectRoot.Participant federate=bobIt runs until Ctrl-C, SIGTERM or SIGHUP, then resigns. If the RTI cannot be reached two seconds after
the signal, it quits without resigning; a second signal stops it at once. federate= names the federate
that sent the message. A federate that has already resigned when the line is printed has no name any
more, so it shows as its federate handle (federate 00000004 and federate 00000006 are the
short-lived send commands described below).
The monitor reads the FDD once, when it joins: classes that a federate adds later, by joining with more
FOM modules, are not watched. With --fom FILE (repeated for each module) it decodes with those files
instead and reads nothing from the RTI, which is what you need for an RTI that does not give out its
current FDD. The federation execution must exist:
microrti-cli: cannot join federation execution Chat: FederationExecutionDoesNotExist: there is no federation execution named 'Chat'Other options of monitor:
| Option | Effect |
|---|---|
--fom FILE | decode with this FOM module instead of the FDD read from the RTI; may be repeated (the MIM is built in) |
--class NAME | subscribe to this object or interaction class only; may be repeated |
--mom | also subscribe to the classes of the Management Object Model |
--name NAME | the federate name of the observer; by default the RTI chooses one |
--seconds N, --events N | stop after N seconds, or after N events |
--json | one JSON object per event |
For example, this follows only the chat lines, under a name of your choosing, and stops after the first
one (here a line posted with send, described below):
microrti-cli monitor Chat --class Communication --name operator-desk --events 1monitoring Chat: 0 object classes, 1 interaction class
interaction HLAinteractionRoot.Communication federate=federate 00000006 Sender="operator" Message="closing at six"With --json, every line is an object that a script can read. A shorter chat, from start to end, with
the monitor started after alice and before bob:
{"event":"monitoring","federation":"Chat","interaction_classes":1,"object_classes":1}
{"class":"HLAobjectRoot.Participant","event":"discover","federate":"alice","object":"alice"}
{"class":"HLAobjectRoot.Participant","event":"discover","federate":"bob","object":"bob"}
{"attributes":{"Name":"bob"},"class":"HLAobjectRoot.Participant","event":"reflect","federate":"bob","object":"bob"}
{"class":"HLAinteractionRoot.Communication","event":"interaction","federate":"alice","parameters":{"Message":"hi bob","Sender":"alice"}}
{"class":"HLAinteractionRoot.Communication","event":"interaction","federate":"bob","parameters":{"Message":"hi alice","Sender":"bob"}}
{"class":"HLAobjectRoot.Participant","event":"remove","federate":"alice","object":"alice"}
{"class":"HLAobjectRoot.Participant","event":"remove","federate":"bob","object":"bob"}List the federation executions: list
microrti-cli listChat HLAfloat64TimeOne line per federation execution: its name and its logical time representation, separated by a tab.
With --json:
{"federation":"Chat","time":"HLAfloat64Time"}An RTI with none says so on the standard error and exits with 0:
microrti-cli: the RTI at tcp://localhost:15164 has no federation executionsSee who is joined: members
microrti-cli members ChatHLAfederate-3 microrti-cli
alice chat
bob chatEach line is a federate name and its federate type. The monitor of the previous section is a member
too: HLAfederate-3 is the name the RTI gave it. With --json:
{"federate":"HLAfederate-3","federation":"Chat","type":"microrti-cli"}
{"federate":"alice","federation":"Chat","type":"chat"}
{"federate":"bob","federation":"Chat","type":"chat"}A name that does not exist is an error (exit status 1):
microrti-cli: federation execution Nope does not exist at tcp://localhost:15164Send an interaction: send
send joins, sends one interaction and resigns. Like monitor, it reads the FDD of the federation
execution from the RTI, here to encode the parameter values, and takes --fom FILE to use FOM module
files instead:
microrti-cli send Chat Communication Sender=operator 'Message=lunch is ready'sent HLAinteractionRoot.Communication with 2 parametersBoth chat participants print <operator> lunch is ready. Parameters are NAME=VALUE; the value is JSON
or plain text, converted to the data type the FOM gives the parameter. From microrti-cli --help:
numbers 3, 12.5 integer and float data types
true, false HLAboolean
plain text, "quoted" hello, "42" strings (plain text that is not JSON is a string)
an enumerator Cola, 101 by name or by number
a JSON array ["salt","pepper"] arrays
a JSON object {"EntreeOk":true,"Veggy1Ok":false,"Veggy2Ok":true}
fixed records, fields in any order
{"$variant":{"discriminant":{"name":"Trainee"},"value":true}}
variant records
{"$bytes":"0a0b"} opaque octets--tag TEXT sets the user-supplied tag of the interaction.
Check that the RTI answers: ping
ping connects, makes one service call and disconnects, and reports the times:
microrti-cli pingtcp://localhost:15164: connected in 1.255 ms, service round trip 0.241 ms, 2.11 ms in all--count N repeats it, and --json gives numbers a script can use:
microrti-cli ping --count 3 --json{"connect_ms":1.029,"round_trip_ms":0.165,"rti":"tcp://localhost:15164","total_ms":1.58}
{"connect_ms":0.494,"round_trip_ms":0.136,"rti":"tcp://localhost:15164","total_ms":0.938}
{"connect_ms":0.459,"round_trip_ms":0.135,"rti":"tcp://localhost:15164","total_ms":1.007}The exit status makes it a health check, for a script or a container:
microrti-cli ping && echo the RTI is upWhen nothing listens, the exit status is 1 and the reason is on the standard error:
microrti-cli: cannot connect to the RTI at tcp://localhost:15164: ConnectionFailed: cannot reach the RTI: tcp://localhost:15164: transport error: cannot connect to tcp://localhost:15164: Connection refused (os error 61)Remove an abandoned federation execution: destroy
A federation execution stays on the RTI until a federate destroys it. The chat example destroys its
room when the last participant leaves, but here the monitor was still joined when alice and bob left,
so the room stayed. destroy refuses while any federate is joined:
microrti-cli destroy Chatmicrorti-cli: federation execution Chat still has joined federates (see `members Chat`): FederatesCurrentlyJoined: federation execution 'Chat' has joined federates: alice, bob, HLAfederate-3Once the monitor is stopped with Ctrl-C, nobody is left, and the same command works:
$ microrti-cli members Chat
microrti-cli: federation execution Chat has no joined federates
$ microrti-cli destroy Chat
federation execution Chat destroyed
$ microrti-cli list
microrti-cli: the RTI at tcp://localhost:15164 has no federation executionsWhat the tool uses
list and members call two services of the standard, List Federation Executions (4.7) and List
Federation Execution Members (4.9); monitor and send are ordinary federates that join, subscribe or
publish, and resign. To read the FDD, they subscribe to the MOM class HLAmanager.HLAfederation, ask
for the value of HLAcurrentFDD (Request Attribute Value Update, 6.21) and unsubscribe again, as any
federate could.
The Management Object Model (MOM, clause 11) is a set of object and interaction classes under
HLAmanager that the RTI itself publishes in every federation execution. Its objects describe the
federation and each joined federate, and its interactions let a federate query and adjust them. With
--mom, the monitor subscribes to those classes as well (see
the Management Object Model in the concepts page).
With alice alone in the room, saying “hi”:
monitoring Chat: 5 object classes, 94 interaction classes
discover HLAmanager-federate-1 class=HLAobjectRoot.HLAmanager.HLAfederate federate=federate 00000000
discover HLAmanager-federate-2 class=HLAobjectRoot.HLAmanager.HLAfederate federate=federate 00000000
discover HLAmanager-federation class=HLAobjectRoot.HLAmanager.HLAfederation federate=federate 00000000
discover alice class=HLAobjectRoot.Participant federate=alice
interaction HLAinteractionRoot.Communication federate=alice Sender="alice" Message="hi"The MOM objects come from the RTI itself, so they show the handle federate 00000000 with no name
behind it.
The server’s log
microrti logs to the standard error. At the default level, info, each line holds a UTC timestamp,
the level, the part of the server that wrote it and a message with its fields. This is alice arriving in
the session above:
2026-12-01T20:21:20.130744Z INFO microrti_fedpro::server: session created session=7df7f9432c7ccc64 peer=Some(127.0.0.1:57047) transport=tcp
2026-12-01T20:21:20.130909Z INFO microrti::service: session opened session=7df7f9432c7ccc64 connection=1
2026-12-01T20:21:20.132578Z INFO microrti::service: federate connected session=7df7f9432c7ccc64
2026-12-01T20:21:20.151803Z INFO microrti::service: federation execution created session=7df7f9432c7ccc64 federation=Chat
2026-12-01T20:21:20.165459Z INFO microrti::service: federate joined session=7df7f9432c7ccc64 federation=Chat federate=alice federate_type=chatand leaving:
2026-12-01T20:21:22.841474Z INFO microrti::service: federate resigned session=7df7f9432c7ccc64 federation=Chat federate=alice federate_type=chat
2026-12-01T20:21:22.842026Z INFO microrti::service: federate disconnected session=7df7f9432c7ccc64
2026-12-01T20:21:22.842259Z INFO microrti_fedpro::server: session ended session=7df7f9432c7ccc64 reason=terminated by the federate
2026-12-01T20:21:22.842331Z INFO microrti::service: session closed by the federate session=7df7f9432c7ccc64The session field ties the lines of one federate together. These are the messages you will see:
| Message | When |
|---|---|
session created, session opened | a federate opened a Federate Protocol session; peer is its address and port |
federate connected, federate disconnected | the Connect and Disconnect services |
federation execution created, federation execution destroyed | Create and Destroy Federation Execution |
federate joined, federate resigned | Join and Resign Federation Execution. federate is the federate name, the one the RTI chose when the federate gave none (the monitor appears as federate=HLAfederate-3), and federate_type its federate type |
session ended, session closed by the federate | the federate ended its session in the normal way |
session resumed | the connection broke and the federate came back on a new one; resent counts the messages sent again |
session lost (WARN) | the session is gone: purged after rti_timeout_purge, ended by a bad message, or ended by the RTI’s shutdown |
federate lost (WARN) | the federate of a lost session was still joined, so the RTI resigned it for its federation execution (4.1.6) |
authorization refused (WARN) | the authorisation service refused a service, usually Connect with a wrong or missing password; peer is the address it came from |
TLS handshake failed; connection dropped | a connection to a tls or wss listener did not get through the TLS handshake; peer is its address and error the reason. The same failure from the same address is logged once a minute, its repetitions at debug with repeated=true. Not logged when the peer closes the connection during the handshake, as a port scan does |
reading the FOM modules named by URL | a Create or Join Federation Execution named FOM modules by URL, which the RTI reads before it carries the service out; count is their number and urls the URLs, with any user name and password in them masked as *** (see FOM modules named by URL) |
federation save written, federation save read | only with save_directory: a save written to its file, or read back for a restore |
federation restore failed (WARN) | a Request Federation Restore was refused or could not be carried out; label names the save and reason says why, for example a damaged file or one written by a 0.4 server (see federation saves) |
HLA_CALL_REQUEST larger than max_message_size dropped (WARN) | a service call over max_message_size, refused (see message size) |
Each microrti-cli command is a short session of its own, so a busy operator shows up as a run of
session created and session closed by the federate lines.
When a federate’s process ends without resigning, its session waits for rti_timeout_purge in case it
comes back. With --rti-timeout-purge 2 and bob’s process killed with kill -9, the log had:
2026-12-01T20:22:12.531731Z INFO microrti_fedpro::server: session ended session=89a0a27b92187947 reason=session purged after RTI_TIMEOUT_PURGE
2026-12-01T20:22:12.533676Z WARN microrti::service: session lost session=89a0a27b92187947 cause=session purged after RTI_TIMEOUT_PURGE
2026-12-01T20:22:12.533759Z WARN microrti::service: federate lost session=89a0a27b92187947 federation=Chat federate=bob federate_type=chatand alice’s chat printed * bob left, since the RTI deleted bob’s object instance when it resigned him.
Stopping the RTI with Ctrl-C or SIGTERM ends the remaining sessions and prints totals:
2026-12-01T20:21:23.083104Z INFO microrti: shutdown requested signal="SIGINT"
2026-12-01T20:21:23.083376Z INFO microrti::server: RTI stopped
2026-12-01T20:21:23.083389Z INFO microrti: microrti stopped sessions=19 calls=153 callbacks=44Federates still joined at that moment get a session lost and a federate lost line each.
A client that fails the TLS handshake shows up as an info line, and a federate refused for its
password as a warning, both with the address they came from. These two are from TLS and authorisation:
2026-12-02T07:30:11.233056Z INFO microrti_fedpro::server: TLS handshake failed; connection dropped peer=127.0.0.1:55136 transport=tls error=transport error: TLS handshake: received fatal alert: UnknownCA
2026-12-02T07:30:11.270582Z WARN microrti::service: authorization refused session=afda5cab0feb83da peer=127.0.0.1:55142 service="Connect" exception=Unauthorized details=wrong passwordOther failed service calls do not appear at info; start the RTI with --log-level debug to see them.
When nobody reads the standard error, the RTI drops log lines instead of slowing down, and says how many
at shutdown. Configure the RTI has the details, including RUST_LOG.
Next steps
- Configure the RTI: the listeners, timeouts and log level used above.
- TLS and authorisation: run these commands against a protected RTI.
- The concepts of HLA: federation executions, federates, objects and interactions.