ipmininet.iptopo module

This module defines topology class that supports adding L3 routers

class ipmininet.iptopo.IPTopo(*args, **kwargs)

Bases: mininet.topo.Topo

A topology that supports L3 routers

OVERLAYS = {'AS': <class 'ipmininet.router.config.bgp.AS'>, '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(router, 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:
  • router – router 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.
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

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.RouterDescription

addParams(**kwargs)
class ipmininet.iptopo.LinkDescription(topo, src, dst, key, link_attrs)

Bases: object

class ipmininet.iptopo.OverlayWrapper(topo, overlay)

Bases: object

class ipmininet.iptopo.RouterDescription(o, topo)

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 router.

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.