p4utils.mininetlib.net module

This module is an extension of mininet.net that allows also router nodes.

class p4utils.mininetlib.net.P4Mininet(*args, router=<class 'p4utils.mininetlib.node.FRRouter'>, **kwargs)[source]

Bases: mininet.net.Mininet

P4Mininet is the Mininet Class extended with P4 switches.

addRouter(name, cls=None, **params)[source]

Adds a router to the network.

Parameters:
  • name (string) – name of the router to add
  • cls (type) – custom router class/constructor (optional)
Returns:

added router

build()[source]

Build P4Mininet.

buildFromTopo(topo=None)[source]

Build mininet from a topology object. At the end of this function, everything should be connected and up.

configTofinos()[source]

Configure a set of Tofinos.

start()[source]

Start controller and switches.

stop()[source]

Stop the controller(s), switches and hosts