<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ouroboros, branch be</title>
<subtitle>Ouroboros main repository</subtitle>
<id>http://133.ip-51-38-114.eu/cgit/ouroboros/atom?h=be</id>
<link rel='self' href='http://133.ip-51-38-114.eu/cgit/ouroboros/atom?h=be'/>
<link rel='alternate' type='text/html' href='http://133.ip-51-38-114.eu/cgit/ouroboros/'/>
<updated>2026-05-22T06:13:50+00:00</updated>
<entry>
<title>lib: Add FIN and receive-side linger for msg dealloc</title>
<updated>2026-05-22T06:13:50+00:00</updated>
<author>
<name>Dimitri Staessens</name>
<email>dimitri@ouroboros.rocks</email>
</author>
<published>2026-05-21T20:49:15+00:00</published>
<link rel='alternate' type='text/html' href='http://133.ip-51-38-114.eu/cgit/ouroboros/commit/?id=5d0cf67a38695ebe65a0506b5c6d6c0d229a3b3e'/>
<id>urn:sha1:5d0cf67a38695ebe65a0506b5c6d6c0d229a3b3e</id>
<content type='text'>
qos_msg flows had no end-of-stream signal: a deallocating sender
relied on the peer's inactivity timers (~30 s) to notice. Worse, the
dealloc-linger path was bugged: a receiver that called flow_dealloc
would stop draining its rx_rb while the peer's tail retransmits kept
arriving. Peer retransmitted into a black hole until its own dealloc
fired, and the whole shutdown stretched takes t_a time.

Generalizes frcti_stream_fin_snd to frcti_fin_snd; for msg mode emit a
FRCT_FIN-only control packet with the FIN seqno boundary in
pci-&gt;ackno. Receiver-side frcti_rcv latches rcv_fin_seen and stores
the boundary on FRCT_FIN-without-DATA.

Fix comment on the FRCT flags.

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: Allow up to two TLPs per recovery episode</title>
<updated>2026-05-22T06:13:50+00:00</updated>
<author>
<name>Dimitri Staessens</name>
<email>dimitri@ouroboros.rocks</email>
</author>
<published>2026-05-21T20:23:01+00:00</published>
<link rel='alternate' type='text/html' href='http://133.ip-51-38-114.eu/cgit/ouroboros/commit/?id=3ad96a09df9dfd8e63e494887f7ef5bc07f244b5'/>
<id>urn:sha1:3ad96a09df9dfd8e63e494887f7ef5bc07f244b5</id>
<content type='text'>
RFC 8985 §7.3 permits up to two tail loss probes before falling back
to RTO. Previously FRCP allowed exactly one TLP per episode, making
tail-loss recovery dependent on a successful first probe; if that
probe was lost the sender fell straight to slow RTO with exponential
backoff.

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: Further align FRCP with TCP RFCs</title>
<updated>2026-05-22T06:13:50+00:00</updated>
<author>
<name>Dimitri Staessens</name>
<email>dimitri@ouroboros.rocks</email>
</author>
<published>2026-05-21T19:42:57+00:00</published>
<link rel='alternate' type='text/html' href='http://133.ip-51-38-114.eu/cgit/ouroboros/commit/?id=6a8b532870cf8c642adb1b7554691cadb8be5257'/>
<id>urn:sha1:6a8b532870cf8c642adb1b7554691cadb8be5257</id>
<content type='text'>
Only the HoL slot retransmits on RTO; non-HoL slots defer and rely on
SACK/RACK fast-rxm for recovery. Matches RFC 6298 §5.4 + RFC 8985 §3
and Linux tcp_retransmit_skb(head, 1). Eliminates the spurious-RTO
storm where ~50-66% of retransmits arrived as duplicates at the peer.

Co-fixes for three latent state-machine bugs that the previous
spurious-retx mask was hiding:

  - recovery_enter: seal recovery_high at the false→true edge only
    (RFC 6582 §3.2). Previously extended on every gap-SACK, which
    trapped the sender in NewReno indefinitely once any cum-ACK fell
    behind the moving recovery_high.

  - rtt_sample_eligible: drop the in_recovery super-gate. Karn at the
    per-slot SND_RTX|SND_TLP level is already correct (matches Linux).

  - rxm_due defer interval: use base RTO, not rto&lt;&lt;rto_mul. Inheriting
    HoL's backoff parked deferred slots tens of seconds in the future.

Bring RACK reorder-window scaling into RFC 8985 §7.2 compliance:
reo_wnd_mult widens at most once per RTT, gated via a srtt-elapsed
check in reo_wnd_on_dsack.

Stat refactor for clearer attribution: rename rxm_snd → rxm_rto (now
RTO-driven sends only), add rxm_nack and rxm_due_defer, split rxm_rcv
into total FRCT_RXM arrivals and rxm_dup_rcv (duplicates). Expose
rx/tx ring queue depths as RIB stats.

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: Set a timeout on FRCT control packets</title>
<updated>2026-05-22T06:13:50+00:00</updated>
<author>
<name>Dimitri Staessens</name>
<email>dimitri@ouroboros.rocks</email>
</author>
<published>2026-05-20T07:23:07+00:00</published>
<link rel='alternate' type='text/html' href='http://133.ip-51-38-114.eu/cgit/ouroboros/commit/?id=3cde856b4b68b5d6bbb9d6bb2d1b995f0babe109'/>
<id>urn:sha1:3cde856b4b68b5d6bbb9d6bb2d1b995f0babe109</id>
<content type='text'>
Time out frct_tx for control packets at 250us so a full tx ring cannot
stall the timer wheel (and with it KA, TLP, RXM fires). DATA frames
(fresh, RXM, TLP, FIN) keep blocking - dropping them would lose
recovery progress.

Add inact_drop, drf_rebase, rq_released, tlp_snd, sdu_snd_alloc,
sdu_snd_tx, sdu_sole, rxm_tx_dead, and per-type tx_drop counters.

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 tail loss probe (TLP) to FRCP</title>
<updated>2026-05-22T06:13:50+00:00</updated>
<author>
<name>Dimitri Staessens</name>
<email>dimitri@ouroboros.rocks</email>
</author>
<published>2026-05-20T16:15:10+00:00</published>
<link rel='alternate' type='text/html' href='http://133.ip-51-38-114.eu/cgit/ouroboros/commit/?id=40cc98c427186a54ddf27fbd10763d7457fffb30'/>
<id>urn:sha1:40cc98c427186a54ddf27fbd10763d7457fffb30</id>
<content type='text'>
The previous bugfixes that fixed a false-positive inactivity timer
check unmasked the need for the tail loss probe (TLP) to quickly
recover from loss of the HoL.

When the sender finishes its app data with packets still inflight,
RACK fast-rxm cannot fire (no ACK arrives), pre-DRF NACK is gated on
rcv_cr.inact, and rto_mul climbs into seconds before the next RXM fire
— recv-side deadline expires first.

This adds the RFC 8985 §7.2 TLP: PTO = 2*SRTT + max_ack_delay (t_a),
capped by the HoL slot's current RTO deadline. Probe fires from
frcti_snd and after frcti_ack_rcv; per §7.3 at most one TLP per
recovery episode, tracked via tlp_high_seq. On fire, re-emit HoL via
fast_rxm_send and hand off to RTO — no PTO self re-arm. A new SND_TLP
slot flag is Karn-skipped for RTT sampling, cleared by RTO retransmit
or NACK-driven fast-rxm, and clears rto_mul on its TLP-ACK (rto_mul
carries no CC meaning in FRCP). Also caps MAX_RTO_MUL at 8 instead of
20.

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: Fix underrun in activity timer</title>
<updated>2026-05-22T06:13:33+00:00</updated>
<author>
<name>Dimitri Staessens</name>
<email>dimitri@ouroboros.rocks</email>
</author>
<published>2026-05-20T11:09:20+00:00</published>
<link rel='alternate' type='text/html' href='http://133.ip-51-38-114.eu/cgit/ouroboros/commit/?id=ac994f2456681bada8371d6cb379467313acddfa'/>
<id>urn:sha1:ac994f2456681bada8371d6cb379467313acddfa</id>
<content type='text'>
The inactivity timers are updated under rdlock with atomics on the
time stamp. Inactivity is measured by comparison between the act stamp
against the thread's own current time (now_ns). A different thread
could already have updated the act stamp, causing undderun in the
signed comparison and causing a false-positive on the inactive test.

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: Skip DRF rebase on same-epoch retransmit</title>
<updated>2026-05-20T06:17:07+00:00</updated>
<author>
<name>Dimitri Staessens</name>
<email>dimitri@ouroboros.rocks</email>
</author>
<published>2026-05-19T20:25:47+00:00</published>
<link rel='alternate' type='text/html' href='http://133.ip-51-38-114.eu/cgit/ouroboros/commit/?id=1566d9b6e273510b376adaa1ce920152a089132f'/>
<id>urn:sha1:1566d9b6e273510b376adaa1ce920152a089132f</id>
<content type='text'>
On some stalls the receiver can go inactive and NACK-driven HoL
retransmits and brief snd-window drains can deliver a DRF-flagged
packet that's still part of the current receive epoch (rxm_pkt_prepare
preserves the original flags). This treats in-window DRF and
RXM-flagged DRF arrivals as same-epoch once the window is seeded and
skip the release_rq + lwe/rwe rebase that would otherwise wipe valid
OOO fragments from rq[].

Bootstrap (lwe == rwe) still rebases unconditionally so a NACK-driven
retransmit of a lost initial DRF can seed the receiver.

Harden seqno_rotate to redraw the ISN until it falls outside the
peer's current rcv window, closing the ~RQ_SIZE / 2^32 collision where
a true new epoch would be misclassified as same-epoch.

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: Free secure memory on process exit</title>
<updated>2026-05-20T06:17:07+00:00</updated>
<author>
<name>Dimitri Staessens</name>
<email>dimitri@ouroboros.rocks</email>
</author>
<published>2026-05-16T13:27:14+00:00</published>
<link rel='alternate' type='text/html' href='http://133.ip-51-38-114.eu/cgit/ouroboros/commit/?id=cbf7f953a49a98adfc4803340475ffeccefbe9fb'/>
<id>urn:sha1:cbf7f953a49a98adfc4803340475ffeccefbe9fb</id>
<content type='text'>
There was a missing crypt_secure_malloc_fini() in the process
init/fini path.

Also fixes a 0 return from OpenSSL RAND_bytes() being interpreted as
succes instead of failure.

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: Update FRCP implementation</title>
<updated>2026-05-20T06:17:07+00:00</updated>
<author>
<name>Dimitri Staessens</name>
<email>dimitri@ouroboros.rocks</email>
</author>
<published>2026-05-10T17:06:21+00:00</published>
<link rel='alternate' type='text/html' href='http://133.ip-51-38-114.eu/cgit/ouroboros/commit/?id=63d3aa9ab8d8b0b6d8a10362e112a431dcb5b4e9'/>
<id>urn:sha1:63d3aa9ab8d8b0b6d8a10362e112a431dcb5b4e9</id>
<content type='text'>
The Flow and Retransmission Control Protocol (FRCP) runs end-to-end
between two peers over a flow. It provides reliability, in-order
delivery, flow control, and liveness. Note that congestion avoidance
is orthogonal to FRCP and handled in the IPCP.

A fixed 16-octet header, network byte order, is prefixed to every FRCP
packet:

     0                   1                   2                   3
     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |             flags             |              hcs              |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                            window                             |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                            seqno                              |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                            ackno                              |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                     payload (variable) ...
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

hcs is a CRC-16-CCITT-FALSE checksum over the PCI (and the stream
extension when present), verified before any flag-driven dispatch.  A
single packet can simultaneously carry DATA + ACK + FC + RXM by OR-ing
flag bits. An optional CRC trailer covers the body on DATA when qs.ber
== 0, and on every SACK packet; an optional AEAD wrap (per-flow keys)
sits outermost.

Flag bits (MSB-first; bits 13..15 reserved, MUST be zero):

    +------+--------+--------+----------------------------------------+
    | Bit  | Mask   | Name   | Meaning                                |
    +------+--------+--------+----------------------------------------+
    |   0  | 0x8000 | DATA   | Carries caller payload                 |
    |   1  | 0x4000 | DRF    | Start of a fresh data run              |
    |   2  | 0x2000 | ACK    | ackno field valid                      |
    |   3  | 0x1000 | NACK   | Pre-DRF nudge (seqno informational)    |
    |   4  | 0x0800 | FC     | window field valid (rwe advertisement) |
    |   5  | 0x0400 | RDVS   | Rendezvous probe (window-closed)       |
    |   6  | 0x0200 | FFGM   | First Fragment of a multi-fragment SDU |
    |   7  | 0x0100 | LFGM   | Last Fragment of a multi-fragment SDU  |
    |   8  | 0x0080 | RXM    | Retransmission                         |
    |   9  | 0x0040 | SACK   | Block list follows in payload          |
    |  10  | 0x0020 | RTTP   | RTT probe / echo (payload follows)     |
    |  11  | 0x0010 | KA     | Keepalive                              |
    |  12  | 0x0008 | FIN    | End of stream marker                   |
    | 13-15|   --   |   --   | Reserved (MUST be zero)                |
    +------+--------+--------+----------------------------------------+

(FFGM, LFGM) encodes the fragment role of a DATA packet (SCTP-style
B/E): 11=SOLE, 10=FIRST, 00=MID, 01=LAST. Each fragment carries its
own seqno; Retransmission recovers fragments individually, reassembly
runs at consume time. In stream mode FFGM/LFGM are unused; per-byte
position is carried by the stream extension below and end-of-stream is
signalled by FIN on a 0-byte DATA packet.

SACK payload (FRCT_ACK | FRCT_FC | FRCT_SACK):

     0                   1                   2                   3
     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |           n_blocks            |        padding (2 octets)     |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                           start[0]                            |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                            end[0]                             |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                        ... n_blocks pairs total ...

Each block describes a *present* (received) range strictly above the
cumulative ACK in the PCI ackno. D-SACK (RFC 2883) is signalled
in-band as block[0] - no flag bit, no extra framing - and consumed by
the RACK reo_wnd_mult scaler (RFC 8985 sec. 7.2).

RTTP payload (FRCT_RTTP only; 24 octets):

     0                   1                   2                   3
     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                          probe_id                             |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                          echo_id                              |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                                                               |
    +                  nonce (16 octets, echoed verbatim)           +
    |                                                               |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Stream PCI extension (in_order == STREAM only; 8 octets after the base
PCI on every DATA packet):

     0                   1                   2                   3
     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                            start                              |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                             end                               |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

start, end are monotonic 32-bit byte offsets; end - start equals the
on-wire payload length. Stream mode is negotiated at flow allocation;
the extension is present iff stream mode is in use, never on a
per-packet basis.

Service modes are an orthogonal (in_order, loss, ber) vector selected
at flow_alloc; the cubes above map to the axes:

    +----------------+---------+------+-----+-----------------------+
    | Cube           | in_order| loss | ber | Engaged               |
    +----------------+---------+------+-----+-----------------------+
    | qos_raw        |    0    |   1  |   1 | Raw passthrough       |
    | qos_raw_safe   |    0    |   1  |   0 | Raw + CRC trailer     |
    | qos_rt         |    1    |   1  |   1 | FRCP, no FRTX, no CRC |
    | qos_rt_safe    |    1    |   1  |   0 | FRCP, no FRTX, CRC    |
    | qos_msg        |    1    |   0  |   0 | FRCP + FRTX           |
    | qos_stream     |    2    |   0  |   0 | FRCP + FRTX, stream   |
    +----------------+---------+------+-----+-----------------------+

in_order=0 sends raw datagrams with no PCI (UDP-equivalent);
in_order=1 engages FRCP with SDU framing; in_order=2 (stream) requires
loss=0 and is rejected otherwise. loss=0 engages the FRTX retransmit
machinery. ber=0 appends the CRC-32 trailer; QOS_DISABLE_CRC at build
time forces ber=1 for development. Encryption is a separate per-flow
attribute layered as an AEAD wrap outside the FRCP packet.

Heritage: delta-t (Watson 1981) supplies timer-based connection
management - no SYN/FIN handshake, the DRF marker, the t_mpl / t_a /
t_r timers. RINA (Day 2008) supplies the unified flow_alloc(name, qos,
...) primitive and the orthogonal QoS-cube axes.  Loss detection
follows TCP/QUIC practice (RFCs 2018, 2883, 6582, 6298, 8985); RTT
probing is nonce-authenticated like QUIC PATH_CHALLENGE.

Adds oftp, a minimal file-transfer tool over an FRCP stream flow. The
client reads from stdin or --in FILE and writes through a
flow_alloc(qos_stream); the server (--listen) calls flow_accept and
writes to stdout or --out FILE. Both sides compute a CRC-64/NVMe over
the bytes they handle and print the result. The server rejects flows
whose negotiated qs.in_order != STREAM.

Two FRCP knobs are exposed via env vars on either side:
  OFTP_FRCT_RTO_MIN         fccntl FRCTSRTOMIN  (ns)
  OFTP_FRCT_STREAM_RING_SZ  fccntl FRCTSRRINGSZ (octets)

The ocbr_client gains an OCBR_QOS env var to pick the cube the client
uses for flow_alloc; recognised values are raw, safe, rt, rt_safe,
msg, stream. Unknown values fall back to raw with a warning on
stderr. Without the env set behaviour is unchanged.

Removes the deprecated lib/timerwheel.c

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: Use push/pop for ssm_pk_buff ops</title>
<updated>2026-05-20T06:17:06+00:00</updated>
<author>
<name>Dimitri Staessens</name>
<email>dimitri@ouroboros.rocks</email>
</author>
<published>2026-05-15T09:40:00+00:00</published>
<link rel='alternate' type='text/html' href='http://133.ip-51-38-114.eu/cgit/ouroboros/commit/?id=f33769c818cb1f01079405f543b36aa294764112'/>
<id>urn:sha1:f33769c818cb1f01079405f543b36aa294764112</id>
<content type='text'>
Renames the allocation for head/tail to push/pop instead of
alloc/release as it's simpler and shorter. Took this approach insted
of adopting the kernel's push/pull/put/trim.

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