ipmininet.iptopo module¶
This module defines topology class that supports adding L3 routers
-
class
ipmininet.iptopo.
HostDescription
(o, topo=None)¶ Bases:
ipmininet.iptopo.NodeDescription
-
addDaemon
(daemon, default_cfg_class=<class 'ipmininet.host.config.base.HostConfig'>, **kwargs)¶ Add the daemon to the list of daemons to start on the node.
Parameters: - daemon – daemon class
- default_cfg_class – config class to use if there is no configuration class defined for the router yet.
- cfg_daemon_list – name of the parameter containing the list of daemons in your config class constructor. For instance, RouterConfig uses ‘daemons’ but BasicRouterConfig uses ‘additional_daemons’.
- daemon_params – all the parameters to give when instantiating the daemon class.
-
-
class
ipmininet.iptopo.
IPTopo
(*args, **kwargs)¶ Bases:
mininet.topo.Topo
A topology that supports L3 routers
-
OVERLAYS
= {'AS': <class 'ipmininet.router.config.bgp.AS'>, 'DNSZone': <class 'ipmininet.host.config.named.DNSZone'>, 'OSPFArea': <class 'ipmininet.router.config.ospf.OSPFArea'>, 'OpenrDomain': <class 'ipmininet.router.config.openr.OpenrDomain'>, 'Subnet': <class 'ipmininet.overlay.Subnet'>, 'iBGPFullMesh': <class 'ipmininet.router.config.bgp.iBGPFullMesh'>}¶
-
addDaemon
(node, daemon, default_cfg_class=<class 'ipmininet.router.config.base.BasicRouterConfig'>, cfg_daemon_list='daemons', **daemon_params)¶ Add the daemon to the list of daemons to start on the router.
Parameters: - node – node name
- daemon – daemon class
- default_cfg_class – config class to use if there is no configuration class defined for the router yet.
- cfg_daemon_list – name of the parameter containing the list of daemons in your config class constructor. For instance, RouterConfig uses ‘daemons’ but BasicRouterConfig uses ‘additional_daemons’.
- daemon_params – all the parameters to give when instantiating the daemon class.
-
addHost
(name, **kwargs)¶ Add a host to the topology
Parameters: name – the name of the node
-
addHub
(name, **opts)¶ Convenience method: Add hub to graph. name: hub name opts: hub options returns: hub name
-
addLink
(node1, node2, port1=None, port2=None, key=None, **opts)¶ Parameters: - node1 – first node to link
- node2 – second node to link
- port1 – port of the first node (optional)
- port2 – port of the second node (optional)
- key – a key to identify the link (optional)
- opts – link options (optional)
Returns: link info key
-
addOverlay
(overlay)¶ Add a new overlay on this topology
-
addRouter
(name, **kwargs)¶ Add a router to the topology
Parameters: name – the name of the node
-
build
(*args, **kwargs)¶ Override this method to build your topology.
-
capture_physical_interface
(intfname, node)¶ Adds a pre-existing physical interface to the given node.
-
getLinkInfo
(l, key, default)¶ Attempt to retrieve the information for the given link/key combination. If not found, set to an instance of default and return it
-
getNodeInfo
(n, key, default)¶ Attempt to retrieve the information for the given node/key combination. If not found, set to an instance of default and return it
-
hosts
(sort=True)¶ Return hosts. sort: sort hosts alphabetically returns: list of hosts
-
hubs
(sort=True)¶ Return a list of hub node names
-
isHub
(n)¶ Check whether the given node is a router
Parameters: n – node name
-
isNodeType
(n, x)¶ Return wether node n has a key x set to True
Parameters: - n – node name
- x – the key to check
-
isRouter
(n)¶ Check whether the given node is a router
Parameters: n – node name
-
post_build
(net)¶ A method that will be invoced once the topology has been fully built and before it is started.
Parameters: net – The freshly built (Mininet) network
-
routers
(sort=True)¶ Return a list of router node names
-
-
class
ipmininet.iptopo.
IntfDescription
(o, topo, link, intf_attrs)¶ Bases:
ipmininet.iptopo.NodeDescription
-
addParams
(**kwargs)¶
-
-
class
ipmininet.iptopo.
LinkDescription
(topo, src, dst, key, link_attrs)¶ Bases:
object
-
class
ipmininet.iptopo.
NodeDescription
(o, topo=None)¶ Bases:
str
-
addDaemon
(daemon, default_cfg_class=<class 'ipmininet.router.config.base.BasicRouterConfig'>, cfg_daemon_list='daemons', **daemon_params)¶ Add the daemon to the list of daemons to start on the node.
Parameters: - daemon – daemon class
- default_cfg_class – config class to use if there is no configuration class defined for the router yet.
- cfg_daemon_list – name of the parameter containing the list of daemons in your config class constructor. For instance, RouterConfig uses ‘daemons’ but BasicRouterConfig uses ‘additional_daemons’.
- daemon_params – all the parameters to give when instantiating the daemon class.
-
get_config
(daemon, **kwargs)¶
-
-
class
ipmininet.iptopo.
OverlayWrapper
(topo, overlay)¶ Bases:
object
-
class
ipmininet.iptopo.
RouterDescription
(o, topo=None)¶ Bases:
ipmininet.iptopo.NodeDescription
-
addDaemon
(daemon, default_cfg_class=<class 'ipmininet.router.config.base.BasicRouterConfig'>, **kwargs)¶ Add the daemon to the list of daemons to start on the node.
Parameters: - daemon – daemon class
- default_cfg_class – config class to use if there is no configuration class defined for the router yet.
- cfg_daemon_list – name of the parameter containing the list of daemons in your config class constructor. For instance, RouterConfig uses ‘daemons’ but BasicRouterConfig uses ‘additional_daemons’.
- daemon_params – all the parameters to give when instantiating the daemon class.
-