package
1.0.5
Repository: https://github.com/fgschwan/vpp-agent.git
Documentation: pkg.go.dev

# README

L2 Plugin

The l2plugin is a Core Agent Plugin designed to configure Bridge Domains and L2 FIB in the VPP. Configuration managed by this plugin is modelled by l2 proto file. The configuration must be stored in etcd using following keys:

/vnf-agent/<agent-label>/vpp/config/v1/bd/<bridge-domain-name>
/vnf-agent/<agent-label>/vpp/config/v1/bd/<bridge-domain-name>/fib/<mac-address>
/vnf-agent/<agent-label>/vpp/config/v1/xconnect/<rx-interface-name>

JSON configuration example with vpp-agent-ctl

An example of basic bridge domain configuration in JSON format can be found here. A bit more advanced example which includes ARP termination entries can be found here. Example of FIB tables is available here

To insert config into etcd in JSON format vpp-agent-ctl can be used. Let's assume that we want to configure vpp with the label vpp1 and config for bridge domain bd1 is stored in the bridge-domain.json file. Furthermore, we assume that the bridge domain bd1 contains tap interface tap1 with configuration stored in tap.json. To convey this configuration to the agent through northbound API, you would execute:

vpp-agent-ctl -put "/vnf-agent/vpp1/vpp/config/v1/interface/tap1" tap.json
vpp-agent-ctl -put "/vnf-agent/vpp1/vpp/config/v1/bd/bd1" bridge-domain.json

Agent operating with the microservice label vpp1 will then create bridge domain, assign every interface which belongs to it (tap1 in the example above), and set BVI (if there is such an interface). If one or more ARP entries are available, all of them are written to ARP Termination table.

Every L2 FIB entry is configured for specific bridge domain and interface, both of them have to be configured (in any order) to be written to FIB table.

Inbuilt configuration example with vpp-agent-ctl

The vpp-agent-ctl binary also ships with some simple predefined bridge domain configurations. It is meant to be used solely for testing purposes.

First create a new tap interface tap1:

vpp-agent-ctl /opt/vpp-agent/dev/etcd.conf -ct

To configure a new bridge domain bd1 containing the previously created tap interface tap1, use:

vpp-agent-ctl /opt/vpp-agent/dev/etcd.conf -cbd

Alternatively, the bridge domain bd1 can be created to include few ARP termination entries with:

vpp-agent-ctl /opt/vpp-agent/dev/etcd.conf -aat

To create a new tap interface tap2 and to L2-xConnect it with tap1, use:

vpp-agent-ctl /opt/vpp-agent/dev/etcd.conf -cxc

To create L2 FIB table, run:

vpp-agent-ctl /opt/vpp-agent/dev/etcd.conf -aft

# Packages

Package bdidx implements name-to-index mapping registry and cache for bridge-domains.
Package binapi is the parent for packages that define various l2plugin southbound APIs.
Package model defines the l2lugin's northbound API.
Package vppcalls contains wrappers over VPP binary APIs for bridge-domains, L2 FIBs and XConnect pairs.
Package vppdump provides helpers to dump all bridge-domains, L2 FIBs and XConnect pairs configured in VPP.

# Structs

BDConfigurator runs in the background in its own goroutine where it watches for any changes in the configuration of bridge domains as modelled by the proto file "../model/l2/l2.proto" and stored in ETCD under the key "/vnf-agent/{vnf-agent}/vpp/config/v1bd".
BridgeDomainMeta holds info about interfaces's bridge domain index and BVI.
BridgeDomainStateMessage is message with bridge domain state + bridge domain name (because state message does not contain it).
BridgeDomainStateNotification contains bridge domain state object with all data published to ETCD.
BridgeDomainStateUpdater holds all data required to handle bridge domain state.
FIBConfigurator runs in the background in its own goroutine where it watches for any changes in the configuration of fib table entries as modelled by the proto file "../model/l2/l2.proto" and stored in ETCD under the key "/vnf-agent/{vnf-agent}/vpp/config/v1/bd/<bd-label>/fib".
FIBMeta metadata holder holds information about entry interface and bridge domain.
XConnectConfigurator implements PluginHandlerVPP.
XConnectMeta meta hold info about transmit interface.