100% found this document useful (3 votes)
192 views75 pages

Mininet Python API Manual

This document is a reference manual for the Mininet Python API. It provides documentation on the namespaces, classes, and functions in the API. The manual contains sections that describe the namespace hierarchy, class hierarchy, and provide detailed documentation for key classes like CLI, Controller, Host, and Mininet. It aims to document the full API for the Mininet networking emulator.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (3 votes)
192 views75 pages

Mininet Python API Manual

This document is a reference manual for the Mininet Python API. It provides documentation on the namespaces, classes, and functions in the API. The manual contains sections that describe the namespace hierarchy, class hierarchy, and provide detailed documentation for key classes like CLI, Controller, Host, and Mininet. It aims to document the full API for the Mininet networking emulator.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Mininet Python API Reference Manual

Generated by Doxygen [Link]


Tue Jul 30 2013 16:44:13

Contents

Namespace Index 1.1 Namespace List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

1 1 3 3 5 5 7 7 7 9 9

Hierarchical Index 2.1 Class Hierarchy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Class Index 3.1 Class List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Namespace Documentation 4.1 topo Namespace Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.1.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Class Documentation 5.1 [Link] Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.1.1 5.1.2 Detailed Description

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

Member Function Documentation [Link] [Link] [Link] [Link] [Link] [Link] [Link] [Link] [Link]

default . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 do_dpctl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 do_dump . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 do_gterm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 do_help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

do_intfs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 do_iperf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

do_iperfudp

do_link . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

[Link] do_net . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 [Link] do_nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

[Link] do_noecho . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 [Link] do_pingall . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

ii

CONTENTS

[Link] do_pingallfull . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 [Link] do_pingpair . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

[Link] do_pingpairfull . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 [Link] do_px [Link] do_py . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

[Link] do_source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 [Link] do_time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

[Link] do_x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 [Link] do_xterm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 [Link] emptyline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 [Link] waitForNode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 5.1.3 Member Data Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 [Link] 5.2 helpStr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

[Link] Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 5.2.1 5.2.2 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

Member Function Documentation [Link] [Link]

start . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 stop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

5.3

[Link] Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 5.3.1 5.3.2 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

Member Function Documentation [Link] [Link] [Link]

cong . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 popen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

setCPUFrac . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

5.4

[Link] Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 5.4.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

5.5

[Link] Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 5.5.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

5.6

[Link] Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 5.6.1 5.6.2 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 [Link] __init__ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

5.6.3

Member Function Documentation [Link] [Link] [Link]

cong . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 setMAC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

setParam . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

5.7

[Link] Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20


Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen

CONTENTS

iii

5.7.1 5.7.2

Detailed Description

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 [Link] __init__ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

5.8

[Link] Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 5.8.1 5.8.2 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 [Link] __init__ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

5.8.3

Member Function Documentation [Link] [Link]

intfName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 makeIntfPair . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

5.9

[Link] Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 5.9.1 5.9.2 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 [Link] __init__ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

5.9.3

Member Function Documentation [Link] [Link] [Link] [Link] [Link] [Link] [Link] [Link] [Link]

__getitem__ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 addController . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 addHost . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 addLink . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 addSwitch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 buildFromTopo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 congHosts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

congLinkStatus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

[Link] interact . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 [Link] iperf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

[Link] monitor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 [Link] ping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

[Link] pingAll . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 [Link] pingAllFull . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 [Link] pingFull . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 [Link] pingPair . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 [Link] pingPairFull . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

[Link] run . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 [Link] runCpuLimitTest . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 [Link] start . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 [Link] startTerms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29


Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen

iv

CONTENTS

[Link] staticArp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 [Link] stopXterms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 5.10 [Link] Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 5.10.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

5.10.2 Member Function Documentation [Link] output

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

[Link] setLogLevel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 5.11 [Link] Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 5.11.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

5.11.2 Member Function Documentation [Link] congureControlNetwork

[Link] congureRoutedControlNetwork . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 5.12 [Link] Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 5.12.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

5.12.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 [Link] __init__ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 5.12.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

[Link] addIntf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 [Link] cleanup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 [Link] cmd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

[Link] cmdPrint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 [Link] cong . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 [Link] connectionsTo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 [Link] deleteIntfs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 [Link] fdToNode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 [Link] intf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 [Link] intfIsUp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 [Link] IP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 [Link] MAC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 [Link] monitor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 [Link] newPort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 [Link] pexec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 [Link] popen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

[Link] read . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 [Link] readline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

[Link] sendCmd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 [Link] sendInt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39


Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen

CONTENTS

[Link] setARP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 [Link] setDefaultRoute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 [Link] setHostRoute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

[Link] setIP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 [Link] setMAC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

[Link] setParam . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 [Link] stop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

[Link] terminate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 [Link] waitOutput . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 [Link] waitReadable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

[Link] write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 5.13 [Link] Class Reference 5.13.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

5.13.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 [Link] __init__ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 5.14 [Link] Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 5.14.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

5.15 [Link] Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 42 5.15.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

5.15.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 [Link] __init__ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 5.15.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

[Link] setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 [Link] start . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 [Link] stop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

5.16 [Link] Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 5.16.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

5.16.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 [Link] __init__ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 5.16.3 Member Function Documentation [Link] stop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

[Link] TCReapply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 5.17 [Link] Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 5.17.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

5.17.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 [Link] __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

[Link] start . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 [Link] stop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

5.18 [Link] Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . 46 5.18.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47

5.18.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 [Link] __init__ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 5.19 [Link] Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 5.19.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48

5.19.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 [Link] __init__ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 5.20 [Link] Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 5.20.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49

5.21 [Link] Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 49 5.21.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

5.21.2 Member Function Documentation [Link] emit

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

5.22 [Link] Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 5.22.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

5.22.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 [Link] __init__ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 5.22.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

[Link] sendCmd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 5.23 [Link] Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 5.23.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52

5.23.2 Member Function Documentation

[Link] cong . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 5.24 [Link] Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 5.24.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

5.25 [Link] Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 5.25.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

5.25.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 [Link] __init__ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 5.25.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

[Link] addHost . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 [Link] addLink . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 [Link] addNode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 [Link] addPort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56


Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen

CONTENTS

vii

[Link] addSwitch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 [Link] hosts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 [Link] isSwitch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 [Link] links . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 [Link] port . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 [Link] sorted . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 [Link] switches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 5.26 [Link] Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 5.26.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58

5.26.2 Member Function Documentation [Link] addTree

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58

5.27 [Link] Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 5.27.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59

5.27.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 [Link] __init__ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 5.27.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59

[Link] setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 [Link] start . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 [Link] 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
1.1 Namespace List

Here is a list of all documented namespaces with brief descriptions: topo Network topology creation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

Namespace Index

Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen

Chapter 2

Hierarchical Index
2.1 Class Hierarchy

This inheritance list is sorted roughly, but not completely, alphabetically: object [Link] . . . . . . . . . . . . . . . . [Link] . . . . . . . . . . . . . [Link] . . . . . . . . . . . . . . . . [Link] . . . . . . . . . . . . [Link] . . . . . . . . . . . [Link] . . . . . . . . . . . . . . [Link] . . . . [Link] . . . . . . . . . . . . . . [Link] . . . . . . . . . . [Link] . . . . . . . . . . . [Link] . . . . . . [Link] . . . . [Link] . . . . . . . . . . . . . [Link] . . . . [Link] . . . . . . . . . . . . [Link] [Link] . . . . . . . [Link] . . . . . . . [Link] . . . . . . . . . . . . . . [Link] . . . . . . . . . . . . . . . [Link] . . . . . . . . . . [Link] . [Link] . . . . . . [Link] . . . . . . . . . . StreamHandler [Link] . . . . . type [Link] . . . . . . . . . . . . . Cmd [Link] . . . . . . . . . . . . . . . . . Logger [Link] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 51 21 52 30 23 31 32 13 41 41 45 17 15 50 42 44 58 17 53 20 46 47 57

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

Hierarchical Index

Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen

Chapter 3

Class Index
3.1 Class List

Here are the classes, structs, unions and interfaces with brief descriptions: [Link] Simple command-line interface to talk to nodes . . . . . . . . . . . . . . . . [Link] A Controller is a Node that is running (or has execed?) an OpenFlow controller [Link] CPU limited host . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . [Link] Utility class to track nodes and edges - replaces [Link] . . . . . . . [Link] A host is simply a Node . . . . . . . . . . . . . . . . . . . . . . . . . . . . . [Link] Basic interface object that can congure itself . . . . . . . . . . . . . . . . . [Link] Linear topology of k switches, with n hosts per switch . . . . . . . . . . . . . [Link] A basic link is just a veth pair . . . . . . . . . . . . . . . . . . . . . . . . . . [Link] Network emulation with hosts spawned in network namespaces . . . . . . . [Link] Mininet-specic logger Enable each mininet .py le to with one . . . . . . . . [Link] Control network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . [Link] A virtual network node is simply a shell in a network namespace . . . . . . . [Link] Controller to run a NOX application . . . . . . . . . . . . . . . . . . . . . . [Link] Open vSwitch controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . [Link] Open VSwitch legacy kernel-space switch using ovs-openowd . . . . . . . . [Link] Open vSwitch switch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . [Link] Controller running outside of Mininets control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

. . . . . . . . . . . 13 . . . . . . . . . . . . 15 . . . . . . . . . . . . 17 . . . . . . . . . . . . 17 . . . . . . . . . . . . 18 . . . . . . . . . . . . 20 . . . . . . . . . . . . 21 . . . . . . . . . . . . 23 . . . . . . . . . . . . 30 . . . . . . . . . . . . 31 . . . . . . . . . . . . 32 . . . . . . . . . . . . 41 . . . . . . . . . . . . 41 . . . . . . . . . . . . 42 . . . . . . . . . . . . 44 . . . . . . . . . . . . 45

Class Index

[Link] Single switch connected to k hosts, with reversed ports . . . . . . . . . . . . . . . . . . . . . . . [Link] Single switch connected to k hosts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . [Link] Singleton pattern from Wikipedia See . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . [Link] StreamHandler that doesnt print newlines by default . . . . . . . . . . . . . . . . . . . . . . . . [Link] A Switch is a Node that is running (or has execed?) an OpenFlow switch . . . . . . . . . . . . . . [Link] Interface customized by tc (trafc control) utility Allows specication of bandwidth limits (various methods) as well as delay, loss and max queue length . . . . . . . . . . . . . . . . . . . . . . . . . . [Link] Link with symmetric TC interfaces congured via opts . . . . . . . . . . . . . . . . . . . . . . . . [Link] Data center network representation for structured multi-trees . . . . . . . . . . . . . . . . . . . . [Link] Topology for a tree network with a given depth and fanout . . . . . . . . . . . . . . . . . . . . . . [Link] User-space switch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. 46 . 47 . 48 . 49 . 50

. 51 . 52 . 53 . 57 . 58

Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen

Chapter 4

Namespace Documentation
4.1 topo Namespace Reference

Network topology creation.

4.1.1

Detailed Description

Network topology creation. Author Brandon Heller (brandonh@[Link]) This package includes code to represent network topologies. A Topo object can be a topology database for NOX, can represent a physical setup for testing, and can even be emulated with the Mininet package.

Namespace Documentation

Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen

Chapter 5

Class Documentation
5.1 [Link] Class Reference

Simple command-line interface to talk to nodes. Inheritance diagram for [Link]:

Cmd

[Link]

Public Member Functions


def __init__ def emptyline
Dont 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 rst two hosts, useful for testing.

10

Class Documentation

def do_pingallfull
Ping between rst two hosts, returns all ping results.

def do_pingpairfull
Ping between rst two hosts, returns all ping results.

def do_iperf
Simple iperf TCP test between two (optionally specied) hosts.

def do_iperfudp
Simple iperf TCP test between two (optionally specied) 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 le.

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 prex is not recognized.

def waitForNode
Wait for a node to nish, 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 [Link] Class Reference

11

Static Public Attributes


string prompt = mininet> tuple helpStr

5.1.1

Detailed Description

Simple command-line interface to talk to nodes.

5.1.2
[Link]

Member Function Documentation


def [Link] ( self, line )

Called on an input line when the command prex is not recognized. Overridden to run shell commands when a node is the rst CLI argument. Past the rst CLI argument, node names are automatically replaced with corresponding IP addrs.

[Link]

def [Link] dpctl ( self, line )

Run dpctl (or ovs-ofctl) command on all switches.

[Link]

def [Link] dump ( self,

line )

Dump node info.

[Link]

def [Link] gterm ( self, line )

Spawn gnome-terminal(s) for the given node(s).

[Link]

def [Link] help ( self, line )

Describe available CLI commands.

[Link]

def [Link] intfs ( self,

line )

List interfaces.

[Link]

def [Link] iperf ( self, line )

Simple iperf TCP test between two (optionally specied) hosts.

[Link]

def [Link] iperfudp ( self, line )

Simple iperf TCP test between two (optionally specied) hosts.


Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen

12

Class Documentation

[Link]

def [Link] link ( self, line )

Bring link(s) between two nodes up or down.

[Link]

def [Link] net ( self,

line )

List network connections.

[Link]

def [Link] nodes ( self,

line )

List all nodes.

[Link]

def [Link] noecho ( self, line )

Run an interactive command with echoing turned off.

[Link]

def [Link] pingall ( self,

line )

Ping between all hosts.

[Link]

def [Link] pingallfull ( self,

line )

Ping between rst two hosts, returns all ping results.

[Link]

def [Link] pingpair ( self,

line )

Ping between rst two hosts, useful for testing.

[Link]

def [Link] pingpairfull ( self,

line )

Ping between rst two hosts, returns all ping results.

[Link]

def [Link] px ( self, line )

Execute a Python statement. Node names may be used, e.g.: px print [Link](ls)

[Link]

def [Link] py ( self, line )

Evaluate a Python expression. Node names may be used, e.g.: py [Link](ls)

[Link]

def [Link] source ( self, line )

Read commands from an input le.


Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen

5.2 [Link] Class Reference

13

[Link]

def [Link] time ( self, line )

Measure time taken for any command in Mininet.

[Link]

def [Link] x ( self, line )

Create an X11 tunnel to the given node, optionally starting a client.

[Link]

def [Link] xterm ( self, line, term = xterm )

Spawn xterm(s) for the given node(s).

[Link]

def [Link] ( self )

Dont repeat last command when you hit return.

[Link]

def [Link] ( self, node )

Wait for a node to nish, and print its output.

5.1.3
[Link]

Member Data Documentation


tuple [Link] [static]

Initial value:
1 = ( 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18

You may also send a command to a node using:\n <node> command {args}\n For example:\n mininet> h1 ifconfig\n \n The interpreter automatically substitutes IP addresses\n for node names when a node is the first arg, so commands\n like\n mininet> h2 ping h3\n should work.\n \n Some character-oriented interactive commands require\n noecho:\n mininet> noecho h2 vi [Link]\n However, starting up an xterm/gterm is generally better:\n mininet> xterm h2\n\n )

The documentation for this class was generated from the following le: mininet/[Link]

5.2

[Link] Class Reference

A Controller is a Node that is running (or has execed?) an OpenFlow controller. Inheritance diagram for [Link]:
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen

14

Class Documentation

object [Link] [Link] [Link] [Link] [Link]

Public Member Functions


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

Additional Inherited Members 5.2.1 Detailed Description

A Controller is a Node that is running (or has execed?) an OpenFlow controller.

5.2.2
[Link]

Member Function Documentation


def [Link] ( self )

Start <controller> <args> on controller. Log to /tmp/[Link]


Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen

5.3 [Link] Class Reference

15

[Link]

def [Link] ( self )

Stop controller. The documentation for this class was generated from the following le: mininet/[Link]

5.3

[Link] Class Reference

CPU limited host. Inheritance diagram for [Link]:

object [Link] [Link] [Link]

Public Member Functions


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 nodes 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 cong 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

Static Public Attributes


inited = False

5.3.1

Detailed Description

CPU limited host.

5.3.2
[Link]

Member Function Documentation


def [Link] ( self, cpu = None, cores = None, params )

Parameters cpu cores params desired overall system CPU fraction (real) core(s) this host can run on parameters for [Link]()

[Link]

def [Link] ( self, args, kwargs )

Return a Popen() object in nodes namespace. Parameters args kwargs Popen() args, single list, or string Popen() keyword args

[Link]

def [Link] ( self, f = -1, sched = None )

Set overall CPU fraction for this host. Parameters f sched CPU bandwidth limit (fraction) rt or cfs Note cfs requires CONFIG_CFS_BANDWIDTH

The documentation for this class was generated from the following le: mininet/[Link]

Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen

5.4 [Link] Class Reference

17

5.4

[Link] Class Reference

Utility class to track nodes and edges - replaces [Link]. Inheritance diagram for [Link]:

object [Link]

Public Member Functions


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

5.4.1

Detailed Description

Utility class to track nodes and edges - replaces [Link]. The documentation for this class was generated from the following le: mininet/[Link]

5.5

[Link] Class Reference

A host is simply a Node. Inheritance diagram for [Link]:


Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen

18

Class Documentation

object [Link] [Link] [Link]

Additional Inherited Members 5.5.1 Detailed Description

A host is simply a Node. The documentation for this class was generated from the following le: mininet/[Link]

5.6

[Link] Class Reference

Basic interface object that can congure itself. Inheritance diagram for [Link]:

object [Link] [Link]

Public Member Functions


def __init__ def cmd
Run a command in our owning node.

def ifcong
Congure ourselves using ifcong.

def setIP
Set our IP address.

def setMAC
Set the MAC address for an interface.

def updateIP
Return updated IP address based on ifcong.

Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen

5.6 [Link] Class Reference

19

def updateMAC
Return updated MAC address based on ifcong.

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 cong
Congure Node according to (optional)

def delete
Delete interface.

def __repr__ def __str__

Public Attributes
node name link prexLen params mac ip

5.6.1

Detailed Description

Basic interface object that can congure itself.

5.6.2
[Link]

Constructor & Destructor Documentation


def [Link]. init ( self, name, node = None, port = None, link = None, params )

Parameters name node link interface name (e.g. h1-eth0) owning node (where this intf most likely lives) parent link if were part of a link other arguments are passed to cong()

5.6.3
[Link]

Member Function Documentation


def [Link] ( self, mac = None, ip = None, ifcong = None, up = True, params )

Congure Node according to (optional)


Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen

20 Parameters parameters mac ip ifcong

Class Documentation

MAC address IP address arbitrary interface conguration Subclasses should override this method and call the parent classs cong(params)

[Link]

def [Link] ( self, macstr )

Set the MAC address for an interface. Parameters macstr MAC address as string

[Link]

def [Link] ( self, results, method, param )

Internal. Parameters method results method param congure a single parameter dict of results to update cong method name arg=value (ignore if value=None) value may also be list or dict

The documentation for this class was generated from the following le: mininet/[Link]

5.7

[Link] Class Reference

Linear topology of k switches, with n hosts per switch. Inheritance diagram for [Link]:

object [Link] [Link]

Public Member Functions


def __init__
Init.
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen

5.8 [Link] Class Reference

21

Public Attributes
k n

Additional Inherited Members 5.7.1 Detailed Description

Linear topology of k switches, with n hosts per switch.

5.7.2
[Link] Init.

Constructor & Destructor Documentation


def [Link]. init ( self, k = 2, n = 1, opts )

Parameters k n hconf lconf number of switches number of hosts per switch host conguration options link conguration options

The documentation for this class was generated from the following le: mininet/[Link]

5.8

[Link] Class Reference

A basic link is just a veth pair. Inheritance diagram for [Link]:

object [Link] [Link]

Public Member Functions


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

Detailed Description

A basic link is just a veth pair. Other types of links could be tunnels, link emulators, etc..

5.8.2
[Link]

Constructor & Destructor Documentation


def [Link]. init ( self, node1, node2, port1 = None, port2 = None, intfName1 = None, intfName2 = None, intf = Intf, cls1 = None, cls2 = None, params1 = None, params2 = None )

Create veth link to another node, making two new interfaces. Parameters node1 node2 port1 port2 intf cls2 intfName1 intfName2 params1 params2 rst node second node node1 port number (optional) node2 port number (optional) default interface class/constructor cls1, optional interface-specic constructors node1 interface name (optional) node2 interface name (optional) parameters for interface 1 parameters for interface 2

5.8.3
[Link]

Member Function Documentation


def [Link] ( cls, node, n )

Construct a canonical interface name node-ethN for interface n.

[Link]

def [Link] ( cls, intf1, intf2 )

Create pair of interfaces. Parameters intf1 intf2 name of interface 1 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 [Link] Class Reference

23

The documentation for this class was generated from the following le: mininet/[Link]

5.9

[Link] Class Reference

Network emulation with hosts spawned in network namespaces. Inheritance diagram for [Link]:

object [Link] [Link]

Public Member Functions


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 congHosts
Congure 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 congureControlNetwork
Control net cong 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

Start a terminal for each node.

def stopXterms
Kill each xterm.

def staticArp
Add all-pairs ARP entries to remove the need to handle broadcast.

def start
Start controller and switches.

def stop
Stop the controller(s), switches and hosts.

def run
Perform a complete start/test/stop cycle.

def monitor
Monitor a set of hosts (or all hosts by default), and return their output, a line at a time.

def ping
Ping between all specied hosts.

def pingFull
Ping between all specied hosts and return all data.

def pingAll
Ping between all hosts.

def pingPair
Ping between rst two hosts, useful for testing.

def pingAllFull
Ping between all hosts.

def pingPairFull
Ping between rst two hosts, useful for testing.

def iperf
Run iperf between two hosts.

def runCpuLimitTest
run CPU limit test with while true processes.

def congLinkStatus
Change status of src <-> dst links.

def interact
Start network and run our simple CLI.

def init
Initialize Mininet.

Public Attributes
topo switch host controller link intf ipBase prexLen nextIP
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen

5.9 [Link] Class Reference

25

inNamespace xterms cleanup autoSetMacs autoStaticArp autoPinCpus numCores nextCore listenPort hosts switches controllers nameToNode terms built

Static Public Attributes


inited = False

5.9.1

Detailed Description

Network emulation with hosts spawned in network namespaces.

5.9.2
[Link]

Constructor & Destructor Documentation


def [Link]. init ( self, topo = None, switch = OVSKernelSwitch, host = Host, controller = Controller, link = Link, intf = Intf, build = True, xterms = False, cleanup = False, ipBase = [Link]/8, inNamespace = False, autoSetMacs = False, autoStaticArp = False, autoPinCpus = False, listenPort = None )

Create Mininet object. Parameters topo switch host controller link intf ipBase build xterms cleanup inNamespace autoSetMacs autoStaticArp autoPinCpus listenPort Topo (topology) object or None default Switch class default Host class/constructor default Controller class/constructor default Link class/constructor default Intf class/constructor base IP address for hosts, build now from topo? if build now, spawn xterms? if build now, cleanup before creating? spawn switches and controller in net namespaces? set MAC addrs automatically like IP addresses? set all-pairs static MAC addrs? pin hosts to (real) cores (requires CPULimitedHost)? base listening port to open; will be incremented for each additional switch in the net if inNamespace=False

Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen

26

Class Documentation

5.9.3
[Link]

Member Function Documentation


def [Link]. getitem ( self, args )

net [ name ] Parameters operator Return node(s) with given name(s)

[Link]

def [Link] ( self, name = c0, controller = None, params )

Add controller. Parameters controller Controller class

[Link]

def [Link] ( self, name, cls = None, params )

Add host. Parameters name cls params name of host to add custom host class/constructor (optional) parameters for host

Returns added host

[Link]

def [Link] ( self, node1, node2, port1 = None, port2 = None, cls = None, params )

"Add a link from node1 to node2 Parameters node1 node2 port1 port2 source node dest node source port dest port

Returns link object

[Link]

def [Link] ( self, name, cls = None, params )

Add switch.
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen

5.9 [Link] Class Reference Parameters name cls name of switch to add custom switch class/constructor (optional)

27

Returns added switch side

Parameters effect increments listenPort ivar .

[Link]

def [Link] ( self )

Build mininet.

[Link]

def [Link] ( self, topo = None )

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

[Link]

def [Link] ( self )

Congure a set of hosts.

[Link]

def [Link] ( self, src, dst, status )

Change status of src <-> dst links. Parameters src dst status node name node name string {up, down}

[Link]

def [Link] ( self )

Start network and run our simple CLI.

[Link]

def [Link] ( self, hosts = None, l4Type = TCP, udpBw = 10M )

Run iperf between two hosts. Parameters hosts l4Type list of hosts; if None, uses opposite hosts string, one of [ TCP, UDP ]

Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen

28 Returns results two-element array of server and client speeds

Class Documentation

[Link]

def [Link] ( self, hosts = None, timeoutms = -1 )

Monitor a set of hosts (or all hosts by default), and return their output, a line at a time. Parameters hosts timeoutms (optional) set of hosts to monitor (optional) timeout value in ms

Returns iterator which returns host, line

[Link]

def [Link] ( self, hosts = None, timeout = None )

Ping between all specied hosts. Parameters hosts timeout list of hosts time to wait for a response, as string

Returns ploss packet loss percentage

[Link]

def [Link] ( self )

Ping between all hosts. Returns ploss packet loss percentage

[Link]

def [Link] ( self )

Ping between all hosts. Returns ploss packet loss percentage

[Link]

def [Link] ( self, hosts = None, timeout = None )

Ping between all specied hosts and return all data.


Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen

5.9 [Link] Class Reference Parameters hosts timeout list of hosts time to wait for a response, as string

29

Returns all ping data; see function body.

[Link]

def [Link] ( self )

Ping between rst two hosts, useful for testing. Returns ploss packet loss percentage

[Link]

def [Link] ( self )

Ping between rst two hosts, useful for testing. Returns ploss packet loss percentage

[Link]

def [Link] ( self, test, args, kwargs )

Perform a complete start/test/stop cycle.

[Link]

def [Link] ( self, cpu, duration = 5 )

run CPU limit test with while true processes. Parameters cpu duration desired CPU fraction of each host test duration in seconds returns a single list of measured CPU fractions as oats.

[Link]

def [Link] ( self )

Start controller and switches.

[Link]

def [Link] ( self )

Start a terminal for each node.

Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen

30

Class Documentation

[Link]

def [Link] ( self )

Add all-pairs ARP entries to remove the need to handle broadcast.

[Link]

def [Link] ( self )

Kill each xterm. The documentation for this class was generated from the following le: mininet/[Link]

5.10

[Link] Class Reference

Mininet-specic logger Enable each mininet .py le to with one. Inheritance diagram for [Link]:

Logger

object

[Link]

Public Member Functions


def __init__ def setLogLevel
Setup loglevel.

def output
Log msg % args with severity OUTPUT.

5.10.1

Detailed Description

Mininet-specic logger Enable each mininet .py le to with one. Parameters import
from [Link] import [lg, info, error] ...get a default logger that doesnt 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 cant have only classic bases

Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen

5.11 [Link] Class Reference

31

If Python2.5/logging/__init__.py dened Filterer as a new-style class, via Filterer( object ): rather than Filterer, we wouldnt need this. Use singleton pattern to ensure only one logger is ever created.

5.10.2
[Link]

Member Function Documentation


def [Link] ( self, msg, args, kwargs )

Log msg % args with severity OUTPUT. To pass exception information, use the keyword argument exc_info with a true value, e.g. [Link]("Houston, we have a %s", "cli output", exc_info=1)

[Link]

def [Link] ( self, levelname = None )

Setup loglevel.
Convenience function to support lowercase names.

Parameters levelName level name from LEVELS

The documentation for this class was generated from the following le: mininet/[Link]

5.11

[Link] Class Reference

Control network. Inheritance diagram for [Link]:

object [Link] [Link]

Public Member Functions


def congureControlNetwork
Congure control network.

def congureRoutedControlNetwork
Congure 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

Additional Inherited Members 5.11.1 Detailed Description

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. 2. If we can get unix domain sockets to work, we can use them instead of an explicit control network. 3. Instead of routing, we could bridge or use in-band control. 4. Even if we dispense with this in general, it could still be useful for people who wish to simulate a separate control network (since real networks may need one!) 5. Basically nobody ever used this code, so it has been moved into its own class. 6. Ultimately we may wish to extend this to allow us to create a control network which every nodes control interface is attached to.

5.11.2
[Link]

Member Function Documentation


def [Link] ( self )

Congure control network.

[Link]

def [Link] ( self, ip = [Link], prexLen =

16 )
Congure a routed control network on controller and switches. For use with the user datapath only right now. The documentation for this class was generated from the following le: mininet/[Link]

5.12

[Link] Class Reference

A virtual network node is simply a shell in a network namespace. Inheritance diagram for [Link]:
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen

5.12 [Link] Class Reference


object [Link] [Link] [Link] [Link] [Link] [Link] [Link] [Link] [Link] [Link] [Link]

33

Public Member Functions


def __init__ def fdToNode
Return node corresponding to given le 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 nodes 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

Return interface for lowest port.

def intf
Return our interface object with given string name, default intf if name is falsy (None, empty string, etc).

def connectionsTo
Return [ intf1, intf2...

def deleteIntfs
Delete all of our interfaces.

def setARP
Add an ARP entry.

def setHostRoute
Add route to host.

def setDefaultRoute
Set the default route to go through intf.

def setMAC
Set the MAC address for an interface.

def setIP
Set the IP address for an interface.

def IP
Return IP address of a node or specic interface.

def MAC
Return MAC address of a node or specic interface.

def intfIsUp
Check if an interface is up.

def setParam
Internal.

def cong
Congure Node according to (optional)

def congDefault
Congure with default parameters.

def linkTo
(Deprecated) Link to another node replace with Link( node1, node2)

def intfList
List of our interfaces sorted by port number.

def intfNames
The names of our interfaces sorted by port number.

def __repr__
More informative string representation.

def __str__
Abbreviated string representation.

def checkSetup
Make sure our class and superclasses are set up.

def setup
Make sure our class dependencies are available.

Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen

5.12 [Link] Class Reference

35

Public Attributes
name inNamespace params intfs ports nameToIntf waiting readbuf shell stdin stdout pid pollOut execed lastCmd lastPid

Static Public Attributes


int portBase = 0 dictionary inToNode = {} dictionary outToNode = {} isSetup = False

5.12.1

Detailed Description

A virtual network node is simply a shell in a network namespace. We communicate with it using pipes.

5.12.2
[Link]

Constructor & Destructor Documentation


def [Link]. init ( self, name, inNamespace = True, params )

Parameters name inNamespace params name of node in network namespace? Node parameters (see cong() for details)

5.12.3
[Link]

Member Function Documentation


def [Link] ( self, intf, port = None )

Add an interface.

Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen

36 Parameters intf port interface port number (optional, typically OpenFlow port number)

Class Documentation

[Link]

def [Link] ( self )

Help python collect its garbage.

[Link]

def [Link] ( self, args, kwargs )

Send a command, wait for output, and return it. Parameters cmd string

[Link]

def [Link] ( self, args )

Call cmd and printing its output. Parameters cmd string

[Link]

def [Link] ( self, mac = None, ip = None, defaultRoute = None, lo = up,

params )

Congure Node according to (optional) Parameters parameters mac ip ifcong MAC address for default interface IP address for default interface arbitrary interface conguration Subclasses should override this method and call the parent classs cong(params)

[Link]

def [Link] ( self, node )

Return [ intf1, intf2... ] for all intfs that connect self to node.

[Link]

def [Link] ( self, checkName = True )

Delete all of our interfaces.

Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen

5.12 [Link] Class Reference Parameters checkName only delete interfaces that contain our name

37

[Link]

def [Link] ( cls, fd )

Return node corresponding to given le descriptor. Parameters fd le descriptor

Returns node

[Link]

def [Link] ( self, intf = )

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 exible input args for interfaces (those that accept both string names and Intf objects).

[Link]

def [Link] ( self, intf = None )

Check if an interface is up.

[Link]

def [Link] ( self, intf = None )

Return IP address of a node or specic interface.

[Link]

def [Link] ( self, intf = None )

Return MAC address of a node or specic interface.

[Link]

def [Link] ( self, timeoutms = None )

Monitor and return the output of a command.


Set [Link] to False if command has completed.

Parameters timeoutms timeout in ms or None to wait indenitely.

Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen

38

Class Documentation

[Link]

def [Link] ( self )

Return the next port number to allocate.

[Link]

def [Link] ( self, args, kwargs )

Execute a command using popen. Returns out, err, exitcode

[Link]

def [Link] ( self, args, kwargs )

Return a Popen() object in our namespace. Parameters args kwargs Popen() args, single list, or string Popen() keyword args

[Link]

def [Link] ( self, maxbytes = 1024 )

Buffered read from node, non-blocking. Parameters maxbytes maximum number of bytes to return

[Link]

def [Link] ( self )

Buffered readline from node, non-blocking. Returns line (minus newline) or None

[Link]

def [Link] ( self, args, kwargs )

Send a command, followed by a command to echo a sentinel, and return without waiting for the command to complete. Parameters args printPid command and arguments, or string print commands PID?

Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen

5.12 [Link] Class Reference

39

[Link]

def [Link] ( self, sig = [Link] )

Interrupt running command.

[Link]

def [Link] ( self, ip, mac )

Add an ARP entry. Parameters ip mac IP address as string MAC address as string

[Link]

def [Link] ( self, intf = None )

Set the default route to go through intf. Parameters intf Intf or {dev <intfname> via <gw-ip> ...}

[Link]

def [Link] ( self, ip, intf )

Add route to host. Parameters ip intf IP address as dotted decimal string, interface name

[Link]

def [Link] ( self, ip, prexLen = 8, intf = None )

Set the IP address for an interface. Parameters intf ip prexLen intf or intf name IP address as a string prex length, e.g. 8 for /8 or 16M addrs

[Link]

def [Link] ( self, mac, intf = None )

Set the MAC address for an interface. Parameters intf mac intf or intf name MAC address as string

Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen

40

Class Documentation

[Link] Internal. Parameters

def [Link] ( self, results, method, param )

method results method param

congure a single parameter dict of results to update cong method name arg=value (ignore if value=None) value may also be list or dict

[Link]

def [Link] ( self )

Stop node.

[Link]

def [Link] ( self )

Send kill signal to Node and clean up after it.

[Link]

def [Link] ( self, verbose = False )

Wait for a command to complete.


Completion is signaled by a sentinel character, ASCII(127) appearing in the output stream. Wait for the sentinel and return the output, including trailing newline.

Parameters verbose print output interactively

[Link]

def [Link] ( self, timeoutms = None )

Wait until nodes output is readable. Parameters timeoutms timeout in ms or None to wait indenitely.

[Link]

def [Link] ( self, data )

Write data to node. Parameters data string

The documentation for this class was generated from the following le:
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen

5.14 [Link] Class Reference

41

mininet/[Link]

5.13

[Link] Class Reference

Controller to run a NOX application. Inheritance diagram for [Link]:

object [Link] [Link] [Link]

Public Member Functions


def __init__
Init.

Additional Inherited Members 5.13.1 Detailed Description

Controller to run a NOX application.

5.13.2
[Link] Init.

Constructor & Destructor Documentation


def [Link]. init ( self, name, noxArgs, kwargs )

Parameters name noxArgs name to give controller arguments (strings) to pass to NOX

The documentation for this class was generated from the following le: mininet/[Link]

5.14

[Link] Class Reference

Open vSwitch controller.


Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen

42

Class Documentation

Inheritance diagram for [Link]:

object [Link] [Link] [Link]

Public Member Functions


def __init__

Additional Inherited Members 5.14.1 Detailed Description

Open vSwitch controller. The documentation for this class was generated from the following le: mininet/[Link]

5.15

[Link] Class Reference

Open VSwitch legacy kernel-space switch using ovs-openowd. Inheritance diagram for [Link]:

object [Link] [Link] [Link]

Public Member Functions


def __init__
Init.

def setup
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen

5.15 [Link] Class Reference

43

Ensure any dependencies are loaded; if not, try to load them.

def start
Start up kernel datapath.

def stop
Terminate kernel datapath.

Public Attributes
dp intf execed

Additional Inherited Members 5.15.1 Detailed Description

Open VSwitch legacy kernel-space switch using ovs-openowd. Currently only works in the root namespace.

5.15.2
[Link] Init.

Constructor & Destructor Documentation


def [Link]. init ( self, name, dp = None, kwargs )

Parameters name dp defaultMAC name for switch netlink id (0, 1, 2, ...) default MAC as unsigned int; random value if None

5.15.3
[Link]

Member Function Documentation


def [Link] ( cls )

Ensure any dependencies are loaded; if not, try to load them.

[Link]

def [Link] ( self, controllers )

Start up kernel datapath.

[Link]

def [Link] ( self )

Terminate kernel datapath. The documentation for this class was generated from the following le: mininet/[Link]
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen

44

Class Documentation

5.16

[Link] Class Reference

Open vSwitch switch. Inheritance diagram for [Link]:

object [Link] [Link] [Link]

Public Member Functions


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.

Static Public Member Functions


def TCReapply
Unfortunately OVS and Mininet are ghting 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 [Link] Class Reference

45

Additional Inherited Members 5.16.1 Detailed Description

Open vSwitch switch. Depends on ovs-vsctl.

5.16.2
[Link] Init.

Constructor & Destructor Documentation


def [Link]. init ( self, name, failMode = secure, datapath = kernel, params )

Parameters name failMode datapath name for switch controller loss behavior (secure|open) userspace or kernel mode (kernel|user)

5.16.3
[Link]

Member Function Documentation


def [Link] ( self )

Terminate OVS switch.

[Link]

def [Link] ( intf ) [static]

Unfortunately OVS and Mininet are ghting over tc queuing disciplines. As a quick hack/ workaround, we clear OVSs and reapply our own. The documentation for this class was generated from the following le: mininet/[Link]

5.17

[Link] Class Reference

Controller running outside of Mininets control. Inheritance diagram for [Link]:

object [Link] [Link] [Link]

Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen

46

Class Documentation

Public Member Functions


def __init__
Init.

def start
Overridden to do nothing.

def stop
Overridden to do nothing.

def checkListening
Warn if remote controller is not accessible.

Additional Inherited Members 5.17.1 Detailed Description

Controller running outside of Mininets control.

5.17.2
[Link] Init.

Constructor & Destructor Documentation


def [Link]. init ( self, name, ip = [Link], port = 6633, kwargs )

Parameters name ip port name to give controller the IP address where the remote controller is listening the port where the remote controller is listening

5.17.3
[Link]

Member Function Documentation


def [Link] ( self )

Overridden to do nothing.

[Link]

def [Link] ( self )

Overridden to do nothing. The documentation for this class was generated from the following le: mininet/[Link]

5.18

[Link] Class Reference

Single switch connected to k hosts, with reversed ports. Inheritance diagram for [Link]:
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen

5.19 [Link] Class Reference

47

object [Link] [Link]

Public Member Functions


def __init__
Init.

Public Attributes
k

Additional Inherited Members 5.18.1 Detailed Description

Single switch connected to k hosts, with reversed ports. The lowest-numbered host is connected to the highest-numbered port. Useful to verify that Mininet properly handles custom port numberings.

5.18.2
[Link] Init.

Constructor & Destructor Documentation


def [Link]. init ( self, k = 2, opts )

Parameters k enable_all number of hosts enables all nodes and switches?

The documentation for this class was generated from the following le: mininet/[Link]

5.19

[Link] Class Reference

Single switch connected to k hosts. Inheritance diagram for [Link]:


Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen

48

Class Documentation

object [Link] [Link]

Public Member Functions


def __init__
Init.

Public Attributes
k

Additional Inherited Members 5.19.1 Detailed Description

Single switch connected to k hosts.

5.19.2
[Link] Init.

Constructor & Destructor Documentation


def [Link]. init ( self, k = 2, opts )

Parameters k enable_all number of hosts enables all nodes and switches?

The documentation for this class was generated from the following le:

mininet/[Link]

5.20

[Link] Class Reference

Singleton pattern from Wikipedia See. Inheritance diagram for [Link]:


Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen

5.21 [Link] Class Reference

49

type [Link]

Public Member Functions


def __init__ def __call__

5.20.1

Detailed Description

Singleton pattern from Wikipedia See. Parameters http//[Link]/wiki/SingletonPattern Python


Intended to be used as a __metaclass_ param, as shown for the class below.

The documentation for this class was generated from the following le: mininet/[Link]

5.21

[Link] Class Reference

StreamHandler that doesnt print newlines by default. Inheritance diagram for [Link]:

StreamHandler [Link]

Public Member Functions


def emit
Emit a record.

5.21.1

Detailed Description

StreamHandler that doesnt print newlines by default.


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, dene a mod to more easily support interactive mode when we want it, or errors-only logging for running unit tests.

5.21.2
[Link]

Member Function Documentation


def [Link] ( self, record )

Emit a record. If a formatter is specied, 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 [Link] and appended to the stream. The documentation for this class was generated from the following le: mininet/[Link]

5.22

[Link] Class Reference

A Switch is a Node that is running (or has execed?) an OpenFlow switch. Inheritance diagram for [Link]:
object [Link] [Link] [Link] [Link] [Link]

Public Member Functions


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 [Link] Class Reference

51

opts listenPort controlIntf

Static Public Attributes


int portBase = 1 int dpidLen = 16

5.22.1

Detailed Description

A Switch is a Node that is running (or has execed?) an OpenFlow switch.

5.22.2
[Link]

Constructor & Destructor Documentation


def [Link]. init ( self, name, dpid = None, opts = , listenPort = None, params )

Parameters dpid opts listenPort dpid for switch (or None to derive from name, e.g. s1 -> 1) additional switch options port to listen on for dpctl connections

5.22.3
[Link]

Member Function Documentation


def [Link] ( self, cmd, kwargs )

Send command to Node. Parameters cmd string

The documentation for this class was generated from the following le:

mininet/[Link]

5.23

[Link] Class Reference

Interface customized by tc (trafc control) utility Allows specication of bandwidth limits (various methods) as well as delay, loss and max queue length. Inheritance diagram for [Link]:
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen

52

Class Documentation

object [Link] [Link]

Public Member Functions


def bwCmds
Return tc commands to set bandwidth.

def tc
Execute tc command for our interface.

def cong
Congure the port and set its properties.

Static Public Member Functions


def delayCmds
Internal method: return tc commands for delay and loss.

Additional Inherited Members 5.23.1 Detailed Description

Interface customized by tc (trafc control) utility Allows specication of bandwidth limits (various methods) as well as delay, loss and max queue length.

5.23.2
[Link]

Member Function Documentation


def [Link] ( 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 )

Congure the port and set its properties. The documentation for this class was generated from the following le: mininet/[Link]

5.24

[Link] Class Reference

Link with symmetric TC interfaces congured via opts. Inheritance diagram for [Link]:
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen

5.25 [Link] Class Reference

53

object [Link] [Link]

Public Member Functions


def __init__

Additional Inherited Members 5.24.1 Detailed Description

Link with symmetric TC interfaces congured via opts. The documentation for this class was generated from the following le: mininet/[Link]

5.25

[Link] Class Reference

Data center network representation for structured multi-trees. Inheritance diagram for [Link]:
object [Link] [Link] [Link] [Link] [Link]

Public Member Functions


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.

Static Public Member Functions


def sorted
Items sorted in natural (i.e.

Public Attributes
g node_info link_info hopts sopts lopts ports

5.25.1

Detailed Description

Data center network representation for structured multi-trees.

5.25.2
[Link] Topo.

Constructor & Destructor Documentation


def [Link]. init ( self, hopts = None, sopts = None, lopts = None )

Parameters

Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen

5.25 [Link] Class Reference

55

object hinfo sopts lopts

default host options default switch options default link options

5.25.3
[Link]

Member Function Documentation


def [Link] ( self, name, opts )

Convenience. Parameters method name opts Add host to graph. host name host options

Returns host name

[Link] node1,

def [Link] ( self, node1, node2, port1 = None, port2 = None, opts )

Parameters node2 port2 opts nodes to link together port1, ports (optional) link options (optional)

Returns link info key

[Link]

def [Link] ( self, name, opts )

Add Node to graph. Parameters name opts name 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

[Link]

def [Link] ( self, src, dst, sport = None, dport = None )

Generate port mapping for new edge. Parameters src dst source switch name destination switch name

[Link]

def [Link] ( self, name, opts )

Convenience. Parameters method name opts Add switch to graph. switch name switch options

Returns switch name

[Link]

def [Link] ( self, sort = True )

Return hosts.
sort: sort hosts alphabetically

Returns dpids list of dpids

[Link]

def [Link] ( self, n )

Returns true if node is a switch.

[Link]

def [Link] ( self, sort = True )

Return links.
sort: sort links alphabetically

Returns links list of name pairs

Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen

5.26 [Link] Class Reference

57

[Link]

def [Link] ( self, src, dst )

Get port number. Parameters src dst source switch name destination switch name

Returns tuple (src_port, dst_port): src_port: port on source switch leading to the destination switch dst_port: port on destination switch leading to the source switch

[Link]

def [Link] ( items ) [static]

Items sorted in natural (i.e. alphabetical) order

[Link]

def [Link] ( self, sort = True )

Return switches.
sort: sort switches alphabetically

Returns dpids list of dpids The documentation for this class was generated from the following le: mininet/[Link]

5.26

[Link] Class Reference

Topology for a tree network with a given depth and fanout. Inheritance diagram for [Link]:

object [Link] [Link]

Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen

58

Class Documentation

Public Member Functions


def __init__ def addTree
Add a subtree starting with node n.

Public Attributes
hostNum switchNum

Additional Inherited Members 5.26.1 Detailed Description

Topology for a tree network with a given depth and fanout.

5.26.2
[Link]

Member Function Documentation


def [Link] ( self, depth, fanout )

Add a subtree starting with node n. Returns last node added The documentation for this class was generated from the following le: mininet/[Link]

5.27

[Link] Class Reference

User-space switch. Inheritance diagram for [Link]:

object [Link] [Link] [Link]

Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen

5.27 [Link] Class Reference

59

Public Member Functions


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

Static Public Attributes


int dpidLen = 12

5.27.1

Detailed Description

User-space switch.

5.27.2
[Link] Init.

Constructor & Destructor Documentation


def [Link]. init ( self, name, dpopts = --no-slicing, kwargs )

Parameters name dpopts name for the switch additional arguments to ofdatapath (no-slicing)

5.27.3
[Link]

Member Function Documentation


def [Link] ( cls )

Ensure any dependencies are loaded; if not, try to load them.

[Link]

def [Link] ( self, controllers )

Start OpenFlow reference user datapath.


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

[Link]

def [Link] ( self )

Stop OpenFlow reference user datapath. The documentation for this class was generated from the following le: mininet/[Link]

Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen

Index
__getitem__ mininet::net::Mininet, 26 __init__ mininet::link::Intf, 19 mininet::link::Link, 22 mininet::net::Mininet, 25 mininet::node::Node, 35 mininet::node::NOX, 41 mininet::node::OVSLegacyKernelSwitch, 43 mininet::node::OVSSwitch, 45 mininet::node::RemoteController, 46 mininet::node::Switch, 51 mininet::node::UserSwitch, 59 mininet::topo::LinearTopo, 21 mininet::topo::SingleSwitchReversedTopo, 47 mininet::topo::SingleSwitchTopo, 48 mininet::topo::Topo, 54 addController mininet::net::Mininet, 26 addHost mininet::net::Mininet, 26 mininet::topo::Topo, 55 addIntf mininet::node::Node, 35 addLink mininet::net::Mininet, 26 mininet::topo::Topo, 55 addNode mininet::topo::Topo, 55 addPort mininet::topo::Topo, 55 addSwitch mininet::net::Mininet, 26 mininet::topo::Topo, 56 addTree mininet::topolib::TreeTopo, 58 build mininet::net::Mininet, 27 buildFromTopo mininet::net::Mininet, 27 cleanup mininet::node::Node, 36 cmd mininet::node::Node, 36 cmdPrint mininet::node::Node, 36 cong mininet::link::Intf, 19 mininet::link::TCIntf, 52 mininet::node::CPULimitedHost, 16 mininet::node::Node, 36 congHosts mininet::net::Mininet, 27 congLinkStatus mininet::net::Mininet, 27 congureControlNetwork mininet::net::MininetWithControlNet, 32 congureRoutedControlNetwork mininet::net::MininetWithControlNet, 32 connectionsTo mininet::node::Node, 36 default mininet::cli::CLI, 11 deleteIntfs mininet::node::Node, 36 do_dpctl mininet::cli::CLI, 11 do_dump mininet::cli::CLI, 11 do_gterm mininet::cli::CLI, 11 do_help mininet::cli::CLI, 11 do_intfs mininet::cli::CLI, 11 do_iperf mininet::cli::CLI, 11 do_iperfudp mininet::cli::CLI, 11 do_link mininet::cli::CLI, 11 do_net mininet::cli::CLI, 12 do_nodes mininet::cli::CLI, 12 do_noecho mininet::cli::CLI, 12 do_pingall

62

INDEX

mininet::cli::CLI, 12 do_pingallfull mininet::cli::CLI, 12 do_pingpair mininet::cli::CLI, 12 do_pingpairfull mininet::cli::CLI, 12 do_px mininet::cli::CLI, 12 do_py mininet::cli::CLI, 12 do_source mininet::cli::CLI, 12 do_time mininet::cli::CLI, 12 do_x mininet::cli::CLI, 13 do_xterm mininet::cli::CLI, 13 emit mininet::log::StreamHandlerNoNewline, 50 emptyline mininet::cli::CLI, 13 fdToNode mininet::node::Node, 37 helpStr mininet::cli::CLI, 13 hosts mininet::topo::Topo, 56 IP mininet::node::Node, 37 interact mininet::net::Mininet, 27 intf mininet::node::Node, 37 intfIsUp mininet::node::Node, 37 intfName mininet::link::Link, 22 iperf mininet::net::Mininet, 27 isSwitch mininet::topo::Topo, 56 links mininet::topo::Topo, 56 MAC mininet::node::Node, 37 makeIntfPair mininet::link::Link, 22

[Link], 9 [Link], 18 [Link], 21 [Link], 51 [Link], 52 [Link], 30 [Link], 48 [Link], 49 [Link], 23 [Link], 31 [Link], 15 [Link], 13 [Link], 17 [Link], 41 [Link], 32 [Link], 41 [Link], 42 [Link], 44 [Link], 45 [Link], 50 [Link], 58 [Link], 17 [Link], 20 [Link], 46 [Link], 47 [Link], 53 [Link], 57 mininet::cli::CLI default, 11 do_dpctl, 11 do_dump, 11 do_gterm, 11 do_help, 11 do_intfs, 11 do_iperf, 11 do_iperfudp, 11 do_link, 11 do_net, 12 do_nodes, 12 do_noecho, 12 do_pingall, 12 do_pingallfull, 12 do_pingpair, 12 do_pingpairfull, 12 do_px, 12 do_py, 12 do_source, 12 do_time, 12 do_x, 13 do_xterm, 13 emptyline, 13 helpStr, 13 waitForNode, 13 mininet::link::Intf
Generated on Tue Jul 30 2013 16:44:09 for Mininet Python API Reference Manual by Doxygen

INDEX

63

__init__, 19 cong, 19 setMAC, 20 setParam, 20 mininet::link::Link __init__, 22 intfName, 22 makeIntfPair, 22 mininet::link::TCIntf cong, 52 mininet::log::MininetLogger output, 31 setLogLevel, 31 mininet::log::StreamHandlerNoNewline emit, 50 mininet::net::Mininet __getitem__, 26 __init__, 25 addController, 26 addHost, 26 addLink, 26 addSwitch, 26 build, 27 buildFromTopo, 27 congHosts, 27 congLinkStatus, 27 interact, 27 iperf, 27 monitor, 28 ping, 28 pingAll, 28 pingAllFull, 28 pingFull, 28 pingPair, 29 pingPairFull, 29 run, 29 runCpuLimitTest, 29 start, 29 startTerms, 29 staticArp, 29 stopXterms, 30 mininet::net::MininetWithControlNet congureControlNetwork, 32 congureRoutedControlNetwork, 32 mininet::node::CPULimitedHost cong, 16 popen, 16 setCPUFrac, 16 mininet::node::Controller start, 14 stop, 14 mininet::node::NOX __init__, 41 mininet::node::Node

__init__, 35 addIntf, 35 cleanup, 36 cmd, 36 cmdPrint, 36 cong, 36 connectionsTo, 36 deleteIntfs, 36 fdToNode, 37 IP, 37 intf, 37 intfIsUp, 37 MAC, 37 monitor, 37 newPort, 37 pexec, 38 popen, 38 read, 38 readline, 38 sendCmd, 38 sendInt, 38 setARP, 39 setDefaultRoute, 39 setHostRoute, 39 setIP, 39 setMAC, 39 setParam, 39 stop, 40 terminate, 40 waitOutput, 40 waitReadable, 40 write, 40 mininet::node::OVSLegacyKernelSwitch __init__, 43 setup, 43 start, 43 stop, 43 mininet::node::OVSSwitch __init__, 45 stop, 45 TCReapply, 45 mininet::node::RemoteController __init__, 46 start, 46 stop, 46 mininet::node::Switch __init__, 51 sendCmd, 51 mininet::node::UserSwitch __init__, 59 setup, 59 start, 59 stop, 60 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::topo::SingleSwitchReversedTopo __init__, 47 mininet::topo::SingleSwitchTopo __init__, 48 mininet::topo::Topo __init__, 54 addHost, 55 addLink, 55 addNode, 55 addPort, 55 addSwitch, 56 hosts, 56 isSwitch, 56 links, 56 port, 56 sorted, 57 switches, 57 mininet::topolib::TreeTopo addTree, 58 monitor mininet::net::Mininet, 28 mininet::node::Node, 37 newPort mininet::node::Node, 37 output mininet::log::MininetLogger, 31 pexec mininet::node::Node, 38 ping mininet::net::Mininet, 28 pingAll mininet::net::Mininet, 28 pingAllFull mininet::net::Mininet, 28 pingFull mininet::net::Mininet, 28 pingPair mininet::net::Mininet, 29 pingPairFull mininet::net::Mininet, 29 popen mininet::node::CPULimitedHost, 16 mininet::node::Node, 38 port mininet::topo::Topo, 56 read mininet::node::Node, 38 readline mininet::node::Node, 38 run

mininet::net::Mininet, 29 runCpuLimitTest mininet::net::Mininet, 29 sendCmd mininet::node::Node, 38 mininet::node::Switch, 51 sendInt mininet::node::Node, 38 setARP mininet::node::Node, 39 setCPUFrac mininet::node::CPULimitedHost, 16 setDefaultRoute mininet::node::Node, 39 setHostRoute mininet::node::Node, 39 setIP mininet::node::Node, 39 setLogLevel mininet::log::MininetLogger, 31 setMAC mininet::link::Intf, 20 mininet::node::Node, 39 setParam mininet::link::Intf, 20 mininet::node::Node, 39 setup mininet::node::OVSLegacyKernelSwitch, 43 mininet::node::UserSwitch, 59 sorted mininet::topo::Topo, 57 start mininet::net::Mininet, 29 mininet::node::Controller, 14 mininet::node::OVSLegacyKernelSwitch, 43 mininet::node::RemoteController, 46 mininet::node::UserSwitch, 59 startTerms mininet::net::Mininet, 29 staticArp mininet::net::Mininet, 29 stop mininet::node::Controller, 14 mininet::node::Node, 40 mininet::node::OVSLegacyKernelSwitch, 43 mininet::node::OVSSwitch, 45 mininet::node::RemoteController, 46 mininet::node::UserSwitch, 60 stopXterms mininet::net::Mininet, 30 switches mininet::topo::Topo, 57 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

You might also like