MCR is a specialized, high-performance multicast relay for Linux, designed to forward multicast traffic between network segments where conventional routing is impossible or inefficient.
It is built for engineers who face challenges with kernel-level multicast forwarding, such as the Reverse Path Forwarding (RPF) check, and require a flexible, scalable, and extremely fast userspace solution.
In many modern network environments—such as broadcast media facilities, financial data centers, or complex cloud VPCs—multicast traffic needs to traverse network boundaries that are not cleanly routable. Attempting to forward this traffic with standard routers often fails due to the kernel's strict RPF check, which drops packets that arrive on an interface other than the one the kernel would use to route back to the source.
MCR is the solution for this exact problem. By operating at Layer 2 and using raw AF_PACKET sockets, it can receive multicast packets from one network interface and re-transmit them on another, completely bypassing the kernel's IP-layer routing and RPF enforcement.
- Network Architects & Cloud Engineers: Bridge multicast traffic (e.g., discovery protocols, service announcements) between different VPCs, subnets, or physical network segments without complex routing changes.
- Broadcast & Media Engineers: Reliably transport high-bitrate media streams (e.g., SMPTE 2110) across network boundaries in production and lab environments.
- Financial Services Developers: Distribute real-time market data feeds across multiple isolated networks with minimal and predictable latency.
MCR is architected from the ground up for maximum throughput and minimal latency. The design combines several modern Linux technologies to achieve near line-rate speeds.
- Userspace Operation: Provides maximum flexibility and control, avoiding the limitations and overhead of kernel-level forwarding.
io_uringfor Asynchronous I/O: Utilizes Linux's most advanced I/O interface to dramatically reduce syscall overhead and minimize kernel-userspace context switching.AF_PACKETfor Raw Sockets: Reads and writes raw Ethernet frames, allowing for efficient processing and bypassing the kernel's IP stack.- Single-Threaded, Unified Event Loop: A single thread handles ingress, processing, and egress within one
io_uringinstance, eliminating cross-thread communication overhead and maximizing cache efficiency. - Zero-Copy Fan-Out: A single ingress packet can be efficiently replicated to multiple egress destinations using a zero-copy
Arc<[u8]>based architecture.
This combination of technologies allows MCR to operate at speeds approaching line-rate, typically limited only by the underlying hardware.
- Linux kernel 5.6+ (recommended: 5.10+ LTS)
- Rust toolchain (latest stable)
cargo build --release# Start the daemon
sudo ./target/release/mcrd supervisor
# Add a forwarding rule (in another terminal)
./target/release/mcrctl add \
--input-interface eth0 \
--input-group 239.1.1.1 \
--input-port 5000 \
--outputs 239.2.2.2:6000:eth1
# Check status
./target/release/mcrctl list
./target/release/mcrctl statsFor detailed usage, see the User Guide.
This project provides separate documentation for users and developers.
- User Guide: A quick-start guide to get MCR up and running.
- Reference Manual: The complete reference for configuring MCR, including kernel tuning, environment variables, and control plane commands.
- WHY_USE_MCR.md: Explains the core problem MCR solves and compares it to other tools like
socat.
- DEVELOPER_DOCS: The main entry point for all developer-focused documentation, including architecture, testing, and contribution guidelines.
This project is dual-licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
We welcome contributions! Please see the Contributing Guide for details on how to get started.