Store, carry, forward: delivery when the path blinks in and out
TL;DR
With store, carry, and forward a message waits for a link instead of failing. The sender keeps it sealed on disk and retries for up to seven days, relays pass it on hop by hop, and IDs and TTLs keep the mesh deduplicated and bounded.
The internet’s core assumption is that a path exists from end to end at the moment you send. Routing protocols spend their effort finding the best such path, but they take for granted that one is there. At the edge, that assumption is often false. The next hop is asleep, out of range, or out of battery, and it will come back in thirty seconds or thirty minutes.
A network built on end-to-end paths calls that a failure. A network built to carry data through it calls it Tuesday. Offline Protocol is built so that a missing next hop is a reason to hold a message, not a reason to fail it.
Store, carry, and forward delivery
Offline Protocol’s delivery model is store, carry, and forward. The sender keeps custody of its own message: until the recipient acknowledges it, the message stays sealed on the sender’s disk and is retried for up to seven days, and 28 days at most. Each relay on the way passes it on hop by hop, holding it for about five seconds while it looks for the next hop. For shared documents, custody in SDK 0.28 goes further: a device that is nearby can hold updates for a peer that is away and deliver them hours later.
This is the classical delay-tolerant networking idea, and it inverts the usual failure mode. Instead of “no path right now, therefore error,” the sender’s stance is “no path right now, therefore hold.” The message is not lost when connectivity is absent. It is simply not done moving yet.
Message ID and TTL in mesh relaying
In Offline Protocol every message carries a unique ID and a TTL, and relays act on those two fields. For custody transfer to work without a coordinator, each message has to be self-describing. The ID lets any device recognize a message it has already seen; the TTL, together with a hop limit of up to eight, bounds how far and how long it travels before it is allowed to expire. A relay does not need to consult anyone to decide what to do with a message. Everything it needs to make the decision is in the message.
That self-description is what makes the buffer safe to flood from and safe to drain. When a device meets a peer, it can offer what it is holding, the peer can accept what it has not already seen, and neither side needs a shared view of the network to do it correctly.
Mesh message deduplication
Deduplication by ID is the defense against duplicate copies. Relays remember the IDs they have handled and drop repeats, so a message that arrives twice is forwarded onward and delivered to the application exactly once. Opportunistic forwarding creates copies. The same message can reach a device by two paths, or come back around a loop, and without a defense that redundancy would multiply until it drowned the mesh. Receivers acknowledge, senders retry on timeout, and the dedup layer absorbs the duplicates all of that retrying naturally produces.
The effect is a system that is aggressive about redundancy where redundancy buys reach, and strict about idempotence where duplication would cost stability. You get the delivery odds of flooding without paying flooding’s usual price.
Storage and battery limits in store-and-forward
TTLs cap how long a message can occupy a buffer, so storage reclaims itself as messages age out rather than accumulating forever, and forwarding duty follows charge level. Holding messages costs memory, and forwarding them costs energy, so store-and-forward is really an exercise in spending two budgets well. Well-charged devices take on more relay work and devices below an energy threshold shed it, the same energy-aware routing that keeps multi-hop paths viable on phones. A buffer that never forgot and a fleet that forwarded blindly would both collapse; bounding each is what keeps the mesh alive over hours, not seconds.
Bulk data rides the same discipline with an added mechanism. File transfer up to 100 MiB is chunked with per-chunk acknowledgment and resume, so a large payload interrupted by a link dropping picks up from the last confirmed chunk instead of restarting. Store-and-forward at the message level and resume at the chunk level are the same principle applied at two scales: never redo work the network already accepted custody of.
Buffered message delivery after reconnection
When the link returns, buffered messages drain toward their destinations, acknowledgments settle, and duplicates are quietly discarded by the same dedup that protected the mesh during the outage. That is the visible payoff at reconnection: because devices kept working and kept custody of what they produced while the backhaul was gone, coming back online is a reconciliation rather than a recovery. Nothing had to be regenerated, because nothing was thrown away when the path first blinked out.
Store, carry, and forward during network outages
Store, carry, and forward is the reason an outage on Offline Protocol is a delay instead of a loss. It runs in production on a network that has reached 350,000+ devices in 140+ countries, underneath the failover that chooses transports and the sessions that keep everything encrypted end to end. If your data has to arrive even when there is no path right now, this is the machinery that holds it for days, deduplicates it, and moves it on at the next contact.
Read more on how the mesh works, or talk to us about moving data through paths that come and go.
Frequently asked questions
How long does Offline Protocol keep an undelivered message?
A device keeps its own undelivered messages sealed on disk and retries them for up to seven days, and 28 days at most. A relay holds another device's message for about five seconds while it looks for a next hop, then lets it go.
How does a sender know a mesh message was delivered?
The receiver acknowledges it. Until the acknowledgment arrives, the sender keeps the message sealed on disk and retries on timeout, for up to seven days and 28 days at most.
What is custody in the Offline Protocol SDK?
Custody, added in SDK 0.28, is an opt-in way for a device to hold shared-document updates for a peer that is away and deliver them hours later. Direct messages are not carried that way yet.
How does a mesh network avoid delivering the same message twice?
Every message carries a unique ID. Relays remember the IDs they have handled and drop repeats, so a message that arrives twice is delivered to the application once.
How far and how long can a mesh message travel before it expires?
Its TTL, together with a hop limit of up to eight, bounds how far and how long it travels before it is allowed to expire.
What happens when a large file transfer is interrupted?
File transfer is chunked with per-chunk acknowledgment and resume, so a payload interrupted by a link dropping picks up from the last confirmed chunk instead of restarting.