Fabric operator handbook
Velstra Fabric connects tenant interfaces across Linux hosts. A controller turns a topology into per-host policy, neighbor entries and forwarding tables. A host agent loads those tables into the eBPF dataplane.
flowchart LR
topo[Topology] --> ctl[Controller]
ctl -->|host-1 config| a1[Agent host-1]
ctl -->|host-2 config| a2[Agent host-2]
a1 --> d1[eBPF dataplane]
a2 --> d2[eBPF dataplane]
d1 <-->|overlay| d2
Start a local fabric to inspect two hosts, two tenant networks and a load balancer. It runs entirely in userspace.
| I want to… | Start here |
|---|---|
| Keep known ARP and IPv6 neighbor lookups on the originating host | Local neighbor discovery |
| Carry a tenant Ethernet frame across an IPv6 underlay | Ethernet over SRv6 |
| See evidence that packets traversed my policy | Verify packet handling |
| Configure workload ports, IP allocation or a service VIP | Topology and API reference |
| Attach a Kubernetes pod to a tenant network | CNI deployment |
| Review the state a standby can recover | Connection-state replication |
For a firewall appliance that includes Fabric and routing, see Velstra Sentinel.
Start a local fabric
Inspect a tenant topology with the same controller and CLI that serve a deployed fabric. This exercise opens loopback listeners, uses a temporary copy of the example and requires neither root nor an eBPF-capable kernel.
Build the controller
Install a current stable Rust toolchain and a native linker. Run these commands on a Linux host:
git clone https://github.com/Velstra/fabric.git
cd fabric
cargo build --locked -p velstra-controller
Start the example
From the repository root:
lab_dir=$(mktemp -d)
cp examples/topology.toml "$lab_dir/topology.toml"
./target/debug/velstra-controller serve \
--topology "$lab_dir/topology.toml" \
--listen 127.0.0.1:50051 --admin-listen 127.0.0.1:50052
Leave the controller running. In another terminal, from the same checkout:
./target/debug/velstra-controller orch list-ports
./target/debug/velstra-controller orch list-load-balancers
Look for 192.168.100.10 on host-1, 192.168.100.20 on host-2, and the web-vip load balancer. The hosts and ports are model objects here. Packet forwarding requires agents and actual interfaces.
Finish
Stop the controller with Ctrl-C. The temporary directory contains only the exercise's topology. Continue with local neighbor discovery to test a packet path on Linux.
Local neighbors and SRv6
Run these exercises from the repository root on a disposable Linux host after building the agent. The test harness creates network namespaces and veth pairs, starts the agents and removes its fixtures on exit. The tests require root, XDP/TC support and iproute2.
Local neighbor discovery
When a VM asks for the MAC of a known peer on its tenant segment, the ingress XDP program answers directly on the tenant interface. A VNI scopes the lookup, so two tenants can reuse the same IP. Unknown neighbors follow the usual discovery path.
sequenceDiagram
participant VM as Tenant VM
participant X as Ingress XDP
participant T as ARP_TABLE / ND_TABLE
VM->>X: Who has 192.168.100.2?
X->>T: lookup (VNI 5000, IP)
alt known
T-->>X: 02:00:00:00:0b:02
X-->>VM: reply on the tenant interface
else unknown
X->>X: usual discovery path
end
For a node with a compatible overlay and a tenant interface bound to VNI 5000, these two records describe the remote endpoint:
[[neighbor]]
vni = 5000
ip = "192.168.100.2"
mac = "02:00:00:00:0b:02"
[[nd_neighbor]]
vni = 5000
ip = "fd00:100::2"
mac = "02:00:00:00:0b:02"
Install arping and ndisc6 for both cases. On Debian these are supplied by iputils-arping and ndisc6. Then run:
sudo ./tests/e2e/run.sh overlay_arp overlay_nd
The IPv4 scenario checks both arp_suppressed and a reply received by the tenant. The IPv6 scenario checks nd_suppressed after a Neighbor Solicitation. A skipped scenario means its probe tool is missing.
Ethernet over SRv6
Fabric can bridge tenant Ethernet frames across an IPv6 underlay. The sending host maps the tenant VNI and destination MAC to a remote service SID. With one SID, the outer IPv6 destination carries it directly. On the receiving host, an end.dt2u local SID identifies the tenant segment.
flowchart LR
vmA[VM on host A] -->|frame, VNI 10000| encA[XDP encap<br/>srv6_route]
encA -->|IPv6 dst = SID fd00::100| decB[XDP decap<br/>end.dt2u]
decB --> vmB[VM on host B]
In the receiving host's node configuration, a local SID binding has this shape:
[[srv6_local_sid]]
sid = "fd00::100"
vni = 10000
behavior = "end.dt2u"
On the sending host, the corresponding [[srv6_route]] needs that same remote_sid, a tenant MAC, an underlay next-hop MAC and an output interface. Both hosts need their own [srv6] endpoint. The two-host fixture constructs both complete configs with the veth MACs it discovers at runtime:
sudo ./tests/e2e/run.sh srv6_roundtrip
Expect srv6_encap on host A and srv6_decap on host B. These assertions establish that an Ethernet frame crossed the tunnel. Check an application connection separately when evaluating workload reachability.
Two-host fixture · Topology and derived state
Verify packet handling
Choose the check that answers your question. Use a disposable Linux host for privileged tests; the harness creates networking fixtures and attaches actual kernel programs. Build the release binaries first.
| Question | Check | Observable result |
|---|---|---|
| Does the node config parse? | ./target/release/velstra validate examples/rules.toml | Resolved policy printed, exit 0; no interfaces touched. |
| Will this kernel accept the object? | sudo ./tests/e2e/loadcheck.sh | The real eBPF verifier accepts the programs. |
| Does a policy affect traffic? | sudo ./tests/e2e/run.sh fw_pass fw_icmp | The namespace cases compare allowed traffic and the expected ICMP drop. |
| Did both overlay endpoints process a frame? | sudo ./tests/e2e/run.sh srv6_roundtrip | Sender encapsulation and receiver decapsulation counters advance. |
| Does the CNI create a controller-managed port? | sudo ./tests/e2e/cni-controller.sh | CNI, the controller and the node agent agree on the allocated port and interface. |
Run a focused dataplane check
sudo ./tests/e2e/run.sh fw_pass fw_icmp
The test uses interfaces joined by veth pairs so packets cross the XDP receive hook. Traffic to a local dummy address can travel through loopback and miss that hook entirely. Read the assertion next to each case; a green routing or load-balancing counter alone cannot demonstrate a full application round trip.
Troubleshoot an unexpected result
| Symptom | Check next |
|---|---|
| Agent binary missing | Run the release build, or set VELSTRA_BIN to the intended binary before starting the harness. |
| Load check fails | Read the verifier output and confirm that this Linux kernel supports eBPF, XDP and TC. |
| ARP or ND case skips | Install arping or ndisc6, respectively, then rerun the two cases. |
| A VIP rewrites requests but replies fail | Check return routing, backend reachability, and that the agent sees both directions with shared NAT maps. |
Scenario definitions and assertions · CNI fixture · Kubernetes lab
Scenario inventory
The runnable names below come from the scenario registry. Append one or more names to sudo ./tests/e2e/run.sh to select them.
| Area | Cases |
|---|---|
| Ingress policy | fw_pass, fw_default_drop, fw_icmp, fw_port, fw_blocklist_v4, fw_blocklist_v6 |
| Egress, forwarding and NAT | egress_blocklist, routing, lb |
| Tenant Ethernet | overlay_arp, overlay_nd, overlay_encap, overlay_mac_fdb, local_mac_learn |
| SRv6 | srv6_encap, srv6_roundtrip, srv6_flood, srv6_irb |
Other integration fixtures target different layers:
- Controller-driven CNI exercises allocation and attachment in a disposable namespace. The Kubernetes guide covers a cluster deployment.
- Live reconciliation exercises a policy update pushed by the controller to a running agent; install
bpftoolfor its map checks. - Controller-driven SRv6 starts from self-registration and follows generated state through to the node agent.
For the original multi-terminal IPv4 NAT lab, see the versioned walkthrough. It describes checksum offload, host forwarding and return-path assumptions specific to that topology.
Run the host agent
Choose a local node policy for one machine or a controller endpoint for a managed fabric. A controller topology file and an agent policy have different schemas.
Local policy
After building the agent, inspect a sample without changing packet handling:
./target/release/velstra validate examples/rules.toml
./target/release/velstra validate examples/overlay.toml
Each command prints the path and resolved rules. To exercise actual packets, use the isolated namespace test. To attach manually, substitute an isolated lab interface that you own for lab0:
sudo ./target/release/velstra run --iface lab0 --xdp-mode skb \
--config examples/rules.toml --stats-interval 5
The agent reports its attachment and counters. Ctrl-C detaches it. Use --iface more than once when forward and return traffic enter different interfaces. Enable --egress only when outbound policy is intended for that host.
Live updates
During a full policy replacement, the agent closes the packet gate and drains existing kernel readers before changing maps. Arriving packets are dropped, not buffered. If applying a replacement fails, it attempts to restore the previous state. A failed restoration keeps the gate closed. The update barrier requires Linux global membarrier support and a kernel without nohz_full isolation. This mechanism applies while the agent runs.
stateDiagram-v2
[*] --> Open
Open --> Closed: replacement starts
Closed --> Drained: kernel readers drained
Drained --> Open: maps applied
Drained --> Restoring: apply failed
Restoring --> Open: previous state restored
Restoring --> HeldClosed: restore failed
Routing, NAT and overlays
| Example | Use it to inspect |
|---|---|
| router.toml | IPv4 longest-prefix forwarding and next-hop rewriting. |
| loadbalancer.toml | Service VIP, backend selection and reply translation. Draining a backend leaves existing flows pinned. |
| overlay.toml | Tunnel endpoint, interface VNI and tenant neighbor entries. Size tenant MTUs for the encapsulation overhead. |
To import Wren routes, configure --wren-socket PATH --wren-routes. Static routes take precedence. Unresolved gateways are retried; on-link and IPv6 learned routes use the kernel.
Controller connection
Repeat --controller for failover. For a remote deployment, use HTTPS endpoints and configure --tls-ca, --tls-cert and --tls-key. The agent retains the last-applied config while reconnecting.
Controller setup · Mutual TLS in Kubernetes
Manage topology and APIs
The controller takes the fabric's declarations through --topology or the management API. The agent takes per-node policy through --config or receives it from a controller. Use the worked topology to try both hosts and inspect their ports without running an agent.
Topology file
A network groups tenant ports by VNI. The example below is a complete single-host topology for inspection. It names a lab interface; no agents attach when only the controller is running.
[[host]]
id = "host-1"
vtep = "10.10.0.1"
underlay_iface = "eth0"
underlay_mac = "02:00:00:00:00:11"
[[network]]
vni = 5000
name = "blue"
subnet = "192.168.100.0/24"
[[port]]
network = 5000
host = "host-1"
tap = "tap-blue-1"
ip = "192.168.100.10"
Save this as topology.toml. Start the controller as in the quickstart, passing this file to --topology. Run velstra-controller orch list-ports and look for port-5000-192.168.100.10.
flowchart LR
host["[[host]]"] --- port["[[port]]"]
net["[[network]] VNI"] --- port
net --- subnet["[[subnet]]"]
sg["[[security_group]]"] -.->|by name| port
vrf["[[ip_vrf]]"] -.->|member VNIs| net
lb["[[load_balancer]]"] -.->|host + tap| port
| Block | What to set | Important relationship |
|---|---|---|
[[host]] | Host ID, underlay interface, IPv4 VTEP and MAC | For a UDP overlay choose VXLAN or Geneve. An SRv6 locator drives service-SID derivation for a configured SRv6 host. |
[[network]] | VNI, name, optional IPv4 allocation subnet and default action | On a port without a separate policy, the VNI supplies the default policy ID. |
[[subnet]] | ID, VNI, CIDR and optional gateway/pool bounds | Supports IPv4 and IPv6. Gateway and bounds must lie inside the prefix. |
[[port]] | Network, host, tap, optional IP and security group | Omitting the IP requests allocation; migrating a port preserves its assigned identity. |
[[security_group]] | Name, default action, optional statefulness and rules | Bind by name from the port. Rules can match a source prefix as well as protocol and port. |
[[ip_vrf]] | L3 VNI, anycast gateway MAC and member network VNIs | A network belongs to at most one VRF. Learned EVPN routes feed its routed context. |
[[load_balancer]] | VNI, VIP, TCP/UDP port and member ports | Refer to members by host/tap in TOML and port ID in the API. The VIP and members must belong to the intended network. |
Northbound API
The orch CLI uses the gRPC management service, normally at 127.0.0.1:50052. The installed build lists its own flags:
./target/debug/velstra-controller orch --help
./target/debug/velstra-controller orch add-load-balancer --help
In Raft mode send topology writes to the leader. With file-backed topology, mutations update the backing file. Use a disposable copy when experimenting.
Read the REST API
To open a local HTTP interface, add --rest-listen 127.0.0.1:9500 to the quickstart's controller command. With that controller running:
curl --fail --silent http://127.0.0.1:9500/healthz
curl --fail --silent http://127.0.0.1:9500/v1/ports
The health endpoint returns {"status":"ok"}. The ports response describes the model currently held by the controller. The REST listener is opt-in; a loopback lab with no tokens grants local clients access.
| Resource or operation | Endpoint |
|---|---|
| Read/change topology | /v1/hosts, /v1/networks, /v1/ports, /v1/subnets, /v1/security-groups, /v1/ip-vrfs |
| Inspect public addresses or service pools | /v1/floating-ips, /v1/load-balancers |
| Read retained operations | GET /v1/audit |
| Subscribe to new audit entries | GET /v1/events (SSE) |
A slow subscriber may receive a lag notification. A consumer needing continuity should reconcile against the audit endpoint and deduplicate by sequence number. Webhook delivery retries transient failures and is best-effort. For the full set of routes and message fields, see the HTTP router and the gRPC contract.
Derived node config
See the node configuration examples for each dataplane path. Inspect [[interface]] to find a local tap's policy and VNI, [[neighbor]] and [[nd_neighbor]] for the tenant IP/MAC bindings, and [[tunnel]] or [[srv6_route]] for a remote destination. A load-balanced VIP becomes a [[service]] under each relevant ingress policy. Direct edits to generated state are replaced on reconciliation.
Field and command reference
| I need the complete… | Reference |
|---|---|
| Topology TOML fields, defaults and relationships | Topology parser and full two-network topology |
| Node policy, service, NAT and overlay configuration | Typed schema and validation and sample node files |
| Current management verbs and option defaults | velstra-controller orch --help, followed by velstra-controller orch <verb> --help |
| REST methods, request limits and response types | HTTP routes and handlers |
| Protobuf request and response messages | velstra.proto |
Service pools
The local exercise includes web-vip with two member ports:
[[load_balancer]]
id = "web-vip"
vni = 5000
vip = "192.168.100.200"
port = 80
proto = "tcp"
[[load_balancer.member]]
host = "host-1"
tap = "tap-blue-1"
port = 8080
[[load_balancer.member]]
host = "host-2"
tap = "tap-blue-2"
port = 8080
In the TOML file, each [[load_balancer.member]] references a host and tap. In the CLI, members use port-id:backend-port. For example, port-5000-192.168.100.10:8080 selects port 8080 on the first example VM. A port must belong to the VIP's network. A duplicate VIP/port/protocol tuple or a VIP colliding with a workload port is rejected.
Set draining = true on a member to stop selecting it for new flows while its established flows finish. Client affinity (client_affinity = true) selects by source address and can concentrate load when many clients share a NAT address. An empty pool passes traffic through and increments lb_no_backend.
Deploy the Kubernetes CNI
The sample manifests run three Raft controllers and one agent per node. On pod creation the CNI allocates a port from the controller; the node's agent attaches the derived policy to the pod veth.
Use a disposable Linux cluster configured for an external CNI. The base manifests install a host CNI and start plaintext listeners. Build Fabric's binaries and have Docker, Kind and kubectl available. In Kind, use disableDefaultCNI: true in the cluster configuration.
Deploy the lab
The examples assume the default Kind cluster name and a kubectl context pointing to that cluster. Start from the repository root:
make kind-load
kubectl apply -f deploy/k8s/
kubectl -n velstra-system rollout status statefulset/velstra-controller
kubectl -n velstra-system rollout status daemonset/velstra-agent
The manifests use the images built locally and loaded into the Kind nodes. For a versioned deployment, use the qualified tag. The controller needs persistent storage for its per-replica snapshots. Set the underlay interface in the agent manifest to the interface actually used by the nodes.
Bootstrap the network
Create the same VNI/subnet that the installed CNI configuration references. In this example ordinal 0 is the initial bootstrap node; use the current leader if it has changed.
kubectl -n velstra-system exec velstra-controller-0 -- \
velstra-controller orch --endpoint http://127.0.0.1:50052 \
add-network --vni 5000 --name blue --subnet 192.168.100.0/24 --drop-icmp false
Schedule a test pod, then compare its assigned IP with the controller's port list:
kubectl get pods -o wide
kubectl -n velstra-system exec velstra-controller-0 -- \
velstra-controller orch --endpoint http://127.0.0.1:50052 list-ports
If creation fails, check that the controller knows the network, that the agent registered the host, and that CNI and controller use matching credentials.
mTLS
For a deployment outside the plaintext lab, supply client and server identities for the agent, admin and Raft channels. A privileged admin identity is distinct from a node identity.
| Component | Required configuration |
|---|---|
| Controller | Mount server key/cert and client CA. Set --tls-cert, --tls-key and --client-ca. Configure allowed admin and Raft peer CNs. |
| Node agent | Use HTTPS endpoints and --tls-ca, --tls-cert, --tls-key. The agent's certificate CN must match its host ID for host-scoped writes. |
| CNI binary | Install its credentials at paths available on the host. Set controllers to HTTPS URLs and configure tlsCA, tlsCert and tlsKey in the conflist. |
| CLI | Use a separate operator client certificate authorized by the controller to change fabric-wide topology. |
The lab PKI helper generates example secrets; adapt its shared sample identities to your actual authorization model. Restrict listeners to known node/control networks, since host-networked agents can appear to originate at node addresses.
Manifests · CNI integration test
Replicate connection state
A standby can receive NAT, firewall and SYN-proxy connection state from a peer. Configure both nodes with compatible Fabric builds and matching filtering policies. Provide a dedicated HA network or encrypted tunnel if the flow metadata needs confidentiality.
Configure peers
Add this table to the first node's policy. Provision the same high-entropy secret (32–1024 bytes) on both nodes through your secret management, and protect the policy file.
[conntrack_sync]
listen = "192.0.2.10:5429"
peer = ["192.0.2.11:5429"]
secret = "REPLACE_WITH_A_RANDOM_SHARED_SECRET"
interval_ms = 50
On the second node, swap the listen and peer addresses. Replication requires authenticated TCP and explicit peers. Missing or invalid secrets and listen-only configurations are rejected; legacy unauthenticated UDP is disabled. Before upgrading both peers, configure a valid shared secret and peer addresses, or remove [conntrack_sync] to disable replication.
Verify a switchover
- Check that the peer stream establishes and both nodes accept the policy fingerprint. Filter, NAT, policy IDs, interface bindings and timeouts must agree.
- Establish a test connection through the active node. Allow the initial snapshot and subsequent changes to reach the standby.
- During a planned failover exercise, check progress on that same connection. A new client connection only demonstrates that the service is reachable again.
How replication works
sequenceDiagram
participant A as Sender
participant S as Receiver
A->>S: TCP connect, challenge handshake (shared secret)
Note over A,S: policy fingerprints must match
A->>S: snapshot: CONNTRACK, FW_FLOWS, SYN_FLOWS
loop every interval_ms
A->>S: changed records and deletions
end
Each new session starts with a snapshot, then sends changed records and deletions. Every node sends to its peers and receives from them. Frames carry sequence numbers and an HMAC: this authenticates, it does not encrypt. Replication is asynchronous: a recent flow may still exist only on the failed node. Election, exclusive forwarding authority and ownership of a shared address must be provided separately.
Replication implementation and tests · Sentinel HA verification
Export IPFIX records
Use IPFIX to measure IPv4 NAT flows per firewall policy. A collector may be reached over either IPv4 or IPv6. This is a diagnostic UDP stream; local submission cannot confirm delivery to the collector.
Configure an exporter
Add a flow_export table to the local node policy. Replace the example collector with your collector's address:
[flow_export]
collector = "192.0.2.45:4739"
interval_secs = 30
observation_domain = 42
Validate the edited node policy with velstra validate PATH. After the agent sees traffic through a NAT service, inspect the records at your collector. An idle flow with no new packets produces no delta.
Decode a record
| Field | What to do with it |
|---|---|
Template ID 257 | Expect the template in each datagram. |
observationPointId (IE 138) | Decode as unsigned 64-bit. It identifies the firewall policy. Policy 0 is the top-level policy. |
| IPv4 tuple, protocol, byte/packet counts | Count deltas for each tuple. Group by exporter, observation domain and observation point before aggregating. |
Two tenants can use identical private addresses. Keep their policy IDs distinct in the collector. If a policy ID is reassigned, rotate the exporter or observation domain and preserve the historical mapping.
Local send failures retain unsent records for retry in memory. An exporter restart loses that pending state and the previous baseline. See the encoder and wire-format tests and the IANA information elements.
Architecture
Follow a workload port from topology to packet handling. In the local fabric exercise, tap-blue-1 belongs to host 1. That host's agent would receive a local interface binding; a participating remote host would receive forwarding and neighbor entries for the port.
Crate layout
| Component | Responsibility |
|---|---|
velstra-orchestrator | Models hosts, networks and ports. Allocates addresses and derives per-host configurations. |
velstra-controller and velstra-raft | Serve configs and the management API. In cluster mode, the leader commits topology changes and followers can serve agent reads. |
velstra-config and velstra-proto | Parse typed node configuration and define the gRPC contract. |
velstra-app (binary velstra) | Attaches programs and reconciles kernel maps with the current node configuration. |
velstra-common and velstra-ebpf | Share packet/map layouts, implement forwarding decisions and run the XDP/TC programs. |
velstra-cni | Connects a pod interface and requests a workload port in controller mode. |
From topology to kernel maps
sequenceDiagram
participant Op as Operator or CNI
participant C as Controller
participant A as Agent
participant K as Kernel maps
Op->>C: orch create-port (admin API)
C->>C: derive per-host NodeConfig
A->>C: WatchConfig(node id)
C-->>A: NodeConfig, then one per change
A->>K: reconcile maps
A->>C: ReportStats
The agent watches the first reachable --controller and identifies itself with --node-id (default: the hostname). The gRPC contract is velstra.proto.
The packet path
flowchart LR
nic[(Ingress)] --> gate[velstra<br/>gate]
gate --> rel[velstra_related]
rel --> main[velstra_main<br/>policy]
main -->|IPv4| s4[velstra_v4_state] --> v4[velstra_v4_verdict] --> fwd[velstra_forward]
main -->|IPv6| v6[velstra_v6] --> s6[velstra_v6_state]
fwd --> out[(Redirect or<br/>kernel stack)]
eg[(Egress)] --> tc[velstra_egress<br/>TC stages]
Each box is an XDP program, chained by tail call through VELSTRA_PROGS; TC egress stages use EGRESS_PROGS. The gate drops a packet before parsing on HA ownership, configuration readiness, port identity or port rate limit.
- The ingress interface selects a firewall policy and, for a tenant interface, a VNI. A security group can share a policy across several VNIs.
- A tenant IP packet goes through policy and forwarding. A matching IPv4 service can translate a VIP to a backend and record the reverse mapping for replies; both directions must reach hooks sharing those maps.
- Overlay lookups can hand a frame to a remote host. Protocol-specific shortcuts include local ARP and Neighbor Discovery.
- Traffic that requires a kernel route continues through the host networking stack. IPv4 fast-path forwarding, dual-stack packet filtering and SRv6 tenant transport have different coverage.
The map ABI
A single set of Rust key/value types defines the binary interface between agent and kernel. A packet counter measures a decision at a hook; a successful application connection exercises the path beyond it.
| Map | Holds |
|---|---|
IFACE_POLICY, CONFIG | Interface → policy, and each policy's settings |
SERVICES, BACKENDS | Policy-scoped service keys and their backends |
CONNTRACK, FW_FLOWS | Connection-tracking and firewall flow records |
ROUTES, TX_PORTS | Longest-prefix routes and redirect targets |
ARP_TABLE, ND_TABLE, SRV6_FDB | VNI-scoped neighbor and overlay lookups |
STATS | Per-CPU counters |
Availability
A file-backed controller stores single-node topology in the file supplied to --topology. Cluster deployments use Raft; configure --raft-dir to keep snapshots through a full restart. Agents can contact multiple controllers and keep the last-applied policy during a controller outage. Replicating connection state between dataplanes is separate.
Topology reference · Verify real traffic · Shared ABI definitions
Development environment
Choose the lightweight host build for controller and model work. Install the BPF toolchain when you need the host agent or want to exercise the Linux dataplane. Run commands from the repository root.
Toolchain
The agent embeds a BPF object built with nightly-2026-08-01 and an LLVM 22-compatible bpf-linker. Use Rustup for both the host compiler and this BPF compiler:
rustup toolchain install stable --component rustfmt --component clippy
rustup toolchain install nightly-2026-08-01 --component rust-src
rustup run nightly-2026-08-01 rustc --version --verbose
Check the reported LLVM major before building the linker. On Debian/Ubuntu with the matching LLVM packages available:
sudo apt-get install llvm-22-dev libpolly-22-dev
export PATH="/usr/lib/llvm-22/bin:$PATH"
cargo install bpf-linker --locked --no-default-features --features llvm-22
bpf-linker --version
The repository’s CI setup documents its LLVM package source. The protobuf build uses vendored protoc unless an explicit PROTOC is supplied.
Build
cargo build --release --locked
./target/release/velstra validate examples/rules.toml
The second command prints the parsed policy without loading any programs. For a controller-only binary, follow the local quickstart.
Tests
cargo fmt --all -- --check
cargo test --workspace --exclude velstra --exclude velstra-ebpf --locked
These tests cover host logic. The release binary and a Linux host with root/XDP/TC support are required for packet tests. See CI for clippy, BPF build and release gates.
Build this handbook
Use mdBook 0.4.52:
mdbook build
Open book/index.html locally. The documentation workflow builds pull requests and deploys the built book on pushes to main. GitHub Pages must use GitHub Actions as the publishing source.
Release qualification
Choose a release image by tag or exact commit. The CI pipeline publishes controller, agent and CNI containers only from deliberate v* tags that pass verification.
| Event | Result |
|---|---|
| Pull request or main-branch integration | Host tests, build and kernel verifier checks. No container release. |
| Qualified version tag | Host, build, verifier and dataplane jobs must succeed before publication. Container images receive version and full-commit tags. |
| GitHub release | Requires successful image publication and release notes for that version. |
For a checkout you intend to deploy, compare git rev-parse HEAD to the full-commit tag and read its release notes. The workflow defines the exact gates. Sentinel's appliance-level signing and upgrade tests have their own qualification process.
IPv4 reply checksum correction
Scope. A generated IPv4 TCP reset could retain the incoming TOS value while its IPv4 checksum assumed TOS zero. Some receivers discarded the resulting reply. The correction aligns the TOS byte with the checksum calculation for reject and synthesized replies.
Verification. The recorded appliance checks covered all 64 DSCP classes for native rejects and actual proxied sessions for SYN-proxy behavior. An earlier, separate routed TCP-checksum observation remained open in that investigation.
For release selection, use the Fabric release notes and the qualification evidence for the appliance version you plan to run.
Rustix dependency correction
The November 2026 build dependency update moved the locked rustix 1.x dependency from 1.1.4 to 1.1.6 for the extended-attribute correction. It entered the build graph through protobuf code generation. A separate 0.38.x entry used by other dependencies was outside the change.
To inspect the dependency chain at the revision you intend to build:
cargo tree --locked -i rustix@1.1.6
This command addresses the recorded lockfile version; use the current locked version for later revisions. Consumers that pin Fabric must advance their own input and qualify the resulting build.