Documentation ¶
Overview ¶
Package beaconing implements tasks and handlers related to beacon propagation and registration.
Handler ¶
Call NewHandler to create a beacon handler that implements infra.Handler. The handler validates the received beacon and verifies all signatures. If successful, the beacon is added to the beacon store.
Originator ¶
The originator should only be instantiated by core beacon servers. It periodically creates fresh beacons and propagates them on all core and child links. In case the task is run before a full period has passed, beacons are originated on all interfaces that have last been originated on more than one period ago.
Registrar ¶
The registrar is a periodic task to register segments with the appropriate path server. Core and Up segments are registered with the local path server. Down segments are registered with the originating core AS. In case the task is run before a full period has passed, segments are only registered, if there has not been a successful registration in the last period.
Propagator ¶
The propagator is a periodic task to propagate beacons to the appropriate neighboring ASes. In a core AS, the beacons are propagated to the neighbors on all core link, unless they will create an AS loop. In a non-core AS, the beacons are propagated to the neighbors on all child links. In case the task is run before a full period has passed, beacons are propagated on all interfaces that have last been propagated on more than one period ago.
Index ¶
Constants ¶
const (
// DefaultIfidSize is the default bit-size for ifids in the hop-fields.
DefaultIfidSize = 12
)
Variables ¶
This section is empty.
Functions ¶
func NewHandler ¶
func NewHandler(ia addr.IA, intfs *ifstate.Interfaces, beaconInserter BeaconInserter, verifier infra.Verifier) infra.Handler
NewHandler returns an infra.Handler for beacon messages. Both the beacon inserter and verifier must not be nil. Otherwise, the handler might panic.
Types ¶
type BeaconInserter ¶
type BeaconInserter interface { PreFilter(beacon beacon.Beacon) error InsertBeacon(ctx context.Context, beacon beacon.Beacon) (beacon.InsertStats, error) }
BeaconInserter inserts beacons into the beacon store.
type BeaconProvider ¶
type BeaconProvider interface {
BeaconsToPropagate(ctx context.Context) (<-chan beacon.BeaconOrErr, error)
}
BeaconProvider provides beacons to send to neighboring ASes.
type ExtenderConf ¶
type ExtenderConf struct { // Signer is used to sign path segments. Signer infra.Signer // Mac is used to calculate the hop field MAC. Mac hash.Hash // Intfs holds all interfaces in the AS. Intfs *ifstate.Interfaces // MTU is the MTU value set in the AS entries. MTU uint16 // IfidSize is the bit-size of the ifid in the hop-fields. IfidSize uint8 // GetMaxExpTime returns the maximum relative expiration time. GetMaxExpTime func() spath.ExpTimeType // contains filtered or unexported fields }
ExtenderConf is the configuration used when extending beacons.
func (*ExtenderConf) InitDefaults ¶
func (cfg *ExtenderConf) InitDefaults()
InitDefaults initializes the default values, if not set.
func (*ExtenderConf) Validate ¶
func (cfg *ExtenderConf) Validate() error
Validate checks that the config contains a signer.
type Originator ¶
type Originator struct {
// contains filtered or unexported fields
}
Originator originates beacons. It should only be used by core ASes.
func (Originator) IntfActive ¶
IntfActive returns whether the interface is active.
func (*Originator) Run ¶
func (o *Originator) Run(ctx context.Context)
Run originates core and downstream beacons.
type OriginatorConf ¶
type OriginatorConf struct { Config ExtenderConf BeaconSender *onehop.BeaconSender Period time.Duration }
OriginatorConf is the configuration to create a new originator.
func (OriginatorConf) New ¶
func (cfg OriginatorConf) New() (*Originator, error)
New creates a new originator.
type Propagator ¶
type Propagator struct {
// contains filtered or unexported fields
}
Propagator forwards beacons to neighboring ASes. In a core AS, the beacons are propagated to neighbors on core links. In a non-core AS, the beacons are forwarded on child links. Selection of the beacons is handled by the beacon provider, the propagator only filters AS loops.
func (Propagator) IntfActive ¶
IntfActive returns whether the interface is active.
func (*Propagator) Run ¶
func (p *Propagator) Run(ctx context.Context)
Run propagates beacons provided by the beacon provider on all active target interfaces. In a core beacon server, core interfaces are the target interfaces. In a non-core beacon server, child interfaces are the target interfaces.
type PropagatorConf ¶
type PropagatorConf struct { Config ExtenderConf BeaconProvider BeaconProvider BeaconSender *onehop.BeaconSender Period time.Duration Core bool AllowIsdLoop bool }
PropagatorConf is the configuration to create a new propagator.
func (PropagatorConf) New ¶
func (cfg PropagatorConf) New() (*Propagator, error)
New creates a new beacon propagation task.
type Registrar ¶
type Registrar struct {
// contains filtered or unexported fields
}
Registrar is used to periodically register path segments with the appropriate path servers. Core and Up segments are registered with the local path server. Down segments are registered at the core.
func (Registrar) IntfActive ¶
IntfActive returns whether the interface is active.
type RegistrarConf ¶
type RegistrarConf struct { Config ExtenderConf SegProvider SegmentProvider TopoProvider itopo.ProviderI Msgr infra.Messenger Period time.Duration SegType proto.PathSegType }
RegistrarConf is the configuration to create a new registrar.
func (RegistrarConf) New ¶
func (cfg RegistrarConf) New() (*Registrar, error)
New creates a new segment regsitration task.
type SegmentProvider ¶
type SegmentProvider interface { SegmentsToRegister(ctx context.Context, segType proto.PathSegType) ( <-chan beacon.BeaconOrErr, error) }
SegmentProvider provides segments to register for the specified type.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package mock_beaconing is a generated GoMock package.
|
Package mock_beaconing is a generated GoMock package. |