<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ouroboros/src/ipcpd/unicast/dir/dht.c, branch 0.24.0</title>
<subtitle>Ouroboros main repository</subtitle>
<id>https://ouroboros.rocks/cgit/ouroboros/atom?h=0.24.0</id>
<link rel='self' href='https://ouroboros.rocks/cgit/ouroboros/atom?h=0.24.0'/>
<link rel='alternate' type='text/html' href='https://ouroboros.rocks/cgit/ouroboros/'/>
<updated>2026-07-19T09:44:36+00:00</updated>
<entry>
<title>ipcpd: Rework congestion avoidance</title>
<updated>2026-07-19T09:44:36+00:00</updated>
<author>
<name>Dimitri Staessens</name>
<email>dimitri@ouroboros.rocks</email>
</author>
<published>2026-07-05T16:58:37+00:00</published>
<link rel='alternate' type='text/html' href='https://ouroboros.rocks/cgit/ouroboros/commit/?id=d050aea4cd892d71ed7fc78b6c6149a7231db5fc'/>
<id>urn:sha1:d050aea4cd892d71ed7fc78b6c6149a7231db5fc</id>
<content type='text'>
Congestion avoidance is a property of the layer, orthogonal to ARQ
and to flow control: FRCP retransmits and lets the peer pace the
sender, per flow, end-to-end; the IPCP paces path aggregates. Each
signal means one thing: a loss triggers a retransmission, a mark
means congestion, the peer window means a slow receiver. Every flow
is paced by the same rate law whatever its QoS, so a greedy raw
sender shares a bottleneck fairly with a reliable stream.

The unit of control is the (destination address, QoS cube)
aggregate: all flows toward that destination share one controller
and one rate; a start-time fair-queuing pacer divides the rate
across them by deadline instead of blocking the send path, and a
new flow rides the aggregate's estimates at its current rate, with
no probing of its own. Slow start runs once per aggregate.

The congestion signal is a multi-bit magnitude: forwarders mark
packets with their standing queue depth, MAX-combined across hops,
so a packet carries the deepest queue on its path. The receiver
feeds back a time-integral mean over a window that adapts to the
flow's byte rate, measuring a slow flow with the same fidelity as a
fast one. The sender runs AIMD scaled by elapsed wall-clock time,
which makes the steady-state allocation RTT-independent.

The PCI gains one byte: the path capacity as a quarter-log2 code.
Forwarders estimate their egress rate from busy-period drain and
MIN-stamp the byte, the receiver returns the window minimum with
its feedback, and the sender scales its rate floor and additive
slope to the bottleneck (C / 32). A deep cut implies a backlogged
bottleneck and a backlogged bottleneck advertises its capacity, so
the scaled floor is live exactly when recovery needs it: the probe
heals a halving in seconds at any link rate, and the floor bounds
the deepest hole to a factor 32 below the bottleneck.

Signed-off-by: Dimitri Staessens &lt;dimitri@ouroboros.rocks&gt;
Signed-off-by: Sander Vrijders &lt;sander@ouroboros.rocks&gt;
</content>
</entry>
<entry>
<title>ipcpd: Fix NULL deref in DHT cleanup</title>
<updated>2026-07-19T09:44:34+00:00</updated>
<author>
<name>Dimitri Staessens</name>
<email>dimitri@ouroboros.rocks</email>
</author>
<published>2026-07-10T15:09:58+00:00</published>
<link rel='alternate' type='text/html' href='https://ouroboros.rocks/cgit/ouroboros/commit/?id=395c084c54bc57cad618aea430afd06ce24d356b'/>
<id>urn:sha1:395c084c54bc57cad618aea430afd06ce24d356b</id>
<content type='text'>
The dht_kv_find_node_rsp_msg function steals *contacts and NULLs it on
success. When the subsequent msg-&gt;val allocation fails in
dht_kv_find_value_rsp_msg(), the stolen contacts are freed along with
the message, and do_dht_kv_find_value_req() is left with contacts ==
NULL while n_contacts is still positive: its fail_vals loop then
dereferences NULL.

Found by clang static analyzer.

Signed-off-by: Dimitri Staessens &lt;dimitri@ouroboros.rocks&gt;
Signed-off-by: Sander Vrijders &lt;sander@ouroboros.rocks&gt;
</content>
</entry>
<entry>
<title>ipcpd: Store local names before DHT peering</title>
<updated>2026-07-08T09:02:25+00:00</updated>
<author>
<name>Dimitri Staessens</name>
<email>dimitri@ouroboros.rocks</email>
</author>
<published>2026-07-05T16:43:19+00:00</published>
<link rel='alternate' type='text/html' href='https://ouroboros.rocks/cgit/ouroboros/commit/?id=42d3c0735624f692257f570fd986c86beb3e637f'/>
<id>urn:sha1:42d3c0735624f692257f570fd986c86beb3e637f</id>
<content type='text'>
A name registered before the DHT had a peer stayed unpublished until
it neared its expiry deadline. Make a never-stored local value (t_repl
== 0) eligible for replication immediately, and flush replication once
when the worker starts so such names are published as soon as the DHT
is enrolled.

Signed-off-by: Dimitri Staessens &lt;dimitri@ouroboros.rocks&gt;
Signed-off-by: Sander Vrijders &lt;sander@ouroboros.rocks&gt;
</content>
</entry>
<entry>
<title>ipcpd: Fix DHT bootstrap re-seeding</title>
<updated>2026-07-08T09:02:24+00:00</updated>
<author>
<name>Dimitri Staessens</name>
<email>dimitri@ouroboros.rocks</email>
</author>
<published>2026-07-05T16:40:25+00:00</published>
<link rel='alternate' type='text/html' href='https://ouroboros.rocks/cgit/ouroboros/commit/?id=1268d6124a5cbc2cd451e5a1ae16d3a4b7cdc423'/>
<id>urn:sha1:1268d6124a5cbc2cd451e5a1ae16d3a4b7cdc423</id>
<content type='text'>
The bootstrap seeder reported success as soon as the query was
sent. Only skip seeding once the peer is in a bucket, and return
-EAGAIN until it actually appears so the caller keeps retrying rather
than assuming bootstrap completed.

Signed-off-by: Dimitri Staessens &lt;dimitri@ouroboros.rocks&gt;
Signed-off-by: Sander Vrijders &lt;sander@ouroboros.rocks&gt;
</content>
</entry>
<entry>
<title>ipcpd: Fix unused values in unicast IPCP</title>
<updated>2026-02-22T15:04:16+00:00</updated>
<author>
<name>Dimitri Staessens</name>
<email>dimitri@ouroboros.rocks</email>
</author>
<published>2026-02-21T11:05:11+00:00</published>
<link rel='alternate' type='text/html' href='https://ouroboros.rocks/cgit/ouroboros/commit/?id=c9662b47be711c00f013ac4606dc86c9a2ad8201'/>
<id>urn:sha1:c9662b47be711c00f013ac4606dc86c9a2ad8201</id>
<content type='text'>
Use the key in the store operation in the DHT, to avoid static
analyzer seeing it as being set without being used in release builds.

The length of the packet buffer is only used when tracking DT stats,
so should be set within the IPCP_FLOW_STATS guard.

Signed-off-by: Dimitri Staessens &lt;dimitri@ouroboros.rocks&gt;
Signed-off-by: Sander Vrijders &lt;sander@ouroboros.rocks&gt;
</content>
</entry>
<entry>
<title>lib: Add struct llist for lists tracking len</title>
<updated>2026-02-18T06:58:21+00:00</updated>
<author>
<name>Dimitri Staessens</name>
<email>dimitri@ouroboros.rocks</email>
</author>
<published>2026-02-15T11:26:04+00:00</published>
<link rel='alternate' type='text/html' href='https://ouroboros.rocks/cgit/ouroboros/commit/?id=760e17f142eb5cc0f594f1383ae68bb63bebe9ee'/>
<id>urn:sha1:760e17f142eb5cc0f594f1383ae68bb63bebe9ee</id>
<content type='text'>
The DHT uses a struct {struct list_head, size_t len} pattern, which is
also useful in the registry and other places. Having a struct llist
(defined in list.h) with consistent macros for addition/deletion etc
removes a lot of duplication and boilerplate and reduces the risk of
inconsistent updates.

The list management is now a macro-only implementation.

Signed-off-by: Dimitri Staessens &lt;dimitri@ouroboros.rocks&gt;
Signed-off-by: Sander Vrijders &lt;sander@ouroboros.rocks&gt;
</content>
</entry>
<entry>
<title>build: Update copyright to 2026</title>
<updated>2026-02-18T06:54:56+00:00</updated>
<author>
<name>Dimitri Staessens</name>
<email>dimitri@ouroboros.rocks</email>
</author>
<published>2026-02-15T09:21:02+00:00</published>
<link rel='alternate' type='text/html' href='https://ouroboros.rocks/cgit/ouroboros/commit/?id=0d72b59c2964208ea34ce2322978344d7ff1a223'/>
<id>urn:sha1:0d72b59c2964208ea34ce2322978344d7ff1a223</id>
<content type='text'>
Signed-off-by: Dimitri Staessens &lt;dimitri@ouroboros.rocks&gt;
Signed-off-by: Sander Vrijders &lt;sander@ouroboros.rocks&gt;
</content>
</entry>
<entry>
<title>lib: Replace rdrbuff with a proper slab allocator</title>
<updated>2026-01-26T06:50:33+00:00</updated>
<author>
<name>Dimitri Staessens</name>
<email>dimitri@ouroboros.rocks</email>
</author>
<published>2026-01-20T21:25:41+00:00</published>
<link rel='alternate' type='text/html' href='https://ouroboros.rocks/cgit/ouroboros/commit/?id=0ca48453a067c7862f0bb6b85f152da826f59af7'/>
<id>urn:sha1:0ca48453a067c7862f0bb6b85f152da826f59af7</id>
<content type='text'>
This is a first step towards the Secure Shared Memory (SSM)
infrastructure for Ouroboros, which will allow proper resource
separation for non-privileged processes.

This replaces the rdrbuff (random-deletion ring buffer) PoC allocator
with a sharded slab allocator for the packet buffer pool to avoid the
head-of-line blocking behaviour of the rdrb and reduce lock contention
in multi-process scenarios. Each size class contains multiple
independent shards, allowing parallel allocations without blocking.

- Configurable shard count per size class (default: 4, set via
  SSM_POOL_SHARDS in CMake). The configured number of blocks are
  spread over the number of shards. As an example:

  	 SSM_POOL_512_BLOCKS = 768 blocks total
	 These 768 blocks are shared among 4 shards
	       (not 768 × 4 = 3072 blocks)

- Lazy block distribution: all blocks initially reside in shard 0
  and naturally migrate to process-local shards upon first
  allocation and subsequent free operations

- Fallback with work stealing: processes attempt allocation from
  their local shard (pid % SSM_POOL_SHARDS) first, then steal
  from other shards if local is exhausted, eliminating
  fragmentation while maintaining low contention

- Round-robin condvar signaling: blocking allocations cycle
  through all shard condition variables to ensure fairness

- Blocks freed to allocator's shard: uses allocator_pid to
  determine target shard, enabling natural load balancing as
  process allocation patterns stabilize over time

Maintains existing robust mutex semantics including EOWNERDEAD
handling for dead process recovery. Internal structures exposed in
ssm.h for testing purposes. Adds some tests (pool_test,
pool_sharding_test.c. etc) verifying lazy distribution, migration,
fallback stealing, and multiprocess behavior.

Updates the ring buffer (rbuff) to use relaxed/acquire/release
ordering on atomic indices. The ring buffer requires the (robust)
mutex to ensure cross-structure synchronization between pool buffer
writes and ring buffer index publication.

Signed-off-by: Dimitri Staessens &lt;dimitri@ouroboros.rocks&gt;
Signed-off-by: Sander Vrijders &lt;sander@ouroboros.rocks&gt;
</content>
</entry>
<entry>
<title>build: Add option to toggle Ouroboros logging in tests</title>
<updated>2026-01-19T07:14:55+00:00</updated>
<author>
<name>Dimitri Staessens</name>
<email>dimitri@ouroboros.rocks</email>
</author>
<published>2026-01-14T00:07:53+00:00</published>
<link rel='alternate' type='text/html' href='https://ouroboros.rocks/cgit/ouroboros/commit/?id=8aa6ab4d29df80adde0d512244d43d38264bf32e'/>
<id>urn:sha1:8aa6ab4d29df80adde0d512244d43d38264bf32e</id>
<content type='text'>
The test output is a bit polluted with logs originating fomr the
logging system, e.g.:

23: test_bind_prog started.
23: ==16636== reg/name(DB): Add prog reg_test to name testname.
23: ==16636== reg(EE): Removing  from names.
23: test_bind_prog succeeded.

This adds a flag DISABLE_TEST_LOGGING that suppresses log_* output in
tests to keep them clean:

23: test_bind_prog started.
23: test_bind_prog succeeded.

The status is printed in CMake output:

-- Ouroboros logging in test output disabled
-- Ouroboros logging in test output enabled

By default the flag is ON (clean test output).

Signed-off-by: Dimitri Staessens &lt;dimitri@ouroboros.rocks&gt;
Signed-off-by: Sander Vrijders &lt;sander@ouroboros.rocks&gt;
</content>
</entry>
<entry>
<title>ipcpd: Fix missing return in DHT</title>
<updated>2025-08-24T08:23:47+00:00</updated>
<author>
<name>Dimitri Staessens</name>
<email>dimitri@ouroboros.rocks</email>
</author>
<published>2025-08-24T08:23:47+00:00</published>
<link rel='alternate' type='text/html' href='https://ouroboros.rocks/cgit/ouroboros/commit/?id=e75861147fdf99509c699f47efffdb9a2966697a'/>
<id>urn:sha1:e75861147fdf99509c699f47efffdb9a2966697a</id>
<content type='text'>
The dht_kv_respond_req had a missing return statement. I'm not sure
why the double mutex_unlock() never caused havoc in testing.

Signed-off-by: Dimitri Staessens &lt;dimitri@ouroboros.rocks&gt;
</content>
</entry>
</feed>
