veb(4) is a minimal L2 Ethernet bridge for virtual topologies such
as bhyve(8) VMs and VNET jail(8)s. It is modeled on OpenBSD's veb(4)
and derived from if_bridge.c, but it is not a replacement for
bridge(4): it has no STP, no pfil(9) hooks, and no implicit host
presence. The host joins a veb explicitly through a vport,
which behaves as an ordinary Ethernet interface.
We add the veb(4) driver as it's structure allows for:
- Treating host forwarding similar to any other member
- L2 logic only: ports are not allowed any inet/inet6 address (besides the vport)
- Faster forwarding (up to 29% faster on multicast scenarios) due to reduced m_dup and m_copyup calls during packet path
- Added security with explicit host presence
- Groundwork for Bhyve networking enhancements (i.e. easy bi-directional packet transfers)
These things are not possible for bridge(4).
veb is configured over netlink, and ifconfig(8) gains veb support.
Because veb ports reuse ifp->if_bridge, bridge_ifdetach() now checks
that the departing interface's if_bridge_input is bridge_input
before treating if_bridge as one of its members.
Notes:
- Control plane is netlink-only (IFLA_INFO_DATA for link attributes, plus a small "veb" genl family for the address table)
- Follow-up: ifconfig.8 documentation for veb commands
Feedback is especially welcome on the netlink implementation and the vport design.