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

CPU limited host. More...

Inheritance diagram for mininet.node.CPULimitedHost:
mininet.node.Host mininet.node.Node

Public Member Functions

def __init__ (self, name, sched='cfs', **kwargs)
def cgroupSet (self, param, value, resource='cpu')
 Set a cgroup parameter and return its value.
def cgroupGet (self, param, resource='cpu')
 Return value of cgroup parameter.
def cgroupDel (self)
 Clean up our cgroup.
def popen (self, *args, **kwargs)
 Return a Popen() object in node's namespace. More...
def cleanup (self)
 Clean up Node, then clean up our cgroup.
def checkRtGroupSched (cls)
 Check (Ubuntu,Debian) kernel config for CONFIG_RT_GROUP_SCHED for RT.
def chrt (self)
 Set RT scheduling priority.
def rtInfo (self, f)
 Internal method: return parameters for RT bandwidth.
def cfsInfo (self, f)
 Internal method: return parameters for CFS bandwidth.
def setCPUFrac (self, f, sched=None)
 Set overall CPU fraction for this host. More...
def setCPUs (self, cores, mems=0)
 Specify (real) cores that our cgroup can run on.
def config (self, cpu=-1, cores=None, **params)
def init (cls)
 Initialization for CPULimitedHost class.
- Public Member Functions inherited from mininet.node.Node
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 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 stop (self, deleteIntfs=False)
 Stop node. More...
def waitReadable (self, timeoutms=None)
 Wait until node's output is readable. More...
def sendCmd (self, *args, **kwargs)
 Send a command, followed by a command to echo a sentinel, and return without waiting for the command to complete. 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 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 defaultIntf (self)
 Return interface for lowest port.
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 __repr__ (self)
 More informative string representation.
def __str__ (self)
 Abbreviated string representation.
def checkSetup (cls)
 Make sure our class and superclasses are set up.
def setup (cls)
 Make sure our class dependencies are available.

Public Attributes

- Public Attributes inherited from mininet.node.Node

Static Public Attributes

bool inited = False
- Static Public Attributes inherited from mininet.node.Node
int portBase = 0
dictionary inToNode = {}
dictionary outToNode = {}
bool isSetup = False

Detailed Description

CPU limited host.

Constructor & Destructor Documentation

◆ __init__()

def mininet.node.CPULimitedHost.__init__ (   self,
  inNamespace = 'cfs',
**  params 
namename of node
inNamespacein network namespace?
privateDirslist of private directory strings or tuples
paramsNode parameters (see config() for details)

Reimplemented from mininet.node.Node.

Member Function Documentation

◆ config()

def mininet.node.CPULimitedHost.config (   self,
  cpu = -1,
  cores = None,
**  params 
cpudesired overall system CPU fraction
cores(real) core(s) this host can run on
paramsparameters for Node.config()

◆ popen()

def mininet.node.CPULimitedHost.popen (   self,
**  kwargs 

Return a Popen() object in node's namespace.

argsPopen() args, single list, or string
kwargsPopen() keyword args

Reimplemented from mininet.node.Node.

◆ setCPUFrac()

def mininet.node.CPULimitedHost.setCPUFrac (   self,
  sched = None 

Set overall CPU fraction for this host.

fCPU bandwidth limit (positive fraction, or -1 for cfs unlimited)
sched'rt' or 'cfs' Note 'cfs' requires CONFIG_CFS_BANDWIDTH, and 'rt' requires CONFIG_RT_GROUP_SCHED

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