https://github.com/usagi-coffee/unison
Flexible UDP transport layer designed for bi-directional multi-path delivery
https://github.com/usagi-coffee/unison
iptables nfqueue rust udp wireguard
Last synced: 27 days ago
JSON representation
Flexible UDP transport layer designed for bi-directional multi-path delivery
- Host: GitHub
- URL: https://github.com/usagi-coffee/unison
- Owner: usagi-coffee
- License: mit
- Created: 2025-06-30T02:02:00.000Z (11 months ago)
- Default Branch: master
- Last Pushed: 2025-10-06T09:16:55.000Z (8 months ago)
- Last Synced: 2026-04-29T06:36:45.138Z (27 days ago)
- Topics: iptables, nfqueue, rust, udp, wireguard
- Language: Rust
- Homepage:
- Size: 133 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Unison
> Proof of Concept - expect bugs and breaking changes.
Flexible UDP transport layer designed for bi-directional multi-path delivery.
## Features
- Packet duplication across multiple interfaces for redundancy
- Packet deduplication, with out-of-order handling
- Packet fragmentation across multiple interfaces for parallel transmission and reassembly
- Seamless bidirectional handling of UDP traffic
- Source IP masquerading and restoration for single-source IP–dependent protocols like SRT
## Planned Features
- Configurable heuristics for adaptive multi-path delivery
- Packet retransmissions for lost packets/fragments
## Installation
```bash
cargo install --git https://github.com/usagi-coffee/unison --locked
```
## Client
This configirations duplicates the UDP traffic that targets port `8888` through `eth0` and `eth1`.
```bash
unison --ports 8888 --interfaces eth0 eth1
```
## Server
Usually server needs only one interface, in this case we just use`eth0` for receiving and sending the packets back if needed, the duplicated traffic comes over port `8888`.
```bash
unison --server --ports 8888 --interfaces eth0
```
## Consistent Source IP/Port
Some protocols like SRT, RTP, or other connection-oriented UDP protocols require all packets to originate from a single consistent source IP and port by reading the ip and udp header. When using multi-path transport, this consistency can be lost and can lead to session instability or rejections.
Unison supports "snat-like" source address and port rewriting to preserve consistency. This is done at the ip/udp header level and ensures that the target socket sees all packets as coming from the same source.
```bash
# Packets will appear as to come from 10.64.0.1:1337 to sockets on the server
unison --server --snat 10.64.0.1:1337 --ports 8888 --interfaces eth0
```