FABRIC–SPHERE integration: follow-up
- This post follows up on the original design record and corrects what has changed since. A working familiarity with Mars, Canopy, and Linux bridging/VXLAN is assumed.
- Throughout, N is the facility VNI and V is the experiment’s XPNet VLAN.
What’s changed
The design is the same as before: a VTEP peered with the fabric, a shared facility bridge, isolated per experiment ports, and routing through xpnet. The implementation has been generalized, and the facility tunnel and bridge are no longer manual.
- Generalized to external networks
- FABRIC is now one instance of a named external network (extnet): an outside layer 2 network brought to infrapod hosts over a static VXLAN.
- The fabric commands, packages, and keys were renamed to extnet.
- Files
- cmd/mrs/extnet.go: the mrs init and deinit commands for extnet, extnet-host, and extnet-attach
- internal/extnet/extnet.go: reads the realization, reserves address blocks, and writes and clears the etcd keys
- pkg/canopy/extnet.go: the facility tunnel and bridge, interface naming, VLAN handling, and port isolation
- service/canopy/reconciler.go and internal/reconcile/keys.go: Canopy handles the new per-host key
- mrs show is gone.
- Interface names
- The experiment interface pair is now xn-Va and xn-Vb, replacing fxN-Va and fxN-Vb.
- The tunnel and bridge default to xnvtepN and xnbrN.
How an external network is set up
- Define the network
- mrs init extnet writes the network definition to /extnet//def: the VNI, remote VTEP, MTU, and an optional address pool.
- Bring it up on a host
- mrs init extnet-host writes /net//extnet/, which holds the local underlay address, parent interface, interface names, and an optional MTU override.
- Mars copies the network’s VNI, remote, and MTU into this key, so Canopy only reads its own keys.
- Canopy builds the VXLAN and the facility bridge, and recreates the VXLAN if its settings drift. Because this is now desired state, it comes back after a reboot.
- The parent interface is still the operator’s. Canopy uses it by name but never creates it.
- Attach an experiment
- mrs init extnet-attach finds the experiment’s VTEP on the XPNet bridge from the realization, considering only hosts that carry the network. --host or --xp-vni is only needed when there is more than one match.
- If the network has a pool, the experiment is given one address block from it: the next free one, or the one given with --block. Mars prints the block along with the gateway and routes.
- The veth key, ownership record, and index are written in one guarded etcd transaction. Canopy then builds the pair as before.
- Remove it
- mrs deinit extnet-attach, or dematerializing the experiment, deletes the interface and releases the block if that experiment still owns them.
- A network can’t be removed while hosts, attachments, or blocks remain, and a host can’t be removed while experiments are attached to it. Removing something that doesn’t exist is an error.
- A live tunnel can’t be renamed, and two networks on one host can’t share interface names.
Usage:
mrs init extnet <name> --vni N --remote <remote-vtep> [--pool <cidr> --block-len <len> --gateway <ip>] # define the network
mrs init extnet-host <name> <host> --local <underlay-ip> --parent <underlay-iface> # tunnel and bridge on a host
mrs init extnet-attach <name> <mzid> # create the experiment's interface
mrs deinit extnet-attach <name> <mzid> # remove it (also automatic on dematerialize)
To check an external network interface on the host:
bridge link show dev xn<network>-Va # on xnbrN, forwarding
bridge -d link show dev xn<network>-Va | grep -o 'isolated on' # isolation set
bridge vlan show dev xn<network>-Vb # only VLAN V, PVID, untagged
What’s Next
-
Not run for real yet
- It builds but still hasn’t been run on a facility host.
-
Address enforcement
- Blocks are reserved so two experiments aren’t given the same addresses, but nothing yet stops an experiment from sending from outside its block.
-
Still manual
- An operator decides which experiments are attached by running mrs init extnet-attach.
- The node’s address and route are still configured by hand, using the block Mars prints.
- Block size and pool range still need to be agreed with the FABRIC side.