Getting started

MicroRTI is an open-source implementation of HLA 4, the High Level Architecture for distributed simulation (IEEE Std 1516-2025, 1516.1-2025 and 1516.2-2025), written in Rust. This section takes you from nothing to a running federation. It assumes no previous HLA experience.

HLA in brief

In HLA, a simulation is split into separate programs called federates: a vehicle model, a sensor, a scenario controller, a data logger. Federates do not talk to each other directly. Each one connects to the Run-Time Infrastructure (RTI) and joins a federation execution, one named run of the simulation. It then declares what it publishes and what it wants to receive. The RTI routes the data and, when the federates ask for it, keeps their logical clocks in step.

The kinds of data the federates exchange are described in a FOM (Federation Object Model), an XML file shared by the federation; a FOM can be split into several files, the FOM modules. The concepts of HLA, one by one explains each of these ideas, and the glossary has short definitions.

What MicroRTI gives you

MicroRTI has these parts:

PartWhat it is
micrortiThe RTI server, one binary.
Rust clientThe crate microrti-client on crates.io.
Python clientThe package microrti: Linux wheels on its releases page, or built from source elsewhere.
Java and C++ federatesThey use the open-source Pitch FedProClient library, which works with MicroRTI.
microrti-cliAn operator tool: list federation executions and their members, watch the traffic, send an interaction, ping the RTI.

The server and the clients speak the standard HLA Federate Protocol (IEEE 1516.1, clause 12.13), which the server accepts over TCP, TLS, WebSocket and secure WebSocket. A federate written in Python can therefore join the same federation execution as one written in Rust or Java.

MicroRTI implements every service of clauses 4 to 10 of IEEE 1516.1-2025 and the Management Object Model of clause 11. It has not been through a formal conformance test and is not certified; the compliance matrix lists every service and the tests that cover it.

What you need

  • To run the RTI, use a prebuilt binary for macOS, Windows or Linux on x86-64 or ARM64, or build it with Rust 1.88 or later.
  • To write a federate in Rust: Rust 1.88 or later.
  • To write a federate in Python: Python 3.11 or later, and a Rust toolchain while the package is built from source.
  • For the five-minute tour below: Git and Rust 1.88 or later.

The path

  1. Install and run the RTI with an installer, a release archive or Cargo.
  2. Write a first federate, in Rust or in Python.
  3. Read HLA in plain words for the ideas behind what you ran: federation executions, object classes and interactions, ownership, logical time.
  4. Pick a client for your own project.

See it work in five minutes

Two chat federates, alice and bob, talk through the RTI while a third program watches what goes past. Everything comes from a clone of the repository:

git clone https://github.com/microrti/microrti
cd microrti
cargo build -p microrti -p microrti-cli -p microrti-examples --bins

The build compiles about 185 crates into target/debug. On the eight-core laptop used for this page it took 30 seconds, once Cargo had downloaded the dependencies.

Open four terminals in the microrti directory and start the programs in this order.

Terminal 1: the RTI

./target/debug/microrti --listen tcp://127.0.0.1:15164

The RTI prints listening on tcp://127.0.0.1:15164, then logs every connection, join and resign. Listening on 127.0.0.1 keeps it reachable from your machine only. Port 15164 is the standard Federate Protocol port for TCP. It is also where every program of the repository looks for the RTI when you give it no --rti option: the default RTI address is tcp://localhost:15164.

Terminals 2 and 3: alice and bob

./target/debug/chat --name alice
./target/debug/chat --name bob

The first chat creates the federation execution Chat; the second joins it. Each one announces the other with * bob joined or * alice joined.

Terminal 4: the monitor

./target/debug/microrti-cli monitor Chat

The monitor joins Chat as a third federate and prints everything it receives.

Talk

Type a line in alice’s terminal and press Enter, then answer from bob’s. After a short exchange, alice’s terminal looks like this (the lines without a prefix are the ones alice typed):

* alice joined Chat at tcp://localhost:15164; type a line to say it, end the input (Ctrl-D) to leave
* bob joined
hi bob
<bob> hello alice, lunch at noon?
yes, see you there

Bob’s:

* bob joined Chat at tcp://localhost:15164; type a line to say it, end the input (Ctrl-D) to leave
* alice joined
<alice> hi bob
hello alice, lunch at noon?
<alice> yes, see you there

And the monitor’s:

monitoring 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="hello alice, lunch at noon?"
interaction HLAinteractionRoot.Communication federate=alice Sender="alice" Message="yes, see you there"

What you just saw, in HLA terms

  • Chat is a federation execution. The first chat created it with the FOM module compiled into the program, the same file as crates/microrti-examples/fom/Chat.xml.
  • Each chat is a federate. It registers one object instance of the class Participant, named after the participant: alice, bob. * bob joined is alice’s federate discovering bob’s instance: the RTI tells it through the callback Discover Object Instance (see 6.9). The monitor prints the same event as discover.
  • Each line you type is sent as an interaction of the class Communication, a message that is sent once and not kept. It has two parameters, Sender and Message, both of the data type HLAunicodeString.
  • The RTI delivers parameter and attribute values as bytes and never decodes them. The monitor can print them as text because it read the FOM of Chat from the RTI when it joined, through the Management Object Model.

Stop everything

Press Ctrl-D in bob’s terminal: bob resigns, alice sees * bob left and the monitor prints a remove line for bob. Press Ctrl-C in the monitor’s terminal. Then press Ctrl-D in alice’s terminal. Alice is now the last federate, so she destroys the federation execution on her way out:

* bob left
* left Chat; the room is closed

Last, press Ctrl-C in the RTI’s terminal. The end of its log:

2026-12-01T20:14:21.111285Z  INFO microrti::service: federate resigned session=1a6ed1910382184b federation=Chat federate=alice federate_type=chat
2026-12-01T20:14:21.111744Z  INFO microrti::service: federation execution destroyed session=1a6ed1910382184b federation=Chat
2026-12-01T20:14:21.111967Z  INFO microrti::service: federate disconnected session=1a6ed1910382184b
2026-12-01T20:14:21.112179Z  INFO microrti_fedpro::server: session ended session=1a6ed1910382184b reason=terminated by the federate
2026-12-01T20:14:21.112223Z  INFO microrti::service: session closed by the federate session=1a6ed1910382184b
2026-12-01T20:14:21.113266Z  INFO microrti: shutdown requested signal="SIGINT"
2026-12-01T20:14:21.113552Z  INFO microrti::server: RTI stopped
2026-12-01T20:14:21.113572Z  INFO microrti: microrti stopped sessions=3 calls=63 callbacks=17

If a federate is still joined when the last chat leaves (the monitor, if you stop it last), Chat stays on the RTI. ./target/debug/microrti-cli list shows it, and ./target/debug/microrti-cli destroy Chat removes it once nobody is joined.

Stop the federates before the RTI. When the RTI disappears, chat tries to resume its session for up to 600 seconds (the client setting FED_TIMEOUT_RECONNECT). Ctrl-C still stops it: if the RTI cannot be reached two seconds after the signal, chat quits without resigning, with exit status 1.

One more: the Restaurant sample

The restaurant program runs the Restaurant sample FOM of IEEE 1516.2-2025 with a waiter and a guest federate. Its demo command needs no server: it starts an RTI inside its own process and checks that the guest received exactly what the waiter sent.

./target/debug/restaurant demo
demo: 3 s on an RTI inside this process, one round every 100 ms
[Guest] joined federation execution Restaurant and subscribed
[Waiter] joined federation execution Restaurant
[Waiter] ready: 4 object instances registered
[Waiter] left after 31 rounds: 124 updates and 124 interactions sent
[Guest] left: 4 object instances discovered, 4 removed, 124 reflects, 124 interactions
demo: the waiter did 31 rounds: 4 object instances, 124 updates, 124 interactions
demo: the guest saw 4 object instances discovered, 4 removed, 124 reflects, 124 interactions
demo: PASS: the guest saw everything the waiter sent, once, with the values sent

The number of rounds changes a little from one run to the next. The last line gives the result of the check.

Next steps