Configure the RTI
microrti, the server of the MicroRTI HLA 4 RTI, reads its settings from a TOML file and from its
command line. This page lists every setting and shows how to check a file before you start the RTI with
it. It ends with three setups you can copy: a development machine, a shared lab server and a WebSocket
listener behind a reverse proxy.
Where the settings come from
The standard calls the settings of an RTI its RID, the RTI initialization data. In MicroRTI the RID is a
TOML file that you pass with --config (or with the environment variable MICRORTI_CONFIG). Without a
file, microrti uses its defaults, which come down to one TCP listener on 0.0.0.0:15164 and no
authorisation.
Four rules cover the rest:
- Every key is optional. A key you leave out takes its default.
- A command line option overrides the same setting of the file.
--listenreplaces all the listeners of the file instead of adding one. - A relative path in the file is relative to the directory of the file, not to the directory you start
micrortifrom. - A key the RTI does not know is an error: a misspelt key keeps the RTI from starting, where it could otherwise go unnoticed.
The file microrti.example.toml lists every key with its default, commented out. It is in the release
archives next to the binaries, and in the repository at
crates/microrti/microrti.example.toml.
Check a file before you use it
Here is a small RID:
# microrti.toml: a small RID to start from
log_level = "info"
# Federate Protocol timeouts, in seconds
rti_timeout_heart = 90
rti_timeout_purge = 300
[[listener]]
transport = "tcp"
address = "0.0.0.0:15164"
[[listener]]
transport = "ws"
address = "0.0.0.0:8080"microrti check-config reads it, fills in the defaults and prints the settings the RTI would run with,
in the same TOML syntax. It starts nothing and opens no port:
microrti check-config microrti.toml# microrti.toml: the settings are valid. Effective settings:
log_level = "info"
tick_period_ms = 100
service_report_directory = "microrti-service-reports"
# no save_directory: federation saves are kept in memory, lost when the RTI stops
fom_urls = "all"
# FOM modules and MIMs named by file:, http: or https: URL are read wherever they are: restrict with fom_urls = "none" or fom_url_directory
fom_url_timeout = 30
# no fom_url_root_certificates: https servers are verified against the trust store of the system
max_message_size = 67108864
rti_timeout_heart = 90
rti_timeout_purge = 300
# no TLS certificate
[[listener]]
transport = "tcp"
address = "0.0.0.0:15164"
[[listener]]
transport = "ws"
address = "0.0.0.0:8080"
[authorization]
enabled = false
authorizer = "HLAauthorizer"
# no passwordcheck-config accepts the same options as the server, so you can see what an override does before you
use it. Here --listen replaces both listeners of the file:
microrti check-config microrti.toml --log-level debug --listen tcp://127.0.0.1:15164 --rti-timeout-heart 120# microrti.toml: the settings are valid. Effective settings:
log_level = "debug"
tick_period_ms = 100
service_report_directory = "microrti-service-reports"
# no save_directory: federation saves are kept in memory, lost when the RTI stops
fom_urls = "all"
# FOM modules and MIMs named by file:, http: or https: URL are read wherever they are: restrict with fom_urls = "none" or fom_url_directory
fom_url_timeout = 30
# no fom_url_root_certificates: https servers are verified against the trust store of the system
max_message_size = 67108864
rti_timeout_heart = 120
rti_timeout_purge = 300
# no TLS certificate
[[listener]]
transport = "tcp"
address = "127.0.0.1:15164"
[authorization]
enabled = false
authorizer = "HLAauthorizer"
# no passwordWhen the settings include a password, check-config says # password: set (not shown) and never
prints it.
When a file is wrong
A RID the RTI cannot use gives one line on the standard error, naming the key, and the exit status 2.
microrti check-config and microrti --config behave the same way, so a service manager sees the
failure at start. Some real examples:
microrti: invalid setting `rti_timeout_hart`: unknown setting (known: authorization, fom_url_directory, fom_url_root_certificates, fom_url_timeout, fom_urls, listener, log_level, max_message_size, rti_timeout_heart, rti_timeout_purge, save_directory, service_report_directory, tick_period_ms, tls_certificate_chain, tls_private_key, tls_self_signed)
microrti: invalid setting `tick_period_ms`: 0 ms is out of range: 1 to 60000
microrti: invalid setting `listener`: the tls listener on 0.0.0.0:15165 needs a certificate: set tls_certificate_chain and tls_private_key, or tls_self_signed = true
microrti: invalid setting `listener.address`: `rti.example.org:15164` is not a bind address; write an IP address with an optional port, for example 0.0.0.0:15164, [::]:15164 or 127.0.0.1
microrti: invalid setting `authorization.password_env`: the environment variable MICRORTI_PASSWORD is not set
microrti: invalid setting `save_directory`: cannot write in the directory ro: Permission denied (os error 13)
microrti: invalid setting `fom_url_directory`: nothere is not a directory the RTI can use: No such file or directory (os error 2)
microrti: invalid setting `fom_urls`: `some` is not accepted: all (every file, http and https URL) or none; to read the files of one directory, set fom_url_directory instead
microrti: cannot read nothere.toml: No such file or directory (os error 2)A TOML syntax error shows the line and column. A string written without quotes is the most common one, and the RTI adds a hint, since TOML’s own message does not help much:
microrti: syntax.toml: TOML parse error at line 1, column 13
|
1 | log_level = info
| ^^^^
invalid float, expected `inf`
hint: `log_level` takes a string, written in quotes: log_level = "info"When the line holds a password (here password = secret word in the [authorization] table), the
error leaves the line out and the hint does not repeat the value:
microrti: auth.toml: TOML parse error at line 3, column 12: string values must be quoted, expected literal string (the line is not shown, since it holds a secret)
hint: `password` takes a string, written in quotes: password = "..."A valid file can still fail at start when a port is taken. That is exit status 1:
microrti: cannot open the listeners: transport error: cannot listen on 127.0.0.1:55651: Address already in use (os error 48)On macOS the system lets a second program listen on 127.0.0.1:15164 while another listens on
0.0.0.0:15164, and each then gets part of the connections. microrti checks for that before it
listens and refuses, here started on 0.0.0.0 while another RTI held the same port on 127.0.0.1:
microrti: cannot open the listeners: transport error: cannot listen on 0.0.0.0:55651: another socket listens on 127.0.0.1:55651, which shares the port with it (Address already in use (os error 48))It checks the loopback and wildcard addresses of IPv4 and IPv6, not every address of the machine, and only on macOS: Linux refuses such a listener by itself. Restarting the RTI on its port while connections of the previous run are still closing works as before.
Every setting
The RID has fourteen plain keys, any number of [[listener]] tables and one [authorization] table. This
section groups them by purpose and gives their defaults.
Listeners
Each [[listener]] table opens one listening socket. transport is one of four values, and address
is an IP address to bind with an optional port.
transport | What federates use | Port when you give none |
|---|---|---|
tcp | tcp://host:port | 15164 |
tls | tls://host:port, TLS 1.3 | 15165 |
ws | ws://host:port, WebSocket | 80 |
wss | wss://host:port, secure WebSocket | 443 |
The address accepts 0.0.0.0:15164 (every IPv4 interface), [::]:15164 (IPv6, brackets when a port
follows), 127.0.0.1 and localhost:15164, which is read as 127.0.0.1:15164. A host name such as
rti.example.org is refused, because the RTI binds addresses and does not resolve names. Port 0 lets
the system choose a free port; the RTI prints the port it got (see the listening on lines).
With no [[listener]] at all, the RTI listens for TCP on 0.0.0.0:15164, and also for TLS on
0.0.0.0:15165 when a certificate is configured.
On the command line, --listen (or -l) takes [TRANSPORT://]IP[:PORT] and may be repeated. Without a
transport it means TCP:
microrti -l tcp://0.0.0.0:15164 -l ws://0.0.0.0:8080Federate Protocol timeouts
The Federate Protocol (IEEE 1516.1, 12.13) keeps a session alive across broken connections. Two timeouts on the RTI side decide when the RTI gives up on a quiet federate (Table 31 of the standard):
| Key | Default | Meaning |
|---|---|---|
rti_timeout_heart | 180 | seconds without any message from a federate before its session becomes inactive. The connection is closed; the federate may reconnect and resume the session. |
rti_timeout_purge | 600 | seconds a session may stay inactive. After that it is purged and its federate is lost for the federation execution (4.1.6). |
A dropped connection also makes the session inactive at once, so rti_timeout_purge is how long a
federate has to come back after a network failure. Fractions of a second are accepted, and the
upper-case names of the standard (RTI_TIMEOUT_HEART, RTI_TIMEOUT_PURGE) work as keys too.
Keep rti_timeout_heart well above the heartbeat interval of every federate. A federate sends a
heartbeat after FED_INT_HEART seconds without traffic; the default in Table 32 is 60 seconds, and the
MicroRTI clients use it. An RTI whose heart timeout is not clearly longer drops the connection of idle
federates, which then reconnect and resume: nothing is lost, but the log fills with session resumed
lines. The default, 180 seconds, leaves room for three heartbeats. With --rti-timeout-heart 2 and a
chat federate idle for eight seconds, the log shows this (each log line starts with a UTC timestamp,
left out in the excerpts on this page):
INFO microrti::service: federate joined session=950a936a135b6f1e federation=Chat federate=alice federate_type=chat
INFO microrti_fedpro::server: session resumed session=950a936a135b6f1e resent=0
INFO microrti_fedpro::server: session resumed session=950a936a135b6f1e resent=0
INFO microrti_fedpro::server: session resumed session=950a936a135b6f1e resent=0
INFO microrti_fedpro::server: session resumed session=950a936a135b6f1e resent=0Message size
max_message_size is the largest Federate Protocol message the RTI accepts from a federate, in bytes,
header included. The default is 67108864 (64 MiB); the accepted range is 1024 to 4294967295, the most the
4-byte size field of the protocol header can hold.
A service call over the limit is not executed. The RTI reads the message to its end without keeping
it and answers with the exception RTIinternalError, which names the size, the limit and the setting;
the session goes on, so the federate can still make smaller calls. FOM modules sent with Create or Join
Federation Execution count: with --max-message-size 2048, the chat example cannot create its room.
It prints
chat: cannot create federation execution Chat: RTIinternalError: the HLA_CALL_REQUEST of 2267 bytes exceeds the maximum message size of the RTI (2048 bytes, RID setting max_message_size); the call was not executedand the RTI logs
WARN microrti_fedpro::server: HLA_CALL_REQUEST larger than max_message_size dropped; the call is refused session=e54e89a1851b14e8 size=2267 max=2048The standard sets no size limit (12.13.4.5); the limit and this answer are MicroRTI’s. WebSocket is the
exception: over ws and wss, a message more than 1 MiB above the limit cannot be skipped, because the
WebSocket layer holds a whole message in memory. The RTI then ends the session as for a bad message. The
federate cannot resume it, gets Connection Lost and, if it was joined, is lost to its federation
execution.
Leave the default unless you have a reason to bound what one federate can send.
Tick period
tick_period_ms (default 100, range 1 to 60000) is how often the RTI does the work that depends on the
wall clock: the periodic reports of the Management Object Model and update rate reduction (6.1.13).
Logical time does not depend on it. You rarely need to change it.
MOM service report logs
A federate can ask, through the Management Object Model, that its service reports go to a file instead
of to the subscribers of HLAreportServiceInvocation (11.5.2). service_report_directory is where those
files go, one per federate; the MOM attribute HLAreportServiceFile of the federate gives the path. The
default is microrti-service-reports in the directory the RTI was started from. The directory is created
when the first log is opened, not before. This setting has no command line option.
Federation saves
A federate can ask the RTI to save the whole federation execution under a label, and later to restore it
(4.19 to 4.35, see save and restore). Where the RTI keeps its
part of the save depends on save_directory.
Without it, the saves stay in the memory of the RTI process and are lost when it stops. The RTI says so
in its log at start, and check-config with a comment:
INFO microrti::server: federation saves are kept in memory and lost when the RTI stops: set save_directory to keep them in files# no save_directory: federation saves are kept in memory, lost when the RTI stopsWith save_directory in the RID, or --save-directory DIRECTORY on the command line, every save is a
file in that directory, and Request Federation Restore reads it from there, also after the RTI was
stopped and started again. Clause 4.1.2 asks for saves that outlive the federation execution; this is
how the server gives you that.
save_directory = "/var/lib/microrti/saves"The RTI creates the directory at start, and does not start (exit status 2) when it cannot write in it.
check-config refuses the same directories with the same messages and exit status 2, without creating
anything: it writes a hidden test file in the directory, or in the nearest parent that exists, and
removes it. Run it as the user the RTI will run as, since the answer holds for the user who runs the
check. Here ro is a directory nobody can write in, and afile a file:
microrti: invalid setting `save_directory`: cannot write in the directory ro: Permission denied (os error 13)
microrti: invalid setting `save_directory`: cannot create the directory ro/saves: cannot write in ro: Permission denied (os error 13)
microrti: invalid setting `save_directory`: afile is not a directoryThe file name is made of the federation execution name and the label (their letters, digits, - and
_ only, cut to 40 characters), followed by a SHA-256 of both, so a name chosen by a federate never
becomes a path. The RTI writes a temporary file and renames it once complete. A new save with the same
name and label replaces the file; the RTI never deletes a save.
Here a small test federate saved the federation execution Lunch under the label before-lunch, on an
RTI started with --save-directory saves:
INFO microrti::server: federation saves are written to files directory=saves
INFO microrti::save_store: federation save written federation=Lunch label=before-lunch file=saves/Lunch.before-lunch.ed230960cb1bb26d8d774bf739d4f41fee196df8c0fbe4a911460726e07966aa.snapshotThe RTI was then stopped and started again with the same option. The federate created Lunch again with
the same FOM module, joined it under the same federate type and asked for a restore of before-lunch:
INFO microrti::save_store: federation save read federation=Lunch label=before-lunch file=saves/Lunch.before-lunch.ed230960cb1bb26d8d774bf739d4f41fee196df8c0fbe4a911460726e07966aa.snapshotand it received Confirm Federation Restoration Request (success), Federation Restore Begun, Initiate Federate Restore and Federation Restored. A restore needs the same situation as at the save: the federation execution created with the same FOM modules, and as many federates of each federate type joined.
Since version 0.5.0 a save file ends with a checksum, a CRC-32 of every byte before it, and the RTI
checks it before it decodes anything. The format number went from 7 to 8 with it, so a save written by
a 0.4 server cannot be restored by a 0.5 one: keep the old server, or save again, if you need it. A
restore is refused through Confirm Federation Restoration Request when the label was never saved, when
the RTI has no save_directory and was restarted since the save, and when the file cannot be read: cut
short, changed after it was written, or written in another save format. That callback carries no reason,
so the RTI logs one in a warning, with the federate that asked and the label. Here, in order, the restore
of a label that was never saved, of before-lunch after its file was cut to 1 000 bytes, after one bit
of it was flipped, and from a file written by MicroRTI 0.4.1:
WARN microrti::service: federation restore failed session=a1bd121be94d42b2 federation=Lunch federate=HLAfederate-1 label=after-lunch reason=federation execution 'Lunch' has no save labelled 'after-lunch'
WARN microrti::service: federation restore failed session=24d382077b684c39 federation=Lunch federate=HLAfederate-1 label=before-lunch reason=not a readable snapshot: the checksum does not match the content, the snapshot is damaged (CRC-32 83f35154, recorded 7461636f)
WARN microrti::service: federation restore failed session=064a0694a56a81a2 federation=Lunch federate=HLAfederate-1 label=before-lunch reason=not a readable snapshot: the checksum does not match the content, the snapshot is damaged (CRC-32 502a6f09, recorded 237e05c9)
WARN microrti::service: federation restore failed session=74e3efae0cb75405 federation=Lunch federate=HLAfederate-1 label=before-lunch reason=not a readable snapshot: format version 7 instead of 8The checksum catches accidental damage, such as a bad copy or a change by hand. It does not prove who wrote the file: anyone who can write in the directory can write a save the RTI accepts, so give the directory the same protection as the RTI itself.
A save that cannot be written ends with Federation Not Saved, reason RTI_UNABLE_TO_SAVE, and a warning
in the log:
WARN microrti::save_store: cannot write the federation save federation=Lunch label=before-lunch file=saves/Lunch.before-lunch.ed230960cb1bb26d8d774bf739d4f41fee196df8c0fbe4a911460726e07966aa.snapshot error=Permission denied (os error 13)The files hold the RTI’s side only. Each federate saves and restores its own state when the RTI tells it to.
FOM modules named by URL
Create Federation Execution and Join Federation Execution take FOM modules, and Create also takes a MIM.
Over the Federate Protocol a federate gives each module in one of three ways (12.13.3.3): its content, a
Zip archive of it, or a URL. The MicroRTI clients send the content: FomModule::file in Rust and a path
in Python read the file on the federate’s machine. A federate that names a module by URL instead
(FomModule::url in Rust, FomModule.url in Python, or Pitch FedProClient when it cannot find the file
itself) has the RTI read it. Four keys decide what the RTI reads and how:
| Key | Option | Default | Meaning |
|---|---|---|---|
fom_urls | --fom-urls | "all" | "all" reads every file:, http: and https: URL, wherever it leads; "none" reads none, and federates send the content |
fom_url_directory | --fom-url-directory | none | reads only the regular files of this directory, named by file: URLs; cannot be set together with fom_urls |
fom_url_timeout | --fom-url-timeout | 30 | seconds that all the modules one call names by URL may take together, from the wait for a free reader to the end of the last download; at most 3600, fractions allowed |
fom_url_root_certificates | --fom-url-root-certificates | none | PEM file of the certificates that https: servers are verified against, in place of the trust store of the system |
A command line option replaces the choice of the file: --fom-urls none on a RID that sets
fom_url_directory gives fom_urls = "none", and the reverse works too. Giving both options on one
command line is an error.
Every URL (the default)
By default the RTI reads what the URL names: a file of its own machine, or a document that it downloads.
The log says so at start, as an info line on a loopback listener and as a warning on a listener that
other hosts can reach (see Install and run the RTI), and
check-config prints:
fom_urls = "all"
# FOM modules and MIMs named by file:, http: or https: URL are read wherever they are: restrict with fom_urls = "none" or fom_url_directory
fom_url_timeout = 30
# no fom_url_root_certificates: https servers are verified against the trust store of the systemA designator must be a URL with one of the three schemes. A file name or a path alone is refused, and so
is a file: URL of a relative path, since there is no directory it could be relative to:
CouldNotOpenFOM: could not open FOM module 'Chat.xml': not a URL: write a file:, http: or https: URL, or send the content of the module
CouldNotOpenFOM: could not open FOM module 'file:Chat.xml': the file URL names a relative path: write the absolute path, as in file:///directory/module.xmlA Rust federate that created a federation execution with FomModule::url got these answers from an RTI
with the default settings (the directory /srv/fom stands for the one used in the test, and a Python
http.server served the files of that directory on port 58302):
| Designator | Result |
|---|---|
file:///srv/fom/Chat.xml | read |
http://127.0.0.1:58302/Chat.xml | downloaded and read |
Chat.xml, /srv/fom/Chat.xml | CouldNotOpenFOM: not a URL: ..., as above |
file:Chat.xml | CouldNotOpenFOM: the file URL names a relative path: ..., as above |
file:///srv/fom/Missing.xml | CouldNotOpenFOM: No such file or directory (os error 2) |
file:///etc/hosts | ErrorReadingFOM: not a well-formed XML document at line 1, column 1; the RTI quotes nothing of a module it read by URL |
file://fileserver/share/Chat.xml | CouldNotOpenFOM: the file URL names the host 'fileserver', which is not the RTI host |
http://127.0.0.1:58302/Missing.xml | CouldNotOpenFOM: the server answered with the HTTP status 404 |
http://127.0.0.1:1/Chat.xml | CouldNotOpenFOM: the connection failed: connection refused |
https://localhost:58481/Chat.xml, a server whose certificate the RTI does not trust | CouldNotOpenFOM: the certificate of the server is not trusted, or not valid for its name |
ftp://127.0.0.1/Chat.xml | CouldNotOpenFOM: the URL scheme 'ftp' is not supported: the RTI reads file:, http: and https: URLs |
An answer never quotes what the RTI read: an error in a document read by URL gives its line and column,
not its content. The full message goes to the log at debug, in a line the module named by URL in full. At info the log has one line per call that reads URLs:
INFO microrti::service: reading the FOM modules named by URL session=361680123a34b246 service="Create Federation Execution" count=1 urls=http://127.0.0.1:58302/Chat.xmlA user name and password written in a URL (http://user:secret@host/...) are masked as *** there, in
the exceptions (could not open FOM module 'http://***@127.0.0.1:1/Chat.xml') and in the MOM. The RTI
connects to http: and https: servers directly: it does not use the proxy settings of the environment
(HTTP_PROXY and the like). It follows at most 5 redirections, never from https: to http:, and
checks an https: server against the trust store of the system, unless fom_url_root_certificates
names other certificates. With a certificate authority made for the test, given as
--fom-url-root-certificates ca.pem, a module served over https: with a certificate it had signed was
read.
Limits on reading
Reading by URL is bounded, and it never holds up the RTI: other federates are served while a call waits for its modules.
- One call reads at most 64 URLs. A Create Federation Execution that named 65 was refused as a whole:
CouldNotOpenFOM:more than 64 modules named by URL in one call: this one is not read, for the 65th. - A module read by URL may have at most 8 MiB (8 388 608 bytes), and all the modules of one call 16 MiB
together. A larger one is
ErrorReadingFOM, here a file of 9 MiB:the module is larger than 8388608 bytes. A module sent by content, or as a Zip archive, may have up to 64 MiB, also once unzipped. - All the modules of one call share one time limit,
fom_url_timeout. With--fom-url-timeout 2and a server that accepted the connection but never answered, Create Federation Execution failed after 2.02 seconds withCouldNotOpenFOM:no answer within the time limit of the call (2s). - The RTI reads for at most 8 calls at once. The others wait for a free reader, within their own time limit. One federate can therefore keep the 8 readers busy and make the others wait until their limit; there is no limit per federate or per address.
Calls of one federate are carried out in order, so a call that waits for its modules also delays the next call of that federate.
No URL
fom_urls = "none" (or --fom-urls none) refuses every module named by URL, and every federate has to
send its modules by content. This was the default of versions 0.4.0 and 0.4.1. The answer is the same
for every designator:
CouldNotOpenFOM: could not open FOM module 'http://127.0.0.1:58302/Chat.xml': the RTI reads a module named by URL only from the files its operator makes available, and this URL names none of them; send the content of the module insteadThe log says at start:
INFO microrti::server: FOM modules and MIMs named by URL are refused, federates send their contentOne directory
To let federates name modules that live next to the RTI, and nothing else, put the files in one directory and give it to the RTI:
fom_url_directory = "foms"or --fom-url-directory foms on the command line. The directory must exist. The RTI then reads the
regular files in that directory and its subdirectories, named by file: URLs. A relative URL, such as
file:Chat.xml, is relative to the directory, not to the directory the RTI was started from. An
absolute one must lead into the directory. http: and https: URLs are refused. With the RTI started
with --fom-url-directory /srv/fom, the same federate got:
| Designator | Result |
|---|---|
file:Chat.xml, file:sub/Chat.xml | read from /srv/fom/Chat.xml and /srv/fom/sub/Chat.xml |
file:///srv/fom/Chat.xml, the absolute URL of the same file | read |
Chat.xml | CouldNotOpenFOM: not a URL: ... |
file:../microrti.toml, file:///etc/hosts, file:Missing.xml, file:hosts.xml (a symbolic link to /etc/hosts), file:sub (a directory), http://127.0.0.1:58302/Chat.xml | CouldNotOpenFOM with the message of fom_urls = "none" above |
file:notes.txt, a text file in the directory | ErrorReadingFOM: not a well-formed XML document at line 1, column 1; ... |
A path with .., a symbolic link that leads out of the directory, a directory, a file the RTI cannot
read and a file that does not exist all get the same answer, so a federate does not learn whether a file
is there or where the directory is. A hard link in the directory is read like any of its files, so keep
the directory for FOM modules, with save_directory and service_report_directory outside it.
check-config prints the key and ends with a comment that names the directory with every symbolic link
resolved, and the start of the log has the same path in the directory field:
# FOM modules and MIMs named by file: URL: only the regular files in /srv/fom are readINFO microrti::server: FOM modules and MIMs named by file: URL are read from this directory only directory=/srv/fomMistakes in these settings
Each of these stops microrti and check-config with exit status 2:
microrti: invalid setting `fom_urls`: `some` is not accepted: all (every file, http and https URL) or none; to read the files of one directory, set fom_url_directory instead
microrti: invalid setting `fom_urls`: cannot be combined with fom_url_directory, which reads the files of one directory only: choose one
microrti: invalid setting `fom_url_directory`: the value is empty: name a directory, or leave the key out so that fom_urls decides
microrti: invalid setting `fom_url_directory`: nothere is not a directory the RTI can use: No such file or directory (os error 2)
microrti: invalid setting `fom_url_timeout`: 0 is not a time in seconds greater than zero
microrti: invalid setting `fom_url_timeout`: 3601 seconds is beyond the limit of 3600 seconds
microrti: invalid setting `fom_url_root_certificates`: Chat.xml: no PEM certificateModules sent by content or as a Zip archive are read as before, whatever these settings say. An RTI
inside a process (EmbeddedRti, see An RTI inside your process) reads the
same URLs by default, and has a method to restrict them. TLS and
authorisation says when to restrict the
server.
Logging
The log goes to the standard error. log_level is error, warn, info (the default), debug or
trace. At info you see listeners, sessions opened, closed and lost, federation executions created
and destroyed, federates joined, resigned and lost (by federate name and federate type), federation saves
written and read, the URLs of the FOM modules a call reads, and failed TLS handshakes with the address of
the peer. The same handshake failure from
the same address is logged at info once a minute; its repetitions within the minute are debug lines
with repeated=true. Services refused by the authorisation service and federation restores that failed
are warnings, with the address of the peer or the reason, so warn keeps them.
Watch and operate a federation has examples of each.
debug adds the repeated TLS handshake failures, the messages of the TLS library (target rustls; its
own detailed messages are at trace), and every service call that raised an exception, which helps while
you write a federate:
DEBUG microrti::service: service raised an exception session=8853f96d9aee8026 service="Destroy Federation Execution" exception=FederatesCurrentlyJoined details=federation execution 'Chat' has joined federates: aliceThe environment variable RUST_LOG, when set, takes over and selects a level per module. This command
keeps the RTI’s own lines at info and shows only warnings and errors from the Federate Protocol layer:
RUST_LOG=microrti=info,microrti_fedpro=warn micrortiApart from the log, the RTI writes one listening on <address> line per listener on the standard
output once it accepts connections. Scripts read the port from there when they start the RTI on port 0:
listening on tcp://0.0.0.0:15164
listening on ws://0.0.0.0:8080A thread of its own writes the log, so the RTI never waits for it. If nobody reads the standard error
(a pipe whose reader is stuck, for example), up to 4096 lines wait; beyond that, lines are dropped and the
federates are served as usual. At shutdown the RTI logs how many were lost, if the stream can be written
again by then. With the log going to a pipe that was not read during 1 000 runs of microrti-cli ping,
the end of the log was:
2026-12-01T20:23:20.133678Z INFO microrti: shutdown requested signal="SIGTERM"
2026-12-01T20:23:20.133952Z INFO microrti::server: RTI stopped
2026-12-01T20:23:20.133970Z INFO microrti: microrti stopped sessions=1001 calls=3003 callbacks=1001
2026-12-01T20:23:20.133999Z WARN microrti: log lines were dropped: the standard error stream was not read fast enough lost=1842Watch and operate a federation explains the log lines one by one.
TLS
Three keys give the tls and wss listeners their certificate:
| Key | Meaning |
|---|---|
tls_certificate_chain | PEM file with the certificate chain, leaf certificate first |
tls_private_key | PEM file with its private key, not encrypted (PKCS#8, PKCS#1 or SEC1; RSA, ECDSA on P-256 or P-384, or Ed25519) |
tls_self_signed | true to generate a certificate at every start: encryption without authentication of the RTI |
Give either the first two or the third. The leaf certificate must be X.509 version 3, and an elliptic
curve key must name its curve. check-config and the start of the RTI check that TLS can use both files
and say what to change when it cannot. TLS and authorisation shows how to make
a certificate, the errors you may meet, and what the federates need.
Authorisation: the keys handed to the engine
The [authorization] table goes to the RTI engine itself (4.1.7, 12.5). Three of its keys are the
engine’s settings, and two more tell the server where to read the password from:
| Key | Default | Meaning |
|---|---|---|
enabled | false | require authorisation at Connect, Create, Destroy and Join |
authorizer | "HLAauthorizer" | the authorisation service; the predefined HLAauthorizer of 12.6 is the only one |
password | none | the global password, written in the file |
password_env | none | the name of an environment variable of the RTI process that holds the password |
password_file | none | a file that holds the password; a line end at its end is not part of it |
Give the password in exactly one of the three ways; two at once is an error. With enabled = true and no
password the RTI refuses to start, because the HLAauthorizer with an empty password would let nobody
in. The details, and what a refused federate sees, are on TLS and authorisation.
Command line options
Each option overrides one setting of the file. There is no option for service_report_directory, and
none for the password itself: on the command line you only say where to read it, which keeps it out of
the process list. This is the full help of microrti 0.5.0:
microrti --helpmicrorti: an HLA 4 Run-Time Infrastructure (IEEE Std 1516.1-2025).
Hosts one RTI and serves federates over the standard HLA Federate Protocol: plain TCP, TLS 1.3,
WebSocket and secure WebSocket. Without any option it listens for TCP on 0.0.0.0:15164.
The settings come from a RID file in TOML (see microrti.example.toml for every key) and from the
options below, which take precedence over the file. The log goes to the standard error stream; when
nobody reads that stream, log lines are dropped rather than the federates kept waiting, and their number
is logged at shutdown (unless the stream is still blocked then: the RTI does not wait for it). The
addresses the RTI listens on are also printed to the standard output, one `listening on <address>` line
per listener. Ctrl-C or SIGTERM stops the RTI in an orderly way.
Usage: microrti [OPTIONS] [COMMAND]
Commands:
run Start the RTI (the default when no command is given)
check-config Validate a RID and print the effective settings, without starting anything
help Print this message or the help of the given subcommand(s)
Options:
-c, --config <FILE>
RID file (TOML); without it the defaults apply
[env: MICRORTI_CONFIG=]
-l, --listen <[TRANSPORT://]IP[:PORT]>
Listen on this address instead of the listeners of the RID; may be given several times. TRANSPORT is tcp (default), tls, ws or wss; a missing port is the standard port of the transport (15164, 15165, 80, 443); port 0 lets the system choose
--tls-cert <FILE>
PEM file with the certificate chain of the tls and wss listeners (leaf certificate first)
--tls-key <FILE>
PEM file with the private key of the certificate
--tls-self-signed
Generate a self-signed certificate at start: encryption without authentication of the RTI
--rti-timeout-heart <SECONDS>
RTI_TIMEOUT_HEART: a session whose federate was silent for this long becomes inactive and may be resumed [default: 180]
--rti-timeout-purge <SECONDS>
RTI_TIMEOUT_PURGE: a session inactive for this long is purged and its federate lost [default: 600]
--max-message-size <BYTES>
Largest message accepted from a federate [default: 67108864]
--tick-period-ms <MILLISECONDS>
Period of the RTI's wall-clock driven work [default: 100]
--save-directory <DIRECTORY>
Write federation saves to files in this directory, created if missing, and restore them from there, also after a restart of the RTI; without it they are kept in memory and lost when the RTI stops
--fom-urls <all|none>
Which FOM modules and MIMs that federates name by URL the RTI reads: all (every file:, http: and https: URL, wherever it leads; the proxy settings of the environment are not followed) or none (federates send their content). Restrict it when federates outside a trusted network can reach the RTI [default: all]
--fom-url-directory <DIRECTORY>
Read the FOM modules and MIMs that federates name by file: URL from this directory only (a relative URL is relative to it; nothing outside it is read, also through .. or a symbolic link); http: and https: URLs are then refused
--fom-url-timeout <SECONDS>
Longest time the FOM modules one call names by URL may take, all of them together: the wait for a reader, the files, the connections and the downloads; at most 3600 [default: 30]
--fom-url-root-certificates <FILE>
PEM file of the certificates that https: servers of FOM modules are verified against, instead of the trust store of the system
--authorization <true|false>
Require authorization (the HLAauthorizer with a global password) or switch it off
[possible values: true, false]
--password-env <VARIABLE>
Take the password from this environment variable
--password-file <FILE>
Take the password from this file (the line end at its end is not part of the password)
--log-level <LEVEL>
error, warn, info, debug or trace [default: info]; RUST_LOG, when set, selects per module
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version
Examples:
microrti TCP on 0.0.0.0:15164, no authorization
microrti --config /etc/microrti.toml settings from a RID file
microrti -l tcp://127.0.0.1:0 loopback only, port chosen by the system
microrti -l tcp://0.0.0.0:15164 -l tls://0.0.0.0:15165 --tls-cert chain.pem --tls-key key.pem
microrti -l wss://[::]:8443 --tls-self-signed
microrti --authorization true --password-env RTI_PASSWORD
microrti --save-directory saves federation saves kept in files, across restarts
microrti --fom-urls none no FOM module named by URL is read: federates send the content
microrti --fom-url-directory /srv/foms FOM modules named by file: URL read from this directory only
microrti check-config microrti.toml validate a RID and print the effective settings
A federate reaches the RTI with the RTI address tcp://HOST:15164 (or tls://, ws://, wss://).Ctrl-C or SIGTERM stops the RTI. Federates still joined at that moment are lost for their federation
execution, and federation executions are not kept from one run to the next. Federation saves are, when
save_directory is set.
Common setups
Each file below was checked with microrti check-config and started.
Local development
Here the federates and the RTI run on one machine, nothing is reachable from the network, and the
debug log shows every exception your federate causes:
# dev.toml: an RTI for the federates of this machine only
log_level = "debug"
[[listener]]
transport = "tcp"
address = "127.0.0.1:15164"microrti --config dev.tomlFederates connect with the default address, tcp://localhost:15164. For a quick session you do not
need a file at all: microrti --listen tcp://127.0.0.1:15164 --log-level debug is the same.
A shared lab server
This is one RTI for the machines of a lab network, on every interface, with TCP for native federates and WebSocket for those that need it. Quiet federates are dropped sooner than with the defaults, and service report logs go to a fixed directory:
# lab.toml: one RTI for the machines of a lab network
log_level = "info"
# A federate that sends nothing for 90 s becomes inactive; 300 s later it is lost.
rti_timeout_heart = 90
rti_timeout_purge = 300
# MOM service report logs (11.5.2), one file per federate that asks for them.
service_report_directory = "/var/lib/microrti/service-reports"
# Federates send their FOM modules: the RTI reads no file and no address for them.
fom_urls = "none"
[[listener]]
transport = "tcp"
address = "0.0.0.0:15164"
[[listener]]
transport = "ws"
address = "0.0.0.0:8080"Federates on other machines use the RTI address tcp://rti.example.org:15164 or
ws://rti.example.org:8080, with the name or address of the server. With fom_urls = "none", no
federate can have the RTI read a file of the server or fetch an address of the lab network, and the RTI
starts without the warning about URLs. Anything on the network can still connect to this RTI and read
what goes through it. If that is not acceptable, add TLS and a password as shown in
TLS and authorisation.
WebSocket behind a reverse proxy
When federates must come in through HTTPS on port 443, put a reverse proxy in front of a ws listener
that only the proxy can reach:
# proxy.toml: WebSocket only, behind a reverse proxy on the same machine
fom_urls = "none"
[[listener]]
transport = "ws"
address = "127.0.0.1:8080"The proxy terminates TLS and forwards the WebSocket upgrade to 127.0.0.1:8080. The listener is on the
loopback interface, so the RTI gives no warning about FOM modules named by URL at start, yet the
federates come from the network through the proxy: hence fom_urls = "none". The RTI accepts the
WebSocket handshake on any request path, so the proxy can pass a path such as /hla through unchanged,
and federates use an address like wss://rti.example.org/hla. The MicroRTI clients and microrti-cli
accept a path in ws:// and wss:// addresses; this ping goes straight to the listener with a path:
microrti-cli --rti ws://127.0.0.1:8080/hla pingws://127.0.0.1:8080/hla: connected in 14.515 ms, service round trip 0.426 ms, 15.888 ms in allThe proxy configuration itself depends on the proxy you use. It must forward WebSocket upgrade requests,
and its idle timeout should be longer than the heartbeat interval of the federates (60 seconds by
default). A proxy that closes quiet connections sooner makes federates reconnect and resume their
sessions over and over. The RTI sees every federate as coming from the proxy, so the MOM attribute
HLAfederateHost holds the proxy’s address.
Next steps
- TLS and authorisation: certificates and passwords.
- Watch and operate a federation:
microrti-cliand the server’s log. - Install and run the RTI, if you have not started it yet.