Resumable Offline Protocol for Emergencies
ROPE transfers growing files and small messages between a small, closed group of devices over unreliable local networks – radio links, Wi-Fi, no internet. Like a rescue line it holds the connection even when it is pulled: an interruption costs time, never data.
Status: early development. The specification is draft 1 with a proposed wire format. Streams from sources via the hub to consumers work, including resume after disconnects and restarts and block repair, and so do messages with custody and offline media (e.g. a USB stick) as a second path. Interfaces will change.
Why
Field teams record large files (for example sonar recordings) on one device and want to evaluate them somewhere else while they are still being recorded. The link in between drops out regularly, and there is no internet. Plain TCP does not resume across connections and acknowledges data before it is safely stored; UDP loses data during outages. ROPE adds the missing pieces on top of TCP, borrowing ideas – not code – from space communication (CFDP class 2, DTN custody transfer).
Key properties
- Resumable – after any interruption, transfer continues from the last durably stored byte, never from zero.
- Custody – a receiver acknowledges only after the data is on disk (flush + fsync). The sender of a message learns which recipients have it.
- End-to-end verified – checksums per segment and per complete file; bit-for-bit identical results. If bytes changed after they were sent (e.g. a header updated at the end of a recording), only the differing blocks travel again.
- Never blocks the producer – separate process, read-only file access without locks, bounded memory.
- Offline – no internet, no cloud, no external services.
- Small groups – star topology with a hub and a closed participant list: source, consumer and recipient roles, names for the operator, and per consumer a choice of which streams it receives.
- Application-agnostic core – the core knows nothing about the data; applications define streams and messages.
- Standard library only – no third-party runtime dependencies.
- Two paths – the same segments and messages can also travel on removable media and mix with the network.
ROPE has no encryption by design and is meant for closed networks – see Security considerations.
How it works (in short)
source ──TCP──▶ hub ──TCP──▶ consumer(s)
│
└──TCP──▶ recipient(s) (messages only)
- Every participant connects to the hub and greets it (identifier, role, protocol version). The hub checks its participant list and tells everybody the names and roles of the group.
- The hub reports how far it has stored each stream (committed offset).
- The source sends segments from there; the hub writes, syncs, then acknowledges.
- When a stream is complete, a final checksum confirms the whole file; on a difference, only the differing blocks are resent.
- On any disconnect: reconnect, greet, continue from the committed offset.
- Without a network, a participant and the hub exchange the same frames as bundles on removable media
(
export_media,import_media); network and media mix freely.
Details: docs/spec.md.
Requirements
- Python 3.11 or newer, on Windows or Linux
- Nothing else at runtime
Installation
python -m pip install rope-protocol
The package is named rope-protocol (import rope_protocol), because the name rope on PyPI belongs to a
well-known refactoring library. Versions and changes: CHANGELOG.md. While ROPE is in early
development, pin the version you tested with (e.g. rope-protocol==0.1.1).
For development:
git clone https://github.com/d-fankhauser/rope.git
cd rope
python -m pip install pytest pyflakes
python -m pytest
Simulating an unreliable link
No radio link at hand? The link simulator sits between two programs and adds bandwidth limits, latency, blackouts and disconnects:
python -m rope_protocol.linksim --listen 127.0.0.1:47311 --target 127.0.0.1:47310 --profile radio
Profiles are lan, wifi, radio and radio-bad; --seed makes the fault schedule reproducible. All profile
values are assumptions until measured on real links (see spec §13).
ROPE's default port is 47310; applications can override it.
Repository layout
| Path | Content |
|---|---|
docs/spec.md |
Protocol specification (draft) |
docs/decisions.md |
Decisions with date and reason |
docs/ideas.md |
Ideas not yet planned |
docs/images/ |
Logo and symbol (SVG; light and dark variant) |
TASKS.md |
Task board |
CHANGELOG.md |
Changes per version |
src/rope_protocol/ |
Package: frame codec (frames.py), link simulator (linksim.py), durable store (store.py), sending and receiving side of streams (sender.py, receiver.py), messages (messages.py), offline media (media.py), participant list (roster.py), participants (hub.py, source.py, consumer.py, recipient.py, base participant.py) |
tests/ |
Unit tests and the fault-injection test bench (framefault.py, test_faults.py) |
AGENTS.md |
Guidelines for contributors and coding agents |
Testing
Every change runs pyflakes and pytest on Windows and Linux (Python 3.11–3.13). The test bench injects faults – a
simulated radio link with blackouts and disconnects, restarts, and one fault at every step of the procedure (connection
cut before or in the middle of a frame, frame duplicated or damaged, participant or hub restarted) – and checks that every file arrives bit-for-bit
identical and every message exactly once. The full set of faults at every step runs with:
ROPE_SOAK=1 python -m pytest tests/test_faults.py
Limitations
- Early development: streams, messages and offline media work. Interfaces and the wire format may still change.
- Not a general file synchronisation tool and not meant for the internet.
- No encryption, no authentication beyond a participant list.
- Not compatible with CFDP or DTN software; only the ideas are borrowed.
Contributing
Contributions are welcome – please read CONTRIBUTING.md. Questions and ideas: open an issue.
License
Copyright 2026 Daniel Fankhauser. Licensed under the Apache License, Version 2.0; see also NOTICE. The name "ROPE" in connection with this protocol is not covered by the licence (Apache-2.0, section 6).
Metadata
Release files for rope-protocol 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| rope_protocol-0.1.1.tar.gz | 85.1 kB | With provenance | Details for rope_protocol-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| rope_protocol-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for rope_protocol-0.1.1-py3-none-any.whl |
Total release size: 145.6 kB
Release files / rope_protocol-0.1.1.tar.gz
| Download URL | rope_protocol-0.1.1.tar.gz |
|---|---|
| Size | 85.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e93db653c2b69258712ed5db222e75fafa5993fae08fb6e61e921db2bd30d4b4
|
|
BLAKE2b-256 checksum How to use checksums |
a9cd73639db5afff33458622686d3827ef24015ddc097217f87df8e32e0a8578
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.
Transparency logRelease files / rope_protocol-0.1.1-py3-none-any.whl
| Download URL | rope_protocol-0.1.1-py3-none-any.whl |
|---|---|
| Size | 60.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
08d5c3f5a64e0add97491a658babcced427ca5d62084bb5650252bbfb7dd1fa7
|
|
BLAKE2b-256 checksum How to use checksums |
b2d29158b2c7af9319914a9a30486a700ac4aa0983a005c8bc28d1971b90109c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.
Transparency logSecurity for rope-protocol 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for rope_protocol-0.1.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.