January 2019
Beginner to intermediate
776 pages
19h 58m
English
In this recipe, we will rewrite the same recipe of 9.2 for MaxiNet. As you can notice, with minor changes, the code and the API remains compatible with that of Mininet's.
Listing 9.2 adopts the listing 9.1 for MaxiNet, as follows:
#!/usr/bin/env python # Python Network Programming Cookbook, Second Edition -- Chapter - 9 # This program is optimized for Python 2.7.12. # It may run on any other version with/without modifications. import sys import maxinet from mininet.topolib import TreeTopo # Emulate a network with depth of depth_ and fanout of fanout_ def emulate(depth_, fanout_): # Start the MaxiNet as a Mininet cluster. cluster = maxinet.MininetCluster("pc1","pc2","pc3") cluster.start() # Emulate the network topology. emu ...Read now
Unlock full access