Expand description
Rust implementation of the MetalBond route distribution protocol.
MetalBond distributes virtual network routes across hypervisors over TCP/IPv6.
§Quick Start
§Server
let server = MetalBondServer::start("[::]:4711", ServerConfig::default()).await?;
// ... server.shutdown().await?;§Client
use rustbond::{MetalBondClient, RouteHandler, Route, Vni};
struct MyHandler;
impl RouteHandler for MyHandler {
fn add_route(&self, vni: Vni, route: Route) { /* handle add */ }
fn remove_route(&self, vni: Vni, route: Route) { /* handle remove */ }
}
let client = MetalBondClient::connect(&["[::1]:4711"], MyHandler);
client.wait_established().await?;
client.subscribe(Vni(100)).await?;§Multi-Server (HA)
For high availability, connect to multiple servers simultaneously:
let client = MetalBondClient::connect(&["[::1]:4711", "[::1]:4712"], MyHandler);
client.wait_any_established().await?;
// Routes are deduplicated across servers; ECMP supported§Features
- Async client/server with Tokio
- Automatic reconnection
- VNI-based subscriptions
- Multi-server HA with ECMP support
- Standard, NAT, and LoadBalancer route types
§Netlink Feature
Enable the netlink feature to install routes directly into the Linux kernel:
[dependencies]
rustbond = { version = "0.1", features = ["netlink"] }Structs§
- Destination
- Route destination (IP prefix).
- Logging
Handler - A logging route handler for debugging.
- Metal
Bond Client - A MetalBond client for connecting to one or more MetalBond servers.
- Metal
Bond Server - A MetalBond server.
- NextHop
- Next hop for a route.
- NoOp
Handler - A no-op route handler for testing.
- Route
- A route consisting of a destination and next hop.
- Route
Table - A route table without internal synchronization.
- Server
Config - Server configuration.
- Server
Id - Unique identifier for each server connection.
- Server
State - Shared server state.
- Vni
- Virtual Network Identifier (VNI).
Enums§
- Action
- Route update action.
- Client
State - Connection state when using multiple servers.
- Connection
State - Connection state.
- Error
- Errors that can occur in MetalBond operations.
- IpVersion
- IP version for route destinations.
- Next
HopType - Next hop type.
Traits§
- Route
Handler - Handler trait for receiving route updates.
Type Aliases§
- Result
- Result type for MetalBond operations.