bfdplugin

package
v0.0.0-...-ae01f8c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 15, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

README

This document describes BFD plugin, its API, features and data representation.

BFD UDP

BFD plugin supports VPP single hop UDP based Bidirectional Forwarding Detection based on RFC 5880 and RFC 5881. BFD configuration requires source interface, local IP address and peer IP address. In order to successfully establish BFD session, both sides must be configured.

BFD local configuration key ID and BFD key ID (as carried in BFD control frames) is generated and assigned by the plugin itself.

Other configurable parameters:

  • Desired minimum TX interval named min_tx_interval in the API is an interval in microseconds where BFD transmits control packets. May not be a zero value.
  • Required minimum RX interval named min_rx_interval in the API is an interval in microseconds between received control packets. Can be set to zero - in that case the system does not expect control packets from the remote router.
  • Detect multiplier is a value multiplying the negotiated transmit, defining final detection time.

The BFD plugin does not support authentication.

A server key/data representation based on the CNF Protobuf model:

Key: /vnf-agent/<microservice_label>/config/vpp/bfd/v1/<interface-name>/peer/<peer-ip>
Data: 
{
    "if_name": "<interface-name>", 
    "local_ip": "<local-interface-ip>"
    "peer_ip": "<peer-ip>"
    "min_tx_interval": <desired-min-tx-interval>
    "min_rx_interval": <required-min-rx-interval>
    "detect_multiplier": <value>
}

The VPP supports CLI commands to show configured BFD sessions:

vpp# sh bfd sessions   
   Index               Property                  Local value         Remote value    
     0     IPv4 address                                10.10.0.5           10.10.0.10
           Session state                                      Up                   Up
           Diagnostic code                         No Diagnostic        No Diagnostic
           Detect multiplier                                   1                    1
           Required Min Rx Interval (usec)               1000000              1000000
           Desired Min Tx Interval (usec)                1000000              1000000
           Transmit interval                             1000000
           Last control frame tx                        .56s ago
           Last control frame rx                        .39s ago
           Min Echo Rx Interval (usec)                         1                    1
           Demand mode                                        no                   no
           Poll state                        BFD_POLL_NOT_NEEDED
     1     IPv4 address                                20.10.0.5           20.10.0.10
           Session state                                      Up                   Up
           Diagnostic code                         No Diagnostic        No Diagnostic
           Detect multiplier                                   1                    1
           Required Min Rx Interval (usec)               1000000              1000000
           Desired Min Tx Interval (usec)                1000000              1000000
           Transmit interval                             1000000
           Last control frame tx                        .34s ago
           Last control frame rx                        .39s ago
           Min Echo Rx Interval (usec)                         1                    1
           Demand mode                                        no                   no
           Poll state                        BFD_POLL_NOT_NEEDED
Number of configured BFD sessions: 2
vpp# 

The example above shows two BFD sessions with local and peer addresses, session state and configured intervals.

Documentation

Index

Constants

View Source
const (
	// PluginName is the name of the BFD Plugin.
	PluginName = "bfd"
)

Variables

View Source
var DefaultPlugin = *NewPlugin()

DefaultPlugin is a default instance of BfdPlugin.

Functions

This section is empty.

Types

type API

type API interface {
	// WatchBfdEvents subscribes for BFD state change notifications.
	WatchBFDEvents(ctx context.Context, subName string, eventChan chan<- *bfd.BFDEvent) error
}

API for the BFD plugin.

type BfdPlugin

type BfdPlugin struct {
	sync.Mutex
	Deps
	// contains filtered or unexported fields
}

BfdPlugin groups required BFD dependencies and descriptors

func NewPlugin

func NewPlugin(opts ...Option) *BfdPlugin

NewPlugin creates a new Plugin with provided options

func (*BfdPlugin) AfterInit

func (p *BfdPlugin) AfterInit() error

AfterInit subscribes for watching BFD state events.

func (*BfdPlugin) Close

func (p *BfdPlugin) Close() error

Close the event channel

func (*BfdPlugin) Init

func (p *BfdPlugin) Init() error

Init the VPP handler and register descriptors

func (*BfdPlugin) WatchBFDEvents

func (p *BfdPlugin) WatchBFDEvents(ctx context.Context, subName string, eventChan chan<- *bfd.BFDEvent) error

WatchBfdEvents subscribes for BFD state change notifications.

type Deps

type Deps struct {
	infra.PluginDeps
	KVScheduler kvs.KVScheduler
	GoVpp       govppmux.API
	IfPlugin    ifplugin.API
	GRPC        grpc_plugin.Server
}

Deps is a set of BFD plugin dependencies

type Option

type Option func(plugin *BfdPlugin)

Option is a function that can be used in NewPlugin allowing plugin customization

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL