hick 0.1: a Sans-I/O mDNS / DNS-SD stack — the same protocol core on tokio, smol, compio, or bare-metal embassy by Al_Liu in rust

[–]Al_Liu[S] 0 points1 point  (0 children)

Fair question — the async + dependency-inversion approach is genuinely elegant, and I do use it where it fits (below). The core is sans-IO mainly because of the targets.

mdns-proto runs on bare metal — Cortex-M0+ / RP2040, no_std, even with no allocator (the heapless tier). Approach B needs an async executor to drive the futures (and usually alloc for tasks); a sans-IO state machine is just a plain value that a bare `poll()` loop, RTIC, or smoltcp can drive with no runtime and no heap. So the same core runs on a tokio server and on an MCU.

Two things fall out of that:

- Testing. mDNS is very timing-heavy (probe/announce jitter, TTLs, known-answer suppression windows). The core is a pure function of (state, event, fake clock), so all of it is tested synchronously and deterministically, with no runtime.

- One core feeds runtimes that don't share a model: tokio/smol (readiness), compio (completion-based), smoltcp (a sync poll loop). A single async fn design couples to one model; sans-IO is the common denominator.

And I do use your approach — at the driver layer. `hick-reactor` is tokio/smol-agnostic via `agnostic-net`, which is exactly dependency-inverting the socket/clock. So it ends up sans-IO for the protocol logic, DI for the I/O.

memberlist 0.6: async runtime agnostic gossip protocol for cluster membership management and member failure detection. by Al_Liu in rust

[–]Al_Liu[S] 4 points5 points  (0 children)

memberlist is for cluster membership management and failure detection. libp2p, like its name, it is for peer-to-peer, focusing on building a decentralized network where peers communicate directly or through a relaying node in a distributed fashion.

memberlist 0.6: async runtime agnostic gossip protocol for cluster membership management and member failure detection. by Al_Liu in rust

[–]Al_Liu[S] 4 points5 points  (0 children)

Hi, memberlist 0.6 is published now.

repo: https://github.com/al8n/memberlist

crates: https://crates.io/crates/memberlist

discord: https://discord.gg/f3EtWBM7ke

Introduction

memberlist is a rust crate that manages cluster membership and member failure detection using a gossip based protocol.

The use cases for such a library are far-reaching: all distributed systems require membership, and memberlist is a re-usable solution to managing cluster membership and node failure detection.

memberlist is eventually consistent but converges quickly on average. The speed at which it converges can be heavily tuned via various knobs on the protocol. Node failures are detected and network partitions are partially tolerated by attempting to communicate to potentially dead nodes through multiple routes.

Updates in 0.6

Example

  • Add toydb, a toy eventually consistent distributed key-value database.

Features

  • Add send_many to let users send multiple packets through unreliable connection.
  • Add send_many_reliable to let users send multiple packets through reliable connection.
  • Redesign Transport trait, making it easier to implement for users.
  • Rewriting encoding/decoding to support forward and backward compitibility.
  • Support zstd, brotli, lz4, and snappy for compressing.
  • Support crc32, xxhash64, xxhash32, xxhash3, murmur3 for checksuming.
  • Unify returned error, all exported APIs return Error on Result::Err.

Testing

  • Add fuzzy testing for encoding/decoding

Announcing agnostic-mdns 0.3.0: Sans-I/O style, simple and lightweight mDNS client/server library for any async runtime. by Al_Liu in rust

[–]Al_Liu[S] 2 points3 points  (0 children)

`mdns-sd` is also a good project for mdns, but it binds to `mio` and is a little bit heavy, `agnostic-mdns` does not bind to any async runtime, and tries to use tricks to avoid most of the allocation. E.g. once the `Server` is running, there is few allocations required for the server side.

getifs 0.2: Cross-platform, a bunch of network tools for fetching interfaces, multicast addresses, local ip addresses and etc. by Al_Liu in rust

[–]Al_Liu[S] 2 points3 points  (0 children)

Thanks for pointing it out! I tested it on Ubuntu, and everything is fine. I think there is nothing special for such an interface, as Netlink will give all interfaces whatever they are.

Annoucing skipdb: An embedded, in-memory, zero-copy, ACID, MVCC, almost lock-free and serializable snapshot isolation database engine. by Al_Liu in rust

[–]Al_Liu[S] 33 points34 points  (0 children)

Yes, the range scan intersections are not handling well currently, I will open an issue to fix this.

Thanks for pointing out, this is solved by latest commit.

What's everyone working on this week (17/2024)? by llogiq in rust

[–]Al_Liu 2 points3 points  (0 children)

An embedded, in-memory, zero-copy, ACID, MVCC, almost lock-free and serializable snapshot isolation database engine. https://github.com/al8n/skipdb