srplugin

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2018 License: Apache-2.0 Imports: 13 Imported by: 0

README

SR plugin

The srplugin is a Core Agent Plugin designed to configure Segment routing for IPv6 (SRv6) in the VPP. Configuration managed by this plugin is modelled by srv6 proto file.

All configuration must be stored in ETCD using the srv6 key prefix:

/vnf-agent/<agent-label>/vpp/config/v1/srv6

Configuring Local SIDs

The local SID can be configured using this key:

/vnf-agent/<agent-label>/vpp/config/v1/srv6/localsid/<SID>

where <SID> (Segment ID) is a unique ID of local sid and it must be an valid IPv6 address. The SID is excluded from the json configuration for this key because it is already present as part of the key.

Configuring Policy

The segment routing policy can be configured using this key:

/vnf-agent/<agent-label>/vpp/config/v1/srv6/policy/<bsid>

where <bsid> is unique binding SID of the policy. As any other SRv6 SID it must be an valid IPv6 address. Also the binding SID is excluded from the json configuration because it is already part of the key.
The policy can have multiple segments (each segment defines one segment routing path and each segment has its own weight). It can be configured using this key:

/vnf-agent/<agent-label>/vpp/config/v1/srv6/policy/<bsid>/segment/<name> 

where <bsid> is the binding SID of policy to which segment belongs and name is a unique string name of the segment.

The VPP implementation doesn't allow to have empty segment routing policy (policy must have always at least one segment). Therefore adding the policy configuration without at least one segment won't write into the VPP anything. The configuration of VPP is postponed until the first policy segment is configured. Similar rules apply for the policy/policy segment removal. When the last policy segment is removed, nothing happens. Only after the removal of policy is everything correctly removed. It is also possible to remove only the policy and the VPP will be configured to remove the policy with all its segments.

Configuring Steering

The steering (the VPP's policy for steering traffic into SR policy) can be configured using this key:

/vnf-agent/<agent-label>/vpp/config/v1/srv6/steering/<name>

where <name> is a unique name of steering.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseIPv6

func ParseIPv6(str string) (net.IP, error)

ParseIPv6 parses string <str> to IPv6 address (including IPv4 address converted to IPv6 address)

Types

type NamedPolicySegment

type NamedPolicySegment struct {
	Name    string /* unique identifiable name */
	Segment *srv6.PolicySegment
}

TODO move unique identifiable name into srv6 models

type NamedSteering

type NamedSteering struct {
	Name     string /* unique identifiable name */
	Steering *srv6.Steering
}

type SRv6Configurator

type SRv6Configurator struct {
	// injectable/public fields
	Log         logging.Logger
	GoVppmux    govppmux.API
	SwIfIndexes ifaceidx.SwIfIndex // SwIfIndexes from default plugins
	VppCalls    vppcalls.SRv6Calls
	// contains filtered or unexported fields
}

SRv6Configurator runs in the background where it watches for any changes in the configuration of interfaces as modelled by the proto file "../model/srv6/srv6.proto" and stored in ETCD under the key "/vnf-agent/{vnf-agent}/vpp/config/v1/srv6".

func (*SRv6Configurator) AddLocalSID

func (plugin *SRv6Configurator) AddLocalSID(value *srv6.LocalSID) error

AddLocalSID adds new Local SID into VPP using VPP's binary api

func (*SRv6Configurator) AddPolicy

func (plugin *SRv6Configurator) AddPolicy(policy *srv6.Policy) error

AddPolicy adds new policy into VPP using VPP's binary api

func (*SRv6Configurator) AddPolicySegment

func (plugin *SRv6Configurator) AddPolicySegment(segmentName string, policySegment *srv6.PolicySegment) error

AddPolicySegment adds policy segment <policySegment> with name <segmentName> into referenced policy in VPP using VPP's binary api.

func (*SRv6Configurator) AddSteering

func (plugin *SRv6Configurator) AddSteering(name string, steering *srv6.Steering) error

AddSteering adds new steering into VPP using VPP's binary api

func (*SRv6Configurator) Close

func (plugin *SRv6Configurator) Close() error

Close closes GOVPP channel

func (*SRv6Configurator) DeleteLocalSID

func (plugin *SRv6Configurator) DeleteLocalSID(value *srv6.LocalSID) error

DeleteLocalSID removes Local SID from VPP using VPP's binary api

func (*SRv6Configurator) Init

func (plugin *SRv6Configurator) Init() (err error)

Init members

func (*SRv6Configurator) ModifyLocalSID

func (plugin *SRv6Configurator) ModifyLocalSID(value *srv6.LocalSID, prevValue *srv6.LocalSID) error

ModifyLocalSID modifies Local SID from <prevValue> to <value> in VPP using VPP's binary api

func (*SRv6Configurator) ModifyPolicy

func (plugin *SRv6Configurator) ModifyPolicy(value *srv6.Policy, prevValue *srv6.Policy) error

ModifyPolicy modifies policy in VPP using VPP's binary api

func (*SRv6Configurator) ModifyPolicySegment

func (plugin *SRv6Configurator) ModifyPolicySegment(segmentName string, value *srv6.PolicySegment, prevValue *srv6.PolicySegment) error

ModifyPolicySegment modifies existing policy segment with name <segmentName> from <prevValue> to <value> in referenced policy.

func (*SRv6Configurator) ModifySteering

func (plugin *SRv6Configurator) ModifySteering(name string, value *srv6.Steering, prevValue *srv6.Steering) error

ModifySteering modifies existing steering in VPP using VPP's binary api

func (*SRv6Configurator) RemovePolicy

func (plugin *SRv6Configurator) RemovePolicy(policy *srv6.Policy) error

RemovePolicy removes policy from VPP using VPP's binary api

func (*SRv6Configurator) RemovePolicySegment

func (plugin *SRv6Configurator) RemovePolicySegment(segmentName string, policySegment *srv6.PolicySegment) error

RemovePolicySegment removes policy segment <policySegment> with name <segmentName> from referenced policy in VPP using VPP's binary api. In case of last policy segment in policy, policy segment is not removed, because policy can't exists in VPP without policy segment. Instead it is postponed until policy removal or addition of another policy segment happen.

func (*SRv6Configurator) RemoveSteering

func (plugin *SRv6Configurator) RemoveSteering(name string, steering *srv6.Steering) error

RemoveSteering removes steering from VPP using VPP's binary api

func (*SRv6Configurator) Resync

func (plugin *SRv6Configurator) Resync(localSids []*srv6.LocalSID, policies []*srv6.Policy, namedSegments []*NamedPolicySegment, namedSteerings []*NamedSteering) error

Resync writes missing segment routing configs to the VPP and removes obsolete ones.

Directories

Path Synopsis
Package cache contains caches for certain modeled types.
Package cache contains caches for certain modeled types.
Package vppcalls contains wrappers over VPP binary APIs to simplify their usage
Package vppcalls contains wrappers over VPP binary APIs to simplify their usage

Jump to

Keyboard shortcuts

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