One kernel WireGuard tunnel.Many paths. Zero added bytes.
Bramaguard is a small UDP proxy that sits between kernel WireGuard and your WAN interfaces and moves already-encrypted datagrams over several links at once. The tunnel stays WireGuard, the keys stay in your kernel, and the traffic stays unread.
This page describes the whole design. What runs today and what comes next is on the roadmap.
The five-minute path
Three sections answer most questions. The rest of the page is reference.
- Step 1What happens to a packetWhere bramaguard sits, and why the bytes on the wire do not change.
- Step 2Why a dead link costs nothingThe same packet on several links, and who throws the copies away.
- Step 3What it rides throughDelay, loss, jitter, reordering, cuts and carrier NAT: the faults behind every figure on this site.
Everything else is here so you can check us: schedulers, path lifecycle, topologies, NAT traversal, the security boundary and the footprint. Skipping it costs you nothing; reading it is how you check what the three sections above claim.
Zero added bytes, by construction
WireGuard in the kernel encrypts the packet and hands a finished UDP datagram to 127.0.0.1:59401 — that address is the whole trick: the peer’s Endpoint points at bramaguard on localhost. Bramaguard copies the datagram onto every active WAN socket, bound per interface with SO_BINDTODEVICE. Nothing is wrapped, so the bytes on each wire are identical to plain WireGuard.
On the server, bramaguard tells clients apart by the open receiver_index field that every WireGuard packet already carries, forwards to the local kernel WireGuard, and the kernel’s anti-replay window keeps the first copy and drops the rest. MTU stays 1420; a 1072-byte datagram is 1072 bytes on every link.
Mirror: reliability without a failover moment
Every packet leaves on every active path at the same instant. Whichever copy arrives first is decrypted; the later copy hits the anti-replay window and is silently dropped. Latency is the best path at each moment, jitter on one link is masked by the other, and a packet is lost only when every active path loses that same packet — a dead link is the easy case, two independent losses in the same instant the other one.
There is no detection, no decision and no switch. Failover, which is the usual answer, runs a loop: notice the failure, decide where the traffic goes, move it. Done well that still costs from hundreds of milliseconds to a few seconds, and the loop is itself a thing that can fail. Mirror has no loop — the copy is already travelling the other link at the moment the first one dies, so a fiber break costs zero lost seconds and a 0.168 s gap at ten packets a second, not the seconds a loop costs.
When a link physically drops, netlink tells bramaguard in 2–8 ms and the path leaves the active set — and the traffic never noticed: the other copies were already in flight.
The reasoning behind it, and why a heart has no failover controller either: we do not decide.
✓ first copy kept · ✕ duplicate dropped by WireGuard anti-replay
Warm reserve and make-before-break
A path is a pair (local WAN, remote address). It walks excluded → candidate → warm → active: netlink reports the link up with an address, heartbeats confirm it answers and keep its NAT mapping open, and the selector picks the top active_target paths by class and priority. The rest stay warm — probed, ready, carrying no data.
Because the reserve is already warm, a failover is a switch of ready state, not a new connection: make-before-break. Links with role = backup never compete for the target; they are promoted only when fewer than active_min paths remain — the metered LTE stick kept for the day the others fail.
[general]
mode = "mirror" # mirror | stripe
active_target = 2 # paths carrying traffic at once
active_min = 1 # below this, backup paths are promoted
prefer = "direct" # a direct pair beats any relay pair
distinct_local = true # active pairs on different physical WANs
[client]
listen = "127.0.0.1:59401" # kernel WG's Endpoint points here
server = "vds.example.com:59500"
[[path]]
iface = "eth1" # fiber
priority = 10 # lower = preferred
[[path]]
iface = "starlink0"
priority = 20
[[path]]
iface = "wwan0" # LTE, metered
priority = 30
role = "backup" # warm only; promoted when active < active_min
standby_heartbeat = "30s"
[health]
heartbeat = "1s" # 200–300 ms for drones
fail_after = 3 # missed beats before the path is dropped
recover_after = "30s" # stability before it comes back
preempt = true # return to the better path when it is aliveMirror for reliability, Stripe for bandwidth
The scheduler decides how packets are laid onto the active paths. Both ends run the same scheduler; the node that owns the WANs sets the policy and the server lays downstream out the same way.
✓ first copy kept · ✕ duplicate dropped by WireGuard anti-replay
Mirror
Cost = traffic × active paths. Latency = the best path at every moment. Loss only when every active path loses the same packet. Works for any mix of links: this is the reliability mode.
arrive out of order · held and re-sorted by the WireGuard counter · no header added
Stripe
On the roadmapRound-robin across paths; the receiver re-sorts by the WireGuard counter that is already in every packet, holding each gap for the latency spread between the paths. The buffer that takes is the spread times the throughput: at a 50 ms spread and 130 Mbit/s about 810 KB, which fits a router; at a 560 ms spread and 100 Mbit/s about 7 MB, which does not. So stripe adds up the bandwidth of links that behave alike (2× Starlink), and a set too uneven for the buffer stays on Mirror.
◆ one parity per group · K = 2 drawn · ✕ lost packet rebuilt at the receiver
Stripe + FEC
On the roadmapStripe has no redundancy of its own, so FEC adds one parity packet per group: a single lost packet is rebuilt at the receiver instead of waiting for a retransmit. Data packets keep their size and the MTU holds; the parity is the declared overhead (10–20%).
What we do not build: per-flow steering (“calls on the fast link, downloads on the wide one”). It needs to see inside the tunnel and we only see ciphertext, so heterogeneous bandwidth aggregation is not on the roadmap.
Exit, hub, P2P: one binary, one lifecycle
The topology says who the peer is; the scheduler and the path lifecycle are the same code everywhere. Exit and hub are available, and P2P is planned. All three can run on one router at once, each WireGuard peer on its own bramaguard port.
Exit — all internet through the VPS
Like a normal VPN, but over every WAN at once. The server keeps the first copy, NATs to the internet with its own address, and mirrors downstream back over the client’s active links. Bramaguard runs on both ends: a bare WireGuard server would accept the upstream copies but reply only to the last address it heard from — downstream would hop between links and no reserve could be kept warm.
Hub — stock WireGuard clients reach the LAN
A phone or laptop with the stock WireGuard app gets one link and no bonding; the router ↔ VPS leg stays multipath. It works with hand-written routes, or onboarding by code sets them up for you. Note that here the VPS is a full WireGuard peer and decrypts the traffic. Any peer without bramaguard can only reach the LAN this way.
P2P — router ↔ router, the VPS only introduces them
On the roadmapA path becomes a pair (WAN of A × address of B) — a matrix, not a list. Three WANs on one router and two on the other is six pairs, not three links: the selector activates as many as active_target asks for, keeps the useful rest warm, and excludes the ones NAT profiling says are hopeless. Pairs that can be punched go direct with mirror on top; the VPS sees signaling and heartbeats only. CGNAT ↔ CGNAT cannot be punched by anyone, so that pair lives on the relay — and the relay is not one link either. The server is a candidate like any other, so it brings two independent pair sets: one pair per WAN of A on the way in, one per WAN of B on the way out. Three WANs here and two there means three pairs and two, not a line — and every one of them lands on the same server socket, because bramaguard listens on one port and tells peers apart by receiver_index. One port serves the whole fleet. Mirror runs on both legs, so falling back through the server costs a round trip and nothing else. It forwards ciphertext without decrypting, unlike hub.
UDP-hostile network — the relay transports
On the roadmapA hotel or corporate firewall kills UDP: every direct pair and relay-udp are dead, and so is masque — it disguises itself as QUIC, which is UDP underneath. What survives is real TLS: the wss (TLS:443) and tcp443 candidates were kept warm the whole time, so the tunnel is promoted to relay-wss within a second. Each transport is a candidate of its own, so one WAN can hold several relay pairs and the selector picks by class — and because the pairs are per WAN on each leg, mirror keeps as many copies in flight here as it does directly. The VPS terminates TLS and forwards ciphertext on. Preference order: udp › masque › wss › tcp443; when UDP returns, preempt brings the direct pairs back.
Mirror the link. Mirror the route.
Mirror across your links protects you from a link that dies. It does not protect you from what sits behind all of them: a provider that sends your traffic the long way to your server, a congested exchange where providers hand it over, a cut cable or a routing change on the transit that both of your links share. The packets leave you on time and arrive late, or not at all.
Ingress relays are small relays of your own at other hosters, on other networks. Each one is another way into your server, and the principle stays the same: the same packet travels several ways at once and your server keeps the first copy to arrive. A way in that turns slow or dies, a relay included, costs nothing, because another copy is already arriving. So there are two layers of mirror: across your links, and across the routes into your server. The best ways carry the traffic and the rest wait in warm reserve.
A relay forwards ciphertext and holds no keys, so a rented server at any hoster sees no more than that hoster’s routers already do. Where to put them is your choice; what matters is that their networks differ from your server’s and from each other.
- Suboptimal or congested transit
- Your provider’s transit to your server’s data centre runs far away, or through an exchange that is congested. A relay at a hoster with a different route takes the short way in.
- PoP changes and routing errors
- Starlink can move you to a PoP in another country, and a BGP misconfiguration or route leak between providers can then carry traffic for a European server across the Atlantic and back: hundreds of milliseconds instead of tens, on every packet. A relay at a hoster that connects differently brings the same packets in by a short route, and the first copy to arrive wins.
- Backbone and subsea cable cuts
- When a cable under the sea is cut, by an anchor or on purpose, the internet reroutes around it, and the detour can put your traffic on a path that is far longer or already full. Relays at hosters on other networks give the same packets other detours, and the first copy to arrive wins.
- A shared upstream failure
- Different links can still meet the same upstream on the way to your server. When it drops that traffic, a third link does not help; another way in does.
Standby server: a second server for the server
On the roadmapThe server itself is the one machine every path ends at. A standby server is a second one of yours, in another data centre, with the same WireGuard identity. While the first is alive, it is one more way in. If every path to the first one dies, your routers move to the second, and nothing in their WireGuard configuration changes.
- Data-centre outage
- A fire, a flood, a power failure or an attack can take a whole data centre offline for days. Your routers move to the standby server in another one, and the network runs on.
- Provider suspension
- A suspended account, a migrated machine, an instance dropped without warning. The standby at another hoster takes over, and nothing on the routers is reconfigured.
In exit mode the public address moves with the server, so open internet connections reconnect once.
A ladder, best rung first
For P2P both routers need to reach each other through their NATs. Bramaguard tries the cheapest thing first and only climbs down when it has to. Heartbeats double as the punching packets, and our own server is the address reflector — no separate STUN infrastructure.
- 1Same LANmDNS / broadcast discovery — no NAT at all
- 2Global IPv6Starlink usually has it — exchange addresses, open the port, nothing to punch
- 3Static IPv4 + port-forwardone side reachable directly
- 4UDP hole-punchour server reflects the external (addr, port) per WAN, both sides burst at once
- 5Port predictionsymmetric NAT on one side: guess the next mapping
- 6Birthday approachhard NAT: many candidates, probability does the rest
- 7TCP simultaneous opena direct-tcp pair when UDP is filtered
- 8Relay via the VPSalways works · udp → masque → wss → tcp443 · forwards ciphertext only
Symmetric NAT on both sides cannot be punched by anyone — that pair lives on the relay, which is just another warm path with the worst priority. And the relay is not one link: it brings a pair per WAN on the way in and another per WAN on the way out, so mirroring continues through it.
What bramaguard sees — and what it never touches
Bramaguard holds no keys and never decrypts. It reads four open fields of the WireGuard header and nothing else; everything after them is ciphertext it forwards unchanged.
| field | offset | used for |
|---|---|---|
| type | byte 0 | handshake vs data vs keepalive |
| receiver_index | 4..8 | which client on a shared port |
| counter | 8..16 | reorder buffer in stripe, passive loss telemetry |
| mac1 | handshake | check before admitting a pending session |
Control packets between two bramaguard processes are authenticated with keyed BLAKE2s (constant-time compare). They are our only protocol addition, and they never carry user data.
- Closed list of routing targets, default-deny. A new table is not a place traffic may go until it is justified in that list.
- Never misdeliver. If two parties claim one routing key and the genuine one cannot be told apart, deliver to neither and count the dispute.
- Privilege is not inherited. An object created by exercising a privilege gets none until confirmed independently.
- A reused slot carries nothing. State of a displaced occupant must not survive the reuse of its slot.
- A pattern search is not a completeness check. Enumerate the whole set and check every member.
This layer went through independent review and adversarial testing before release; the rules above are what it is checked against.
We do not publish the code. Instead, every claim on this page can be checked from outside the binary, on your own hardware:
- ✓ Zero added bytes — tcpdump on your WAN shows the same 1072-byte datagrams with us and without.
- ✓ No key reaches us — the keys live in the kernel WireGuard you installed, which is open and audited.
- ✓ Nothing phones home — the only addresses it speaks to are the ones in your config. Buying happens in your browser at our payment partner; the license itself is a signed file you paste in, checked offline, so nothing about payment is in the data path.
- ✓ The binary is ours — signed releases and checksums, with the key published in more than one place to cross-check.
- ✓ It is removable — stop it, point the Endpoint back at your server, and the tunnel runs on one link as before.
- ✓ The protocol is not ours — we own no format you would be locked into; the tunnel is WireGuard’s.
Sized for a router, runs anywhere Linux does
Rust on stable, plain threads instead of an async runtime, one static musl binary with LTO and panic = abort. The data plane never allocates per packet, never takes a lock per packet and never logs per packet; recvmmsg/sendmmsg batch syscalls because on weak ARM and MIPS the syscall is the ceiling.
Put a bramaguard router in front of them and every device behind it — laptops, consoles, cameras, printers — gets the bonded connection without running any software at all. We bond the link the machines share. The data plane is Linux-specific on purpose, because it uses the kernel’s own WireGuard and the kernel’s own link events; a client for another operating system would mean carrying our own cryptography in userspace, which is exactly what makes the mesh clients above weigh 40–60 MB.
Built for links that misbehave
Mirror is made for real links, not clean ones. Every figure on this site holds with these faults on the links at the same time:
Three layers that do not know about each other
Obfuscation and post-quantum protection are not features we build. They come from the layers around WireGuard, and they are different kinds of thing: one is an alternative build of WireGuard with obfuscation, one stands beside it, and we stand in front of it.
- AmneziaWGan alternative to ithow the packet looks on the wire
- Rosenpassstands beside ithow the two ends agreed on keys
- bramaguardstands in frontover how many links the packet travels
| Layer | Relationship to WireGuard | What it determines |
|---|---|---|
| AmneziaWG | an alternative to it | how the packet looks on the wire |
| Rosenpass | stands beside it | how the two ends agreed on keys |
| bramaguard | stands in front | over how many links the packet travels |
All three can run at once — DPI obfuscation, post-quantum protection and multipath — and no layer knows the other two exist. That is the payoff of never touching the protocol: we inherit both for free, and a vendor with a protocol of its own cannot.
An alternative build of WireGuard for networks that hunt it: awg0 runs instead of wg0, the same protocol in substance and the same cryptography, with masked headers, junk packets and padding so deep packet inspection cannot recognise it.
For you it is one line of config per network — a flavor, not a code path. With AmneziaWG’s default header values the bytes on the wire are WireGuard’s, so nothing changes for us. With obfuscation on — H1–H4 and the S1–S4 junk sizes — the byte that says “this is a WireGuard packet” changes and the fields our server reads to tell one router from another move, so bramaguard takes the same values from the awg.conf you already have.
Post-quantum, beside the tunnel. WireGuard has a standard preshared-key field. Rosenpass — a separate daemon in Rust, published under MIT or Apache-2 — negotiates that key with post-quantum algorithms (Classic McEliece for authenticity and confidentiality, Kyber-512 for forward secrecy) and refreshes it about every two minutes, without patching WireGuard and without touching your traffic. It carries no data of its own.
Because bramaguard never touches cryptography, a session with a post-quantum preshared key and one without are indistinguishable to it. There is nothing to enable on our side and nothing for us to support: run Rosenpass beside your WireGuard and the protection applies. Its design is symbolically verified in ProVerif and it resists denial of service with cookies.
One caveat: Rosenpass runs alongside the tunnel on its own channel and its own port, outside our multipath. On a link failure the tunnel stays up and the key simply stops rotating until the link returns — WireGuard keeps using the last post-quantum key it was given, so protection is retained.
- ✕ our own obfuscation — it would add bytes and duplicate AmneziaWG
- ✕ our own post-quantum cryptography — Rosenpass has been through ProVerif; ours would need an audit of its own
- ✕ userspace WireGuard in the router data path — the kernel is faster
- ✕ per-flow classification — we see only ciphertext
- ✕ any server of ours in your traffic path — every role runs on your own infrastructure
- ✕ QKD — it needs a dedicated quantum channel; post-quantum keys through the preshared field are the right answer
The bonding appliances own their protocols and cannot swap them. We can, because we don’t have one — we stand on WireGuard.
Duplication and failover, and which one this is
There are two established answers to a dead link, and they differ in kind rather than in quality. Duplication: send the same packet over more than one link and let the receiver throw the copy away — what a bonding appliance does, on its own hardware and with its own protocol. Failover: one path carries the traffic and something moves it when that path breaks, which costs the detection and the switch. Ours is the first answer in software: duplication on hardware you already own, with the cryptography left in the kernel WireGuard you installed.
Whether that combination is worth anything to you is a question about your links, not about us: put two of them in the simulator and cut one.