topo

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2022 License: Apache-2.0 Imports: 10 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearTopology

func ClearTopology(conn *grpc.ClientConn) error

ClearTopology removes all Devices, links and hosts from the simulator

func GenerateNetcfg

func GenerateNetcfg(topologyPath string, netcfgPath string, driver string, pipeconf string) error

GenerateNetcfg loads the specified topology YAML file and uses it to generate ONOS netcfg.json file

func GenerateTopology

func GenerateTopology(recipePath string, topologyPath string) error

GenerateTopology loads the specified topology recipe YAML file and uses the recipe to generate a fully elaborated topology YAML file that can be loaded via LoadTopology

func LoadTopology

func LoadTopology(conn *grpc.ClientConn, topologyPath string) error

LoadTopology loads the specified YAML file and creates the prescribed simulated topology entities using the fabric simulator API client.

Types

type AccessFabric

type AccessFabric struct {
	Spines         int `mapstructure:"spines" yaml:"spines"`
	SpinePortCount int `mapstructure:"spine_port_count" yaml:"spine_port_count"`
	LeafPairs      int `mapstructure:"leaf_pairs" yaml:"leaf_pairs"`
	LeafPortCount  int `mapstructure:"leaf_port_count" yaml:"leaf_port_count"`
	SpineTrunk     int `mapstructure:"spine_trunk" yaml:"spine_trunk"`
	PairTrunk      int `mapstructure:"pair_trunk" yaml:"pair_trunk"`
	HostsPerPair   int `mapstructure:"hosts_per_pair" yaml:"hosts_per_pair"`
}

AccessFabric is a recipe for creating simulated access fabric with spines and paired leaves

type Builder

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

Builder hods state to assist generating various fabric topologies

func NewBuilder

func NewBuilder() *Builder

NewBuilder creates a new topology builder context

func (*Builder) NextAgentPort

func (b *Builder) NextAgentPort() int32

NextAgentPort reserves the next available agent port and returns it

func (*Builder) NextDevicePortID

func (b *Builder) NextDevicePortID(deviceID string) string

NextDevicePortID reserves the next available port ID and returns it

type Device

type Device struct {
	ID        string `mapstructure:"id" yaml:"id"`
	ChassisID uint64 `mapstructure:"chassis_id" yaml:"chassis_id"`
	Type      string `mapstructure:"type" yaml:"type"`
	AgentPort int32  `mapstructure:"agent_port" yaml:"agent_port"`
	Stopped   bool   `mapstructure:"stopped" yaml:"stopped"`
	Ports     []Port `mapstructure:"ports" yaml:"ports"`
}

Device is a description of a simulated device

type Host

type Host struct {
	ID   string `mapstructure:"id" yaml:"id"`
	NICs []NIC  `mapstructure:"nics" yaml:"nics"`
}

Host is a description of a simulated host

type Link struct {
	SrcPortID      string `mapstructure:"src" yaml:"src"`
	TgtPortID      string `mapstructure:"tgt" yaml:"tgt"`
	Unidirectional bool   `mapstructure:"unidirectional" yaml:"unidirectional"`
}

Link is a description of a simulated link

type NIC

type NIC struct {
	Mac  string `mapstructure:"mac" yaml:"mac"`
	IPv4 string `mapstructure:"ip" yaml:"ip"`
	IPV6 string `mapstructure:"ipv6" yaml:"ipv6"`
	Port string `mapstructure:"port" yaml:"port"`
}

NIC is a description of a simulated NIC

type Netcfg

type Netcfg struct {
	Devices map[string]*NetcfgDevice `json:"devices"`
}

Netcfg structure represents ONOS network configuration

type NetcfgDevice

type NetcfgDevice struct {
	Basic *NetcfgDeviceBasic `json:"basic"`
}

NetcfgDevice structure represents ONOS device config

type NetcfgDeviceBasic

type NetcfgDeviceBasic struct {
	Name              string `json:"name"`
	ManagementAddress string `json:"managementAddress"`
	Driver            string `json:"driver"`
	Pipeconf          string `json:"pipeconf"`
}

NetcfgDeviceBasic structure represents ONOS basic device config

type Port

type Port struct {
	Number    uint32 `mapstructure:"number" yaml:"number"`
	SDNNumber uint32 `mapstructure:"sdn_number" yaml:"sdn_number"`
	Speed     string `mapstructure:"speed" yaml:"speed"`
}

Port is a description of a simulated port

type Recipe

type Recipe struct {
	SuperSpineFabric *SuperSpineFabric `mapstructure:"superspine_fabric" yaml:"superspine_fabric"`
	AccessFabric     *AccessFabric     `mapstructure:"access_fabric" yaml:"access_fabric"`
}

Recipe is a container for holding one of the supported simulated topology recipes

type SuperSpineFabric

type SuperSpineFabric struct {
}

SuperSpineFabric is a recipe for creating simulated 4 rack fabric with superspines

type Topology

type Topology struct {
	Devices []Device `mapstructure:"Devices" yaml:"Devices"`
	Links   []Link   `mapstructure:"links" yaml:"links"`
	Hosts   []Host   `mapstructure:"hosts" yaml:"hosts"`
}

Topology is a description of a simulated network topology

func GenerateAccessFabric

func GenerateAccessFabric(fabric *AccessFabric) *Topology

GenerateAccessFabric generates topology YAML from the specified access fabric recipe

func GenerateSuperSpineFabric

func GenerateSuperSpineFabric(fabric *SuperSpineFabric) *Topology

GenerateSuperSpineFabric generates topology YAML from the specified super-spine fabric recipe

Jump to

Keyboard shortcuts

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