reservation

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const E2EIDLen = 16
View Source
const HopFieldLen = 8
View Source
const InfoFieldLen = 8

InfoFieldLen is the length in bytes of the InfoField.

View Source
const SegmentIDLen = 10

Variables

This section is empty.

Functions

This section is empty.

Types

type AllocationBead added in v0.6.0

type AllocationBead struct {
	AllocBW BWCls
	MaxBW   BWCls
}

AllocationBead represents an allocation resolved in an AS for a given reservation. It is used in an array to represent the allocation trail that happened for a reservation.

type AllocationBeads added in v0.6.0

type AllocationBeads []AllocationBead

func (AllocationBeads) MinMax added in v0.6.0

func (bs AllocationBeads) MinMax() BWCls

MinMax returns the minimum of all the max BW in the AllocationBeads.

type BWCls

type BWCls uint8

BWCls is the bandwidth class. bandwidth = 16 * sqrt(2^(BWCls - 1)). 0 <= bwcls <= 63 kbps.

func BWClsFromBW added in v0.6.0

func BWClsFromBW(bwKbps uint64) BWCls

BWClsFromBW constructs a BWCls from the bandwidth. Given that bandwidth = 16 * sqrt(2^(BWCls - 1)) where bandwidth is kbps. We then have BWCls = 2 * log2( bandwidth/16 ) + 1 The value of BWCls will be the ceiling of the previous expression.

func MaxBWCls added in v0.6.0

func MaxBWCls(a, b BWCls) BWCls

MaxBWCls returns the maximum of two BWCls.

func MinBWCls added in v0.6.0

func MinBWCls(a, b BWCls) BWCls

MinBWCls returns the minimum of two BWCls.

func (BWCls) ToKbps added in v0.6.0

func (b BWCls) ToKbps() uint64

ToKbps returns the kilobits per second this BWCls represents.

func (BWCls) Validate

func (b BWCls) Validate() error

Validate will return an error for invalid values.

type E2EID

type E2EID struct {
	ASID   addr.AS
	Suffix [10]byte
}

E2EID identifies a COLIBRI E2E reservation. The suffix is different for each reservation for any given AS.

func E2EIDFromRaw

func E2EIDFromRaw(raw []byte) (*E2EID, error)

E2EIDFromRaw constructs an E2EID parsing a buffer.

func E2EIDFromRawBuffers added in v0.6.0

func E2EIDFromRawBuffers(ASID, suffix []byte) (*E2EID, error)

E2EIDFromRawBuffers constructs a E2DID from two separate buffers.

func NewE2EID added in v0.6.0

func NewE2EID(AS addr.AS, suffix []byte) (*E2EID, error)

NewE2EID returns a new E2EID

func (*E2EID) Read

func (id *E2EID) Read(raw []byte) (int, error)

Read serializes this E2EID into the buffer.

func (*E2EID) ToRaw added in v0.6.0

func (id *E2EID) ToRaw() []byte

ToRaw calls Read and returns a new allocated buffer with the ID serialized.

type HopField added in v0.6.0

type HopField struct {
	Ingress uint16
	Egress  uint16
	Mac     [4]byte
}

HopField is a COLIBRI HopField. TODO(juagargi) move to slayers

func HopFieldFromRaw added in v0.6.0

func HopFieldFromRaw(raw []byte) (*HopField, error)

HopFieldFromRaw builds a HopField from a raw buffer.

func (*HopField) Read added in v0.6.0

func (hf *HopField) Read(b []byte) (int, error)

Read serializes this HopField into the buffer.

func (*HopField) ToRaw added in v0.6.0

func (hf *HopField) ToRaw() []byte

ToRaw returns the serial representation of the HopField.

type IndexNumber added in v0.6.0

type IndexNumber uint8

IndexNumber is a 4 bit index for a reservation.

func (IndexNumber) Add added in v0.6.0

func (i IndexNumber) Add(other IndexNumber) IndexNumber

func (IndexNumber) Sub added in v0.6.0

func (i IndexNumber) Sub(other IndexNumber) IndexNumber

func (IndexNumber) Validate added in v0.6.0

func (i IndexNumber) Validate() error

Validate will return an error for invalid values.

type InfoField

type InfoField struct {
	ExpirationTick Tick
	BWCls          BWCls
	RLC            RLC
	Idx            IndexNumber
	PathType       PathType
}

InfoField is used in the reservation token and segment request data. 0B 1 2 3 4 5 6 7 +--------+--------+--------+--------+--------+--------+--------+--------+ | Expiration time (4B) | BwCls | RTT Cls|Idx|Type| padding| +--------+--------+--------+--------+--------+--------+--------+--------+

The bandwidth class (BwCls) indicates the reserved bandwidth in an active reservation. In a steady request, it indicates the minimal bandwidth class reserved so far. In a ephemeral request, it indicates the bandwidth class that the source end host is seeking to reserve.

The round trip class (RTT Cls) allows for more granular control in the pending request garbage collection.

The reservation index (Idx) is used to allow for multiple overlapping reservations within a single path, which enables renewal and changing the bandwidth requested.

Type indicates which path type of the reservation.

func InfoFieldFromRaw

func InfoFieldFromRaw(raw []byte) (*InfoField, error)

InfoFieldFromRaw builds an InfoField from the InfoFieldLen bytes buffer.

func (*InfoField) Read

func (f *InfoField) Read(b []byte) (int, error)

Read serializes this InfoField into a sequence of InfoFieldLen bytes.

func (*InfoField) ToRaw added in v0.6.0

func (f *InfoField) ToRaw() []byte

ToRaw returns the serial representation of the InfoField.

func (*InfoField) Validate

func (f *InfoField) Validate() error

Validate will return an error for invalid values.

type PathEndProps added in v0.6.0

type PathEndProps uint8

PathEndProps represent the zero or more properties a COLIBRI path can have at both ends.

const (
	StartLocal    PathEndProps = 0x10
	StartTransfer PathEndProps = 0x20
	EndLocal      PathEndProps = 0x01
	EndTransfer   PathEndProps = 0x02
)

The only current properties are "Local" (can be used to create e2e rsvs) and "Transfer" (can be stiched together with another segment reservation). The first 4 bits encode the properties of the "Start" AS, and the last 4 bits encode those of the "End" AS.

func NewPathEndProps added in v0.6.0

func NewPathEndProps(startLocal, startTransfer, endLocal, endTransfer bool) PathEndProps

func (PathEndProps) Validate added in v0.6.0

func (pep PathEndProps) Validate() error

Validate will return an error for invalid values.

func (PathEndProps) ValidateWithPathType added in v0.6.0

func (pep PathEndProps) ValidateWithPathType(pt PathType) error

ValidateWithPathType checks the validity of the properties when in a path of the specified type.

type PathType

type PathType uint8

PathType specifies which type of COLIBRI path this segment reservation or request refers to.

const (
	UnknownPath PathType = iota
	DownPath
	UpPath
	PeeringDownPath
	PeeringUpPath
	E2EPath
	CorePath
)

the different COLIBRI path types.

func (PathType) Validate

func (pt PathType) Validate() error

Validate will return an error for invalid values.

type RLC

type RLC uint8

RLC Request Latency Class. latency = 2^rlc miliseconds. 0 <= rlc <= 63

func (RLC) Validate

func (c RLC) Validate() error

Validate will return an error for invalid values.

type SegmentID

type SegmentID struct {
	ASID   addr.AS
	Suffix [4]byte
}

SegmentID identifies a COLIBRI segment reservation. The suffix differentiates reservations for the same AS.

func NewSegmentID added in v0.6.0

func NewSegmentID(AS addr.AS, suffix []byte) (*SegmentID, error)

NewSegmentID returns a new SegmentID

func SegmentIDFromRaw

func SegmentIDFromRaw(raw []byte) (
	*SegmentID, error)

SegmentIDFromRaw constructs a SegmentID parsing a raw buffer.

func SegmentIDFromRawBuffers added in v0.6.0

func SegmentIDFromRawBuffers(ASID, suffix []byte) (*SegmentID, error)

SegmentIDFromRawBuffers constructs a SegmentID from two separate buffers.

func (*SegmentID) Read

func (id *SegmentID) Read(raw []byte) (int, error)

Read serializes this SegmentID into the buffer.

func (*SegmentID) String added in v0.6.0

func (id *SegmentID) String() string

func (*SegmentID) ToRaw added in v0.6.0

func (id *SegmentID) ToRaw() []byte

ToRaw calls Read and returns a new allocated buffer with the ID serialized.

type SplitCls

type SplitCls uint8

SplitCls is the traffic split parameter. split = sqrt(2^c). The split divides the bandwidth in control traffic (BW * split) and end to end traffic (BW * (1-s)). 0 <= splitCls <= 256 .

type Tick

type Tick uint32

Tick represents a slice of time of 4 seconds.

func TickFromTime

func TickFromTime(t time.Time) Tick

TickFromTime returns the tick for a given time.

func (Tick) ToTime added in v0.6.0

func (t Tick) ToTime() time.Time

type Token added in v0.6.0

type Token struct {
	InfoField
	HopFields []HopField
}

Token is used in the data plane to forward COLIBRI packets.

func TokenFromRaw added in v0.6.0

func TokenFromRaw(raw []byte) (*Token, error)

TokenFromRaw builds a Token from the passed bytes buffer.

func (*Token) Len added in v0.6.0

func (t *Token) Len() int

Len returns the number of bytes of this token if serialized.

func (*Token) Read added in v0.6.0

func (t *Token) Read(b []byte) (int, error)

Read serializes this Token to the passed buffer.

func (*Token) ToRaw added in v0.6.0

func (t *Token) ToRaw() []byte

ToRaw returns the serial representation of the Token.

func (*Token) Validate added in v0.6.0

func (t *Token) Validate() error

Validate will return an error for invalid values. It will not check the hop fields' validity.

Jump to

Keyboard shortcuts

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