p4utils.mininetlib.cli module¶
This module is an extension of mininet.cli. It provides a CLI interface that the user can enable
using the NetworkAPI or the JSON network configuration file.
If enabled, the CLI starts right after the network boot and provides useful commands.
-
class
p4utils.mininetlib.cli.P4CLI(network_api, *args, **kwargs)[source]¶ Bases:
mininet.cli.CLIClient class to interact with the network once it has been created.
-
network_api[source]¶ instance of the network orchestrator.
Type: NetworkAPI
-
do_enable_scheduler(line='')[source]¶ Enables the
TaskServeron a node.Usage:
mininet> enable_scheduler [<node>] [--path <dir>]
Note
The directory where the socket file will be placed can be specified using
--path <dir>.
-
do_p4switch_reboot(line='')[source]¶ Reboots a P4 switch.
Usage:
mininet> p4switch_reboot <p4switch name> [--p4src <path>] [--cmds <path>]
Note
This command also allows to specify new configuration files for the switch:
--p4srcprovides a new P4 source,--cmdsprovides a new command file.
-
do_p4switch_start(line='')[source]¶ Starts a P4 switch.
Usage:
mininet> p4switch_start <p4switch name> [--p4src <path>] [--cmds <path>]
Note
This command also allows to specify new configuration files for the switch:
--p4srcprovides a new P4 source,--cmdsprovides a new command file.
-
do_p4switch_stop(line='')[source]¶ Stops execution of the specified P4 switch.
Usage:
mininet> p4switch_stop <p4switch name>
-
do_p4switches_reboot(line='')[source]¶ Reboots all P4 switches with new program.
Usage:
mininet> p4switches_reboot [--p4src <path>] [--cmds <path>]
Note
This command also allows to specify the same new configuration files for all the switches:
--p4srcprovides a new P4 source,--cmdsprovides a new command file.
-
do_pingset(line='')[source]¶ Pings between the hosts in the set.
Usage:
mininet> pingset <host1> ... <hostN>
-
do_task(line='')[source]¶ Executes a task on the given host.
Usage:
mininet> task <node> <start> <duration> <exe> [<arg1>] ... [<argN>] [--mod <module>] [--<key1> <kwarg1>] ... [--<keyM> <kwargM>]
Note
The starting delay (specified with
<start>) is taken with respect to the current time. The deafult module in which functions are looked up isp4utils.utils.traffic_utils. A different module can be specified in the command with--mod <module>.
-