PubSubRT - an industrial pub/sub server

Overview

PubSubRT - an industrial real-time pub/sub server

What is PSRT

PSRT is a pub/sub real-time telemetry protocol, optimized for industrial needs: providing low latency, dealing with slow channels and large payloads.

PSRT can process 100K+ messages on a single node with very low latencies (<1ms). Speeds are reasonable (1K+ ops/sec) even with enormous (1MB+) payloads.

Topic subscriptions in PubSubRT are processed with B-tree algorithms, which allows the server to handle hundred thousands subscriptions without any speed loss.

Why not MQTT?

We love MQTT. And we use MQTT a lot. There are cases where MQTT ideally fits requirements. However, for some it does not satisfy our speed and reliability needs and produces additional overhead. That is why we invented PSRT and use it as the primary protocol for EVA ICS in large enterprise setups.

What is the difference?

  • PSRT is the protocol, optimized for large (65K+) message payloads
  • No QoS - all messages are always delivered to subscribers only once, so consider it is always QoS=2 if use MQTT measurements
  • No retain topics. Retains usually require disk writes, which produce additional overhead
  • No OP-ACK loops. All control operations are fast, synchronous and atomic
  • Two TCP sockets: one for control ops and the second one for incoming messages. This makes clients a bit more complicated, but allows to process incoming messages without any extra overhead. Additionally, with two sockets control op acknowledgements and incoming message data can be mixed, which is important when large messages are processed on slow channels
  • Devices and nodes, which do not need subscriptions, can use either a single TCP control socket or work without any connection established, using UDP datagrams with or without acknowledge from the server
  • PSRT is almost 100% logically compatible with MQTT, so software can be switched to it and vice versa with only a couple of lines of code

What is the same?

PSRT is logically the same as MQTT: same format for topics, same format for topic masks etc:

  • path/to/topic - an individual topic (subscribe / publish)
  • path/to/# - all topics under the specified path (subscribe)
  • path/+/some/+/topic - all topics matching the mask ("+" for any subtopic)

About the repository

This repository contains PubSubRT server, implementing PSRT (open-source version without the cluster module), command-line client and Rust client library. The cluster code is not open-source, but may be opened in the future as well.

Other repositories:

Installation

Use binaries from https://github.com/alttch/psrt/releases. For Debian/Ubuntu and other deb-based distros, *.deb packages can be used.

Build from source

  • Install Rust
  • Build the server and cli:
cargo build --features server,cli --release

Configuration files

If installed manually, get configuration files from https://github.com/alttch/psrt/tree/main/make-deb/etc/psrtd or use files from test-configs directory (need to be edited before use).

If installed from deb-package, configuration files are stored in /etc/psrtd directory.

Problems

If any problems occur, try running psrtd with -v argument to get verbose logging in terminal.

Authentication

PubSubRT uses the standard htpasswd format, use any htpasswd-compatible tool (with -B flag for bcrypt).

Statistical data

Overview (web interface / API)

Users with admin rights can obtain statistical data using a web browser (by default, at http://localhost:2884).

The data can also be obtained in JSON for 3rd-party apps at:

curl http://localhost:2884/status

If the anonymous user has no admin rights, URI requires login and password (HTTP basic auth).

Most used topics

By executing psrt-cli with --top argument, the most used topics can be monitored in console in real-time. Use "s" key to switch sorting between message count and bytes.

Cargo crate

https://crates.io/crates/psrt

Protocol specifications

https://github.com/alttch/psrt/blob/main/proto.md

Enterprise version

Download packages from https://get.eva-ics.com/psrt-enterprise/

Cluster setup instructions

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 upper and upper every day.

You might also like...
A Matrix Server Stats bot
A Matrix Server Stats bot

A bot running trough the matrix network to find all rooms.

A standalone libp2p rendezvous server binary.

Standalone Rendezvous Server A standalone libp2p rendezvous server binary. Usage Run the rendezvous_server: rendezvous_server --secret-file PATH-TO-S

Lightning Optimizing Opening Server

Lightning Optimizing Opening Server (loptoš ~ naughty boy/brat/hooligan/..., not to be confused with lopta == ball) WARNING: ULTRA-EXPERIMENTAL SOFTWA

pam-send-slack-message is a program that publishes messages on slack when a linux server is accessed through ssh.

pam-send-slack-message pam-send-slack-message is a program that publishes messages on slack when the linux server is accessed through ssh. Installatio

A simple tcp server that written in rustlang
A simple tcp server that written in rustlang

rust_tcp A simple tcp server that written in rustlang How to build In the root dir cargo run Then you can do a test by using telnet as a client telne

Simple project to test grpc between ruby (client) and rust (server)

grpc-example Simple project to test grpc between ruby (client) and rust (server). Usage To simplify a lot this project uses docker and docker compose

Proxy sentry request to a sentry server using a tunnel/proxy endpoint

Sentry Tunnel This is a proxy that forwards tunneled sentry requests to the real sentry server. The implementation is based on the explanation provide

A high performence Socks5 proxy server with bind/reverse support implementation by Rust.

rsocx A high performence Socks5 proxy server with bind/reverse support implementation by Rust Features Async-std No unsafe code Single executable Linu

A tcp proxy server/client which exchange the data in temp files

ftcp A tcp proxy server/client which exchange the data in temp files 通过在临时文件中交换数据来进行TCP代理的一个服务端/客户端 学校内网中有针对教学楼的防火墙导致教室电脑难以上网( 但学校内建有公共ftp服务器,因此就有了这个借

Releases(v0.1.30)
Owner
Altertech
Altertech
axum-server is a hyper server implementation designed to be used with axum framework.

axum-server axum-server is a hyper server implementation designed to be used with axum framework. Features Conveniently bind to any number of addresse

null 79 Jan 4, 2023
Jex Compiler Server - Server that runs Jex code

Server that compiles and runs Jex code.

furetur 3 Nov 18, 2021
Dav-server-rs - Rust WebDAV server library. A fork of the webdav-handler crate.

dav-server-rs A fork of the webdav-handler-rs project. Generic async HTTP/Webdav handler Webdav (RFC4918) is defined as HTTP (GET/HEAD/PUT/DELETE) plu

messense 30 Dec 29, 2022
A simple web server(and library) to display server stats over HTTP and Websockets/SSE or stream it to other systems.

x-server-stats A simple web server(and library) to display server stats over HTTP and Websockets/SSE or stream it to other systems. x-server(in x-serv

Pratyaksh 11 Oct 17, 2022
DNS Server written in Rust for fun, see https://dev.to/xfbs/writing-a-dns-server-in-rust-1gpn

DNS Fun Ever wondered how you can write a DNS server in Rust? No? Well, too bad, I'm telling you anyways. But don't worry, this is going to be a fun o

Patrick Elsen 26 Jan 13, 2023
QUIC proxy that allows to use QUIC to connect to an SSH server without needing to patch the client or the server.

quicssh-rs ?? quicssh-rs is a QUIC proxy that allows to use QUIC to connect to an SSH server without needing to patch the client or the server. quicss

Jun Ouyang 18 May 5, 2023
A telnet chat server written in Rust, running on Lunatic.

Lunatic.chat A telnet chat server written in Rust, running on Lunatic. If you just would like to try it out, join the hosted version with: # US server

Lunatic 101 Jan 2, 2023
server security proxy write by Rust

server-security-proxy server security proxy write by Rust how to use config toml file

baoyachi. Aka Rust Hairy crabs 3 May 24, 2021
Imagine your SSH server only listens on an IPv6 address, and where the last 6 digits are changing every 30 seconds as a TOTP code...

tosh Imagine your SSH server only listens on an IPv6 address, and where the last 6 digits are changing every 30 seconds as a TOTP code... Inspired fro

Mark Vainomaa 409 Oct 23, 2022
A working demo of RustDesk server implementation

A working demo of RustDesk server implementation This is a super simple working demo implementation with only one relay connection allowed, without NA

RustDesk 461 Jan 1, 2023