p4utils.mininetlib.node module¶
This module is an extension of mininet.node with customized nodes.
-
class
p4utils.mininetlib.node.
FRRouter
(name, bin_dir='/usr/local/sbin', int_conf=None, conf_dir='./routers', **kwargs)[source]¶ Bases:
mininet.node.Node
FRRouter built as Mininet node.
Parameters: - name (str) – name of the router
- bin_dir (str) – directory that contains the daemons binaries
- int_conf (str) – path to the router integrated configuration file
- conf_dir (str) – path to the directory which contains the folder with the configuration files for all the daemons (the folder is named after the router)
- zebra (bool) – enable Zebra daemon
- bgpd (bool) – enable BGP protocol
- ospfd (bool) – enable OSPFv2 (for IPv4) protocol
- ospf6d (bool) – enable OSPFv3 (for IPv6) protocol
- ripd (bool) – enable RIP protocol
- ripngd (bool) – enable RIPng protocol
- isisd (bool) – enable IS-IS protocol
- pimd (bool) – enable PIM protocol
- ldpd (bool) – enable LPD protocol
- nhrpd (bool) – enable NHRP protocol
- eigrpd (bool) – enable EIGRP protocol
- babeld (bool) – enable Babel protocol
- sharpd (bool) – enable SHARP daemon
- staticd (bool) – enable STATIC daemon
- pbrd (bool) – enable Policy Based Routing
- bfdd (bool) – enable Bidirectional Forwarding Detection
- fabricd (bool) – enable OpenFabric protocol
Warning
Only the following daemons and protocols are enabled by default:
zebra
ospfd
bgpd
staticd
Note
If
int_conf
is set, the contentconf_dir
is not considered except forvtysh.conf
which is always taken into account. Ifconf_dir
is not specified, then it is assumed to be./routers
, and the folder which contains the configuration files is then./routers/<name>
.
-
class
p4utils.mininetlib.node.
P4Host
(*args, log_enabled=False, log_dir='/tmp', **kwargs)[source]¶ Bases:
mininet.node.Host
Virtual hosts with custom configuration to work with P4 switches.
-
class
p4utils.mininetlib.node.
P4RuntimeSwitch
(*args, sw_bin='simple_switch_grpc', grpc_port=None, **kwargs)[source]¶ Bases:
p4utils.mininetlib.node.P4Switch
BMv2 switch with gRPC support.
Parameters: - name (str) – name of the switch
- device_id (int) – switch unique id
- sw_bin (str) – switch binary to execute
- json_path (str) – path to the P4 compiled JSON configuration
- thrift_port (int) – Thrift server’s port
- grpc_port (int) – P4Runtime gRPC server’s port
- pcap_dump (bool) – whether to save
.pcap
logs to disk - pcap_dir (str) –
.pcap
files path - log_enabled (bool) – whether to save logs to disk
- log_dir (srt) – log path
- enable_debugger (bool) – whether to enable debugger
-
class
p4utils.mininetlib.node.
P4Switch
(name, device_id, sw_bin='simple_switch', json_path=None, thrift_port=None, pcap_dump=False, pcap_dir=None, log_enabled=False, log_dir='/tmp', enable_debugger=False, priority_queues_num=1, **kwargs)[source]¶ Bases:
mininet.node.Switch
P4 virtual switch.
Parameters: - name (str) – name of the switch
- device_id (int) – switch unique id
- sw_bin (str) – switch binary to execute
- json_path (str) – path to the P4 compiled JSON configuration
- thrift_port (int) – Thrift server’s port
- pcap_dump (bool) – whether to save
.pcap
logs to disk - pcap_dir (str) –
.pcap
files path - log_enabled (bool) – whether to save logs to disk
- log_dir (srt) – log path
- enable_debugger (bool) – whether to enable debugger