Module Expr Str Import alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias FunctionDef arguments args NameParam NameParam defaults Num Num kwarg body Expr Str Assign NameStore Call NameLoad NameLoad NameLoad Return Call NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad Str keyword NameLoad Assign NameStore AttributeLoad Call AttributeLoad NameLoad attr NameLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr BinOpAdd BinOpAdd BinOpAdd Str NameLoad Str Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults Str Str Str NameLoad NameLoad body Expr Str If UnaryOpNot NameLoad body Assign NameStore SubscriptLoad NameLoad Index Str If UnaryOpNot NameLoad body Assign NameStore ListLoad Str Expr Call NameLoad NameLoad NameLoad NameLoad NameLoad For NameStore AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr BinOpAdd BinOpAdd BinOpAdd NameLoad Str NameLoad Str Print Str For NameStore AttributeLoad NameLoad attr body Expr Call NameLoad keyword NameLoad keyword Num keyword Num Print Print Str Print For NameStore AttributeLoad NameLoad attr body Print AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Print Print Str Expr Call NameLoad NameLoad For NameStore AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr BinOpAdd Str NameLoad Expr Call AttributeLoad NameLoad attr decorator_list If CompareEq NameLoad Str body Expr Call AttributeLoad NameLoad attr Str Assign NameStore Call NameLoad keyword Num keyword Num Assign NameStore IfExp CompareGt Call NameLoad AttributeLoad NameLoad attr Num Call AttributeLoad Str attr SubscriptLoad AttributeLoad NameLoad attr Slice Num Str Expr Call NameLoad NameLoad keyword NameLoad
N/A N/A 
Create a network and start sshd(8) on each host.

While something like rshd(8) would be lighter and faster,
(and perfectly adequate on an in-machine network)
the advantage of running sshd is that scripts can work
unchanged on mininet and hardware.

In addition to providing ssh access to hosts, this example
demonstrates:

- creating a convenience function to construct networks
- connecting the host network to the root namespace
- running server processes (sshd in this case) on hosts
 N/A sys mininet.net Mininet mininet.cli CLI mininet.log lg mininet.node Node mininet.topolib TreeTopo mininet.util waitListening TreeNet N/A N/A depth fanout N/A 1 2 kwargs N/A N/A Convenience function for creating tree networks. N/A topo N/A TreeTopo depth fanout N/A N/A Mininet topo kwargs N/A connectToRootNS N/A N/A network switch ip routes N/A N/A N/A Connect hosts to root namespace via switch. Starts network.
      network: Mininet() network object
      switch: switch to connect to root namespace
      ip: IP address for root namespace node
      routes: host networks to route to N/A root N/A Node root inNamespace False N/A intf N/A N/A N/A network addLink root switch intf1 N/A N/A N/A root setIP ip intf intf N/A N/A N/A network start N/A route routes N/A N/A N/A N/A root cmd N/A N/A N/A route add -net  route  dev  N/A str intf N/A sshd N/A N/A network cmd opts ip routes switch N/A /usr/sbin/sshd -D 10.123.123.1/32 None None N/A N/A Start a network, connect it to root ns, and run sshd on all hosts.
       ip: root-eth0 IP address in root namespace (10.123.123.1/32)
       routes: Mininet host networks to route to (10.0/24)
       switch: Mininet switch to connect to root namespace (s1) N/A N/A switch N/A N/A switch N/A network N/A s1 N/A N/A routes N/A N/A routes N/A 10.0.0.0/24 N/A N/A connectToRootNS network switch ip routes N/A host N/A network hosts N/A N/A N/A N/A host cmd N/A N/A N/A cmd opts & N/A *** Waiting for ssh daemons to start N/A server N/A network hosts N/A N/A N/A waitListening server server port 22 timeout 5 N/A N/A *** Hosts are running sshd at the following addresses: N/A N/A host N/A network hosts N/A N/A N/A host name N/A N/A host IP N/A N/A *** Type 'exit' or control-D to shut down network N/A N/A CLI network N/A host N/A network hosts N/A N/A N/A N/A host cmd N/A kill % cmd N/A N/A N/A network stop N/A N/A N/A __name__ __main__ N/A N/A N/A N/A lg setLogLevel info N/A net N/A TreeNet depth 1 fanout 4 N/A argvopts N/A N/A N/A len N/A sys argv 1 N/A N/A join N/A N/A sys argv N/A 1 -D -o UseDNS=no -u0 N/A N/A sshd net opts argvopts