Revision 80be5642 mininet/net.py

View differences:

mininet/net.py
49 49

  
50 50
The basic naming scheme is as follows:
51 51

  
52
    Host nodes are named h0-hN
53
    Switch nodes are named s0-sN
52
    Host nodes are named h1-hN
53
    Switch nodes are named s1-sN
54 54
    Controller nodes are named c0-cN
55 55
    Interfaces are named {nodename}-eth0 .. {nodename}-ethN
56 56

  
57
Note: If the network topology is created using mininet.topo, then
58
node numbers are unique among hosts and switches (e.g. we have
59
h1..hN and SN..SN+M) and also correspond to their default IP addresses
60
of 10.x.y.z/8 where x.y.z is the base-256 representation of N for
61
hN. This mapping allows easy determination of a node's IP
62
address from its name, e.g. h1 -> 10.0.0.1, h257 -> 10.0.1.1.
63

  
57 64
Currently we wrap the entire network in a 'mininet' object, which
58 65
constructs a simulated network based on a network topology created
59
using a topology object (e.g. LinearTopo) from topo.py and a Controller
60
node which the switches will connect to.  Several
61
configuration options are provided for functions such as
66
using a topology object (e.g. LinearTopo) from mininet.topo or
67
mininet.topolib, and a Controller which the switches will connect
68
to. Several configuration options are provided for functions such as
62 69
automatically setting MAC addresses, populating the ARP table, or
63 70
even running a set of xterms to allow direct interaction with nodes.
64 71

  
65
After the mininet is created, it can be started using start(), and a variety
66
of useful tasks maybe performed, including basic connectivity and
67
bandwidth tests and running the mininet CLI.
72
After the network is created, it can be started using start(), and a
73
variety of useful tasks maybe performed, including basic connectivity
74
and bandwidth tests and running the mininet CLI.
68 75

  
69 76
Once the network is up and running, test code can easily get access
70
to host and switch objects, which can then be used
71
for arbitrary experiments, typically involving running a series of
72
commands on the hosts.
77
to host and switch objects which can then be used for arbitrary
78
experiments, typically involving running a series of commands on the
79
hosts.
73 80

  
74 81
After all desired tests or activities have been completed, the stop()
75 82
method may be called to shut down the network.
......
187 194
    #
188 195
    # Notes:
189 196
    #
190
    # 1. If the controller and switches are in the same ( e.g. root )
197
    # 1. If the controller and switches are in the same (e.g. root)
191 198
    #    namespace, they can just use the loopback connection.
192
    #    We may wish to do this for the user datapath as well as the
193
    #    kernel datapath.
194 199
    #
195 200
    # 2. If we can get unix domain sockets to work, we can use them
196 201
    #    instead of an explicit control network.
......
244 249
                exit( 1 )
245 250
        info( '\n' )
246 251

  
247
    def _configHosts( self ):
252
    def configHosts( self ):
248 253
        "Configure a set of hosts."
249 254
        # params were: hosts, ips
250 255
        for host in self.hosts:
......
294 299
            self._configureControlNetwork()
295 300

  
296 301
        info( '*** Configuring hosts\n' )
297
        self._configHosts()
302
        self.configHosts()
298 303

  
299 304
        if self.xterms:
300 305
            self.startXterms()

Also available in: Unified diff