edensdn

package
v1.0.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateSdnMgmtMAC

func GenerateSdnMgmtMAC() string

GenerateSdnMgmtMAC (deterministically) generates MAC address for interface connecting Eden-SDN with the Host.

func GetDefaultNetModel

func GetDefaultNetModel() (model sdnapi.NetworkModel, err error)

GetDefaultNetModel : get default network model. Used unless the user selects custom network model.

func LoadNetModeFromFile

func LoadNetModeFromFile(filepath string) (sdnapi.NetworkModel, error)

LoadNetModeFromFile loads network model stored inside a JSON file.

Types

type LinkState

type LinkState struct {
	EveIfName string
	IsUP      bool
}

LinkState of an EVE uplink interface.

type SdnClient

type SdnClient struct {
	SSHPort    uint16
	SSHKeyPath string
	MgmtPort   uint16
}

SdnClient is a client for talking to Eden-SDN management agent. It also allows to SSH into SDN VM, establish SSH port forwarding with SDN VM and to run command from inside of an endpoint deployed in Eden-SDN.

func (*SdnClient) ApplyNetworkModel

func (client *SdnClient) ApplyNetworkModel(netModel model.NetworkModel) (err error)

ApplyNetworkModel : submit network model to Eden-SDN.

func (*SdnClient) GetEveIfIP

func (client *SdnClient) GetEveIfIP(eveIfName string) (ip string, err error)

GetEveIfIP : get IP address assigned to the given EVE interface.

func (*SdnClient) GetEveIfMAC

func (client *SdnClient) GetEveIfMAC(eveIfName string) (mac string, err error)

GetEveIfMAC : get MAC address assigned to the given EVE interface.

func (*SdnClient) GetNetworkConfigGraph

func (client *SdnClient) GetNetworkConfigGraph() (config string, err error)

GetNetworkConfigGraph : get network config applied by Eden-SDN. Network config items and their dependencies are depicted using a DOT graph.

func (*SdnClient) GetNetworkModel

func (client *SdnClient) GetNetworkModel() (netModel model.NetworkModel, err error)

GetNetworkModel : get network model currently applied to Eden-SDN.

func (*SdnClient) GetSdnLogs

func (client *SdnClient) GetSdnLogs() (string, error)

GetSdnLogs : get all logs from running Eden-SDN VM.

func (*SdnClient) GetSdnStatus

func (client *SdnClient) GetSdnStatus() (status model.SDNStatus, err error)

GetSdnStatus : get status of the running Eden-SDN.

func (*SdnClient) RunCmdFromEndpoint

func (client *SdnClient) RunCmdFromEndpoint(epLogicalLabel, cmd string, args ...string) error

RunCmdFromEndpoint : execute command from inside of an endpoint deployed in Eden-SDN.

func (*SdnClient) SSHIntoSdnVM

func (client *SdnClient) SSHIntoSdnVM() error

SSHIntoSdnVM : ssh into the running Eden-SDN.

func (*SdnClient) SSHPortForwarding

func (client *SdnClient) SSHPortForwarding(localPort, targetPort uint16,
	targetIP string) (close func(), err error)

SSHPortFowarding : establish port forwarding between the host and the SDN VM using ssh. Close the tunnel by running returned "close" function.

type SdnMgmtSubnet

type SdnMgmtSubnet struct {
	*net.IPNet
	DHCPStart net.IP
}

SdnMgmtSubnet : IP configuration for Eden-SDN management network.

type SdnVMConfig

type SdnVMConfig struct {
	Architecture   string
	Acceleration   bool
	HostOS         string // darwin, linux, etc.
	ImagePath      string
	ConfigDir      string
	CPU            int
	RAM            int // in MB
	Firmware       []string
	NetModel       model.NetworkModel
	TelnetPort     uint16
	SSHPort        uint16
	SSHKeyPath     string
	MgmtPort       uint16
	MgmtSubnet     SdnMgmtSubnet
	NetDevBasePort uint16 // QEMU-specific
	PidFile        string
	ConsoleLogFile string
}

SdnVMConfig : configuration for Eden-SDN VM.

type SdnVMQemuRunner

type SdnVMQemuRunner struct {
	SdnVMConfig
}

SdnVMQemuRunner implements Eden-SDN VM runner using QEMU.

func NewSdnVMQemuRunner

func NewSdnVMQemuRunner(config SdnVMConfig) *SdnVMQemuRunner

NewSdnVMQemuRunner is constructor for SdnVMQemuRunner.

func (*SdnVMQemuRunner) RequiresVmRestart

func (vm *SdnVMQemuRunner) RequiresVmRestart(oldModel, newModel model.NetworkModel) bool

RequiresVmRestart returns true if the set of ports has changed.

func (*SdnVMQemuRunner) Start

func (vm *SdnVMQemuRunner) Start() error

Start Eden-SDN VM using QEMU.

func (*SdnVMQemuRunner) Stop

func (vm *SdnVMQemuRunner) Stop() (err error)

Stop Eden-SDN VM running in QEMU.

type SdnVMRunner

type SdnVMRunner interface {
	// Start Eden-SDN VM.
	Start() error
	// Stop Eden-SDN VM.
	Stop() error
	// RequiresVmRestart should return true if going from oldModel to newModel requires
	// to restart EVE VM and SDN VM.
	RequiresVmRestart(oldModel, newModel model.NetworkModel) bool
}

SdnVMRunner is implemented for every virtualization technology on which Eden-SDN is supported. Currently only QEMU is supported.

func GetSdnVMRunner

func GetSdnVMRunner(devModelType string, config SdnVMConfig) (SdnVMRunner, error)

GetSdnVMRunner returns SdnVMRunner for a given device model type.

Jump to

Keyboard shortcuts

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