Documentation
¶
Index ¶
Constants ¶
const (
// MaxSize is the maximum size allowed for a topology.
MaxSize = 5000
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Area ¶
type Area struct { N int Latency Delay X float64 Y float64 // contains filtered or unexported fields }
Area is a subset of the topology that have a given number of nodes inside it and a global location. A latency can be set for the members of the area and the latency for outsiders is computed based on the distance to other areas.
type AreaTopology ¶
type AreaTopology struct {
// contains filtered or unexported fields
}
AreaTopology is a network topology with multiple areas. Each members of an area have the same latency inside the area, and the same latency to members of other areas, case by case depending on the location. A unit of distance is 1ms thus coordinates can be adapted to fit a given latency.
func NewAreaTopology ¶
func NewAreaTopology(areas ...*Area) *AreaTopology
NewAreaTopology creates a topology based on multiple areas.
func (*AreaTopology) GetNodes ¶
func (t *AreaTopology) GetNodes() []Node
GetNodes returns the list of identifiers for the nodes.
func (*AreaTopology) Len ¶
func (t *AreaTopology) Len() int
Len returns the number of nodes inside the topology.
type CloudTopology ¶
type CloudTopology struct { NodeSelectorKey string // contains filtered or unexported fields }
CloudTopology is a topology that will create a node on each of the regions provided so that the topology will have latencies from the real world.
func NewCloudTopology ¶
func NewCloudTopology(key string, values []string) CloudTopology
NewCloudTopology returns a new cloud topology from the list of regions.
func (CloudTopology) GetNodes ¶
func (t CloudTopology) GetNodes() []Node
GetNodes returns the list of nodes.
type FullTopology ¶
type FullTopology struct {
SimpleTopology
}
FullTopology is a topology where the links are defined one by one.
func NewFullTopology ¶
func NewFullTopology(inputs ...FullInput) FullTopology
NewFullTopology creates a new topology.
type Link ¶
Link is a network link from the host to the node. It defines the properties of the link like a delay or a percentage of loss.
type Loss ¶
type Loss struct {
Value float64
}
Loss is a parameter of a rule that will induce a percentage of loss to the outgoing traffic.
type Rule ¶
Rule is a set of parameters to apply to a topology link to change the properties like the RRT, bandwidth and so on.
func NewDelayRule ¶
NewDelayRule creates a rule that only adds delay to the link.
func NewLossRule ¶
NewLossRule creates a rule that only adds loss to the link.
type SimpleTopology ¶
type SimpleTopology struct {
// contains filtered or unexported fields
}
SimpleTopology represents a network map where the links between nodes have defined properties.
func NewSimpleTopology ¶
func NewSimpleTopology(n int, delay time.Duration) SimpleTopology
NewSimpleTopology creates a simple topology with a delay for traffic going to node0.
func (SimpleTopology) GetNodes ¶
func (t SimpleTopology) GetNodes() []Node
GetNodes returns the nodes.
func (SimpleTopology) Len ¶
func (t SimpleTopology) Len() int
Len returns the number of nodes in the topology.