alttch/elbus

ELBUS - Rust-native IPC broker

ELBUS is a rust-native IPC broker, written in Rust/Tokio, inspired by

<#404>

What is ELBUS

NATS, ZeroMQ and Nanomsg. ELBUS is fast, flexible and very easy to use.

The library can be embedded in any Rust project or be used as a standalone server.

NOTE: ELBUS is not officially released yet and SDK can be changed at any time without any backward compatibility. ELBUS (stands actually for "EVA ICS Local Bus") is the key component of EVA ICS v4, which is going to be released in 2022-2023.

The name "ELBUS" is also only the working one, after the official release the bus will be renamed, as well as its crates, bindings and modules.

Documentation

Available at https://elbus.readthedocs.io/

Inter-process communication

The following communication patterns are supported out-of-the-box:

  • one-to-one messages
  • one-to-many messages
  • pub/sub

The following channels are supported:

  • async channels between threads/futures (Rust only)
  • UNIX sockets (local machine)
  • TCP sockets

In addition to Rust, ELBUS has also bindings for the following languages:

  • Python (sync): https://pypi.org/project/elbus/
  • Python (async): https://pypi.org/project/elbus-async/
  • JavaScript (Node.js): https://www.npmjs.com/package/elbus

Rust crate: https://crates.io/crates/elbus

Client registration

A client should register with a name "group.subgroup.client" (subgroups are optional). The client's name can not start with dot (".", reserved for internal broker clients) if registered via IPC.

The client's name must be unique, otherwise the broker refuses the registration.

Broadcasts

Broadcast messages are sent to multiple clients at once. Use "?" for any part of the path, "*" as the ending for wildcards. E.g.:

"?.test.*" - the message is be sent to clients "g1.test.client1", "g1.test.subgroup.client2" etc.

Topics

Use MQTT-format for topics: "+" for any part of the path, "#" as the ending for wildcards. E.g. a client, subscribed to "+/topic/#" receives publications sent to "x/topic/event", "x/topic/sub/event" etc.

RPC layer

An optional included RPC layer for one-to-one messaging can be used. The layer is similar to JSON RPC but is optimized for byte communications.

Security and reliability model

ELBUS has a very simple optional security model in favor of simplicity and speed. Also, ELBUS is not designed to work via unstable connections, all clients should be connected either from the local machine or using high-speed reliable local network communications.

If you need a pub/sub server for a wide area network, try PSRT.

Examples

See examples folder.

Build a stand-alone server

The "rpc" feature is optional. When enabled for the server, it allows to initialize the default broker RPC API, spawn fifo servers, send broker announcements etc.

Some numbers

Benchmarks

CPU: i7-7700HQ

Broker: 4 workers, clients: 8, payload size: 100 bytes, local IPC (single unix socket), totals:

stage iters/s
rpc.call 126_824
rpc.call+handle 64_694
rpc.call0 178_505
send+recv.qos.no 1_667_131
send+recv.qos.processed 147_812
send.qos.no 2_748_870
send.qos.processed 183_795

About the authors

Bohemia Automation / Altertech is a group of companies with 15+ years of experience in the enterprise automation and industrial IoT. Our setups include power plants, factories and urban infrastructure. Largest of them have 1M+ sensors and controlled devices and the bar raises higher and higher every day.

Versions

Find the latest versions by id

v0.2.8 - Jun 12, 2022

  • primary_sender() method in frames and events

v0.2.3 - Jun 11, 2022

  • stability improvements

v0.2.2 - Jun 09, 2022

  • advanced ACLs

v0.2.0 - May 29, 2022

  • added simple AAA for semi-trusted remote clients

Information - Updated Jul 28, 2022

Stars: 42
Forks: 1
Issues: 0

Repositories & Extras

Rocket is an async web framework for Rust with a focus on usability, security,

Visiting localhost:8000/hello/John/58, for example, will trigger the hello

Rocket is an async web framework for Rust with a focus on usability, security,

macOS/iOS Security framework for Rust

MIT license (LICENSE-MIT or

macOS/iOS Security framework for Rust
Actix

2.1K

Curated examples using the Actix ecosystem

Zero2prod : Source code of zero to production series Triox : A free file hosting server that focuses on speed, reliability and security

Curated examples using the Actix ecosystem

libdiffuzz: security-oriented alternative to Memory Sanitizer

This is a drop-in replacement for OS memory allocator that can be used to detect uses of uninitialized memory

libdiffuzz: security-oriented alternative to Memory Sanitizer

Transparent endpoint security

Block and detect advanced attacks

Transparent endpoint security

A WIP Rust implementation of Messaging Layer Security based on draft 9+

Messaging Layer Security based on draft 9+

A WIP Rust implementation of Messaging Layer Security based on draft 9+

Rust Language Security

execrices: RUSTSEC-2021-0001

Rust Language Security

No security audit has been performed

There are currently 3 interesting things

No security audit has been performed

security-keys-rust

Many thanks to the authors of the openpgp-card Rust crate

security-keys-rust

Owlyshield open source security platform

An OSS security platform written in rust with security threat detection

Owlyshield open source security platform

No security audit has been performed

There are currently 3 interesting things

No security audit has been performed

Parse and validate Web Content-Security-Policy level 3

This function parses a CSP string into a data structure, and provides a bunch of functions you can call on it (basically all of the...

Parse and validate Web Content-Security-Policy level 3
Facebook Instagram Twitter GitHub Dribbble
Privacy