Mininet Python API Reference Manual: Generated by Doxygen 1.8.3.1
Mininet Python API Reference Manual: Generated by Doxygen 1.8.3.1
1 Namespace Index 1
1.1 Namespace List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
2 Hierarchical Index 3
2.1 Class Hierarchy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
3 Class Index 5
3.1 Class List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
4 Namespace Documentation 7
4.1 topo Namespace Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
4.1.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
5 Class Documentation 9
5.1 mininet.cli.CLI Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
5.1.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
5.1.2 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
5.1.2.1 default . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
5.1.2.2 do_dpctl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
5.1.2.3 do_dump . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
5.1.2.4 do_gterm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
5.1.2.5 do_help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
5.1.2.6 do_intfs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
5.1.2.7 do_iperf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
5.1.2.8 do_iperfudp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
5.1.2.9 do_link . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
5.1.2.10 do_net . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
5.1.2.11 do_nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
5.1.2.12 do_noecho . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
5.1.2.13 do_pingall . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
ii CONTENTS
5.1.2.14 do_pingallfull . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
5.1.2.15 do_pingpair . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
5.1.2.16 do_pingpairfull . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
5.1.2.17 do_px . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
5.1.2.18 do_py . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
5.1.2.19 do_source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
5.1.2.20 do_time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
5.1.2.21 do_x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
5.1.2.22 do_xterm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
5.1.2.23 emptyline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
5.1.2.24 waitForNode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
5.1.3 Member Data Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
5.1.3.1 helpStr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
5.2 mininet.node.Controller Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
5.2.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
5.2.2 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
5.2.2.1 start . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
5.2.2.2 stop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
5.3 mininet.node.CPULimitedHost Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
5.3.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
5.3.2 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
5.3.2.1 config . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
5.3.2.2 popen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
5.3.2.3 setCPUFrac . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
5.4 mininet.topo.Graph Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
5.4.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
5.5 mininet.node.Host Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
5.5.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
5.6 mininet.link.Intf Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
5.6.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
5.6.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
5.6.2.1 __init__ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
5.6.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
5.6.3.1 config . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
5.6.3.2 setMAC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
5.6.3.3 setParam . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
5.7 mininet.topo.LinearTopo Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
CONTENTS iii
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
iv CONTENTS
5.9.3.23 staticArp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
5.9.3.24 stopXterms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
5.10 mininet.log.MininetLogger Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
5.10.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
5.10.2 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
5.10.2.1 output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
5.10.2.2 setLogLevel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
5.11 mininet.net.MininetWithControlNet Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
5.11.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
5.11.2 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
5.11.2.1 configureControlNetwork . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
5.11.2.2 configureRoutedControlNetwork . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
5.12 mininet.node.Node Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
5.12.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
5.12.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
5.12.2.1 __init__ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
5.12.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
5.12.3.1 addIntf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
5.12.3.2 cleanup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
5.12.3.3 cmd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
5.12.3.4 cmdPrint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
5.12.3.5 config . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
5.12.3.6 connectionsTo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
5.12.3.7 deleteIntfs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
5.12.3.8 fdToNode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
5.12.3.9 intf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
5.12.3.10 intfIsUp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
5.12.3.11 IP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
5.12.3.12 MAC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
5.12.3.13 monitor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
5.12.3.14 newPort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
5.12.3.15 pexec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
5.12.3.16 popen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
5.12.3.17 read . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
5.12.3.18 readline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
5.12.3.19 sendCmd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
5.12.3.20 sendInt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
CONTENTS v
5.12.3.21 setARP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
5.12.3.22 setDefaultRoute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
5.12.3.23 setHostRoute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
5.12.3.24 setIP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
5.12.3.25 setMAC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
5.12.3.26 setParam . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
5.12.3.27 stop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
5.12.3.28 terminate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
5.12.3.29 waitOutput . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
5.12.3.30 waitReadable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
5.12.3.31 write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
5.13 mininet.node.NOX Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
5.13.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
5.13.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
5.13.2.1 __init__ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
5.14 mininet.node.OVSController Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
5.14.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
5.15 mininet.node.OVSLegacyKernelSwitch Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 42
5.15.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
5.15.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
5.15.2.1 __init__ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
5.15.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
5.15.3.1 setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
5.15.3.2 start . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
5.15.3.3 stop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
5.16 mininet.node.OVSSwitch Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
5.16.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
5.16.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
5.16.2.1 __init__ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
5.16.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
5.16.3.1 stop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
5.16.3.2 TCReapply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
5.17 mininet.node.RemoteController Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
5.17.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
5.17.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
5.17.2.1 __init__ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
5.17.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
vi CONTENTS
5.17.3.1 start . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
5.17.3.2 stop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
5.18 mininet.topo.SingleSwitchReversedTopo Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . 46
5.18.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
5.18.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
5.18.2.1 __init__ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
5.19 mininet.topo.SingleSwitchTopo Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
5.19.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
5.19.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
5.19.2.1 __init__ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
5.20 mininet.log.Singleton Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
5.20.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
5.21 mininet.log.StreamHandlerNoNewline Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 49
5.21.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
5.21.2 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
5.21.2.1 emit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
5.22 mininet.node.Switch Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
5.22.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
5.22.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
5.22.2.1 __init__ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
5.22.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
5.22.3.1 sendCmd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
5.23 mininet.link.TCIntf Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
5.23.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
5.23.2 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
5.23.2.1 config . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
5.24 mininet.link.TCLink Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
5.24.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
5.25 mininet.topo.Topo Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
5.25.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
5.25.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
5.25.2.1 __init__ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
5.25.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
5.25.3.1 addHost . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
5.25.3.2 addLink . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
5.25.3.3 addNode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
5.25.3.4 addPort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
CONTENTS vii
5.25.3.5 addSwitch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
5.25.3.6 hosts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
5.25.3.7 isSwitch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
5.25.3.8 links . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
5.25.3.9 port . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
5.25.3.10 sorted . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
5.25.3.11 switches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
5.26 mininet.topolib.TreeTopo Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
5.26.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
5.26.2 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
5.26.2.1 addTree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
5.27 mininet.node.UserSwitch Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
5.27.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
5.27.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
5.27.2.1 __init__ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
5.27.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
5.27.3.1 setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
5.27.3.2 start . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
5.27.3.3 stop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Index 60
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
Chapter 1
Namespace Index
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
Chapter 2
Hierarchical Index
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
Chapter 3
Class Index
Here are the classes, structs, unions and interfaces with brief descriptions:
mininet.cli.CLI
Simple command-line interface to talk to nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
mininet.node.Controller
A Controller is a Node that is running (or has execed?) an OpenFlow controller . . . . . . . . . . . 13
mininet.node.CPULimitedHost
CPU limited host . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
mininet.topo.Graph
Utility class to track nodes and edges - replaces networkx.Graph . . . . . . . . . . . . . . . . . . . 17
mininet.node.Host
A host is simply a Node . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
mininet.link.Intf
Basic interface object that can configure itself . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
mininet.topo.LinearTopo
Linear topology of k switches, with n hosts per switch . . . . . . . . . . . . . . . . . . . . . . . . . 20
mininet.link.Link
A basic link is just a veth pair . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
mininet.net.Mininet
Network emulation with hosts spawned in network namespaces . . . . . . . . . . . . . . . . . . . 23
mininet.log.MininetLogger
Mininet-specific logger Enable each mininet .py file to with one . . . . . . . . . . . . . . . . . . . . 30
mininet.net.MininetWithControlNet
Control network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
mininet.node.Node
A virtual network node is simply a shell in a network namespace . . . . . . . . . . . . . . . . . . . 32
mininet.node.NOX
Controller to run a NOX application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
mininet.node.OVSController
Open vSwitch controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
mininet.node.OVSLegacyKernelSwitch
Open VSwitch legacy kernel-space switch using ovs-openflowd . . . . . . . . . . . . . . . . . . . . 42
mininet.node.OVSSwitch
Open vSwitch switch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
mininet.node.RemoteController
Controller running outside of Mininet’s control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
6 Class Index
mininet.topo.SingleSwitchReversedTopo
Single switch connected to k hosts, with reversed ports . . . . . . . . . . . . . . . . . . . . . . . . 46
mininet.topo.SingleSwitchTopo
Single switch connected to k hosts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
mininet.log.Singleton
Singleton pattern from Wikipedia See . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
mininet.log.StreamHandlerNoNewline
StreamHandler that doesn’t print newlines by default . . . . . . . . . . . . . . . . . . . . . . . . . 49
mininet.node.Switch
A Switch is a Node that is running (or has execed?) an OpenFlow switch . . . . . . . . . . . . . . . 50
mininet.link.TCIntf
Interface customized by tc (traffic control) utility Allows specification of bandwidth limits (various meth-
ods) as well as delay, loss and max queue length . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
mininet.link.TCLink
Link with symmetric TC interfaces configured via opts . . . . . . . . . . . . . . . . . . . . . . . . . 52
mininet.topo.Topo
Data center network representation for structured multi-trees . . . . . . . . . . . . . . . . . . . . . 53
mininet.topolib.TreeTopo
Topology for a tree network with a given depth and fanout . . . . . . . . . . . . . . . . . . . . . . . 57
mininet.node.UserSwitch
User-space switch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
Chapter 4
Namespace Documentation
Author
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
Chapter 5
Class Documentation
Cmd
mininet.cli.CLI
• def __init__
• def emptyline
Don’t repeat last command when you hit return.
• def do_help
Describe available CLI commands.
• def do_nodes
List all nodes.
• def do_net
List network connections.
• def do_sh
Run an external shell command.
• def do_py
Evaluate a Python expression.
• def do_px
Execute a Python statement.
• def do_pingall
Ping between all hosts.
• def do_pingpair
Ping between first two hosts, useful for testing.
10 Class Documentation
• def do_pingallfull
Ping between first two hosts, returns all ping results.
• def do_pingpairfull
Ping between first two hosts, returns all ping results.
• def do_iperf
Simple iperf TCP test between two (optionally specified) hosts.
• def do_iperfudp
Simple iperf TCP test between two (optionally specified) hosts.
• def do_intfs
List interfaces.
• def do_dump
Dump node info.
• def do_link
Bring link(s) between two nodes up or down.
• def do_xterm
Spawn xterm(s) for the given node(s).
• def do_x
Create an X11 tunnel to the given node, optionally starting a client.
• def do_gterm
Spawn gnome-terminal(s) for the given node(s).
• def do_exit
Exit.
• def do_quit
Exit.
• def do_EOF
Exit.
• def isatty
Is our standard input a tty?
• def do_noecho
Run an interactive command with echoing turned off.
• def do_source
Read commands from an input file.
• def do_dpctl
Run dpctl (or ovs-ofctl) command on all switches.
• def do_time
Measure time taken for any command in Mininet.
• def default
Called on an input line when the command prefix is not recognized.
• def waitForNode
Wait for a node to finish, and print its output.
Public Attributes
• mn
• nodelist
• nodemap
• locals
• stdin
• inPoller
• inputFile
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
5.1 mininet.cli.CLI Class Reference 11
List interfaces.
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
12 Class Documentation
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
5.2 mininet.node.Controller Class Reference 13
Initial value:
1 = (
2 ’You may also send a command to a node using:\n’
3 ’ <node> command {args}\n’
4 ’For example:\n’
5 ’ mininet> h1 ifconfig\n’
6 ’\n’
7 ’The interpreter automatically substitutes IP addresses\n’
8 ’for node names when a node is the first arg, so commands\n’
9 ’like\n’
10 ’ mininet> h2 ping h3\n’
11 ’should work.\n’
12 ’\n’
13 ’Some character-oriented interactive commands require\n’
14 ’noecho:\n’
15 ’ mininet> noecho h2 vi foo.py\n’
16 ’However, starting up an xterm/gterm is generally better:\n’
17 ’ mininet> xterm h2\n\n’
18 )
The documentation for this class was generated from the following file:
• mininet/cli.py
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
14 Class Documentation
object
mininet.node.Node
mininet.node.Controller
• def __init__
• def checkListening
Make sure no controllers are running on our port.
• def start
Start <controller> <args> on controller.
• def stop
Stop controller.
• def IP
Return IP address of the Controller.
• def __repr__
More informative string representation.
Public Attributes
• command
• cargs
• cdir
• ip
• port
• execed
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
5.3 mininet.node.CPULimitedHost Class Reference 15
Stop controller.
The documentation for this class was generated from the following file:
• mininet/node.py
object
mininet.node.Node
mininet.node.Host
mininet.node.CPULimitedHost
• def __init__
• def cgroupSet
Set a cgroup parameter and return its value.
• def cgroupGet
Return value of cgroup parameter.
• def cgroupDel
Clean up our cgroup.
• def popen
Return a Popen() object in node’s namespace.
• def cleanup
Clean up Node, then clean up our cgroup.
• def chrt
Set RT scheduling priority.
• def rtInfo
Internal method: return parameters for RT bandwidth.
• def cfsInfo
Internal method: return parameters for CFS bandwidth.
• def setCPUFrac
Set overall CPU fraction for this host.
• def setCPUs
Specify (real) cores that our cgroup can run on.
• def config
• def init
Initialization for CPULimitedHost class.
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
16 Class Documentation
Public Attributes
• cgroup
• period_us
• sched
• rtprio
• inited = False
Parameters
cpu desired overall system CPU fraction
cores (real) core(s) this host can run on
params parameters for Node.config()
Parameters
args Popen() args, single list, or string
kwargs Popen() keyword args
Parameters
f CPU bandwidth limit (fraction)
sched ’rt’ or ’cfs’ Note ’cfs’ requires CONFIG_CFS_BANDWIDTH
The documentation for this class was generated from the following file:
• mininet/node.py
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
5.4 mininet.topo.Graph Class Reference 17
object
mininet.topo.Graph
• def __init__
• def add_node
Add node to graph.
• def add_edge
Add edge to graph.
• def nodes
Return list of graph nodes.
• def edges
Iterator: return graph edges.
• def __getitem__
Return link dict for the given node.
Public Attributes
• data
• mininet/topo.py
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
18 Class Documentation
object
mininet.node.Node
mininet.node.Host
mininet.node.CPULimitedHost
• mininet/node.py
object
mininet.link.Intf
mininet.link.TCIntf
• def __init__
• def cmd
Run a command in our owning node.
• def ifconfig
Configure ourselves using ifconfig.
• def setIP
Set our IP address.
• def setMAC
Set the MAC address for an interface.
• def updateIP
Return updated IP address based on ifconfig.
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
5.6 mininet.link.Intf Class Reference 19
• def updateMAC
Return updated MAC address based on ifconfig.
• def IP
Return IP address.
• def MAC
Return MAC address.
• def isUp
Return whether interface is up.
• def rename
Rename interface.
• def setParam
Internal.
• def config
Configure Node according to (optional)
• def delete
Delete interface.
• def __repr__
• def __str__
Public Attributes
• node
• name
• link
• prefixLen
• params
• mac
• ip
5.6.2.1 def mininet.link.Intf. init ( self, name, node = None, port = None, link = None, params )
Parameters
name interface name (e.g. h1-eth0)
node owning node (where this intf most likely lives)
link parent link if we’re part of a link other arguments are passed to config()
5.6.3.1 def mininet.link.Intf.config ( self, mac = None, ip = None, ifconfig = None, up = True, params )
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
20 Class Documentation
Parameters
parameters
mac MAC address
ip IP address
ifconfig arbitrary interface configuration Subclasses should override this method and call the parent class’s
config(∗∗params)
Parameters
macstr MAC address as string
Internal.
Parameters
method configure a single parameter
results dict of results to update
method config method name
param arg=value (ignore if value=None) value may also be list or dict
The documentation for this class was generated from the following file:
• mininet/link.py
object
mininet.topo.Topo
mininet.topo.LinearTopo
• def __init__
Init.
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
5.8 mininet.link.Link Class Reference 21
Public Attributes
• k
• n
Init.
Parameters
k number of switches
n number of hosts per switch
hconf host configuration options
lconf link configuration options
The documentation for this class was generated from the following file:
• mininet/topo.py
object
mininet.link.Link
mininet.link.TCLink
• def __init__
Create veth link to another node, making two new interfaces.
• def intfName
Construct a canonical interface name node-ethN for interface n.
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
22 Class Documentation
• def makeIntfPair
Create pair of interfaces.
• def delete
Delete this link.
• def __str__
Public Attributes
• intf2
5.8.2.1 def mininet.link.Link. init ( self, node1, node2, port1 = None, port2 = None, intfName1 = None, intfName2 =
None, intf = Intf, cls1 = None, cls2 = None, params1 = None, params2 = None )
Parameters
node1 first node
node2 second node
port1 node1 port number (optional)
port2 node2 port number (optional)
intf default interface class/constructor cls1,
cls2 optional interface-specific constructors
intfName1 node1 interface name (optional)
intfName2 node2 interface name (optional)
params1 parameters for interface 1
params2 parameters for interface 2
Parameters
intf1 name of interface 1
intf2 name of interface 2 (override this class method [and possibly delete()] to change link type)
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
5.9 mininet.net.Mininet Class Reference 23
The documentation for this class was generated from the following file:
• mininet/link.py
object
mininet.net.Mininet
mininet.net.MininetWithControlNet
• def __init__
Create Mininet object.
• def addHost
Add host.
• def addSwitch
Add switch.
• def addController
Add controller.
• def getNodeByName
Return node(s) with given name(s)
• def get
Convenience alias for getNodeByName.
• def __getitem__
net [ name ]
• def __iter__
return iterator over nodes
• def addLink
"Add a link from node1 to node2
• def configHosts
Configure a set of hosts.
• def buildFromTopo
Build mininet from a topology object At the end of this function, everything should be connected and up.
• def configureControlNetwork
Control net config hook: override in subclass.
• def build
Build mininet.
• def startTerms
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
24 Class Documentation
Public Attributes
• topo
• switch
• host
• controller
• link
• intf
• ipBase
• prefixLen
• nextIP
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
5.9 mininet.net.Mininet Class Reference 25
• inNamespace
• xterms
• cleanup
• autoSetMacs
• autoStaticArp
• autoPinCpus
• numCores
• nextCore
• listenPort
• hosts
• switches
• controllers
• nameToNode
• terms
• built
• inited = False
5.9.2.1 def mininet.net.Mininet. init ( self, topo = None, switch = OVSKernelSwitch, host = Host, controller
= Controller, link = Link, intf = Intf, build = True, xterms = False, cleanup = False, ipBase =
’10.0.0.0/8’, inNamespace = False, autoSetMacs = False, autoStaticArp = False, autoPinCpus =
False, listenPort = None )
Parameters
topo Topo (topology) object or None
switch default Switch class
host default Host class/constructor
controller default Controller class/constructor
link default Link class/constructor
intf default Intf class/constructor
ipBase base IP address for hosts,
build build now from topo?
xterms if build now, spawn xterms?
cleanup if build now, cleanup before creating?
inNamespace spawn switches and controller in net namespaces?
autoSetMacs set MAC addrs automatically like IP addresses?
autoStaticArp set all-pairs static MAC addrs?
autoPinCpus pin hosts to (real) cores (requires CPULimitedHost)?
listenPort base listening port to open; will be incremented for each additional switch in the net if in-
Namespace=False
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
26 Class Documentation
net [ name ]
Parameters
operator Return node(s) with given name(s)
Add controller.
Parameters
controller Controller class
Add host.
Parameters
name name of host to add
cls custom host class/constructor (optional)
params parameters for host
Returns
added host
5.9.3.4 def mininet.net.Mininet.addLink ( self, node1, node2, port1 = None, port2 = None, cls = None, params )
Parameters
node1 source node
node2 dest node
port1 source port
port2 dest port
Returns
link object
Add switch.
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
5.9 mininet.net.Mininet Class Reference 27
Parameters
name name of switch to add
cls custom switch class/constructor (optional)
Returns
Parameters
effect increments listenPort ivar .
Build mininet.
Build mininet from a topology object At the end of this function, everything should be connected and up.
Parameters
src node name
dst node name
status string {up, down}
5.9.3.11 def mininet.net.Mininet.iperf ( self, hosts = None, l4Type = ’TCP’, udpBw = ’10M’ )
Parameters
hosts list of hosts; if None, uses opposite hosts
l4Type string, one of [ TCP, UDP ]
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
28 Class Documentation
Returns
Monitor a set of hosts (or all hosts by default), and return their output, a line at a time.
Parameters
hosts (optional) set of hosts to monitor
timeoutms (optional) timeout value in ms
Returns
Parameters
hosts list of hosts
timeout time to wait for a response, as string
Returns
Returns
Returns
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
5.9 mininet.net.Mininet Class Reference 29
Parameters
hosts list of hosts
timeout time to wait for a response, as string
Returns
Returns
Returns
Parameters
cpu desired CPU fraction of each host
duration test duration in seconds returns a single list of measured CPU fractions as floats.
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
30 Class Documentation
• mininet/net.py
Logger object
mininet.log.MininetLogger
• def __init__
• def setLogLevel
Setup loglevel.
• def output
Log ’msg % args’ with severity ’OUTPUT’.
Parameters
import
from mininet.log import [lg, info, error]
...get a default logger that doesn’t require one newline per logging
call.
Inherit from object to ensure that we have at least one new-style base
class, and can then use the __metaclass__ directive, to prevent this
error
TypeError Error when calling the metaclass bases a new-style class can’t have only classic bases
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
5.11 mininet.net.MininetWithControlNet Class Reference 31
If Python2.5/logging/__init__.py defined Filterer as a new-style class, via Filterer( object ): rather than Filterer, we
wouldn’t need this.
Use singleton pattern to ensure only one logger is ever created.
Setup loglevel.
Parameters
levelName level name from LEVELS
The documentation for this class was generated from the following file:
• mininet/log.py
Control network.
Inheritance diagram for mininet.net.MininetWithControlNet:
object
mininet.net.Mininet
mininet.net.MininetWithControlNet
• def configureControlNetwork
Configure control network.
• def configureRoutedControlNetwork
Configure a routed control network on controller and switches.
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
32 Class Documentation
Control network.
Parameters
support
Create an explicit control network. Currently this is only
used/usable with the user datapath.
Notes
1. If the controller and switches are in the same (e.g. root)
namespace, they can just use the loopback connection.
• mininet/net.py
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
5.12 mininet.node.Node Class Reference 33
object
mininet.node.Node
• def __init__
• def fdToNode
Return node corresponding to given file descriptor.
• def startShell
Start a shell process for running commands.
• def cleanup
Help python collect its garbage.
• def read
Buffered read from node, non-blocking.
• def readline
Buffered readline from node, non-blocking.
• def write
Write data to node.
• def terminate
Send kill signal to Node and clean up after it.
• def stop
Stop node.
• def waitReadable
Wait until node’s output is readable.
• def sendCmd
Send a command, followed by a command to echo a sentinel, and return without waiting for the command to complete.
• def sendInt
Interrupt running command.
• def monitor
Monitor and return the output of a command.
• def waitOutput
Wait for a command to complete.
• def cmd
Send a command, wait for output, and return it.
• def cmdPrint
Call cmd and printing its output.
• def popen
Return a Popen() object in our namespace.
• def pexec
Execute a command using popen.
• def newPort
Return the next port number to allocate.
• def addIntf
Add an interface.
• def defaultIntf
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
34 Class Documentation
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
5.12 mininet.node.Node Class Reference 35
Public Attributes
• name
• inNamespace
• params
• intfs
• ports
• nameToIntf
• waiting
• readbuf
• shell
• stdin
• stdout
• pid
• pollOut
• execed
• lastCmd
• lastPid
• int portBase = 0
• dictionary inToNode = {}
• dictionary outToNode = {}
• isSetup = False
Parameters
name name of node
inNamespace in network namespace?
params Node parameters (see config() for details)
Add an interface.
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
36 Class Documentation
Parameters
intf interface
port port number (optional, typically OpenFlow port number)
Parameters
cmd string
Parameters
cmd string
5.12.3.5 def mininet.node.Node.config ( self, mac = None, ip = None, defaultRoute = None, lo = ’up’, params )
Parameters
parameters
mac MAC address for default interface
ip IP address for default interface
ifconfig arbitrary interface configuration Subclasses should override this method and call the parent class’s
config(∗∗params)
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
5.12 mininet.node.Node Class Reference 37
Parameters
checkName only delete interfaces that contain our name
Parameters
fd file descriptor
Returns
node
Return our interface object with given string name, default intf if name is falsy (None, empty string, etc).
or the input intf arg.
Having this fcn return its arg for Intf objects makes it easier to construct functions with flexible input args for interfaces
(those that accept both string names and Intf objects).
Parameters
timeoutms timeout in ms or None to wait indefinitely.
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
38 Class Documentation
Returns
Parameters
args Popen() args, single list, or string
kwargs Popen() keyword args
Parameters
maxbytes maximum number of bytes to return
Returns
Send a command, followed by a command to echo a sentinel, and return without waiting for the command to complete.
Parameters
args command and arguments, or string
printPid print command’s PID?
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
5.12 mininet.node.Node Class Reference 39
Parameters
ip IP address as string
mac MAC address as string
Parameters
intf Intf or {dev <intfname> via <gw-ip> ...}
Parameters
ip IP address as dotted decimal
intf string, interface name
Parameters
intf intf or intf name
ip IP address as a string
prefixLen prefix length, e.g. 8 for /8 or 16M addrs
Parameters
intf intf or intf name
mac MAC address as string
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
40 Class Documentation
Internal.
Parameters
method configure a single parameter
results dict of results to update
method config method name
param arg=value (ignore if value=None) value may also be list or dict
Stop node.
Parameters
verbose print output interactively
Parameters
timeoutms timeout in ms or None to wait indefinitely.
Parameters
data string
The documentation for this class was generated from the following file:
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
5.14 mininet.node.OVSController Class Reference 41
• mininet/node.py
object
mininet.node.Node
mininet.node.Controller
mininet.node.NOX
• def __init__
Init.
Init.
Parameters
name name to give controller
noxArgs arguments (strings) to pass to NOX
The documentation for this class was generated from the following file:
• mininet/node.py
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
42 Class Documentation
object
mininet.node.Node
mininet.node.Controller
mininet.node.OVSController
• def __init__
• mininet/node.py
object
mininet.node.Node
mininet.node.Switch
mininet.node.OVSLegacyKernelSwitch
• def __init__
Init.
• def setup
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
5.15 mininet.node.OVSLegacyKernelSwitch Class Reference 43
Public Attributes
• dp
• intf
• execed
Init.
Parameters
name name for switch
dp netlink id (0, 1, 2, ...)
defaultMAC default MAC as unsigned int; random value if None
• mininet/node.py
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
44 Class Documentation
object
mininet.node.Node
mininet.node.Switch
mininet.node.OVSSwitch
• def __init__
Init.
• def setup
Make sure Open vSwitch is installed and working.
• def dpctl
Run ovs-ofctl command.
• def attach
Connect a data port.
• def detach
Disconnect a data port.
• def controllerUUIDs
Return ovsdb UUIDs for our controllers.
• def connected
Are we connected to at least one of our controllers?
• def start
Start up a new OVS OpenFlow switch using ovs-vsctl.
• def stop
Terminate OVS switch.
• def TCReapply
Unfortunately OVS and Mininet are fighting over tc queuing disciplines.
Public Attributes
• failMode
• datapath
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
5.17 mininet.node.RemoteController Class Reference 45
5.16.2.1 def mininet.node.OVSSwitch. init ( self, name, failMode = ’secure’, datapath = ’kernel’, params )
Init.
Parameters
name name for switch
failMode controller loss behavior (secure|open)
datapath userspace or kernel mode (kernel|user)
• mininet/node.py
object
mininet.node.Node
mininet.node.Controller
mininet.node.RemoteController
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
46 Class Documentation
• def __init__
Init.
• def start
Overridden to do nothing.
• def stop
Overridden to do nothing.
• def checkListening
Warn if remote controller is not accessible.
5.17.2.1 def mininet.node.RemoteController. init ( self, name, ip = ’127.0.0.1’, port = 6633, kwargs )
Init.
Parameters
name name to give controller
ip the IP address where the remote controller is listening
port the port where the remote controller is listening
Overridden to do nothing.
Overridden to do nothing.
The documentation for this class was generated from the following file:
• mininet/node.py
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
5.19 mininet.topo.SingleSwitchTopo Class Reference 47
object
mininet.topo.Topo
mininet.topo.SingleSwitchReversedTopo
• def __init__
Init.
Public Attributes
• k
Init.
Parameters
k number of hosts
enable_all enables all nodes and switches?
The documentation for this class was generated from the following file:
• mininet/topo.py
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
48 Class Documentation
object
mininet.topo.Topo
mininet.topo.SingleSwitchTopo
• def __init__
Init.
Public Attributes
• k
Init.
Parameters
k number of hosts
enable_all enables all nodes and switches?
The documentation for this class was generated from the following file:
• mininet/topo.py
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
5.21 mininet.log.StreamHandlerNoNewline Class Reference 49
type
mininet.log.Singleton
• def __init__
• def __call__
Parameters
http//en.- Python
wikipedia.-
Intended to be used as a __metaclass_ param, as shown for the class
org/wiki/- below.
Singleton-
Pattern
The documentation for this class was generated from the following file:
• mininet/log.py
StreamHandler
mininet.log.StreamHandlerNoNewline
• def emit
Emit a record.
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
50 Class Documentation
Since StreamHandler automatically adds newlines, define a mod to more easily support interactive mode when we want
it, or errors-only logging for running unit tests.
Emit a record.
If a formatter is specified, it is used to format the record. The record is then written to the stream with a trailing newline [
N.B. this may be removed depending on feedback ]. If exception information is present, it is formatted using traceback.-
printException and appended to the stream.
The documentation for this class was generated from the following file:
• mininet/log.py
object
mininet.node.Node
mininet.node.Switch
• def __init__
• def defaultDpid
Derive dpid from switch name, s1 -> 1.
• def defaultIntf
Return control interface.
• def sendCmd
Send command to Node.
• def connected
Is the switch connected to a controller? (override this method)
• def __repr__
More informative string representation.
Public Attributes
• dpid
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
5.23 mininet.link.TCIntf Class Reference 51
• opts
• listenPort
• controlIntf
• int portBase = 1
• int dpidLen = 16
5.22.2.1 def mininet.node.Switch. init ( self, name, dpid = None, opts = ’’, listenPort = None, params )
Parameters
dpid dpid for switch (or None to derive from name, e.g. s1 -> 1)
opts additional switch options
listenPort port to listen on for dpctl connections
Parameters
cmd string
The documentation for this class was generated from the following file:
• mininet/node.py
Interface customized by tc (traffic control) utility Allows specification of bandwidth limits (various methods) as well as
delay, loss and max queue length.
Inheritance diagram for mininet.link.TCIntf:
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
52 Class Documentation
object
mininet.link.Intf
mininet.link.TCIntf
• def bwCmds
Return tc commands to set bandwidth.
• def tc
Execute tc command for our interface.
• def config
Configure the port and set its properties.
• def delayCmds
Internal method: return tc commands for delay and loss.
Interface customized by tc (traffic control) utility Allows specification of bandwidth limits (various methods) as well as
delay, loss and max queue length.
5.23.2.1 def mininet.link.TCIntf.config ( self, bw = None, delay = None, jitter = None, loss = None, disable gro = True,
speedup = 0, use hfsc = False, use tbf = False, latency ms = None, enable ecn = False, enable red =
False, max queue size = None, params )
• mininet/link.py
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
5.25 mininet.topo.Topo Class Reference 53
object
mininet.link.Link
mininet.link.TCLink
• def __init__
• mininet/link.py
object
mininet.topo.Topo
• def __init__
Topo.
• def addNode
Add Node to graph.
• def addHost
Convenience.
• def addSwitch
Convenience.
• def addLink
node1,
• def addPort
Generate port mapping for new edge.
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
54 Class Documentation
• def nodes
Return nodes in graph.
• def isSwitch
Returns true if node is a switch.
• def switches
Return switches.
• def hosts
Return hosts.
• def links
Return links.
• def port
Get port number.
• def linkInfo
Return link metadata.
• def setlinkInfo
Set link metadata.
• def nodeInfo
Return metadata (dict) for node.
• def setNodeInfo
Set metadata (dict) for node.
• def sorted
Items sorted in natural (i.e.
Public Attributes
• g
• node_info
• link_info
• hopts
• sopts
• lopts
• ports
5.25.2.1 def mininet.topo.Topo. init ( self, hopts = None, sopts = None, lopts = None )
Topo.
Parameters
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
5.25 mininet.topo.Topo Class Reference 55
object
hinfo default host options
sopts default switch options
lopts default link options
Convenience.
Parameters
method Add host to graph.
name host name
opts host options
Returns
host name
5.25.3.2 def mininet.topo.Topo.addLink ( self, node1, node2, port1 = None, port2 = None, opts )
node1,
Parameters
node2 nodes to link together port1,
port2 ports (optional)
opts link options (optional)
Returns
Parameters
name name
opts node options
Returns
node name
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
56 Class Documentation
5.25.3.4 def mininet.topo.Topo.addPort ( self, src, dst, sport = None, dport = None )
Parameters
src source switch name
dst destination switch name
Convenience.
Parameters
method Add switch to graph.
name switch name
opts switch options
Returns
switch name
Return hosts.
Returns
Return links.
Returns
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
5.26 mininet.topolib.TreeTopo Class Reference 57
Parameters
src source switch name
dst destination switch name
Returns
tuple (src_port, dst_port): src_port: port on source switch leading to the destination switch dst_port: port on desti-
nation switch leading to the source switch
Return switches.
Returns
The documentation for this class was generated from the following file:
• mininet/topo.py
object
mininet.topo.Topo
mininet.topolib.TreeTopo
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
58 Class Documentation
• def __init__
• def addTree
Add a subtree starting with node n.
Public Attributes
• hostNum
• switchNum
Returns
The documentation for this class was generated from the following file:
• mininet/topolib.py
User-space switch.
Inheritance diagram for mininet.node.UserSwitch:
object
mininet.node.Node
mininet.node.Switch
mininet.node.UserSwitch
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
5.27 mininet.node.UserSwitch Class Reference 59
• def __init__
Init.
• def setup
Ensure any dependencies are loaded; if not, try to load them.
• def dpctl
Run dpctl command.
• def connected
Is the switch connected to a controller?
• def start
Start OpenFlow reference user datapath.
• def stop
Stop OpenFlow reference user datapath.
Public Attributes
• dpopts
• int dpidLen = 12
User-space switch.
Init.
Parameters
name name for the switch
dpopts additional arguments to ofdatapath (–no-slicing)
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
60 Class Documentation
Log to /tmp/sN-{ofd,ofp}.log.
Parameters
controllers list of controller objects
• mininet/node.py
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
Index
__getitem__ mininet::node::Node, 36
mininet::net::Mininet, 26 cmdPrint
__init__ mininet::node::Node, 36
mininet::link::Intf, 19 config
mininet::link::Link, 22 mininet::link::Intf, 19
mininet::net::Mininet, 25 mininet::link::TCIntf, 52
mininet::node::Node, 35 mininet::node::CPULimitedHost, 16
mininet::node::NOX, 41 mininet::node::Node, 36
mininet::node::OVSLegacyKernelSwitch, 43 configHosts
mininet::node::OVSSwitch, 45 mininet::net::Mininet, 27
mininet::node::RemoteController, 46 configLinkStatus
mininet::node::Switch, 51 mininet::net::Mininet, 27
mininet::node::UserSwitch, 59 configureControlNetwork
mininet::topo::LinearTopo, 21 mininet::net::MininetWithControlNet, 32
mininet::topo::SingleSwitchReversedTopo, 47 configureRoutedControlNetwork
mininet::topo::SingleSwitchTopo, 48 mininet::net::MininetWithControlNet, 32
mininet::topo::Topo, 54 connectionsTo
mininet::node::Node, 36
addController
mininet::net::Mininet, 26 default
addHost mininet::cli::CLI, 11
mininet::net::Mininet, 26 deleteIntfs
mininet::topo::Topo, 55 mininet::node::Node, 36
addIntf do_dpctl
mininet::node::Node, 35 mininet::cli::CLI, 11
addLink do_dump
mininet::net::Mininet, 26 mininet::cli::CLI, 11
mininet::topo::Topo, 55 do_gterm
addNode mininet::cli::CLI, 11
mininet::topo::Topo, 55 do_help
addPort mininet::cli::CLI, 11
mininet::topo::Topo, 55 do_intfs
addSwitch mininet::cli::CLI, 11
mininet::net::Mininet, 26 do_iperf
mininet::topo::Topo, 56 mininet::cli::CLI, 11
addTree do_iperfudp
mininet::topolib::TreeTopo, 58 mininet::cli::CLI, 11
do_link
build mininet::cli::CLI, 11
mininet::net::Mininet, 27 do_net
buildFromTopo mininet::cli::CLI, 12
mininet::net::Mininet, 27 do_nodes
mininet::cli::CLI, 12
cleanup do_noecho
mininet::node::Node, 36 mininet::cli::CLI, 12
cmd do_pingall
62 INDEX
mininet::cli::CLI, 12 mininet.cli.CLI, 9
do_pingallfull mininet.link.Intf, 18
mininet::cli::CLI, 12 mininet.link.Link, 21
do_pingpair mininet.link.TCIntf, 51
mininet::cli::CLI, 12 mininet.link.TCLink, 52
do_pingpairfull mininet.log.MininetLogger, 30
mininet::cli::CLI, 12 mininet.log.Singleton, 48
do_px mininet.log.StreamHandlerNoNewline, 49
mininet::cli::CLI, 12 mininet.net.Mininet, 23
do_py mininet.net.MininetWithControlNet, 31
mininet::cli::CLI, 12 mininet.node.CPULimitedHost, 15
do_source mininet.node.Controller, 13
mininet::cli::CLI, 12 mininet.node.Host, 17
do_time mininet.node.NOX, 41
mininet::cli::CLI, 12 mininet.node.Node, 32
do_x mininet.node.OVSController, 41
mininet::cli::CLI, 13 mininet.node.OVSLegacyKernelSwitch, 42
do_xterm mininet.node.OVSSwitch, 44
mininet::cli::CLI, 13 mininet.node.RemoteController, 45
mininet.node.Switch, 50
emit mininet.node.UserSwitch, 58
mininet::log::StreamHandlerNoNewline, 50 mininet.topo.Graph, 17
emptyline mininet.topo.LinearTopo, 20
mininet::cli::CLI, 13 mininet.topo.SingleSwitchReversedTopo, 46
mininet.topo.SingleSwitchTopo, 47
fdToNode
mininet.topo.Topo, 53
mininet::node::Node, 37
mininet.topolib.TreeTopo, 57
mininet::cli::CLI
helpStr
default, 11
mininet::cli::CLI, 13
do_dpctl, 11
hosts
do_dump, 11
mininet::topo::Topo, 56
do_gterm, 11
IP do_help, 11
mininet::node::Node, 37 do_intfs, 11
interact do_iperf, 11
mininet::net::Mininet, 27 do_iperfudp, 11
intf do_link, 11
mininet::node::Node, 37 do_net, 12
intfIsUp do_nodes, 12
mininet::node::Node, 37 do_noecho, 12
intfName do_pingall, 12
mininet::link::Link, 22 do_pingallfull, 12
iperf do_pingpair, 12
mininet::net::Mininet, 27 do_pingpairfull, 12
isSwitch do_px, 12
mininet::topo::Topo, 56 do_py, 12
do_source, 12
links do_time, 12
mininet::topo::Topo, 56 do_x, 13
do_xterm, 13
MAC emptyline, 13
mininet::node::Node, 37 helpStr, 13
makeIntfPair waitForNode, 13
mininet::link::Link, 22 mininet::link::Intf
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
INDEX 63
__init__, 19 __init__, 35
config, 19 addIntf, 35
setMAC, 20 cleanup, 36
setParam, 20 cmd, 36
mininet::link::Link cmdPrint, 36
__init__, 22 config, 36
intfName, 22 connectionsTo, 36
makeIntfPair, 22 deleteIntfs, 36
mininet::link::TCIntf fdToNode, 37
config, 52 IP, 37
mininet::log::MininetLogger intf, 37
output, 31 intfIsUp, 37
setLogLevel, 31 MAC, 37
mininet::log::StreamHandlerNoNewline monitor, 37
emit, 50 newPort, 37
mininet::net::Mininet pexec, 38
__getitem__, 26 popen, 38
__init__, 25 read, 38
addController, 26 readline, 38
addHost, 26 sendCmd, 38
addLink, 26 sendInt, 38
addSwitch, 26 setARP, 39
build, 27 setDefaultRoute, 39
buildFromTopo, 27 setHostRoute, 39
configHosts, 27 setIP, 39
configLinkStatus, 27 setMAC, 39
interact, 27 setParam, 39
iperf, 27 stop, 40
monitor, 28 terminate, 40
ping, 28 waitOutput, 40
pingAll, 28 waitReadable, 40
pingAllFull, 28 write, 40
pingFull, 28 mininet::node::OVSLegacyKernelSwitch
pingPair, 29 __init__, 43
pingPairFull, 29 setup, 43
run, 29 start, 43
runCpuLimitTest, 29 stop, 43
start, 29 mininet::node::OVSSwitch
startTerms, 29 __init__, 45
staticArp, 29 stop, 45
stopXterms, 30 TCReapply, 45
mininet::net::MininetWithControlNet mininet::node::RemoteController
configureControlNetwork, 32 __init__, 46
configureRoutedControlNetwork, 32 start, 46
mininet::node::CPULimitedHost stop, 46
config, 16 mininet::node::Switch
popen, 16 __init__, 51
setCPUFrac, 16 sendCmd, 51
mininet::node::Controller mininet::node::UserSwitch
start, 14 __init__, 59
stop, 14 setup, 59
mininet::node::NOX start, 59
__init__, 41 stop, 60
mininet::node::Node mininet::topo::LinearTopo
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
64 INDEX
__init__, 21 mininet::net::Mininet, 29
mininet::topo::SingleSwitchReversedTopo runCpuLimitTest
__init__, 47 mininet::net::Mininet, 29
mininet::topo::SingleSwitchTopo
__init__, 48 sendCmd
mininet::topo::Topo mininet::node::Node, 38
__init__, 54 mininet::node::Switch, 51
addHost, 55 sendInt
addLink, 55 mininet::node::Node, 38
addNode, 55 setARP
addPort, 55 mininet::node::Node, 39
addSwitch, 56 setCPUFrac
hosts, 56 mininet::node::CPULimitedHost, 16
isSwitch, 56 setDefaultRoute
links, 56 mininet::node::Node, 39
port, 56 setHostRoute
sorted, 57 mininet::node::Node, 39
switches, 57 setIP
mininet::topolib::TreeTopo mininet::node::Node, 39
addTree, 58 setLogLevel
monitor mininet::log::MininetLogger, 31
mininet::net::Mininet, 28 setMAC
mininet::node::Node, 37 mininet::link::Intf, 20
mininet::node::Node, 39
newPort setParam
mininet::node::Node, 37 mininet::link::Intf, 20
mininet::node::Node, 39
output setup
mininet::log::MininetLogger, 31 mininet::node::OVSLegacyKernelSwitch, 43
mininet::node::UserSwitch, 59
pexec sorted
mininet::node::Node, 38 mininet::topo::Topo, 57
ping start
mininet::net::Mininet, 28 mininet::net::Mininet, 29
pingAll mininet::node::Controller, 14
mininet::net::Mininet, 28 mininet::node::OVSLegacyKernelSwitch, 43
pingAllFull mininet::node::RemoteController, 46
mininet::net::Mininet, 28 mininet::node::UserSwitch, 59
pingFull startTerms
mininet::net::Mininet, 28 mininet::net::Mininet, 29
pingPair staticArp
mininet::net::Mininet, 29 mininet::net::Mininet, 29
pingPairFull stop
mininet::net::Mininet, 29 mininet::node::Controller, 14
popen mininet::node::Node, 40
mininet::node::CPULimitedHost, 16 mininet::node::OVSLegacyKernelSwitch, 43
mininet::node::Node, 38 mininet::node::OVSSwitch, 45
port mininet::node::RemoteController, 46
mininet::topo::Topo, 56 mininet::node::UserSwitch, 60
stopXterms
read mininet::net::Mininet, 30
mininet::node::Node, 38 switches
readline mininet::topo::Topo, 57
mininet::node::Node, 38
run TCReapply
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen
INDEX 65
mininet::node::OVSSwitch, 45
terminate
mininet::node::Node, 40
topo, 7
waitForNode
mininet::cli::CLI, 13
waitOutput
mininet::node::Node, 40
waitReadable
mininet::node::Node, 40
write
mininet::node::Node, 40
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen