srplugin

package
v2.0.0-alpha+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2018 License: Apache-2.0 Imports: 15 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
}

NamedPolicySegment represents named policy segment. TODO: move unique identifiable name into srv6 models

type NamedSteering

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

NamedSteering represents named steetring.

type SRv6Configurator

type SRv6Configurator struct {
	// 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 (c *SRv6Configurator) AddLocalSID(value *srv6.LocalSID) error

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

func (*SRv6Configurator) AddPolicy

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

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

func (*SRv6Configurator) AddPolicySegment

func (c *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 (c *SRv6Configurator) AddSteering(name string, steering *srv6.Steering) error

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

func (*SRv6Configurator) Close

func (c *SRv6Configurator) Close() error

Close closes GOVPP channel

func (*SRv6Configurator) DeleteLocalSID

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

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

func (*SRv6Configurator) Init

func (c *SRv6Configurator) Init(logger logging.PluginLogger, goVppMux govppmux.API, swIfIndexes ifaceidx.SwIfIndex,
	srHandler vppcalls.SRv6VppAPI) (err error)

Init members

func (*SRv6Configurator) LogError added in v1.8.1

func (c *SRv6Configurator) LogError(err error) error

LogError prints error if not nil, including stack trace. The same value is also returned, so it can be easily propagated further

func (*SRv6Configurator) ModifyLocalSID

func (c *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 (c *SRv6Configurator) ModifyPolicy(value *srv6.Policy, prevValue *srv6.Policy) error

ModifyPolicy modifies policy in VPP using VPP's binary api

func (*SRv6Configurator) ModifyPolicySegment

func (c *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 (c *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 (c *SRv6Configurator) RemovePolicy(policy *srv6.Policy) error

RemovePolicy removes policy from VPP using VPP's binary api

func (*SRv6Configurator) RemovePolicySegment

func (c *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 (c *SRv6Configurator) RemoveSteering(name string, steering *srv6.Steering) error

RemoveSteering removes steering from VPP using VPP's binary api

func (*SRv6Configurator) Resync

func (c *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