Documentation
¶
Overview ¶
Allows the ability for the simulation of network conditions accross nodes.
Index ¶
- func Apply(client *ssh.Client, netconf Netconf, serverId int) error
- func ApplyAll(netconfs []Netconf, nodes []db.Node) error
- func ApplyToAll(netconf Netconf, nodes []db.Node) error
- func CalculatePartitions(nodes []db.Node) ([][]int, error)
- func CreateCommands(netconf Netconf, serverId int) []string
- func CreateLinks(pnts []util.Point, c *Calculator) [][]Link
- func CreatePartitionOutage(side1 []db.Node, side2 []db.Node)
- func MakeOutage(node1 db.Node, node2 db.Node) error
- func MakeOutageCommands(node1 db.Node, node2 db.Node) []string
- func RemoveAll(nodes []db.Node) error
- func RemoveAllOnServer(client *ssh.Client, nodes int)
- func RemoveAllOutages(client *ssh.Client) error
- func RemoveOutage(node1 db.Node, node2 db.Node) error
- type Calculator
- type Connection
- type Connections
- type Link
- type Netconf
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyToAll ¶
ApplyToAll applies the given netconf to `nodes` nodes in the network on the given server
func CreateCommands ¶
CreateCommands generates the commands needed to obtain the desired network conditions
func CreateLinks ¶
func CreateLinks(pnts []util.Point, c *Calculator) [][]Link
func RemoveAllOnServer ¶
RemoveAll removes network conditions from the given number of nodes
func RemoveAllOutages ¶
Types ¶
type Calculator ¶
type Calculator struct {
Loss func(float64) float64
Delay func(float64) int
Rate func(float64) string
Duplication func(float64) float64
Corrupt func(float64) float64
Reorder func(float64) float64
}
func GetDefaultCalculator ¶
func GetDefaultCalculator() *Calculator
Create a calculator which can be used to calculate latency
type Connection ¶
func GetCutConnections ¶
func GetCutConnections(client *ssh.Client) ([]Connection, error)
TODO: Naive Implementation, does not yet take multiple servers into account
type Connections ¶
type Connections struct {
// contains filtered or unexported fields
}
func NewConnections ¶
func NewConnections(nodes int) *Connections
func (*Connections) Networks ¶
func (this *Connections) Networks() [][]int
func (*Connections) RemoveAll ¶
func (this *Connections) RemoveAll(conns []Connection)
type Link ¶
type Link struct {
EgressNode int `json:"egressNode"` //redundant info
IngressNode int `json:"ingressNode"` //redundant info
Loss float64 `json:"loss"` //Loss % ie 100% = 100
Delay int `json:"delay"`
Rate string `json:"rate"`
Duplication float64 `json:"duplicate"`
Corrupt float64 `json:"corrupt"`
Reorder float64 `json:"reorder"`
}
Click to show internal directories.
Click to hide internal directories.