router

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: Apache-2.0 Imports: 43 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchConn

type BatchConn interface {
	ReadBatch(underlayconn.Messages) (int, error)
	WriteTo([]byte, *net.UDPAddr) (int, error)
	WriteBatch(msgs underlayconn.Messages, flags int) (int, error)
	Close() error
}

BatchConn is a connection that supports batch reads and writes.

type Connector

type Connector struct {
	DataPlane DataPlane

	ReceiveBufferSize int
	SendBufferSize    int
	// contains filtered or unexported fields
}

Connector implements the Dataplane API of the router control process. It sets up connections for the DataPlane.

func (*Connector) AddExternalInterface

func (c *Connector) AddExternalInterface(localIfID common.IFIDType, link control.LinkInfo,
	owned bool) error

AddExternalInterface adds a link between the local and remote address.

func (*Connector) AddInternalInterface

func (c *Connector) AddInternalInterface(ia addr.IA, local net.UDPAddr) error

AddInternalInterface adds the internal interface.

func (*Connector) AddSvc

func (c *Connector) AddSvc(ia addr.IA, svc addr.SVC, ip net.IP) error

AddSvc adds the service address for the given ISD-AS.

func (*Connector) CreateIACtx

func (c *Connector) CreateIACtx(ia addr.IA) error

CreateIACtx creates the context for ISD-AS.

func (*Connector) DelSvc

func (c *Connector) DelSvc(ia addr.IA, svc addr.SVC, ip net.IP) error

DelSvc deletes the service entry for the given ISD-AS and IP pair.

func (*Connector) ListExternalInterfaces

func (c *Connector) ListExternalInterfaces() ([]control.ExternalInterface, error)

func (*Connector) ListInternalInterfaces

func (c *Connector) ListInternalInterfaces() ([]control.InternalInterface, error)

func (*Connector) ListSiblingInterfaces

func (c *Connector) ListSiblingInterfaces() ([]control.SiblingInterface, error)

func (*Connector) SetKey

func (c *Connector) SetKey(ia addr.IA, index int, key []byte) error

SetKey sets the key for the given ISD-AS at the given index.

type DataPlane

type DataPlane struct {
	Metrics *Metrics

	ExperimentalSCMPAuthentication bool
	// contains filtered or unexported fields
}

DataPlane contains a SCION Border Router's forwarding logic. It reads packets from multiple sockets, performs routing, and sends them to their destinations (after updating the path, if that is needed).

XXX(lukedirtwalker): this is still in development and not feature complete. Currently, only the following features are supported:

  • initializing connections; MUST be done prior to calling Run

func (*DataPlane) AddExternalInterface

func (d *DataPlane) AddExternalInterface(ifID uint16, conn BatchConn) error

AddExternalInterface adds the inter AS connection for the given interface ID. If a connection for the given ID is already set this method will return an error. This can only be called on a not yet running dataplane.

func (*DataPlane) AddExternalInterfaceBFD

func (d *DataPlane) AddExternalInterfaceBFD(ifID uint16, conn BatchConn,
	src, dst control.LinkEnd, cfg control.BFD) error

AddExternalInterfaceBFD adds the inter AS connection BFD session.

func (*DataPlane) AddInternalInterface

func (d *DataPlane) AddInternalInterface(conn BatchConn, ip net.IP) error

AddInternalInterface sets the interface the data-plane will use to send/receive traffic in the local AS. This can only be called once; future calls will return an error. This can only be called on a not yet running dataplane.

func (*DataPlane) AddLinkType

func (d *DataPlane) AddLinkType(ifID uint16, linkTo topology.LinkType) error

AddLinkType adds the link type for a given interface ID. If a link type for the given ID is already set, this method will return an error. This can only be called on a not yet running dataplane.

func (*DataPlane) AddNeighborIA

func (d *DataPlane) AddNeighborIA(ifID uint16, remote addr.IA) error

AddNeighborIA adds the neighboring IA for a given interface ID. If an IA for the given ID is already set, this method will return an error. This can only be called on a yet running dataplane.

func (*DataPlane) AddNextHop

func (d *DataPlane) AddNextHop(ifID uint16, a *net.UDPAddr) error

AddNextHop sets the next hop address for the given interface ID. If the interface ID already has an address associated this operation fails. This can only be called on a not yet running dataplane.

func (*DataPlane) AddNextHopBFD

func (d *DataPlane) AddNextHopBFD(ifID uint16, src, dst *net.UDPAddr, cfg control.BFD,
	sibling string) error

AddNextHopBFD adds the BFD session for the next hop address. If the remote ifID belongs to an existing address, the existing BFD session will be re-used.

func (*DataPlane) AddRemotePeer added in v0.9.0

func (d *DataPlane) AddRemotePeer(local, remote uint16) error

AddRemotePeer adds the remote peering interface ID for local interface ID. If the link type for the given ID is already set to a different type, this method will return an error. This can only be called on a not yet running dataplane.

func (*DataPlane) AddSvc

func (d *DataPlane) AddSvc(svc addr.SVC, a *net.UDPAddr) error

AddSvc adds the address for the given service. This can be called multiple times for the same service, with the address added to the list of addresses that provide the service.

func (*DataPlane) DelSvc

func (d *DataPlane) DelSvc(svc addr.SVC, a *net.UDPAddr) error

DelSvc deletes the address for the given service.

func (*DataPlane) Run

func (d *DataPlane) Run(ctx context.Context, cfg *RunConfig) error

func (*DataPlane) SetIA

func (d *DataPlane) SetIA(ia addr.IA) error

SetIA sets the local IA for the dataplane.

func (*DataPlane) SetKey

func (d *DataPlane) SetKey(key []byte) error

SetKey sets the key used for MAC verification. The key provided here should already be derived as in scrypto.HFMacFactory.

type Metrics

type Metrics struct {
	InputBytesTotal           *prometheus.CounterVec
	OutputBytesTotal          *prometheus.CounterVec
	InputPacketsTotal         *prometheus.CounterVec
	OutputPacketsTotal        *prometheus.CounterVec
	ProcessedPackets          *prometheus.CounterVec
	DroppedPacketsTotal       *prometheus.CounterVec
	InterfaceUp               *prometheus.GaugeVec
	BFDInterfaceStateChanges  *prometheus.CounterVec
	BFDPacketsSent            *prometheus.CounterVec
	BFDPacketsReceived        *prometheus.CounterVec
	ServiceInstanceCount      *prometheus.GaugeVec
	ServiceInstanceChanges    *prometheus.CounterVec
	SiblingReachable          *prometheus.GaugeVec
	SiblingBFDPacketsSent     *prometheus.CounterVec
	SiblingBFDPacketsReceived *prometheus.CounterVec
	SiblingBFDStateChanges    *prometheus.CounterVec
}

Metrics defines the data-plane metrics for the BR.

func NewMetrics

func NewMetrics() *Metrics

NewMetrics initializes the metrics for the Border Router, and registers them with the default registry.

type RunConfig added in v0.9.0

type RunConfig struct {
	NumProcessors         int
	NumSlowPathProcessors int
	BatchSize             int
}

Directories

Path Synopsis
bfd
Package bfd implements Bidirectional Forwarding Detection as defined in RFC 5880.
Package bfd implements Bidirectional Forwarding Detection as defined in RFC 5880.
mock_bfd
Package mock_bfd is a generated GoMock package.
Package mock_bfd is a generated GoMock package.
cmd
Package config defines the router's configuration file.
Package config defines the router's configuration file.
internal/metrics
Package metrics defines and exports router metrics to be scraped by prometheus.
Package metrics defines and exports router metrics to be scraped by prometheus.
mock_api
Package mock_api is a generated GoMock package.
Package mock_api is a generated GoMock package.
Package mgmtapi provides primitives to interact with the openapi HTTP API.
Package mgmtapi provides primitives to interact with the openapi HTTP API.
Package mock_router is a generated GoMock package.
Package mock_router is a generated GoMock package.

Jump to

Keyboard shortcuts

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