Mininet Python API Reference Manual
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
mininet.node.OVSSwitch Class Reference

Open vSwitch switch. More...

Inheritance diagram for mininet.node.OVSSwitch:
mininet.node.Switch mininet.node.Node mininet.node.OVSBridge

Public Member Functions

def __init__ (self, name, failMode='secure', datapath='kernel', inband=False, protocols=None, reconnectms=1000, stp=False, batch=False, **params)
def setup (cls)
 Make sure Open vSwitch is installed and working.
def isOldOVS (cls)
 Is OVS ersion < 1.10?
def dpctl (self, *args)
 Run ovs-ofctl command.
def vsctl (self, *args, **kwargs)
 Run ovs-vsctl command (or queue for later execution)
def attach (self, intf)
 Connect a data port.
def detach (self, intf)
 Disconnect a data port.
def controllerUUIDs (self, update=False)
 Return ovsdb UUIDs for our controllers. More...
def connected (self)
 Are we connected to at least one of our controllers?
def intfOpts (self, intf)
 Return OVS interface options for intf.
def bridgeOpts (self)
 Return OVS bridge options.
def start (self, controllers)
 Start up a new OVS OpenFlow switch using ovs-vsctl.
def batchStartup (cls, switches, run=errRun)
 Batch startup for OVS. More...
def stop (self, deleteIntfs=True)
 Terminate OVS switch. More...
def batchShutdown (cls, switches, run=errRun)
 Shut down a list of OVS switches.
- Public Member Functions inherited from mininet.node.Switch
def __init__ (self, name, dpid=None, opts='', listenPort=None, **params)
def defaultDpid (self, dpid=None)
 Return correctly formatted dpid from dpid or switch name (s1 -> 1)
def defaultIntf (self)
 Return control interface.
def sendCmd (self, *cmd, **kwargs)
 Send command to Node. More...
def __repr__ (self)
 More informative string representation.
- Public Member Functions inherited from mininet.node.Node
def __init__ (self, name, inNamespace=True, **params)
def fdToNode (cls, fd)
 Return node corresponding to given file descriptor. More...
def startShell (self, mnopts=None)
 Start a shell process for running commands.
def mountPrivateDirs (self)
 mount private directories
def unmountPrivateDirs (self)
 mount private directories
def cleanup (self)
 Help python collect its garbage.
def read (self, size=1024)
 Buffered read from node, potentially blocking. More...
def readline (self)
 Buffered readline from node, potentially blocking. More...
def write (self, data)
 Write data to node. More...
def terminate (self)
 Send kill signal to Node and clean up after it.
def waitReadable (self, timeoutms=None)
 Wait until node's output is readable. More...
def sendInt (self, intr=chr(3))
 Interrupt running command.
def monitor (self, timeoutms=None, findPid=True)
 Monitor and return the output of a command. More...
def waitOutput (self, verbose=False, findPid=True)
 Wait for a command to complete. More...
def cmd (self, *args, **kwargs)
 Send a command, wait for output, and return it. More...
def cmdPrint (self, *args)
 Call cmd and printing its output. More...
def popen (self, *args, **kwargs)
 Return a Popen() object in our namespace. More...
def pexec (self, *args, **kwargs)
 Execute a command using popen. More...
def newPort (self)
 Return the next port number to allocate.
def addIntf (self, intf, port=None, moveIntfFn=moveIntf)
 Add an interface. More...
def delIntf (self, intf)
 Remove interface from Node's known interfaces. More...
def intf (self, intf=None)
 Return our interface object with given string name, default intf if name is falsy (None, empty string, etc). More...
def connectionsTo (self, node)
 Return [ intf1, intf2... More...
def deleteIntfs (self, checkName=True)
 Delete all of our interfaces. More...
def setARP (self, ip, mac)
 Add an ARP entry. More...
def setHostRoute (self, ip, intf)
 Add route to host. More...
def setDefaultRoute (self, intf=None)
 Set the default route to go through intf. More...
def setMAC (self, mac, intf=None)
 Set the MAC address for an interface. More...
def setIP (self, ip, prefixLen=8, intf=None, **kwargs)
 Set the IP address for an interface. More...
def IP (self, intf=None)
 Return IP address of a node or specific interface.
def MAC (self, intf=None)
 Return MAC address of a node or specific interface.
def intfIsUp (self, intf=None)
 Check if an interface is up.
def setParam (self, results, method, **param)
 Internal. More...
def config (self, mac=None, ip=None, defaultRoute=None, lo='up', **_params)
 Configure Node according to (optional) More...
def configDefault (self, **moreParams)
 Configure with default parameters.
def linkTo (self, node, link=Link)
 (Deprecated) Link to another node replace with Link( node1, node2)
def intfList (self)
 List of our interfaces sorted by port number.
def intfNames (self)
 The names of our interfaces sorted by port number.
def __str__ (self)
 Abbreviated string representation.
def checkSetup (cls)
 Make sure our class and superclasses are set up.

Static Public Member Functions

def TCReapply (intf)
 Unfortunately OVS and Mininet are fighting over tc queuing disciplines. More...

Public Attributes

- Public Attributes inherited from mininet.node.Switch
- Public Attributes inherited from mininet.node.Node

Static Public Attributes

int argmax = 128000
- Static Public Attributes inherited from mininet.node.Switch
int portBase = 1
int dpidLen = 16
- Static Public Attributes inherited from mininet.node.Node
int portBase = 0
dictionary inToNode = {}
dictionary outToNode = {}
bool isSetup = False

Detailed Description

Open vSwitch switch.

Depends on ovs-vsctl.

Constructor & Destructor Documentation

◆ __init__()

def mininet.node.OVSSwitch.__init__ (   self,
  failMode = 'secure',
  datapath = 'kernel',
  inband = False,
  protocols = None,
  reconnectms = 1000,
  stp = False,
  batch = False,
**  params 
namename for switch
failModecontroller loss behavior (secure|standalone)
datapathuserspace or kernel mode (kernel|user)
inbanduse in-band control (False)
protocolsuse specific OpenFlow version(s) (e.g. OpenFlow13) Unspecified (or old OVS version) uses OVS default
reconnectmsmax reconnect timeout in ms (0/None for default)
stpenable STP (False, requires failMode=standalone)
batchenable batch startup (False)

Member Function Documentation

◆ batchStartup()

def mininet.node.OVSSwitch.batchStartup (   cls,
  run = errRun 

Batch startup for OVS.

switchesswitches to start up
runfunction to run commands (errRun)

◆ controllerUUIDs()

def mininet.node.OVSSwitch.controllerUUIDs (   self,
  update = False 

Return ovsdb UUIDs for our controllers.

updateupdate cached value

◆ stop()

def mininet.node.OVSSwitch.stop (   self,
  deleteIntfs = True 

Terminate OVS switch.

deleteIntfsdelete interfaces? (True)

Reimplemented from mininet.node.Switch.

◆ TCReapply()

def mininet.node.OVSSwitch.TCReapply (   intf)

Unfortunately OVS and Mininet are fighting over tc queuing disciplines.

As a quick hack/ workaround, we clear OVS's and reapply our own.

The documentation for this class was generated from the following file: