Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
ff07262
fix experiment methodology and add payload format scripts
fabracht Mar 3, 2026
0d7904c
use configurable port and repo binary in localhost experiment
fabracht Mar 3, 2026
adfa757
fix HOL blocking investigation: deprecate per-subscription, add broke…
fabracht Mar 4, 2026
92167a0
add HOL blocking trace instrumentation and analysis
fabracht Mar 4, 2026
ce61d33
add WebSocket bridge support to WASM broker
fabracht Mar 5, 2026
ae87bf3
add publication prep: QoS fix, analysis scripts, experiment scripts 0…
fabracht Mar 5, 2026
0359c4c
add 02d/02e experiment results and diary entries
fabracht Mar 5, 2026
a91d563
add interventional PublishAction to on_client_publish event handler
fabracht Mar 5, 2026
bf8b885
add per-client outbound delivery rate limiting
fabracht Mar 6, 2026
96daa37
add fig08-11, bootstrap CI, Cliff's delta, exp01/exp03 parsers
fabracht Mar 6, 2026
5458eb0
fix queue filename collision and stale subscription leak
fabracht Mar 6, 2026
8779611
add exp 05/06 results, RTT sweep for datagram vs stream
fabracht Mar 6, 2026
f9d1433
ignore generated figure output and result analysis files
fabracht Mar 6, 2026
f479085
add experiment scripts, HOL analysis, ACL README, QUIC spec
fabracht Mar 6, 2026
1a672d2
document per-subscription deprecation architectural rationale
fabracht Mar 6, 2026
98489e6
use unidirectional QUIC streams for data paths
fabracht Mar 7, 2026
583b8a7
add parallel experiment infrastructure for split pub/sub on n2 VMs
fabracht Mar 7, 2026
f7a851c
gitignore paper/ directory
fabracht Mar 7, 2026
c767acb
add exp 04-06 figure scripts, stats parsers, and updated config
fabracht Mar 7, 2026
cb956f6
write parallel experiment results to results_v2/
fabracht Mar 7, 2026
d271161
fill group env IPs, add ProxyJump support for sub-3
fabracht Mar 7, 2026
183e0e8
add experiment scripts, HOL analysis, ACL README, QUIC spec
fabracht Mar 9, 2026
543c248
fix v3 experiment script to skip unused sub VM monitoring
fabracht Mar 9, 2026
97ca83b
update figure scripts and stats to use v3 HOL blocking metrics
fabracht Mar 9, 2026
3f2e731
add JOSS paper, references, and code of conduct
fabracht Mar 10, 2026
f602018
add LaTeX paper with verified references and experiment figures
fabracht Mar 10, 2026
e48983e
move JOSS paper from paper/ to joss/
fabracht Mar 10, 2026
361c0a2
bump crate versions for release
fabracht Mar 10, 2026
7de47b8
deprecate per-subscription stream strategy in CLI and tests
fabracht Mar 10, 2026
30d9895
remove per-subscription from docs
fabracht Mar 10, 2026
57ae3b4
fix PR review issues: semver, lock scope, persistence, config path
fabracht Mar 10, 2026
1cf65bd
allow result_large_err on websocket callback (type dictated by tungst…
fabracht Mar 10, 2026
eb0bc0a
re-inject identity properties on PublishAction::Transform, clean up s…
fabracht Mar 10, 2026
210cb9c
rewrite JOSS paper for flow, add draft PDF workflow
fabracht Mar 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/joss.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Draft JOSS Paper
on:
push:
paths:
- joss/**
- .github/workflows/joss.yml

jobs:
paper:
runs-on: ubuntu-latest
name: Paper Draft
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build draft PDF
uses: openjournals/openjournals-draft-action@master
with:
journal: joss
paper-path: joss/paper.md
- name: Upload
uses: actions/upload-artifact@v4
with:
name: paper
path: joss/paper.pdf
Comment on lines +10 to +24

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI 7 months ago

In general, the fix is to add an explicit permissions block to the workflow or the specific job, granting only the minimal scopes required. For this workflow, the actions used (actions/checkout, openjournals/openjournals-draft-action, and actions/upload-artifact) only need read access to repository contents; they do not need to write to the repository or modify issues, PRs, etc. Therefore, the safest and simplest change is to add permissions: contents: read at the job level for paper.

Concretely, in .github/workflows/joss.yml, under jobs: paper: and aligned with runs-on / name, add:

permissions:
  contents: read

This will restrict the GITHUB_TOKEN used in that job to read-only repository contents, without altering the workflow’s behavior. No additional methods, imports, or other definitions are needed because this is purely a YAML configuration change.

Suggested changeset 1
.github/workflows/joss.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/joss.yml b/.github/workflows/joss.yml
--- a/.github/workflows/joss.yml
+++ b/.github/workflows/joss.yml
@@ -9,6 +9,8 @@
   paper:
     runs-on: ubuntu-latest
     name: Paper Draft
+    permissions:
+      contents: read
     steps:
       - name: Checkout
         uses: actions/checkout@v4
EOF
@@ -9,6 +9,8 @@
paper:
runs-on: ubuntu-latest
name: Paper Draft
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
Copilot is powered by AI and may make mistakes. Always verify output.
20 changes: 19 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ experiments/results/*.json
experiments/results/**/*.json
experiments/results/*.csv
experiments/results/**/*.csv
experiments/results_v2/

# Allow experiment scripts and config
!experiments/**/*.sh
Expand All @@ -209,4 +210,21 @@ experiments/results/**/*.csv
!experiments/README.md
public/

articles/
articles/

# Analysis artifacts (generated figures, stats output)
artifacts/
experiments/analysis/figures/output/
experiments/results/**/*.txt
experiments/results/**/*.tex

# Paper (LaTeX build artifacts)
paper/*.aux
paper/*.bbl
paper/*.blg
paper/*.log
paper/*.out
paper/*.pdf
paper/*.fls
paper/*.fdb_latexmk
paper/*.synctex.gz
1 change: 0 additions & 1 deletion ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,6 @@ Client Broker
1. **ControlOnly**: Single stream (traditional MQTT behavior)
2. **DataPerPublish**: New stream per QoS 1/2 publish
3. **DataPerTopic**: Stream pooling by topic
4. **DataPerSubscription**: Dedicated streams per subscription

### Benefits

Expand Down
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

- **QUIC transport options for bridges**: Fine-grained control over QUIC bridge behavior
- `quic_stream_strategy`: Control stream usage (`control_only`, `data_per_publish`, `data_per_topic`, `data_per_subscription`)
- `quic_stream_strategy`: Control stream usage (`control_only`, `data_per_publish`, `data_per_topic`)
- `quic_flow_headers`: Enable/disable flow control headers in QUIC streams
- `quic_datagrams`: Enable/disable QUIC datagram support for low-latency messaging
- `quic_max_streams`: Limit concurrent QUIC streams per bridge connection
Expand Down Expand Up @@ -773,7 +773,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- **QUIC data stream byte consumption bug** in broker's QUIC acceptor
- `try_read_flow_header()` was consuming bytes when checking for flow headers but not returning them when they weren't flow headers
- This caused QUIC stream strategies (DataPerPublish, DataPerTopic, DataPerSubscription) to fail with "Malformed packet" errors
- This caused QUIC stream strategies (DataPerPublish, DataPerTopic) to fail with "Malformed packet" errors
- Added `FlowHeaderResult` with `leftover` field to preserve non-flow-header bytes
- Added `read_packet_with_buffer()` to use leftover bytes before reading from stream

Expand Down Expand Up @@ -885,7 +885,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- **QUIC multistream architecture** for parallel MQTT operations
- Eliminates head-of-line blocking for concurrent publishes
- Stream strategies: `ControlOnly`, `DataPerPublish`, `DataPerTopic`, `DataPerSubscription`
- Stream strategies: `ControlOnly`, `DataPerPublish`, `DataPerTopic`
- Configurable stream management with `QuicStreamManager`
- Automatic stream lifecycle management

Expand Down
85 changes: 85 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@

# Contributor Covenant Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment for our community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
* Focusing on what is best not just for us as individuals, but for the overall community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.

Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at fabricio@bracht.dev. All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series of actions.

**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within the community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].

Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder][Mozilla CoC].

For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at [https://www.contributor-covenant.org/translations][translations].

[homepage]: https://www.contributor-covenant.org
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
[Mozilla CoC]: https://github.com/mozilla/diversity
[FAQ]: https://www.contributor-covenant.org/faq
[translations]: https://www.contributor-covenant.org/translations

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ members = [
resolver = "2"

[workspace.package]
version = "0.11.2"
version = "0.12.0"
edition = "2021"
rust-version = "1.88"
authors = ["fabriciobracht <fabricio@bracht.dev>"]
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,6 @@ QUIC multistream support allows different stream allocation strategies:
| `ControlOnly` | Single stream for all packets | Simple deployments |
| `DataPerPublish` | New stream per QoS 1/2 publish | High-throughput publishing |
| `DataPerTopic` | Dedicated stream per topic | Topic isolation |
| `DataPerSubscription` | Stream per subscription | Subscriber isolation |

### Flow Headers

Expand Down Expand Up @@ -691,7 +690,8 @@ Monitor and react to broker events with custom handlers:
```rust
use mqtt5::broker::config::BrokerConfig;
use mqtt5::broker::events::{
BrokerEventHandler, ClientConnectEvent, ClientPublishEvent, ClientDisconnectEvent,
BrokerEventHandler, ClientConnectEvent, ClientPublishEvent,
ClientDisconnectEvent, PublishAction,
};
use std::future::Future;
use std::pin::Pin;
Expand All @@ -712,16 +712,16 @@ impl BrokerEventHandler for MetricsHandler {
fn on_client_publish<'a>(
&'a self,
event: ClientPublishEvent,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'a>> {
) -> Pin<Box<dyn Future<Output = PublishAction> + Send + 'a>> {
Box::pin(async move {
println!("Message published to {}: {} bytes", event.topic, event.payload.len());
// MQTT 5.0 request/response support
if let Some(response_topic) = &event.response_topic {
println!(" Response topic: {response_topic}");
}
if let Some(correlation_data) = &event.correlation_data {
println!(" Correlation data: {} bytes", correlation_data.len());
}
PublishAction::Continue
})
}

Expand Down
2 changes: 1 addition & 1 deletion crates/mqtt5-protocol/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mqtt5-protocol"
version = "0.9.9"
version = "0.10.0"
edition.workspace = true
rust-version.workspace = true
authors.workspace = true
Expand Down
2 changes: 2 additions & 0 deletions crates/mqtt5-protocol/src/packet/property_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ proptest! {
packet_id,
properties: Properties::new(),
protocol_version: 5,
stream_id: None,
};

// Test encoding
Expand Down Expand Up @@ -285,6 +286,7 @@ mod property_invariant_tests {
packet_id: None,
properties: Properties::new(),
protocol_version: 5,
stream_id: None,
};

let mut pub_buffer = Vec::new();
Expand Down
13 changes: 4 additions & 9 deletions crates/mqtt5-protocol/src/packet/publish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,17 @@ use crate::types::ProtocolVersion;
use crate::QoS;
use bytes::{Buf, BufMut, Bytes};

/// MQTT PUBLISH packet
#[derive(Debug, Clone)]
pub struct PublishPacket {
/// Topic name
pub topic_name: String,
/// Packet identifier (required for `QoS` > 0)
pub packet_id: Option<u16>,
/// Message payload
pub payload: Bytes,
/// Quality of Service level
pub qos: QoS,
/// Retain flag
pub retain: bool,
/// Duplicate delivery flag
pub dup: bool,
/// PUBLISH properties (v5.0 only)
pub properties: Properties,
/// Protocol version (4 = v3.1.1, 5 = v5.0)
pub protocol_version: u8,
pub stream_id: Option<u64>,
}

impl PublishPacket {
Expand All @@ -42,6 +34,7 @@ impl PublishPacket {
dup: false,
properties: Properties::default(),
protocol_version: 5,
stream_id: None,
}
}

Expand All @@ -57,6 +50,7 @@ impl PublishPacket {
dup: false,
properties: Properties::default(),
protocol_version: 4,
stream_id: None,
}
}

Expand Down Expand Up @@ -314,6 +308,7 @@ impl PublishPacket {
dup,
properties,
protocol_version,
stream_id: None,
})
}
}
Expand Down
2 changes: 2 additions & 0 deletions crates/mqtt5-protocol/src/types/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ pub struct Message {
pub qos: QoS,
pub retain: bool,
pub properties: MessageProperties,
pub stream_id: Option<u64>,
}

impl From<crate::packet::publish::PublishPacket> for Message {
Expand All @@ -183,6 +184,7 @@ impl From<crate::packet::publish::PublishPacket> for Message {
qos: packet.qos,
retain: packet.retain,
properties: MessageProperties::from(packet.properties),
stream_id: packet.stream_id,
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions crates/mqtt5-wasm/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mqtt5-wasm"
version = "1.0.0"
version = "1.1.0"
edition.workspace = true
rust-version.workspace = true
authors.workspace = true
Expand All @@ -27,8 +27,8 @@ broker = ["client", "dep:mqtt5", "dep:tokio"]
codec = ["client", "dep:miniz_oxide"]

[dependencies]
mqtt5-protocol = "0.9.9"
mqtt5 = { version = "0.22", optional = true, default-features = false, features = [
mqtt5-protocol = "0.10"
mqtt5 = { version = "0.23", optional = true, default-features = false, features = [
"tokio",
] }

Expand Down
44 changes: 44 additions & 0 deletions crates/mqtt5-wasm/examples/acl-permissions/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# ACL Permission Demo

This example demonstrates **Access Control Lists (ACL)** with role-based access control (RBAC). Users are assigned roles that define read/write permissions on topic patterns, and the broker enforces these rules on every PUBLISH and SUBSCRIBE.

## Running the Example

1. Build the WASM package:
```bash
cd crates/mqtt5-wasm
wasm-bindgen ../target/wasm32-unknown-unknown/release/mqtt5_wasm.wasm --out-dir examples/acl-permissions/pkg --target web
```

2. Serve the example:
```bash
cd examples/acl-permissions
python3 -m http.server 8080
```

3. Open http://localhost:8080 in your browser

## How the Demo Works

- Four users are pre-configured with distinct roles and permissions
- Select a user to connect as that identity
- Test subscribe and publish operations against various topics
- Operations are checked against the ACL rules and shown as ALLOWED or DENIED
- A permission matrix shows all topic/operation combinations for the selected user

## Users and Roles

| User | Role | Topic Pattern | Permission |
|------|------|---------------|------------|
| Alice | admin | `#` | read/write |
| Bob | publisher | `data/#` | write |
| Carol | subscriber | `data/#` | read |
| Dave | guest | `public/#` | read |

## Try It

1. Start as Alice (admin) — all operations succeed on any topic
2. Switch to Bob (publisher) — can publish to `data/sensors` but cannot subscribe
3. Switch to Carol (subscriber) — can subscribe to `data/sensors` but cannot publish
4. Switch to Dave (guest) — limited to reading `public/#` topics only
5. Try operations on topics outside each user's allowed patterns to see denials
Loading