pathselection

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2024 License: Apache-2.0 Imports: 13 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindIndexByPathString

func FindIndexByPathString(pq []PathQuality, s string) int

func PathToString

func PathToString(path snet.Path) string

func UnwrapPathset

func UnwrapPathset(pathset PathSet) []snet.Path

Types

type CustomPathSelection

type CustomPathSelection interface {
	CustomPathSelectAlg(*PathSet) (*PathSet, error)
}

type InMemoryPathQualityDatabase

type InMemoryPathQualityDatabase struct {
	// contains filtered or unexported fields
}

func NewInMemoryPathQualityDatabase

func NewInMemoryPathQualityDatabase() *InMemoryPathQualityDatabase

func (*InMemoryPathQualityDatabase) GetPathSet

func (db *InMemoryPathQualityDatabase) GetPathSet(addr *snet.UDPAddr) (PathSet, error)

func (*InMemoryPathQualityDatabase) SetConnections

func (db *InMemoryPathQualityDatabase) SetConnections(conns []packets.UDPConn)

func (*InMemoryPathQualityDatabase) UpdateMetrics

func (db *InMemoryPathQualityDatabase) UpdateMetrics()

func (*InMemoryPathQualityDatabase) UpdatePathQualities

func (db *InMemoryPathQualityDatabase) UpdatePathQualities(addr *snet.UDPAddr, metricsInterval time.Duration) error

type PathEnumerator

type PathEnumerator interface {
	Enumerate(addr.HostAddr) PathSet
}

type PathQuality

type PathQuality struct {
	Timestamp    time.Time
	HopCount     int
	MTU          uint16
	Latency      time.Duration
	RTT          time.Duration
	Bytes        int
	Duration     time.Duration
	MaxBandwidth int64
	Path         snet.Path
	Id           string
	// contains filtered or unexported fields
}

type PathQualityDatabase

type PathQualityDatabase interface {
	GetPathSet(addr *snet.UDPAddr) (PathSet, error)
	SetConnections([]packets.UDPConn)
	UpdatePathQualities(addr *snet.UDPAddr, interval time.Duration) error
	UpdateMetrics()
}

type PathSet

type PathSet struct {
	Address snet.UDPAddr
	Paths   []PathQuality
}

func SelectPaths

func SelectPaths(count int, pathSet *PathSet) *PathSet

func (*PathSet) GetPathHighBandwidth

func (pathSet *PathSet) GetPathHighBandwidth(number int) *PathSet

GetPathHighBandwidth Select the shortest paths from given path array

func (*PathSet) GetPathLargeMTU

func (pathSet *PathSet) GetPathLargeMTU(number int) *PathSet

func (*PathSet) GetPathLowLatency

func (pathSet *PathSet) GetPathLowLatency(number int) *PathSet

GetPathLowLatency Select the paths from given path array with lowest total latency

func (*PathSet) GetPathSmallHopCount

func (pathSet *PathSet) GetPathSmallHopCount(number int) *PathSet

GetPathSmallHopCount Select the shortest paths from given path array

type SelecteablePathSet

type SelecteablePathSet interface {
	GetPathHighBandwidth(number int) PathSet
	GetPathLowLatency(number int) PathSet
	GetPathLargeMTU(number int) PathSet
	GetPathSmallHopCount(number int) PathSet
}

Jump to

Keyboard shortcuts

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