Compare commits

..

1666 Commits

Author SHA1 Message Date
Bob Lantz dd0abe0e12 Default ipv6 action should be 'add' 2015-04-14 14:20:07 -07:00
Bob Lantz 5a7b8f9833 setIP(): allow multiple IP addresses and IPv6 addresses
This may be a useful feature, but it doesn't fit well into
the established Mininet API, which assumes a single default
IP address for each interface.
2015-04-09 17:57:52 -07:00
Bob Lantz 1df1f9a1c5 Fix sorting & remove duplicate 2015-04-09 17:56:37 -07:00
Bob Lantz 125e669723 Support multiple --controller arguments 2015-03-30 20:40:07 -07:00
Bob Lantz a2486a6d66 Allow node.setIP() to pass extra arguments to intf.setIP() 2015-03-30 19:43:51 -07:00
Bob Lantz 15f2898f26 Add a space after ipv6.disable=1 so as not to break text boot 2015-03-30 16:26:05 -07:00
Bob Lantz 1c4adde1b6 Remove redundant processing for '/' 2015-03-24 15:22:55 -07:00
Bob Lantz 4d22991245 Allow install.sh -V on debian 2015-03-23 18:48:30 -07:00
Bob Lantz 90ea6c6bd1 Usually kernel install is unnecessary, so don't quit if it fails 2015-03-23 17:42:51 -07:00
Bob Lantz 269cecd3ee openvswitch-datapath-dkms is no longer needed for 14.04+ 2015-03-23 17:15:59 -07:00
Bob Lantz c2be20f09e Rename node.RYU to node.Ryu
Perhaps it should be RyuController, but just Ryu for now.
RYU made no sense because it's not an acronym.
2015-03-18 16:00:28 -07:00
Bob Lantz df56fa2716 2.2.1d1 -> 2.2.1d2 2015-03-18 15:47:53 -07:00
Bob Lantz f49e2539b7 Minor formatting, pass code check 2015-03-18 15:32:21 -07:00
Bob Lantz 4da7b3b7f0 Fix exception for unknown class 2015-03-18 15:31:40 -07:00
Bob Lantz e5a5cd0070 customConstructor -> customClass 2015-03-18 15:18:02 -07:00
Bob Lantz c5779deeb6 Pass code check 2015-03-18 15:17:33 -07:00
Bob Lantz 79c944aef4 Remove obsolete OVSLegacyKernelSwitch 2015-03-18 15:12:09 -07:00
Bob Lantz a23c6a2871 Fix undefined constructors in customClass() 2015-03-18 15:10:20 -07:00
Bob Lantz f6f6d9282b CustomConstructor -> CustomClass, which calls specialClass
specialClass is an analog of functools.partial but for classes.
We can now use it instead of partial() in mn, so that Mininet
can introspect on the actual base class.

Fixes #488
2015-03-13 21:17:43 -07:00
lantz 5224884e5e Merge pull request #473 from joerango/master
Support for running arbitrary command when starting terminal
2015-03-13 15:09:11 -07:00
lantz f063b023bd Merge pull request #478 from rlane/fix-readline-history
cli: don't read/write readline history more than once
2015-03-02 14:22:19 -08:00
Rich Lane a1edb167b1 Merge pull request #1 from lantz/devel/fix-readline-history
Move cmdloop() wrapper into a new run() method
2015-03-02 14:20:11 -08:00
Bob Lantz 613fac4bab Move cmdloop() wrapper into a new run() method
I also added another try/catch block so that interrupting
the 'Interrupt' message should no longer occur.
2015-02-20 16:46:18 -08:00
Rich Lane e0cd11ab21 cli: don't read/write readline history more than once
Previously, when creating multiple CLI objects, each one would append the
~/.mininet_history file to readline's internal list. When writing the file back
it would be duplicated for each CLI object created. So, over a few mininet runs
the history file would grow exponentially.

This change moves the readline setup code out of the CLI constructor into a
class method and adds a flag to prevent it from being executed more than once.
2015-02-20 10:47:43 -08:00
Joseph Beshay 5b818ad75c Support for running arbitrary command when starting terminal (other than bash) 2015-02-09 12:55:25 -06:00
Bob Lantz 17ba6a7c4d Add ip:port shorthand to Controller
Fixes #475
2015-02-04 11:16:42 -08:00
Bob Lantz f77a8b9e17 Fix customConstructor to work correctly with newargs 2015-02-04 10:56:32 -08:00
Bob Lantz 3dd8c2cda6 A controller should delete its interfaces if necessary
This was causing controlnet.py to not clean up its interfaces, since
those interfaces were linked from the controller to the switch
rather than vice-versa!!

deleteIntfs already will only delete interfaces whose names match
our name, which should usually prevent us from accidentally deleting
a hardware interface from the root namespace!
2015-02-04 10:30:26 -08:00
Bob Lantz 48a8ed857e 2.2.0+ -> 2.2.1d1 2015-02-04 05:27:51 -08:00
Bob Lantz 74c3511d5c pass code check 2015-02-04 05:27:14 -08:00
Bob Lantz 5ac113cfaa Batch link delete commands (and minor edits) 2015-02-04 05:21:15 -08:00
Bob Lantz cd02954c91 pass code check 2015-02-04 04:45:46 -08:00
Bob Lantz 93be1d0401 Fix OVS protocols option 2015-02-04 04:44:55 -08:00
Bob Lantz 6a38811f1a Clarify makeIntfPair behavior and pass code check 2015-02-04 04:44:14 -08:00
Bob Lantz 4ac45a3967 Fix super() arg in DataController 2015-02-04 04:43:23 -08:00
Bob Lantz d7e01bb821 Pass code check 2015-02-04 04:43:02 -08:00
Bob Lantz 340bf3cb7a Remove now-unused quietRun import 2015-02-04 04:29:08 -08:00
Bob Lantz 5f8547a5e0 Remove now-unused Link import 2015-02-04 04:28:57 -08:00
Bob Lantz 09e9c0550a Indent one line for consistency 2015-02-04 04:27:31 -08:00
Bob Lantz c1dc80571a Correctly group switches for batch operations 2015-02-04 04:26:58 -08:00
Bob Lantz ec9b23ba9c Delete tap9 for CE
In the future, we should probably not hardwire this,
or should at least make it a constant!!
2015-02-04 04:15:19 -08:00
Bob Lantz 7c0b56f9ba Delete both tunnel interfaces
We also clean things up a bit and check for error messages,
which now can cause exceptions which should invoke cleanup.
2015-02-04 04:14:40 -08:00
Bob Lantz d90a45514f node shell: remove unnecessary -m and unset HISTFILE
Since we already disable job notification with +m, it doesn't
make sense to set it in the original invocation!

It's also annoying if all of the host commands end up overwriting
your regular bash_history!!
2015-02-03 22:02:29 -08:00
Bob Lantz b2fe0778dc Change iperf() to use waitListening() 2015-02-03 21:44:21 -08:00
lantz 3e4f254573 Merge pull request #474 from mininet/devel/ovsbatch
Batch startup support for OVS

Currently, every ovs-vsctl command requires reading the entire OVS
configuration database. This means that its performance gets linearly
slower as more switches and ports are added. To mitigate this, we
batch multiple configuration operations into individual, long,
ovs-vsctl commands.

This patch set makes a couple of other notable changes, including
setting printPid=False by default (avoids using mnexec unnecessarily)
and running certain commands using errRun rather than quietRun.
Additionally we no longer look for leftover links in the root
namespace, so code relying on that functionality may have to change
slightly (as in controlnet.py and sshd.py for example.) It also adds
cluster support to mn -c.

The performance result is that mn --topo linear,200 --test none now
completes in 60 seconds rather than 95 seconds (on my laptop) without
the patch (vs. 101 seconds in 2.2.0).

This is still slower than I would like - we should be able to make
some additional improvements.
2015-02-03 19:24:03 -08:00
Bob Lantz 2e4dd13482 Turn off printPid by default to avoid mnexec fork/exec 2015-02-03 17:40:20 -08:00
Bob Lantz 19331ca287 use net.addLink() so that link is cleaned up 2015-02-03 16:02:07 -08:00
Bob Lantz 9483f6378f Make sure DataController's interfaces are deleted 2015-02-03 15:30:16 -08:00
Bob Lantz a4e933688a Set batch=False in OVSSwitch for low-level API
If you try to use the low-level API, you are probably
not going to call batchStartup()! So, we set batch=False
by default. This means that buildFromTopo() needs to set
it to True, so we add a bit of irritatingly complex machinery
to allow this to happen. The good fallout of this is that
now customConstructor() returns a real subclass, not simply
a constructor function! We also detect errors where people
are incorrectly attempting to give parameters to a lambda
function - since none of our lambdas accept parameters!!

Note that this is a bit like functools.partial for classes -
it would be nice if functools had a true subclassing function.
2015-01-29 00:26:15 -08:00
Bob Lantz c11e9f3316 Fix OVS user switch (remove unnecessary % parameter) 2015-01-28 17:04:58 -08:00
Bob Lantz acdcf9b6ae cluster: add batchStartup/Shutdown, cleanup 2015-01-27 15:27:26 -08:00
Bob Lantz c702840a0a Remove debug print lines 2015-01-27 15:24:29 -08:00
Bob Lantz 254fae2dc9 Clarify which intf pair failed and raise exception 2015-01-27 15:23:48 -08:00
Bob Lantz bdad3e8c8e Merge OVSBatch into OVSSwitch
Note that we are changing the interface of batchStartup/Shutdown
slightly so that the method can choose not to start some of the
switches. We might wish to refine this a bit...
2015-01-26 18:01:20 -08:00
Bob Lantz 574d634fc2 Don't clean up links that may have been dumped into root NS.
This should rarely happen - in the usual case, either the
links will be shut down by Mininet.stop(), or the interfaces
will be deleted by node.stop( deleteIntfs=True ), or the
links or interfaces will be explicitly deleted or stopped
using the low-level API.

Cases that are relying on links being automatically deleted
in cleanup() will potentially find that they are now no longer
deleted, but these cases should be rare.
2015-01-26 14:06:23 -08:00
Bob Lantz eafbd2a597 Change to OVSSwitch 2015-01-26 14:06:23 -08:00
Bob Lantz 7485b035af make 'ovs-vsctl' string symmetric 2015-01-26 14:06:23 -08:00
Bob Lantz 8014a7023c Fix super() typo 2015-01-26 14:06:23 -08:00
Bob Lantz bec34e7227 Clean up - TCReapply still broken! 2015-01-26 14:06:23 -08:00
Bob Lantz 9ca6322603 Remove shared reconnectms, improve self.started
We still need to set it in batchShutdown()
2015-01-26 14:06:23 -08:00
Bob Lantz 957fe1db93 Refactor for compatibility with isOldOVS() == True 2015-01-26 14:06:23 -08:00
Bob Lantz 3b4738c2ca First crack at setting controller backoff in single command 2015-01-26 14:06:23 -08:00
Bob Lantz 30ebb852a3 errRun: add debug( results ) 2015-01-26 14:06:22 -08:00
Bob Lantz 959586bc8f Add debug(cmd) to errRun() 2015-01-26 14:06:22 -08:00
Bob Lantz 9bda98486d Add OVSBatch class (experimental)
This implements batch startup for OVS switches.
2015-01-26 14:06:22 -08:00
Bob Lantz c68e4e76f4 Clarify bandwidth limit for TCIntfs
In the future, we would like to support higher bandwidth
limits for TCIntfs, but we'll probably need to adjust some
of the parameters dynamically.
2015-01-26 13:55:38 -08:00
Bob Lantz 98a8231cef Exit poll loop on POLLHUP or anything unexpected
In my opinion, we really shouldn't even get POLLHUP, but
we do. In case we get anything else odd, quite polling on
that fd.
2015-01-23 16:43:49 -08:00
Bob Lantz 28ce13d18e Fix polling in errRun
It's tricky to get this right, but basically we want to read
if there is something to read; if not, we want to check for
EOF.
2015-01-23 16:41:29 -08:00
Bob Lantz ef59cd88dc Return correct success condition in cgroupDel
Without this, we end up retrying until we fail, instead
of returning immediately on success!
2015-01-23 16:39:50 -08:00
Bob Lantz 9db6cdc261 Call delete() in link.stop() ; warn on exited node.cmd()
We should think a bit about the semantics that we want here.
The comments say "stop and clean up link" so perhaps that's
what we want. However, we could also imagine stop stopping
forwarding on the link (and possibly allowing restarts).

We warn on exited node.cmd() because we terminate the controller
before stopping/deleting the links. This makes sense to avoid a
storm of link/port down events, but since the controller's
shell has exited we cannot call link.stop() on any of its
links. We may want to simply stop the controller and not
terminate it, but at least it doesn't hang for now.
2015-01-22 03:22:43 -08:00
Bob Lantz f7b29333f5 2.2.0 -> 2.2.0+ 2015-01-18 23:35:54 -08:00
Bob Lantz 24520fc982 Allow + in version number 2015-01-18 23:35:29 -08:00
Bob Lantz b93cc989f4 Pass code check 2015-01-18 23:35:12 -08:00
Bob Lantz a8cc243aa7 Add stp param to OVS and connected() to OVSBridge
This allows --switch ovsbr,stp=True to work correctly
2015-01-18 22:59:21 -08:00
Bob Lantz e65dc4c6d6 OVSLink: use isinstance() to detect OVSSwitch subclasses 2015-01-18 21:56:38 -08:00
Bob Lantz d4be92713a Merge del-br into cmd, and add reconnectms param
With newer versions of OVS, this allows us to set up a switch
with a single OVS command (if reconnectms is zero.) If reconnectms
is specified, then it slows things down slightly (but not much.)
2015-01-18 16:09:02 -08:00
Bob Lantz 79f5d39db5 Comment edits and pass code check 2015-01-17 13:56:37 -08:00
Bob Lantz 6da3fcdef1 Add bridges s1-s3 to topology and explain some details 2015-01-17 13:38:55 -08:00
Bob Lantz 026130bd5f pass code check 2015-01-17 13:33:59 -08:00
Bob Lantz c1b48fb5c8 Stub out RemoteOVSSwitch.batchShutdown()
Eventually we should implement true batch shutdown.
In the mean time, we just ignore it. Note there's no good
way that I know of for a subclass to remove a superclass
method, so we changed the protocol a bit to require a return
value of True.
2015-01-15 02:43:38 -08:00
Bob Lantz b1983548aa Fix indentation error 2015-01-15 02:36:34 -08:00
Bob Lantz c62812a944 Update cluster.py for new makeIntfPair 2015-01-15 02:29:51 -08:00
Bob Lantz d66b96260a Don't stop switches that we've already stopped.
Note that this also changes the way that links are deleted;
the reason is that the batch shutdown doesn't currently delete
the links, but OVSSwitch.stop() does. We may wish to revisit
this in the future.
2015-01-15 02:07:00 -08:00
Bob Lantz d7e9c3bbfd Add comment about redundant intf.delete() 2015-01-15 02:07:00 -08:00
Bob Lantz 7a4a865bdb customize makeIntfPair to eliminate fastIntfPair 2015-01-15 02:07:00 -08:00
Bob Lantz da4dcf3753 Add addresses to fastIntfPair() and fix codecheck 2015-01-15 02:07:00 -08:00
Bob Lantz 5383b0e603 Update comment to reflect OVS patch link limits 2015-01-15 02:07:00 -08:00
Bob Lantz 9d2e6404b3 add fastIntfPair to speed up link creation 2015-01-15 02:07:00 -08:00
Bob Lantz 91a73bd191 use isinstance( intf, OVSIntf ) 2015-01-15 02:07:00 -08:00
Bob Lantz c069542c5c Add OVSLink/--link ovs, which uses OVS patch links when possible 2015-01-15 02:07:00 -08:00
Bob Lantz 127f35a9bc Revert to using OVS default OpenFlow versions.
It makes sense to follow Open vSwitch's lead here.
OVS 2.3 enables OpenFlow 1.0 through 1.3 by default.
OVS 2.0 has incomplete support for 1.3, but you can enable
it with protocols=OpenFlow13
2015-01-14 14:18:53 -08:00
Bob Lantz 171e815122 Set OVSSwitch default protocols to OpenFlow10,OpenFlow13
For OVS versions 1.9 or earlier, this setting is ignored.
2015-01-14 14:15:14 -08:00
Bob Lantz 3ac5cafe53 Fix code minor code check errors 2015-01-06 16:26:33 -08:00
Bob Lantz a7ad739036 Disable IPv6 via grub command line
Unfortunately disabling IPv6 via sysctl doesn't actually
disable it on all of the interfaces by default. Disabling
it via grub disables it entirely in the VM.

Helps with #454
2014-12-17 13:49:12 -08:00
Bob Lantz a84bec9709 Disable splash and quiet individually (more robust) 2014-12-17 13:48:43 -08:00
Bob Lantz 05dbf82edb Correctly set controller backoff for OVS.
Also report connected in standalone/bridge mode

Fixes #460

Conflicts:
	mininet/node.py
2014-12-11 17:03:49 -08:00
Bob Lantz c75eb47158 2.2.0rc1 -> 2.2.0 2014-12-09 13:37:43 -08:00
Bob Lantz 9945864a32 2.2.0rc1 -> 2.2.0rc2
Basically no changes except for whitespace and satisfying pep8.
2014-12-08 15:37:50 -08:00
Bob Lantz beeea4b292 Exclude miniedit from pep8 checking for now
(Also untabbed comment lines, flagged by emacs et al.)
2014-12-08 15:27:13 -08:00
Bob Lantz 7a3159c9af Spacing tweaks for pep8 checker 2014-12-08 15:10:32 -08:00
Bob Lantz ccd6b5cd7d version -> 2.2.0rc1 and update copyright date 2014-12-04 09:28:19 -08:00
Bob Lantz 908e85d9f9 Remove PLFMT since options are moved to .pylint 2014-12-04 09:27:53 -08:00
Bob Lantz e341526f46 Raise line limit to 4000 for miniedit.py (see note)
Future versions of pylint will allow this to be disabled
in the file itself, so we can drop the limit back to
1500 or something more reasonable!!
2014-12-04 09:26:11 -08:00
Bob Lantz 03461ce908 Add 'slowtest' make target to test walkthrough, examples 2014-12-04 09:17:13 -08:00
Bob Lantz 8c37975d44 Remove erroneous self.cmd = None 2014-12-04 09:03:46 -08:00
Bob Lantz 4d55ef1132 Restore missing space in RT_GROUP_SCHED message 2014-12-04 08:57:28 -08:00
Bob Lantz 342d47cfb5 call to run() should be to runCmd() 2014-12-04 08:56:08 -08:00
Bob Lantz 554abdd57a warn -> debug in connected; change IVS class comment 2014-12-04 08:38:54 -08:00
Bob Lantz 061598f011 Change from numeric to symbolic pylint error codes 2014-12-04 08:21:53 -08:00
Bob Lantz d754a7ceea Call super(deleteIntfs)
Maybe this is better - maybe not. ;-p
2014-12-04 07:36:53 -08:00
Bob Lantz 643c9f912f More pylint changes... 2014-12-04 05:55:57 -08:00
Bob Lantz 4965421215 More pylint fixes... 2014-12-04 02:57:36 -08:00
Bob Lantz 18aab5b786 More pylint changes 2014-12-04 00:51:05 -08:00
Bob Lantz b905dddf19 Reorganize and pass pylint 2014-12-02 20:26:34 -08:00
Bob Lantz 11a9c46904 Fix missing imports 2014-12-02 23:22:56 -08:00
Bob Lantz b1ec912db5 Fixing pylint errors 2014-12-02 23:00:50 -08:00
Bob Lantz db45b7c644 Parseable output format for newer pylint 2014-12-02 23:00:14 -08:00
Bob Lantz 2256a53830 Fix pylint error 2014-12-02 22:59:32 -08:00
Bob Lantz 03ef55672d Add cleanup and fix pylint errors 2014-12-02 22:58:57 -08:00
Bob Lantz c45bfab318 Add cleanup 2014-12-02 22:58:38 -08:00
Bob Lantz b2fcab827d Add cleanup and fix pylint errors 2014-12-02 22:58:10 -08:00
Bob Lantz 1471da95a9 Fix pylint errors 2014-12-02 22:57:32 -08:00
Bob Lantz 5a530af189 Remove trailing whitespace. ;-/ 2014-12-01 15:39:44 -08:00
Bob Lantz 3c9f5ad56e Disable pep8 whitespace errors 2014-12-01 15:38:38 -08:00
Bob Lantz c5d9e0e03c Set default route in one cmd line to avoid dc'ing root NS
Usually you won't want to create a node in the root namespace,
and usually you won't want to use the Mininet API to set your
(real) default route, but if you do then you will probably want
to use a single command line to avoid disconnecting an SSH
session while we wait for the reulst of the 'ip route del default
command.
2014-12-01 15:10:44 -08:00
Brian O'Connor 0094997aa1 fixing install-mininet-vm.sh 2014-11-25 17:18:49 -08:00
lantz 7a411b6bb5 Merge pull request #453 from cdburkard/master
update examples README with new examples
2014-11-25 13:01:31 -08:00
cody burkard c2341cd47a update examples README with new examples 2014-11-24 19:43:15 -08:00
Bob Lantz 4219b22978 2.2.0b2 2014-11-24 19:35:34 -08:00
lantz 08ab7e8de7 Merge pull request #452 from mininet/nat-cmd
Updating NAT class to use gateway interface
2014-11-24 19:13:33 -08:00
lantz 3ef6bcface Additional info about --nat and LinuxRouter 2014-11-24 19:04:15 -08:00
Brian O'Connor ab97dfa19c fixing no --nat issue 2014-11-24 18:36:57 -08:00
Brian O'Connor af1ccf93a5 Updating NAT class to use gateway interface
Also, passing CLI args to NAT constructor

fixes #437
2014-11-24 18:16:57 -08:00
lantz 015cd9e776 Merge pull request #443 from cdburkard/devel/cluster
use rcmd instead of quietRun when shutting down remote nodes
2014-11-24 12:30:52 -08:00
Bob Lantz 3d44bcdcc4 MiniNet -> Mininet 2014-11-23 17:32:11 -08:00
Bob Lantz 1817cbc3a4 Pass pyflakes 2014-11-23 17:31:43 -08:00
Bob Lantz e0bf8ece3c Minor code cleanup 2014-11-23 17:17:21 -08:00
Bob Lantz 37bdf14b49 Rename examples.{intfOptions,multiLink} -> {intfoptions,multilink} 2014-11-23 17:11:06 -08:00
Bob Lantz 292e69f89a Renamed to intfoptions.py for consistency 2014-11-23 17:07:32 -08:00
Bob Lantz dd876e69c8 DemoCLI -> ClusterCLI 2014-11-23 17:04:07 -08:00
lantz 4e644d7465 Merge pull request #450 from mininet/sw-cmd
adding deleteIntfs option to switches and corresponding CLI command
2014-11-24 11:27:59 -08:00
lantz 596fd9d0c6 Merge pull request #449 from cdburkard/devel/cluster_controlPaths
use ControlPersist ssh option to fix ControlPath shutdown
2014-11-23 14:59:11 -08:00
Bob Lantz 474f68600e Make pylint happier for no particular reason 2014-11-23 11:13:54 -08:00
Bob Lantz 50774e407c Remove unused imports 2014-11-23 11:11:03 -08:00
Bob Lantz 8e63e2c540 Fix undefined sleep() 2014-11-23 11:10:43 -08:00
Bob Lantz 273c4e9403 Fix typo. ;-p 2014-11-23 11:09:21 -08:00
Bob Lantz c273f49077 type( foo ) is bar -> isinstance( foo, bar ) 2014-11-23 11:06:12 -08:00
Bob Lantz 9a8bdfd765 use isinstance( obj, basestring) to allow unicode strings
fixes #448
2014-11-23 10:59:08 -08:00
Brian O'Connor 23dfbe4ae2 explicit param call in cli command 2014-11-21 18:35:37 -08:00
Brian O'Connor b57e5d93b8 adding deleteIntfs option to switches and corresponding CLI command 2014-11-21 18:33:06 -08:00
Bob Lantz f0f9907b9d Add setup() and dpctl() methods for LinuxBridge
Also adds docstrings.
Fixes #422
2014-11-19 09:32:56 -08:00
Bob Lantz c4fc630413 Correctly call cli() rather than CLI() 2014-11-19 09:18:05 -08:00
Bob Lantz aabbf29542 Revert to old "Adding controller" message 2014-11-19 08:58:17 -08:00
backb1 b7898befef raise exception when no prefixLen is set 2014-11-19 08:58:17 -08:00
backb1 6721f0655e Some clarifications 2014-11-19 08:58:17 -08:00
lantz d37d6ecd99 Merge pull request #241 from moijes12/fix44
(pending) Create test_switchdpidassignment.py
2014-11-20 14:14:14 -08:00
Bob Lantz e4db698184 Fix indentation error so we don't wait forever. 2014-11-19 05:58:36 -08:00
lantz e661a4b1c3 Merge pull request #447 from rlane/ivs-verbose-off
IVSSwitch: turn off verbose logging by default
2014-11-20 11:56:42 -08:00
Rich Lane f5164f86b7 IVSSwitch: turn off verbose logging by default
Most users don't need this much logging and it slows down the switch.
2014-11-19 18:24:49 -08:00
Bob Lantz 9e0c1549f4 Only uninstall ntpd on COW disk. 2014-11-19 04:59:23 -08:00
Bob Lantz 55b455e9ae Fix typo in depend() 2014-11-19 03:20:48 -08:00
cody burkard 34933ef741 use ControlPersist ssh option to create a ControlMaster connection that will not die when a node dies 2014-11-18 17:22:06 -08:00
cody burkard bbf94cdb63 use rcmd instead of quietRun when shutting down remote nodes 2014-11-17 17:55:06 -08:00
Brian O'Connor 593fc365d0 fixing --custom in mn (there was one two many selfs) 2014-11-17 17:46:24 -08:00
Brian O'Connor 1edf3515e3 Merge pull request #439 from cdburkard/patches/sudoers
fix sudoers file to allow -u option
2014-11-17 17:01:50 -08:00
cody burkard 0d271f9477 fix sudoers file to allow -u option 2014-11-17 16:19:28 -08:00
Bob Lantz 3534f77761 Remove extra git clone line 2014-11-12 18:31:10 -08:00
Bob Lantz 64bbaeccc4 Add doxygen-latex if needed (14.04+) 2014-11-12 17:45:36 -08:00
Bob Lantz de002b0d9a Remove ^S which was in this file (thanks emacs bindings) 2014-11-12 17:39:50 -08:00
Bob Lantz 307302ed32 Clarify dependencies 2014-11-12 15:52:53 -08:00
Bob Lantz a60f77ad36 Clarify checking out a version, and add Debian/Fedora 2014-11-12 15:50:41 -08:00
Bob Lantz 383c3fb3e4 in-line documentation link 2014-11-12 15:50:24 -08:00
Bob Lantz a64f8c28bd Don't blow away parameters that aren't specified in node.config() 2014-11-12 15:17:17 -08:00
Bob Lantz 377d1b1cd8 2.2.0b0 -> 2.2.0b1 2014-11-12 13:33:34 -08:00
Bob Lantz dde2263fe7 Disable shared SSH connections by default.
Note that we do still provide a default if you specify
ControlPath=True
2014-11-12 13:29:58 -08:00
Bob Lantz 434619053a Satisfy pyflakes by making a local cli variable 2014-11-12 13:12:22 -08:00
Bob Lantz b739cd11c8 Remove obsolete util.custom(), and make custom() a method 2014-11-12 13:08:36 -08:00
lantz bc6ef0dad8 Merge pull request #435 from mininet/devel/custom
Adding support for multiple custom files
2014-11-12 12:25:46 -08:00
Brian O'Connor 3ac0dd7093 Adding support for multiple custom files
Works in a few ways:
 * a single file: --custom foo.py (as before)
 * comma-separated list: --custom foo.py,bar.py
 * multiple custom args: --custom foo.py --custom bar.py
2014-11-11 03:14:46 -08:00
Bob Lantz 0f0fe82350 Fix typo, ugh. 2014-11-11 00:14:11 -08:00
Bob Lantz 6be4bfd026 Avoid mirrors.kernel.org for now 2014-11-10 23:31:08 -08:00
Bob Lantz d9d209f34d Update from official archive since mirror seems to be failing 2014-11-10 23:00:56 -08:00
Bob Lantz 2059786f7b Use sudo -n when talking to VM 2014-11-10 22:45:42 -08:00
lantz 6008f987d3 Merge pull request #436 from cdburkard/patches/plot
fix plot command to work when standard classes are present
2014-11-11 11:54:56 -08:00
Bob Lantz 635e8f11f3 Add -q option to apt-get for quieter logging 2014-11-10 19:37:11 -08:00
Bob Lantz 9b5fa1d7ed Always chdir() to current working directory. 2014-11-10 16:57:12 -08:00
Bob Lantz 1955e90493 Minor cleanup. 2014-11-10 16:50:24 -08:00
Bob Lantz 222e87daeb Rearrange init code slightly. 2014-11-10 16:48:20 -08:00
Bob Lantz a89ccb789e Fix problem of ssh'ing into "localhost" on a remote node. 2014-11-10 16:46:43 -08:00
lantz 2013b7ae81 Merge pull request #428 from cdburkard/patches/cluster_servers
standardize on localhost for local server's name
2014-11-10 16:23:59 -08:00
Bob Lantz 3e1100b71a Clarify MultiTopo docstrs and copy addLInk opts
Note: it's a bit confusing, but we need to copy the link
parameter dicts (since we update them with node info), but we
can share the node dicts. Perhaps we should copy the node
dicts as well...
2014-11-10 15:18:05 -08:00
lantz 086afe852b Merge pull request #434 from cdburkard/patches/cluster_x11
wrap the title string in quotes so that bash interprets it correctly
2014-11-10 14:12:39 -08:00
Bob Lantz abcdf18547 Uninstall ntpd to disable it more reliably 2014-11-10 14:09:35 -08:00
Bob Lantz 4a304688f4 Select TCP Reno and run iperf for a longer time interval
The hope is that this will make the results a bit more consistent
when running in a VM environment.
2014-11-10 12:39:55 -08:00
Bob Lantz d3377bf911 Add seconds option to iperf() 2014-11-10 12:37:54 -08:00
Bob Lantz 481cbea10c Update mininet docs ref to markdown format 2014-11-07 15:23:18 -08:00
Bob Lantz b817cbc0ed Update documentation link 2014-11-07 15:12:12 -08:00
lantz 15275048b6 Merge pull request #433 from mininet/devel/update-version-2.2b0
Initial update of README, text files and versions for 2.2.0b0
2014-11-07 16:58:12 -08:00
lantz 3baccfee3a Merge pull request #416 from mininet/devel/multitopo
Multi-link topology support
2014-11-07 16:16:25 -08:00
Bob Lantz bb76c21275 Use 2.2.0b0 for consistency with earlier Mininet releases 2014-11-07 15:08:15 -08:00
Bob Lantz c92c4efb66 Add a few clarifying comments 2014-11-07 13:47:03 -08:00
Bob Lantz 39203484a6 Make port1, port2 truly optional and don't pass them to Link() 2014-11-07 13:42:50 -08:00
Bob Lantz 2a2d605074 Get rid of paramDict and simplify things a bit 2014-11-07 13:40:00 -08:00
cody burkard 0676346aeb fix plot command to work when standard classes are present 2014-11-07 05:10:06 -08:00
cody burkard 93fdb69ee3 standardize on localhost for local server's name 2014-11-07 02:32:42 -08:00
Brian O'Connor c7921fe402 Merge pull request #432 from mininet/devel/fallback
Fall back to OVSBridge if no controller is available for default switch
2014-11-07 01:29:06 -08:00
cody burkard 3660e6d02f wrap the title string in quotes so that bash interprets it correctly 2014-11-07 01:11:40 -08:00
Bob Lantz 083322a217 Draft update for Mininet 2.2b0 2014-11-06 12:05:55 -08:00
Bob Lantz 8225105cf2 Fix to allow more flexible version numbers 2014-11-06 12:05:33 -08:00
Bob Lantz ccd3276dcf Raise exception if DefaultController cannot find a controller 2014-11-05 18:43:58 -08:00
Bob Lantz f51eddef6d Return controller correctly. 2014-11-05 18:41:00 -08:00
Bob Lantz 4f8aa1d8a0 Don't check rt_runtime_us for CFS scheduler 2014-11-05 16:49:28 -08:00
Bob Lantz 060d46a282 Set VM date based on host date.
This should fix #398 for real; note that if we try to shut down ntpd
right at boot, it doesn't work! ;-(

However, setting the Unix time in the traditional manner using seconds
since 1970 should do the trick!
2014-11-05 16:18:13 -08:00
Bob Lantz 820c3be7df Reorganize CFS and RT default/error conditions. 2014-11-04 17:20:35 -08:00
Bob Lantz a562ca1be3 Move RT check into its own method, and save value. 2014-11-04 16:27:34 -08:00
lantz 658761d953 Merge pull request #419 from cdburkard/patches/rt_failure_output
fix silent failures when rt cannot be assigned - will follow up on this
2014-11-04 16:09:25 -08:00
Bob Lantz 1b69ea13f5 Merge branch 'fallback' of https://github.com/thinred/mininet into thinred-fallback
Conflicts:
	bin/mn
	mininet/node.py
2014-11-04 03:24:16 -08:00
Bob Lantz 6e5ac34bc2 Update module comment. 2014-11-03 20:01:22 -08:00
lantz ec9f02c7ab Merge pull request #424 from cdburkard/devel/mergePrivate
merge HostWithPrivateDirs into Node
2014-11-04 15:09:20 -08:00
lantz f75bee62b5 Merge pull request #429 from cdburkard/patches/cluster_m
ensure we retrieve a single PID when run on a cluster node
2014-11-04 12:49:08 -08:00
Bob Lantz e77123cf0e Remove unnecessary 0 2014-11-03 14:25:09 -08:00
Bob Lantz 8dea57d271 Ignore link info when sorting links. 2014-11-03 14:20:01 -08:00
Bob Lantz 634761b8a7 Fix edges() and add convertTo() to Topo() (with keys option) 2014-11-03 12:59:53 -08:00
Bob Lantz 01aac350fa Remove unused edgeinfo 2014-11-03 12:43:52 -08:00
Cody Burkard 08d611f49b fix silent failures when rt cannot be assigned 2014-10-31 20:30:36 -07:00
Bob Lantz f6de358b06 Try to prime the pump to avoid PACKET_INs during iperf test
Background: the reference controller is reactive and installs exact
match rules. By attempting to start a telnet session we make sure that
the ARP caches and TCP flow rules are set up (in one direction at
least) before the test starts.

This is intended to help with #413
2014-10-31 15:06:15 -07:00
cody burkard f66904ab90 ensure we retrieve a single PID when run on a cluster node 2014-10-31 08:23:00 -07:00
cody burkard 6a363f65e3 unmount private directories after use 2014-10-31 04:59:35 -07:00
cody burkard 736db20c9f merge HostWithPrivateDirs into Host 2014-10-31 04:43:10 -07:00
Bob Lantz ba8ea8f0cc Return (src, dst) in original order, and allow keys + data 2014-10-28 20:43:10 -07:00
Bob Lantz eab4ea3fb9 Minor fixes 2014-10-28 17:05:00 -07:00
cody burkard 06d9e4bba7 add example and test for multiple links 2014-10-28 16:10:46 -07:00
Bob Lantz 38ce329e7e Allow Mininet() to accept multi-link topos w/correct params. 2014-10-28 16:06:53 -07:00
Bob Lantz 94f088d7e8 Allow natural sort to accept non-strings. 2014-10-28 16:06:53 -07:00
Bob Lantz 89fb081983 First crack at fixing multiple links
* Makes MultiGraph more like networkx.multigraph
* Adds converTo method
* Synchronizes node1 with xxx1 in link options
2014-10-28 15:50:06 -07:00
lantz aae0affae4 Merge pull request #411 from cdburkard/devel/cli_usage
add cli usage information
2014-10-14 13:42:40 -07:00
lantz 8190e81ba8 Merge pull request #410 from cdburkard/patches/tshark_walkthrough_1404
support wireshark versions greater than 1.11 in test_walkthrough
2014-10-14 13:36:24 -07:00
lantz 16a2a6dc55 Merge pull request #400 from cdburkard/patches/fixEmptyPing
Mininet crashes when running ping between two hosts with no interfaces
2014-10-13 18:11:19 -07:00
lantz b7999978f9 Merge pull request #409 from cdburkard/patches/cleanup_tests
if a test fails or exits with an error, run cleanup as a precaution
2014-10-13 18:06:44 -07:00
Bob Lantz e1711f357a Use server receive rate rather than client send()/buffering rate
Fixes #412
2014-10-13 17:52:47 -07:00
Bob Lantz 501eb4f916 Add more information for test condition failure 2014-10-13 13:52:43 -07:00
Cody Burkard f341159300 support wireshark versions greater than 1.11 2014-10-13 10:52:37 -07:00
cody burkard cac98f5fd5 add cli usage information 2014-10-10 20:32:15 -07:00
lantz 5eca0802d2 Merge pull request #407 from cdburkard/patches/baresshd_waitListening
wait for sshd to start in baresshd example
2014-10-10 12:33:45 -07:00
Bob Lantz 6159e923e6 Add VM port forwarding option: --forward tcp:2222:22 2014-10-09 14:30:09 -07:00
Bob Lantz 2ceb57915a Merge branch 'cdburkard-patches/test_walkthrough' 2014-10-07 16:11:03 -07:00
Bob Lantz 61c144b9f6 Minor fixes to wireshark test 2014-10-07 16:08:57 -07:00
lantz 8537e8d9fa Merge pull request #404 from cdburkard/patches/default_cli
use node.pexec() to update IP address of intf instead of node.cmd()
2014-10-07 14:27:46 -07:00
cody burkard 33d42e25e6 if a test fails or exits with an error, run cleanup as a precaution 2014-10-03 09:50:39 -07:00
cody burkard 7c5d2771f7 wait for sshd to start in example 2014-10-03 04:52:21 -07:00
Bob Lantz 098bede0ec Wait for controller shutdown.
Unfortunately, this can slow things down a bit - perhaps
100-200 ms in the case of ovs-controller, but I am hoping that
it may help slightly with #399.
2014-10-02 20:09:17 -07:00
Bob Lantz 629e58ca5b Add 'use' test for using VM interactively 2014-10-02 18:45:54 -07:00
cody burkard e3ab3fc239 fix a few small issues with walkthrough tests 2014-10-02 11:10:17 -07:00
cody burkard f1123e71ae update interface IP address with pexec so that backgrounded process output from the cli cannot interfere 2014-10-02 09:19:07 -07:00
cody burkard 778267aa75 if there are no interfaces to ping, there are no packets sent 2014-10-01 23:05:34 -07:00
Bob Lantz d6da13d4e3 ntpd doesn't take a server argument 2014-10-01 17:32:15 -07:00
Bob Lantz 92a4f2ddbf Try using ntpd since ntpdate doesn't always work 2014-10-01 17:29:04 -07:00
Bob Lantz ded25a9ef8 disableNtpd: wait 1 second and print out date just to be sure 2014-10-01 14:42:43 -07:00
Bob Lantz 1bae1aab03 Turn of ntpd and set date manually before tests
This should fix the problem where we see the first test
taking negative time, as well as possibly other issues
with performance tests which may be sensitive to changes
in wall clock time.

Fixes #398
2014-10-01 14:20:59 -07:00
lantz 01a1e8e400 Merge pull request #397 from cdburkard/patches/test_nets
wait for switches to connect during test_nets
2014-09-30 15:19:54 -07:00
Bob Lantz 9487cb508d Fix typo 2014-09-29 19:57:26 -07:00
Bob Lantz 461751e5cd Merge branch 'cdburkard-patches/linear_bw' 2014-09-29 19:06:31 -07:00
Bob Lantz 762479c15b Merge branch 'patches/linear_bw' of https://github.com/cdburkard/mininet into cdburkard-patches/linear_bw 2014-09-29 19:06:08 -07:00
Bob Lantz c8607467bd Merge branch 'cdburkard-patches/fix_sshd' 2014-09-29 18:51:00 -07:00
Bob Lantz f8e98d6a7f Merge branch 'patches/fix_sshd' of https://github.com/cdburkard/mininet into cdburkard-patches/fix_sshd 2014-09-29 18:50:41 -07:00
lantz 4aa0b82381 Merge pull request #395 from cdburkard/patches/vlan_fail_output
check for vlan dependency
2014-09-29 18:33:38 -07:00
lantz f9522b30dc Merge pull request #394 from cdburkard/patches/cpu_test
continue to test cfs if rt is not enabled in kernel
2014-09-29 17:41:07 -07:00
Bob Lantz ec26c7492d Install vconfig in VM for VLAN example
This should help with #393 although it doesn't solve
the root issue of the example failing silently when
vconfig is missing.
2014-09-29 16:30:24 -07:00
cody burkard 684092bae1 wait for switches to connect during test_nets 2014-09-27 06:43:39 -07:00
cody burkard 9cbf4688b2 add 1ms delay to all links to exaggerate TCP bandwidth decrease across an increasing number of links 2014-09-27 04:48:57 -07:00
cody burkard 74857ba474 remove User Switch from linearBandwidth due to poor performance 2014-09-27 04:47:56 -07:00
cody burkard f1b61c629a Merge branch 'master' of github.com:mininet/mininet into patches/fix_sshd
Conflicts:
	examples/cpu.py
2014-09-27 04:31:46 -07:00
cody burkard a565bdd57d fix popen to work with shell 2014-09-27 04:30:16 -07:00
cody burkard cf5bbd597a promote waitListening to util.py 2014-09-27 04:30:16 -07:00
cody burkard c0d8fc0d37 wait until sshd has started on each host 2014-09-27 04:30:16 -07:00
cody burkard eef43402b6 check for vlan dependency 2014-09-27 04:24:27 -07:00
cody burkard 54bd9e6112 continue to test cfs if rt is not enabled in kernel 2014-09-27 03:20:07 -07:00
lantz fa7edec7c8 Merge pull request #391 from cdburkard/patches/fix_popen
workaround: attach to cgroup first, then mount namespace
2014-09-26 16:47:06 -07:00
lantz 89cc29b4c2 Merge pull request #367 from cdburkard/devel/Ryu
add Ryu controller support to Mininet
2014-09-26 16:41:45 -07:00
cody burkard 686a9993f5 add Ryu controller to mininet 2014-09-26 15:42:15 -07:00
cody burkard e16c5fe905 attach to cgroup first, then mount namespace 2014-09-25 22:51:48 -07:00
Bob Lantz dedb06b2f5 Wait for crlf after OK/FAILED for better -v output 2014-09-25 18:43:07 -07:00
lantz 5fc3f57ede Merge pull request #386 from cdburkard/patches/cpu_test
Skip test_cpu.py if RT_GROUP_SCHED is not enabled
2014-09-25 14:19:55 -07:00
lantz 5789dae8be Merge pull request #387 from cdburkard/patches/iperf_bw
use udp with iperf to measure loss. pings are not reliable
2014-09-25 14:17:09 -07:00
lantz 0efde9c4ed Merge pull request #388 from cdburkard/patches/intfOptions
measure loss with udp iperf
2014-09-25 14:16:26 -07:00
cody burkard 7eeaed992c use udp with iperf to measure loss. pings are not reliable 2014-09-25 13:09:24 -07:00
cody burkard f0ce6f501d measure loss with udp iperf 2014-09-25 12:39:42 -07:00
cody burkard 823d1b9990 skip test if RT_GROUP_SCHED is not enabled 2014-09-25 10:16:55 -07:00
Bob Lantz 61760eabc5 Make sure we 'sudo kill' our sudo pexpect process in close().
This should more reliably shut down pexpect subprocesses when
build.py exits before completion.
2014-09-24 11:57:46 -07:00
Bob Lantz 12095a12f4 Try to install openvswitch-testcontroller if needed 2014-09-23 17:49:46 -07:00
Bob Lantz 412726d39c Fix -a 2014-09-23 17:18:59 -07:00
Bob Lantz 136c959191 Fix wireshark namespace conflict and don't reinstall 2014-09-23 16:32:30 -07:00
lantz 2ac4cd43da Merge pull request #384 from mininet/devel/loxigen
Switch to loxigen-built openflow.lua wireshark plugin
2014-09-23 14:09:02 -07:00
Bob Lantz f603052b35 Install coloring rules regardless of plugin. Also don't clobber. 2014-09-23 14:01:40 -07:00
Bob Lantz 47be38e63c Don't install lua plugin for wireshark 1.12+
Apparently there is a conflict where the lua plugin
conflicts with the built-in dissector for openflow
that is included with 1.12 and up. For now, we will
just not install the plugin. This should fix the
14.10 VM build.

Additionally, I have added a handy function,
version_ge, which compares version numbers in
canonical x.y.z format. Thanks to stackoverflow for
pointing out the incredibly useful sort -V option!
2014-09-23 13:45:20 -07:00
Bob Lantz 9ca775cba3 Switch to loxigen-built openflow.lua wireshark plugin
The older wireshark dissectors were not well-maintained
and were a pain to build. They also added tons of extra junk
into our VM images! The ones built into the current
wireshark are deficient for 1.3. The solution for the
future is almost certainly to go with the lua-based plugin,
since it is architecture-independent and should be much
easier to maintain and upgrade.
2014-09-22 15:54:58 -07:00
lantz e4d49e6df7 Merge pull request #229 from mininet/devel/mobility-example
A simple mobility API and example
2014-09-22 12:31:31 -07:00
Bob Lantz 02bf34aa96 Remove setup/isOldOVS which have been merged into OVSSwitch 2014-09-22 12:27:49 -07:00
Brian O'Connor 73ef3e9a39 Merge pull request #375 from cdburkard/patches/multi_core_rt
fix host --rt
2014-09-21 00:43:25 -07:00
Brian O'Connor 55ef99b667 Merge pull request #379 from cdburkard/devel/show_ports
adding 'ports' command to cli
2014-09-21 00:13:58 -07:00
Brian O'Connor 57686d3149 Merge pull request #381 from cdburkard/examples/interfaces
adding example and test for intf.config()
2014-09-20 23:31:30 -07:00
Brian O'Connor 8396960ec0 Merge pull request #380 from cdburkard/devel/cli_comments
parse comments out of CLI
2014-09-20 23:27:33 -07:00
Brian O'Connor 3e8df323b3 Merge pull request #374 from cdburkard/patches/rt
check if RT_GROUP_SCHED is enabled in kernel
2014-09-20 23:21:06 -07:00
cody burkard 706229da77 adding example and test for intf.config 2014-09-17 12:55:59 -07:00
lantz 2c10a8e687 Merge pull request #376 from cdburkard/patches/pingOutput
if we do not receive a ping and cannot parse output, return errorTuple
2014-09-16 13:43:06 -07:00
lantz e4c4891a47 Merge pull request #359 from mininet/devel/cluster
Cluster Support Prototype
2014-09-16 13:40:45 -07:00
Bob Lantz 80d647a9b0 add findUser() to clean up user identification 2014-09-16 13:31:51 -07:00
cody burkard c5e8f09b10 adding comments to CLI 2014-09-15 15:52:14 -07:00
cody burkard 08643fe679 adding 'ports' command to cli 2014-09-15 15:33:58 -07:00
cody burkard 3df3610199 adding sanity check for cluster edition 2014-09-09 22:30:20 -07:00
cody burkard 00cbb348a7 if we do not receive a ping and cannot parse output, return errorTuple 2014-09-09 13:59:41 -07:00
lantz cde6c3aaf4 Merge pull request #369 from cdburkard/patches/hifi_multicore
Fix runCpuLimitTest with multiple cores
2014-09-05 15:44:23 -07:00
Bob Lantz c265deedef Cluster edition prototype: remote nodes and links.
We add a new experimental feature to allow Mininet to run across
a cluster of machines. This is currently implemented via a set
mix-in classes that provide remote nodes that are implemented
via a connection to a remote shell, and remote links which are
tunnels across servers. In this preliminary implementation,
both control and data connections are made via ssh, but this
could change in the future.

A MininetCluster class is provided which allows existing code
to be used with minimal modification - all that is required is
to provide a list of servers to use. A customizable placement
algorithm may also be specified. An experimental CLI subclass
is also provided to make it easier to examine node placement;
status and links commands can also check whether nodes and
tunnels are still running.

Although this is an experimental feature, it does include a
--cluster option to make it convenient to start up a Mininet
simulation over a cluster, and a script to assist with setting
up the prerequisite authentication via ssh key pairs.

The cluster feature is preliminary and missing some obvious
important features, such as parallel startup and multiple tunnel
types, which we hope to add in the future.
2014-09-04 23:07:01 -07:00
Bob Lantz 0333d3dbf4 qcow2size(): use qemu-image instead of file
file no longer returns image size on 14.04
fixes #373
2014-09-04 21:51:21 -07:00
cody burkard 58324bdc50 check if RT_GROUP_SCHED is enabled in kernel 2014-09-04 12:24:18 -07:00
cody burkard 04c1c098ed wall clock time makes rt quota independent of nprocs 2014-09-04 10:46:57 -07:00
Bob Lantz f2458d1dcf Accept 'ISO' or 'boot' in file *.iso command output
Fixes #372
2014-09-04 06:50:54 -07:00
cody burkard ce781a1832 use cgroups to calculate percentage of cpu used 2014-09-04 04:21:25 -07:00
Bob Lantz b85943dc0a chdir() to correct path after calling chroot()
Since chroot() doesn't chdir() by default, we are left in
an unreachable directory in node.pexec() (and in xterms.)

fixes #370
2014-09-04 02:22:13 -07:00
Brian O'Connor d4ca1db60b Merge pull request #364 from cdburkard/patches/testCPULimit
Fix output of backgrounded processes
2014-08-29 19:34:32 -07:00
Brian O'Connor 47d567e53c Merge pull request #365 from cdburkard/devel/test_output
print useful output for tests upon failure
2014-08-29 18:47:30 -07:00
Brian O'Connor 6b8d3538ef adding comment to VLANStarTopo in vlanhost.py 2014-08-28 05:57:10 -07:00
Brian O'Connor 05f3fbae73 Merge pull request #362 from mininet/devel/vlanhost
Adding VLANHost to Examples
2014-08-28 17:49:25 -07:00
Brian O'Connor 65e33fed9b Merge pull request #361 from mininet/devel/linuxrouter
Adding LinuxRouter to Examples
2014-08-28 17:49:07 -07:00
Brian O'Connor d334c1ccfe adding test for vlanhost.py and adding vlantopo example 2014-08-28 02:48:46 -07:00
Brian O'Connor fe8358add2 chmod +x vlanhost.py 2014-08-27 23:07:37 -07:00
Brian O'Connor 2c76ab718b linuxrouter.py: changing name, printing routing table, and some more documentation 2014-08-27 22:43:04 -07:00
Brian O'Connor aa4dfda44c adding documentation and test for linuxrouter.py 2014-08-27 22:01:18 -07:00
lantz 66ae58de17 Merge pull request #363 from cdburkard/patches/testLinkDelay
Fix UserSwitch.connected() as well as testLinkDelay() in test_hifi
We need more than one iteration since the first iteration may show reactive forwarding and ARP delay; currently we have three for good measure, although two is probably enough.
2014-08-27 16:36:30 -07:00
cody burkard ce1673803f clean up logic for backgrounded processes 2014-08-27 11:07:22 -07:00
cody burkard 73adba8b81 print useful output for tests upon failure 2014-08-27 10:55:08 -07:00
cody burkard c11d577349 parse pid printed when backgrounding a process 2014-08-27 08:44:08 -07:00
Brian O'Connor be1ed10363 adding vlanhost.py 2014-08-27 03:58:36 -07:00
Brian O'Connor 8a987b9c55 adding linuxrouter.py 2014-08-27 03:57:38 -07:00
cody burkard c75ff7ecd9 fixes for LinkDelay test in test_hifi 2014-08-26 22:34:34 -07:00
lantz 92075113d8 Merge pull request #342 from cdburkard/devel/startup
improve startup performance, largely by removing unnecessary ifconfigs
2014-08-26 19:59:12 -07:00
Bob Lantz 13bdd914dc Pass rename correctly in moveSwitch() 2014-08-26 19:55:48 -07:00
Bob Lantz 60b0c7a914 Fix version check. 2014-08-26 19:55:48 -07:00
Bob Lantz 212399feaf Allow port selection in addIntf() and moveIntf() 2014-08-26 19:55:48 -07:00
Bob Lantz 08d83d136d Rename intfs, and add simple moveHost() function 2014-08-26 19:55:48 -07:00
Bob Lantz dd6424fee8 Simple mobility example. 2014-08-26 19:55:48 -07:00
cody burkard 720a846cf8 use kernel's mac generation 2014-08-26 18:48:08 -07:00
Bob Lantz bfdbb7089a Fall back to chroot() if setns() fails for mnt namespace
fixes #347
2014-08-26 14:09:40 -07:00
lantz 16a384ab4b Merge pull request #353 from mininet/devel/nat
Adding NAT class to NodeLib
2014-08-21 14:16:41 -05:00
lantz a3e1a9a44d Merge pull request #354 from darshanthaker/link_exception
Raise exception when link incorrectly formatted
2014-08-20 22:08:46 -05:00
lantz 6a69c2f699 Merge pull request #356 from cdburkard/patches/stop_controller
fix for controller shutdown - send SIGHUP rather than SIGKILL
2014-08-20 22:04:51 -05:00
lantz db888fa5d4 Merge pull request #348 from ggee/miniedit2109
Update to MiniEdit 2.2.0.1
2014-08-20 22:03:21 -05:00
cody burkard c9b844a721 added controller.stop() back in 2014-08-18 23:51:29 -07:00
cody burkard 604ad455ee kill all child processes to avoid race condition and no controller shutdown 2014-08-18 23:24:18 -07:00
Gregory Gee 8d493b686e Update to MiniEdit 2.2.0.1
- Replace custom code to set OF protocols with new Mininet available API to set.
2014-08-16 01:00:25 -04:00
lantz c0e7e34916 Merge pull request #337 from ggee/ovsProtocol
Add parameter to set protocol list in OVSSwitch.
2014-08-15 14:44:33 -07:00
Gregory Gee 1a53141502 Update to MiniEdit 2.2.0.0
- Updated for new Mininet 2.2.0
- Support TCP or SSL for remote controller
- Support HostWithPrivateDirs Hosts
2014-08-14 21:41:45 -04:00
Brian O'Connor 1285fb22dc updaing build.py to use 12.04.5 and extract kernel using noload 2014-08-14 15:38:31 -07:00
Darshan Thaker 4550fff1af Raise exception when link incorrectly formatted 2014-08-14 13:50:59 -07:00
Brian O'Connor 7c4e5b14cb adding line to natnet.py 2014-08-14 01:07:44 -07:00
cody burkard f72d3dfa32 Merge branch 'master' of github.com:mininet/mininet 2014-08-14 01:07:24 -07:00
Brian O'Connor e67539752e updaing build.py to use 12.04.5 and extract kernel using noload 2014-08-14 00:18:37 -07:00
Brian O'Connor db0f36f431 Fixing Node.monitor() to read entire prompt marker.
Applying @cdburkard fix to #322
2014-08-14 00:18:37 -07:00
lip.z 7e9d3f2b50 fix Singleton.__call__ error
fix Singleton.__call__ error
2014-08-14 00:18:37 -07:00
Brian O'Connor 4015e0666e moving NAT to nodelib 2014-08-13 22:09:24 -07:00
Brian O'Connor cee62eb28e adding natnet example test 2014-08-13 22:08:15 -07:00
Brian O'Connor 735080a84b Merge branch 'master' into nat 2014-08-13 19:51:12 -07:00
Brian O'Connor 161e7997fa Fixing Node.monitor() to read entire prompt marker.
Applying @cdburkard fix to #322
2014-08-13 19:49:08 -07:00
cody burkard 417d79780f merging master 2014-08-13 17:35:34 -07:00
cody burkard 41a54f05cb adding comments and removing random access spaces 2014-08-13 17:33:00 -07:00
cody burkard 84c1c24ce2 skip this because of poor UserSwitch performance 2014-08-13 17:06:00 -07:00
cody burkard af4c9719b3 autostaticarp is broken without this 2014-08-13 15:08:04 -07:00
Tomasz Buchert 39a3b73f85 fallback to ovsb when no OF controller is unavailable 2014-08-13 17:04:24 +02:00
Tomasz Buchert e8623fdc91 introducing OVSBridge 2014-08-13 16:55:00 +02:00
Gregory Gee 06dbd774a1 Update to MiniEdit 2.1.0.9
Includes some big fixes and new feature to run user defined command during
node start and stop.
2014-08-07 22:35:45 -04:00
Brian O'Connor a280501ff1 Merge branch 'master' into nat
Conflicts:
	mininet/net.py
	mininet/node.py
2014-08-07 13:40:14 -07:00
cody burkard 891a9e8bdf fixed syntax error 2014-08-06 17:52:40 -07:00
cody burkard 7ae39fffc2 stop using ONLAB OUI for generated mac addressses 2014-08-06 17:51:32 -07:00
lantz a56d9a6661 Merge pull request #344 from bentenshan/patch-1
fix Singleton.__call__ error
2014-08-04 16:18:38 -07:00
Brian O'Connor b0048c0aca Merge pull request #333 from mininet/devel/buildtopo
Clean up standard topologies to use build
2014-08-03 21:47:10 -07:00
lip.z 0983ed29bb fix Singleton.__call__ error
fix Singleton.__call__ error
2014-08-02 20:18:06 +08:00
cody burkard 88763cfbe1 removed more unnecessary ifconfigs 2014-08-01 13:22:02 -07:00
cody burkard 19dd7f70c1 switched back to node.cmd for OVS commands. this is faster.. 2014-08-01 12:18:50 -07:00
cody burkard 42cdda38bb added some documentation 2014-08-01 11:27:25 -07:00
cody burkard f0fd84770a Merge branch 'devel/startup' of github.com:cdburkard/mininet into devel/startup 2014-08-01 11:00:58 -07:00
cody burkard a2d0ea78be fixed issue with regex matching 2014-08-01 11:00:08 -07:00
cody burkard e9d034bd31 adding old changes 2014-08-01 11:00:07 -07:00
cody burkard a3d51b77e9 few small fixes to syntax errors 2014-08-01 11:00:07 -07:00
cody burkard 4b65110e4d removed comments and cleaned up code. 2014-08-01 11:00:07 -07:00
cody burkard eba13f0ca8 removed many of the commands being run to maximize startup performance 2014-08-01 11:00:07 -07:00
cody burkard c1934706bb testing link stuff 2014-08-01 11:00:07 -07:00
Brian O'Connor f67a7b64c8 Merge pull request #322 from mininet/devel/pty
Attach a pty to each node's bash process
2014-07-31 18:36:35 -07:00
Brian O'Connor 628e84068e Reverting the disable signals change 2014-07-31 18:27:57 -07:00
Brian O'Connor 78a32e93fd Merge branch 'master' into devel/pty 2014-07-31 18:23:19 -07:00
cody burkard 859bfea502 fixed issue with regex matching 2014-07-25 03:41:13 -07:00
cody burkard 2973798ca1 Merge branch 'devel/pty' of github.com:mininet/mininet into startup 2014-07-24 16:31:10 -07:00
cody burkard b9a15f071c adding old changes 2014-07-24 16:30:48 -07:00
cody burkard f11dbe81d2 few small fixes to syntax errors 2014-07-24 15:59:38 -07:00
cody burkard 6bc9d68485 removed comments and cleaned up code. 2014-07-22 23:00:43 -07:00
cody burkard 5cd6b553a5 removed many of the commands being run to maximize startup performance 2014-07-22 19:27:45 -07:00
cody burkard 5b13dc62ce Merge branch 'master' of git://github.com/mininet/mininet into devel/startup 2014-07-19 02:09:03 -07:00
cody burkard 4d381f0b58 testing link stuff 2014-07-19 02:05:37 -07:00
Gregory Gee 84ce84f501 Add parameter to set protocol list in OVSSwitch. Allows setting OpenFlow version.
s2 = net.addSwitch( 's2', protocols='OpenFlow13' )
2014-07-18 22:10:03 -04:00
Bob Lantz 5b0897701b Merge branch 'cdburkard-devel/defaultController' 2014-07-16 10:25:37 -07:00
Bob Lantz 5465246245 Merge branch 'devel/defaultController' of https://github.com/cdburkard/mininet into cdburkard-devel/defaultController
Conflicts:
	bin/mn
	mininet/net.py
2014-07-16 10:24:35 -07:00
Bob Lantz e183e69997 Check for Controller type using isinstance() 2014-07-16 09:57:48 -07:00
Cody Burkard 779ea5f0ad removed bookmark 2014-07-15 19:39:50 -07:00
Cody Burkard 00d1963484 revised comment on defaultController function 2014-07-15 18:21:56 -07:00
Cody Burkard 5ac3cde2bd restructured defaultController into a function 2014-07-15 15:48:18 -07:00
Bob Lantz 2a08dec648 Hack to avoid failing version check... ;-/ 2014-07-15 08:50:30 -07:00
Bob Lantz b7268856d7 Tolerate passing controller *objects* into Mininet() 2014-07-15 08:28:05 -07:00
Bob Lantz 1b2c7a3193 Clean up standard topologies to use build 2014-07-15 05:58:10 -07:00
Bob Lantz b5962e8ee9 Added TorusTopo, a 2D torus topology 2014-07-15 05:44:13 -07:00
Bob Lantz ece509d579 add connected() to LinuxBridge 2014-07-15 05:34:32 -07:00
Bob Lantz 2935000485 Add utopic/Ubuntu 14.10 2014-07-15 04:32:52 -07:00
Bob Lantz 708b184397 Don't remove items from a list we're iterating over 2014-07-15 01:29:09 -07:00
Brian O'Connor 9a11544d87 Merge pull request #332 from cdburkard/patches/fix_linear5
adding waitConnected to linear5 test
2014-07-14 16:12:43 -07:00
lantz 2451d757bd Merge pull request #318 from cdburkard/patches/hifi_fix
added support in iperf for different result formats.
2014-07-14 15:20:11 -07:00
Cody Burkard ea97dea902 adding waitConnected to linear5 test 2014-07-14 14:42:00 -07:00
Cody Burkard a19cc91537 set DefaultController as the mininet class default 2014-07-14 14:09:39 -07:00
Cody Burkard 796b281bf1 fixed command parameter 2014-07-14 13:09:41 -07:00
Cody Burkard 72fd120dc8 added default controller class 2014-07-11 19:04:20 -07:00
Bob Lantz 4794871a9a Change algorithm slightly and print progress 2014-07-10 13:40:21 -07:00
Bob Lantz 13d25b4109 Minor message changes 2014-07-10 12:44:49 -07:00
lantz 21b50c962e Merge pull request #325 from cdburkard/patches/userspace_connect
added waitConnected attribute to mininet class
2014-07-14 13:46:07 -07:00
Brian O'Connor 54b29af818 Merge pull request #327 from mininet/devel/nodelib
Devel/nodelib
2014-07-11 17:02:18 -07:00
Brian O'Connor 8f34fa4c88 Merge pull request #326 from cdburkard/patches/nets
Switched shutdown order to kill controller first
2014-07-11 17:01:43 -07:00
lantz 872e336462 Merge pull request #328 from mininet/devel/newtopo
Add build() method to simplify Topo() usage
2014-07-11 16:27:49 -07:00
Cody Burkard b7a112cbec Shutting down controller first 2014-07-10 11:24:58 -07:00
Cody Burkard 5a9c74be03 fixed last commit 2014-07-10 11:07:50 -07:00
Bob Lantz 38addf2e24 Add alias + switch: { 'ovs': OVSSwitch, 'lxbr': LinuxBridge } 2014-07-10 01:34:53 -07:00
Bob Lantz 3878c000fe Add nodelib.py, a library of new node types 2014-07-10 00:44:53 -07:00
Bob Lantz 1324ae6262 Add build() method to simplify Topo() usage 2014-07-09 21:37:47 -07:00
Cody Burkard 3a52ad2f53 fixed linearbandwidth and waitconnected 2014-07-09 19:24:22 -07:00
Cody Burkard c23c992f14 fixed waitConnected performance and moved waitConnected call to mn.start 2014-07-09 19:12:15 -07:00
Cody Burkard 73f477be9d added waitConnect to linearbandwidth example. 2014-07-09 19:12:15 -07:00
Cody Burkard 4797b42005 conforming to style, and fixing documentation 2014-07-09 19:12:15 -07:00
Cody Burkard 6845fd8339 added documentation for waitConnected timeout 2014-07-09 19:12:15 -07:00
Cody Burkard 8e2443ada4 improved waitConnected algorithm and set default wait time to wait forever 2014-07-09 19:12:15 -07:00
Cody Burkard 84ea8d7f90 added waitConnected attribute to mininet class 2014-07-09 19:12:15 -07:00
Cody Burkard 1aed2b8abd Merge remote-tracking branch 'upstream/master' 2014-07-09 19:07:29 -07:00
Brian O'Connor 191df1cb73 Adding listen socket to UserSwitch when there is no listenPort set 2014-07-09 17:47:25 -07:00
Cody Burkard b6be1e2810 Merge branch 'patches/cleanup' 2014-07-08 17:57:10 -07:00
Cody Burkard a1acfa89c2 set default iperf formatting to none 2014-07-08 17:23:35 -07:00
Cody Burkard 93ddd92662 Revert "fixed default iperf formatting behavior"
This reverts commit 0e733c7754.
2014-07-08 16:55:50 -07:00
Cody Burkard 3131c90344 rolled back to iperf format option, and changed 'cpu' variable to 'pct' 2014-07-08 16:53:45 -07:00
lantz 3b484491ce Merge pull request #315 from cdburkard/patches/fix_bindpy
Added support for mount namespaces in bind.py
2014-07-08 16:27:06 -07:00
Bob Lantz 3b24bd7abd Restore non-mnexec pid detection for background commands 2014-07-08 02:22:02 -07:00
Bob Lantz e9013d761f Fix pid regex to eat \r\n 2014-07-07 21:58:30 -07:00
Bob Lantz c49b216c1f Set default printPid back to True 2014-07-07 21:55:34 -07:00
Bob Lantz 16ddf6560a Fix findPid since pty uses \r\n as line ending 2014-07-07 21:51:07 -07:00
Cody Burkard 0e733c7754 fixed default iperf formatting behavior 2014-07-02 13:07:57 -07:00
Cody Burkard 9c3ecfe338 conforming to mininet style 2014-07-02 10:53:41 -07:00
Bob Lantz 771850b9cf Possibly faster check for sentinel. 2014-07-01 18:04:44 -07:00
Bob Lantz 355696f3dd Don't set self.waiting twice 2014-07-01 17:55:14 -07:00
Cody Burkard 342b743b13 set staticArp in testLinkDelay 2014-07-01 17:07:14 -07:00
Cody Burkard 40a4a25dd8 use a single mininet instance in bindpy 2014-07-01 14:51:07 -07:00
lantz 25979e715e Merge pull request #317 from cdburkard/patches/cleanup
added code to kill stale mininet processes
2014-07-01 13:32:58 -07:00
Bob Lantz 82e0e9f38f Avoid overhead of another process (env) in startShell() 2014-07-01 01:49:10 -07:00
Bob Lantz 549f1ebc8f Attach a pty to each node's bash process
This should enable node commands that are expecting a tty to
behave better.
2014-06-27 16:41:54 -07:00
Bob Lantz 00803bcd7f Whitespace changes in OVSSwitch. 2014-06-27 13:05:10 -07:00
Cody Burkard af2f67d98c added documentation for HostWithPrivateDirs 2014-06-26 09:29:06 -07:00
Cody Burkard 752c2d6e7c mountprivatedirs is no longer needed 2014-06-20 23:54:18 -07:00
Cody Burkard 3c3344e1f5 imported check_output 2014-06-20 23:31:45 -07:00
Brian O'Connor 68e2e45f7d Merge pull request #316 from cdburkard:patches/fix_remote_ip
fixed netParse bug that caused mininet crash when no ip prefix was specified
2014-06-19 16:28:09 -07:00
Cody Burkard 6a81b6dfb3 added persistence option to HostWithPrivateDirs. also attached mount namespaces when mnexec -a is specified 2014-06-19 15:08:26 -07:00
Cody Burkard 4e76439c79 added support in iperf for different result formats. also added upper bounds for hifi tests 2014-06-16 23:33:38 -07:00
Cody Burkard 0d39f11034 added code to kill stale mininet processes 2014-06-16 17:39:24 -07:00
Brian O'Connor 893cf61c21 Merge pull request #313 from cdburkard/master
ovs port numbering bug fix
2014-06-11 16:17:14 -07:00
Cody Burkard ebc1eae679 Merge branch 'patches/fix_bindpy' of https://github.com/cdburkard/mininet into patches/fix_bindpy 2014-06-11 03:26:45 -07:00
Cody Burkard 29e5bee34e fixed issue with AssertTrue and skip first test if using old OVS version 2014-06-10 22:15:49 -07:00
Cody Burkard de41192ea7 imported warn from mininet.log 2014-06-10 21:50:40 -07:00
Cody Burkard b3055067ac fixed netParse bug that caused mininet crash when no ip prefix was specified 2014-06-10 18:38:10 -07:00
Cody Burkard 9109233886 Added support for mount namespaces in bind.py. Also moved it to the node class as a host type. 2014-06-10 11:44:03 -07:00
Brian O'Connor e49c9d2600 build.py: making ovf generation more generic 2014-06-06 21:21:13 -07:00
Cody 87b6021428 restructured code and added a test for the numberedports.py example 2014-05-29 17:26:40 -07:00
Cody 50f5080912 corrected code 2014-05-29 11:52:56 -07:00
Cody 3641723193 explaining test 2014-05-29 11:11:12 -07:00
Brian O'Connor 8b215af818 slight refactoring of util/vm/build.py to make it more extensible 2014-05-28 22:22:20 -07:00
Cody 586a9bb631 adding example to test functionality of port numbering 2014-05-28 17:46:19 -07:00
lantz 00c3238e50 Merge pull request #310 from rlane/ivs-verbose
IVSSwitch: add an option to control the --verbose flag
2014-05-28 14:31:45 -07:00
lantz e07775c7c3 Merge pull request #309 from rlane/ivs-batch-shutdown
support batch shutdown for IVS
2014-05-28 14:31:34 -07:00
Cody 4579b303e6 conforming to mininet python style 2014-05-28 13:46:55 -07:00
Cody 32d3c2bc79 removing debugging messages 2014-05-28 12:56:24 -07:00
Cody ba43451bd6 rearranged code for elegance 2014-05-28 12:42:48 -07:00
Cody f1e42ba5fa adding ovs version detection to fix port numbering bug 2014-05-28 11:50:13 -07:00
Rich Lane 163a66c64c IVSSwitch: add an option to control the --verbose flag 2014-05-22 13:06:57 -07:00
Rich Lane 876e66e555 net: allow batch shutdown of multiple types of switches
Each switch class will be called to shutdown its own instances.
2014-05-22 12:36:07 -07:00
Rich Lane 93cd5583eb IVSSwitch: support batch shutdown
Not a single command like the OVS one, but it still greatly decreases the
shutdown time.

This does assume that stop() is called after batchShutdown(), which is true in
the current mininet code.
2014-05-22 12:22:41 -07:00
lantz 5797f5852e Merge pull request #303 from jhall11/pingall
Add a timeout parameter to the pingAll command
2014-05-07 13:31:44 -07:00
lantz 15d2d76972 Merge pull request #305 from ggee/ovsssl
OVS switch connect to controllers using protocols other than TCP like SSL.
2014-05-07 13:29:39 -07:00
Gregory Gee 5cb4a5424d Add ability for for OVS switch start connect to controllers using protocols other than TCP.
net.addController( 'c0', protocol='ssl' )

This now allows OVS to connect to a controller using SSL.  The default of protocol is 'tcp'
as it currently is.
2014-05-03 16:21:53 -04:00
Jon Hall 4d1a9cdc1d Add a timeout parameter to the pingAll command 2014-04-25 04:37:11 +00:00
Bob Lantz c3bf407adf Added Ubuntu 14.04. 2014-04-23 14:28:09 -07:00
lantz 14e14f1b87 Merge pull request #286 from lantz/devel/ovsbatch
Enable batch startup/shutdown of OVS

Not perfect, but it moves us forward at least.
2014-04-13 18:44:11 -07:00
lantz bffe045267 Merge pull request #290 from backb1/patch/netstatnumeric
Netstat: do not resolve addresses
2014-04-01 11:50:51 -07:00
lantz 92a28881b1 Update net.py 2014-04-01 11:46:52 -07:00
lantz ebac6784d4 Merge pull request #293 from backb1/patch/pingloss
Ping: packet loss should be a float
2014-04-01 11:45:06 -07:00
Adrian d9376439b1 Ping: packet loss should be a float 2014-03-26 13:37:32 +01:00
lantz d718bb72e9 Merge pull request #257 from ggee/miniedit21071
Uploading MiniEdit 2.1.0.7.1
2014-03-21 13:02:35 -07:00
lantz 40ea9172f9 Merge pull request #283 from ggee/ovs2install
OVS install Ubuntu packages
2014-03-21 13:00:48 -07:00
lantz 787f8234ce Merge pull request #289 from rlane/ivs-wait
IVSSwitch: wait for ivs to terminate before tearing down node
2014-03-20 18:33:07 -07:00
lantz cc20908bb3 Merge pull request #288 from rlane/history
persistent command history
2014-03-20 18:26:55 -07:00
Rich Lane a7eb557680 IVSSwitch: wait for ivs to terminate before tearing down node
This was a problem when running IVS in a container. IVS would begin the process
of closing controller connections on receiving SIGTERM, but often mininet would
have continued on and removed the control network interface from the container
before it could send the FIN. The controller wouldn't know the connection had
been closed until it timed out much later.
2014-03-18 11:04:14 -07:00
Bob Lantz 0fe73a6780 build=False is unnecessary if topo=None, which is the default 2014-03-16 05:20:43 -07:00
Rich Lane a905be2260 persistent command history
Saves readline history to ~/.mininet_history.
2014-03-15 10:46:07 -07:00
lantz 8f5f38c6a5 Merge pull request #246 from rlane/newns
(pending) mnexec: mount sysfs in each container
2014-03-14 17:30:32 -07:00
Bob Lantz d82900d3a8 Don't look through all interfaces if you don't need to. 2014-03-06 17:52:41 -08:00
Gregory Gee e62715870a Update to 2.1.0.8.1. Include a fix to work around Mininet version number
checking with non-numeric characters.
2014-02-28 22:23:27 -05:00
Bob Lantz 2e19ceb0aa Use a single ovs-vsctl command for speed/atomicity 2014-02-28 18:45:41 -08:00
Bob Lantz a0bc100289 Enable batch shutdown for OVS. 2014-02-28 18:45:41 -08:00
Bob Lantz 5e60ee266b assertTrue( a > b ) -> assertGreater( a, b ) for better messages 2014-02-28 18:41:41 -08:00
Bob Lantz 7c29c2ebf2 Fix IVS build 2014-02-28 14:56:08 -08:00
Gregory Gee 4b7b23cf20 Change the installation to a separate option as recommended with -V.
This argument expect a parameter which is the version number of OVS you wish to install.
    install.sh -V 2.0.0

    What is nice that I tested, is that you can keep running the above to change
    which OVS version you want to test with.  Also, if a new version of OVS
    is released, just run the above again specifying the new version number.

    The version number must match the version number in the tarball file name
    like openvswitch-2.0.0.tar.gz.  In this case, the version specified
    must be 2.0.0.
2014-02-25 23:15:03 -05:00
Bob Lantz 2dee3413cf Remove Ubuntu 10 and Debian Lenny and add Debian Wheezy support 2014-02-25 16:49:33 -08:00
Gregory Gee 59cbec3fc9 Update to 2.1.0.8 2014-02-23 18:30:04 -08:00
Bob Lantz 3e2eb71316 Fix default of in-band control for OVS.
fixes #279
2014-02-17 00:23:10 -08:00
Bob Lantz 06115a0456 Add support for batch shutdown of OVS switches.
This saves about 10 seconds for a 200 switch network.
2014-02-06 17:56:32 -08:00
Bob Lantz 9cf9b7b223 Clean things up slightly. 2014-02-06 17:50:09 -08:00
Bob Lantz 1fda4865c8 Try batch deleting OVS instances. 2014-02-06 15:51:24 -08:00
Bob Lantz f0e55e1096 Remove mn links with dots in them (e.g. foo_bar-baz1.2-eth0) 2014-02-06 15:33:11 -08:00
Bob Lantz 74c71bc8a4 Minor tweak of return value. 2014-02-03 17:55:25 -08:00
Bob Lantz 0b5609f587 Check (and canonicalize) dpid arguments to Switch()
This seems slightly ugly, but it has bitten many people.

Closes #268
2014-02-03 17:52:51 -08:00
moijes12 2fc5e46f1b Update test_switchdpidassignment.py 2014-01-30 23:41:46 +05:30
lantz ef6774325a Merge pull request #258 from ggee/MininetINSTALL
Add notes about specific release branches.
2014-01-29 17:05:24 -08:00
lantz 7450cfc627 Merge pull request #263 from adferguson/clean-fix
adjust regex for finding mininet's links during cleanup
2014-01-29 17:03:37 -08:00
Bob Lantz 29988c8b1d Canonicalize dpid by removing colons and padding with zeros
closes #268
2014-01-29 16:54:25 -08:00
lantz 34bb64eddd Merge pull request #249 from yeasy/master
Close the file when done with it.
2014-01-28 15:24:24 -08:00
lantz 873049c346 Merge pull request #252 from sieben/useless_parenthesis
fixup: useless_parenthesis
2014-01-28 15:22:53 -08:00
lantz a722a3a110 Update test_simpleperf.py
Add spaces.
2014-01-28 15:21:48 -08:00
lantz f2942a7f92 Merge pull request #253 from sieben/Simplify_chained_comparaison
OK...
2014-01-28 15:20:29 -08:00
lantz ae367d3645 Merge pull request #266 from adferguson/if_namesize
print error messages when making interfaces
2014-01-28 15:16:19 -08:00
lantz 6022e96b4d Merge pull request #269 from adferguson/userspace_unix
userspace switch can be reached on unix port by dpctl
2014-01-28 15:14:30 -08:00
Bob Lantz 2286ef4b36 Remove GRUB_TERMINAL=serial from /etc/default/grub
This is added because we install Ubuntu from a serial console.
Fixes #265
2014-01-24 15:44:49 -08:00
Andrew Ferguson 0dd96ebc57 userspace switch can be reached on unix port by dpctl 2014-01-24 16:59:42 -05:00
Bob 06b99c8ef2 Merge pull request #264 from adferguson/tc-no_opt-fix
don't crash when link is TCLink but without options
2014-01-24 12:43:50 -08:00
Bob b357a212dd Merge pull request #254 from sieben/unresolved_references
fixup: unresolved_references
2014-01-24 12:41:14 -08:00
Andrew Ferguson 2e704f996b print error messages when making interfaces
without this, thereis no indication in Mininet that creating an
interface has failed. for example, this may happen when the interface
name is too long (longer than IFNAMSIZ, which is 16 chars).
2014-01-23 16:39:27 -05:00
Andrew Ferguson 284547080c don't crash when link is TCLink but without options
caused by optimized return in link.py#275 in TCIntf.config()
2014-01-20 17:45:30 -05:00
Andrew Ferguson 07e3da08d0 adjust regex for finding mininet's links during cleanup
link names of the form "a-b-ethN" were previously interpreted
as "b-ethN". this change accepts link names with a dash, and
requires N to only contain digits.
2014-01-19 18:33:27 -05:00
Bob Lantz dfd79bde56 Add OperatingSystemSection to OVF template
should facilitate importing 64-bit image
2014-01-15 10:47:06 -08:00
Bob Lantz 317d6482e4 Fix typo/minor error. 2014-01-14 20:26:40 -08:00
Bob Lantz 5f51abd142 Allow -b to specify install or test branch 2014-01-14 20:08:22 -08:00
Bob Lantz b9288efc4a Allow specification of branch to install 2014-01-14 19:42:55 -08:00
Bob Lantz c90fb34d6d If specified, add Branch to build dir name 2014-01-13 23:35:15 -08:00
Bob Lantz 75abd94bf5 Add #streamOptimized to fix .ovf for VirtualBox 4.3.2
fixes #261
2014-01-10 18:07:08 -08:00
Bob Lantz 55e48112f8 Remove trailing spaces 2014-01-10 18:06:29 -08:00
Gregory Gee 4b65570ba5 Add notes about specific release branches. 2014-01-02 21:54:56 -05:00
Gregory Gee 9aefda7c1a Uploading MiniEdit 2.1.0.7.1
Many changes since master version.
- save/load topologies
- host, controller, switch and link properties
- link actions to set status up/down
2014-01-02 21:40:46 -05:00
Baohua Yang bb485009c3 Merge branch 'master' of github.com:yeasy/mininet 2013-12-21 21:42:31 +08:00
Baohua Yang 24fe68d925 Correct the comments of do_pingallfull() and do_iperfudp() 2013-12-21 21:36:24 +08:00
Baohua Yang 3780d9cda8 Close the file when done with it. 2013-12-21 21:36:22 +08:00
Rémy Léone e10703cd7b fixup: unresolved_references 2013-12-20 14:46:38 +01:00
Rémy Léone 824afb84c9 fixup: useless_parenthesis 2013-12-20 14:43:30 +01:00
Rémy Léone aee33863c8 fixup: Simplify_chained_comparaison 2013-12-20 14:41:22 +01:00
Baohua Yang 90c29d8f23 Merge branch 'master' of github.com:yeasy/mininet 2013-12-16 10:33:12 +08:00
Baohua Yang e686911210 Correct the comments of do_pingallfull() and do_iperfudp() 2013-12-16 10:31:54 +08:00
Baohua Yang 8bb830824b Close the file when done with it. 2013-12-16 10:31:51 +08:00
Bob a6a0cb4331 Merge pull request #250 from rlane/killpg
kill entire process group in Node.terminate
2013-12-14 12:36:32 -08:00
Rich Lane 2200d8d173 node: kill entire process group in terminate
mnexec already puts the shell into its own process group. Killing the entire
process group cleans up after any background processes the user left running.
2013-12-14 11:12:46 -08:00
backb1 c34a000e78 Do not resolve addresses 2013-12-14 16:11:33 +01:00
Brian O'Connor fb51cdaca3 adding output file to build.py 2013-12-12 18:38:20 -08:00
Brian O'Connor 50423936b2 Merge branch 'master' of github.com:mininet/mininet 2013-12-12 15:56:41 -08:00
Brian O'Connor 49994c8915 adding noneTest to Mininet vm build script 2013-12-12 15:38:45 -08:00
Bob Lantz 17dbc7e055 Minor codecheck fixes 2013-12-11 18:33:54 -08:00
Bob Lantz 312c386cda Fix regex to support Mininet 20.30.40+++ 2013-12-11 18:29:58 -08:00
Bob Lantz 96952b92f8 2.1.0 -> 2.1.0+ 2013-12-11 18:08:33 -08:00
Baohua Yang 3e2333e5ed Correct the comments of do_pingallfull() and do_iperfudp() 2013-12-11 15:19:24 +08:00
Baohua Yang fc7c919b43 Close the file when done with it. 2013-12-11 14:41:21 +08:00
Brian O'Connor c7e86f9374 fixing CLI host rewriting when host's default interface does not have an IP 2013-12-05 17:30:09 -08:00
Bob Lantz 5da9376222 Depend: add dnsmasq (needed), remove landscape-client (not) 2013-11-20 22:15:26 -08:00
Rich Lane 5461565945 mnexec: mount sysfs in each container
The sysfs filesystem is [tagged][1] with a set of namespaces when mounted, taken
from the mounting process. Among other things, this controls which network
devices will show up in /sys/class/net and /sys/class/net/bonding_masters.

Without this change, mininet will not mount sysfs in a node. Attempting to
configure a bond interface in a node will only affect the parent namespace.

This change mounts a new sysfs filesystem in each node. To prevent this mount
from affecting the parent namespace the mount namespace is also unshared.

[1]: https://www.kernel.org/doc/Documentation/filesystems/sysfs-tagging.txt
2013-11-18 17:05:09 -08:00
Bob bee06cf264 Merge pull request #245 from yeasy/master
Fix error wiki url.
2013-11-15 13:23:10 -08:00
Baohua Yang cd238fe567 Fix error wiki url. 2013-11-15 14:24:51 +08:00
moijes12 09b06509a8 Create test_switchdpidassignment.py
Regression tests to verify switch datapath ID assignment.
2013-11-07 09:49:36 -08:00
Bob Lantz e771239608 Only restart network-manager if we've changed config 2013-10-24 15:11:43 -07:00
Brian O'Connor e0af160213 small fixes for NAT 2013-10-23 13:48:50 -07:00
Bob e5380d646c Merge pull request #226 from rlane/ivs-lo
IVSSwitch: bring up lo interface
ok for symmetry - we can probably get rid of this later though
2013-10-15 15:22:21 -07:00
Bob 621c3eebf3 Merge pull request #218 from jpoliv/master
Fixes a couple of compiler warnings
2013-10-15 15:20:53 -07:00
Rich Lane 4a94f76ec3 IVSSwitch: bring up lo interface 2013-10-08 16:59:02 -07:00
Bob c0ddd5c5d8 Merge pull request #225 from fcappi/master
Update Oflops repository in install.sh
2013-10-08 12:42:19 -07:00
Fernando Cappi a6e55e3528 Update Oflops repository in install.sh 2013-10-05 22:49:15 -03:00
Brian O'Connor ffeb16eb66 fixing --nat option in mn 2013-10-03 16:29:05 -07:00
Brian O'Connor a802d8b19a more NAT cleanup of net and topo 2013-10-03 15:19:34 -07:00
Brian O'Connor 555d10dea7 adding internet / nat example 2013-10-03 15:15:40 -07:00
Brian O'Connor 3f2355a36a undoing gateway in net and removing addNAT helpers 2013-10-03 15:15:20 -07:00
Brian O'Connor bceb298edb Adding NAT class
Includes automatic NAT feature (mn --nat) and addNAT convenience method for topologies
fixes #111
2013-10-03 09:40:00 -07:00
Brian O'Connor 47b9466fad Adding NAT class
Includes automatic NAT feature (mn --nat) and addNAT convenience method for topologies
fixes #111
2013-10-03 09:39:40 -07:00
Jose Pedro Oliveira 8f80f875b5 Change cgroup() return type from int to void (avoids a gcc warning) 2013-09-28 01:42:05 +01:00
Jose Pedro Oliveira 2941bbae2d Defines _GNU_SOURCE (required by the unshare syscall) 2013-09-28 01:37:51 +01:00
Jose Pedro Oliveira 8842e450db Turns on gcc warnings (CFLAGS += -Wall -Wextra) 2013-09-28 01:36:02 +01:00
Jose Pedro Oliveira f5737aa3cc The header file limits.h was being included twice 2013-09-28 01:34:01 +01:00
Jose Pedro Oliveira b8fd3d2d8e Fixes compiler warning: control reaches end of non-void function 2013-09-19 15:26:26 +01:00
Jose Pedro Oliveira 387250cd83 Fixes compiler warning: implicit declaration of function 'isalnum' 2013-09-19 15:25:22 +01:00
Bob Lantz 433d83221a Fix typo 2013-09-19 04:12:04 -07:00
Bob Lantz 3151804cf8 Add option to set pexpect timeout 2013-09-19 02:02:03 -07:00
Bob Lantz f66e9af515 Update for 2.1.0 final packaging 2013-09-18 22:44:35 -07:00
Bob Lantz f92abd2ba5 Sync changelog (somewhat) with ubuntu packaging
Only differences are copyright and log message.
2013-09-18 22:41:17 -07:00
Bob Lantz 700c5bf5b5 Add date to ovf name 2013-09-18 21:39:09 -07:00
Bob Lantz 87c37bb182 Add jpoliv 2013-09-18 21:38:36 -07:00
Bob Lantz 9cc9a491a8 Avoid reverse DNS lookup 2013-09-18 20:53:54 -07:00
Bob Lantz 76a8a1637f Clean up sshd.py and its test so it works on VirtualBox 2013-09-18 20:48:22 -07:00
Bob Lantz 568f6424e5 Add --memory option for VM memory size (for large tests) 2013-09-18 18:49:21 -07:00
Bob f32a8f7ea0 Minor edits 2013-09-18 16:47:28 -07:00
Bob Lantz e0b50c8a70 Fix var name change 2013-09-18 00:04:20 -07:00
Bob Lantz 0294f5ec55 Add options to run commands before or after tests 2013-09-18 00:03:16 -07:00
Bob 53987e31aa Merge pull request #214 from zlim/mnexec-fix
mnexec: getopt bugfix
2013-09-18 13:06:58 -07:00
Bob Lantz f59858543c Fix walkthrough test path 2013-09-18 12:44:54 -07:00
Zi Shen Lim cae7be1a60 mnexec: getopt bugfix
getopt returns an 'int', so use change datatype of 'c' to match it.
Otherwise, 'c' may hold a value of 255 (0xff), and fail the comparison
with -1 (0xffffffff): while ((c = getopt(...)) != -1)

This bug was uncovered on Ubuntu 13.04 running on ARM, using
arm-linux-gnueabihf-gcc4.7.
2013-09-18 10:33:15 -07:00
Bob Lantz 4ccfe242e8 Remove extra expect (paste error) that broke bootAndRunTests() 2013-09-17 18:02:06 -07:00
Brian O'Connor 811963ad26 small additions to README 2013-09-17 15:51:46 -07:00
Brian O'Connor 41d932017b updated source install for Ubuntu in INSTALL 2013-09-17 15:51:46 -07:00
Bob Lantz 7a24407ecc Remove unneeded bc dependency
fixes #212
2013-09-17 17:31:21 -07:00
Brian O'Connor df68c211b5 Merge pull request #209 from jpoliv/master
Fedora 18+ installation notes
2013-09-17 16:38:24 -07:00
Bob Lantz 2ca1ea92ff Clarify log message 2013-09-17 15:56:09 -07:00
Bob Lantz 8f546d89b4 Backing out attempt to identify kernel binary format 2013-09-17 15:40:52 -07:00
Bob Lantz 6d3cb5bcd3 Add arch to vm name, and check kernel for boot arch 2013-09-17 14:50:41 -07:00
Bob Lantz ca5b0c56f0 setLogLevel('warning') to avoid test spam 2013-09-17 13:44:42 -07:00
Jose Pedro Oliveira 0d58b93a84 Fedora 18+ installation notes 2013-09-16 21:42:06 +01:00
Bob Lantz b7548e68a8 Add walkthrough test and log build exceptions 2013-09-16 11:22:26 -07:00
Bob Lantz 2f3e8c2bd3 Log failed test output. 2013-09-16 11:06:12 -07:00
Brian O'Connor fc2a8fd59a fixed git download for testRemoteController in test_walkthrough.py 2013-09-17 11:28:10 -07:00
Brian O'Connor 47b24beb6c Merge branch 'master' of github.com:mininet/mininet 2013-09-16 23:59:06 -07:00
Brian O'Connor 895ff6f452 adding runner to mininet/test, added test_walkthrough.py 2013-09-16 23:58:22 -07:00
Bob Lantz fce7f5c56b Add --zip option to archive VM. 2013-09-16 07:45:32 -07:00
Bob b5e8dd5edc Merge pull request #210 from rlane/ivs-opts
IVSSwitch: support opts constructor parameter
2013-09-16 14:22:18 -07:00
Rich Lane d4fabc0464 IVSSwitch: support opts constructor parameter
This parameter is already supported by the other switch classes.
2013-09-16 13:33:38 -07:00
Brian O'Connor 971d6aafd4 Merge pull request #208 from jpoliv/master
install.sh: improve support for the Fedora linux distribution
2013-09-13 18:32:29 -07:00
Jose Pedro Oliveira 0457824193 Fedora: update status messages 2013-09-14 02:22:07 +01:00
Jose Pedro Oliveira 40ad3a1bf9 Replaces a couple of 'sudo apt-get install -y' instances by '$install' 2013-09-14 02:21:24 +01:00
Jose Pedro Oliveira de2680152b Fedora: support the -w option (wireshark) 2013-09-14 02:19:39 +01:00
Jose Pedro Oliveira 541ba67daf Fedora: support the -v option (OVS) 2013-09-14 02:18:04 +01:00
Brian O'Connor 6576d894a3 Merge branch 'master' of github.com:mininet/mininet 2013-09-13 13:06:49 -07:00
Brian O'Connor 8e1dade106 removing assert from util.py 2013-09-13 13:06:21 -07:00
Bob 2ebdd028cf Merge pull request #194 from jpoliv/master
Make install.sh (-n) work in Fedora 19
2013-09-13 12:40:08 -07:00
Jose Pedro Oliveira b5a48f9f6c Merge branch 'master' of https://github.com/mininet/mininet
Conflicts:
	mininet/node.py -- revert our change; better solution upstream
	util/install.sh -- resolved the conflict (echo statement)
2013-09-13 04:05:47 +01:00
Bob d70ca981c9 Update README.md 2013-09-12 14:23:19 -07:00
Bob 4b719d7443 Minor cosmetic edits 2013-09-12 14:21:20 -07:00
Bob Lantz 5b9f6b2192 Added .md to README so that it displays nicely on github. 2013-09-12 14:16:58 -07:00
Bob Lantz 4e242e9211 Add -v so that we can see exampletest results 2013-09-12 14:14:55 -07:00
Bob 94f3c76039 Merge pull request #207 from mininet/devel/exampletest
Added tests for all non-X11 examples
2013-09-12 14:14:14 -07:00
Brian O'Connor 67a7c5601a Merge branch 'master' of github.com:mininet/mininet 2013-09-12 13:49:45 -07:00
Brian O'Connor 4ea0c0936d Updated mininet/util.py to support better resource setting semantics and protected with try block 2013-09-12 13:49:40 -07:00
Bob Lantz 7bd9a79b12 Add --test {test} and --branch {branch} options, and exampletest 2013-09-11 22:59:50 -07:00
Brian O'Connor bfb560045c add rm to sshd tests 2013-09-11 14:45:49 -07:00
Brian O'Connor c5da46f125 added -quick options to skip long tests 2013-09-11 14:45:49 -07:00
Brian O'Connor 10fdd01dc8 fixed runner.py and added -v and -quick options 2013-09-11 14:45:48 -07:00
Brian O'Connor 1e9e781c12 changed 1% to 2% in test_limit.py 2013-09-11 14:45:48 -07:00
Brian O'Connor 24b38126ec cleaned up and commented test_simpleperf.py 2013-09-11 14:45:48 -07:00
Brian O'Connor 3577a6989d cleaned up and commented test_tree1024.py and test_treeping64.py 2013-09-11 14:45:48 -07:00
Brian O'Connor 48c49c54e2 cleaned up and commented test_sshd.py 2013-09-11 14:45:48 -07:00
Brian O'Connor d4993c0ba4 cleaned up and commented test_scratchnet.py 2013-09-11 14:45:48 -07:00
Brian O'Connor 213b7c57ee cleaned up and commented test_popen.py 2013-09-11 14:45:48 -07:00
Brian O'Connor b9b1f2e7f0 cleaned up and commented test_nat.py; added check for connectivity before running test 2013-09-11 14:45:48 -07:00
Brian O'Connor cdd5210bb7 cleaned up and commented test_multitest.py 2013-09-11 14:45:48 -07:00
Brian O'Connor bc90a79581 cleaned up and commented test_multipoll.py 2013-09-11 14:45:47 -07:00
Brian O'Connor e6e1260bc2 cleaned up and commented test_multiping.py 2013-09-11 14:45:47 -07:00
Brian O'Connor 1d555e724b cleaned up and commented test_linearbandwidth.py 2013-09-11 14:45:47 -07:00
Brian O'Connor e6fe480a30 cleaned up and commented test_limit.py 2013-09-11 14:45:47 -07:00
Brian O'Connor 91a06063b4 cleaned up and commented test_hwintf.py 2013-09-11 14:45:47 -07:00
Brian O'Connor 49fc496c12 cleaned up and commented test_emptynet.py 2013-09-11 14:45:47 -07:00
Brian O'Connor 94abeeabb9 cleaned up and commented test_cpu.py 2013-09-11 14:45:47 -07:00
Brian O'Connor b7e506341f cleaned up and commented test_controlnet.py 2013-09-11 14:45:47 -07:00
Brian O'Connor fba3fd81fa cleaned up and commented test_controllers.py 2013-09-11 14:45:47 -07:00
Brian O'Connor e875c0de26 minor test cleanup 2013-09-11 14:45:47 -07:00
Brian O'Connor 43f058df6d cleaned up and commented test_bind.py; added one new test 2013-09-11 14:45:46 -07:00
Brian O'Connor 01c0ef0013 added comments to test_baresshd.py 2013-09-11 14:45:46 -07:00
Brian O'Connor a46fae0687 adding first draft of tests for all examples, they need comments and clean up, some could be made more rebust 2013-09-11 14:45:46 -07:00
Brian O'Connor 5a646a0d20 sshd.py: allow sshd args to be passed via commandline 2013-09-11 14:45:46 -07:00
Brian O'Connor 9a73dcad53 fixed print format in popenpoll 2013-09-11 14:45:46 -07:00
Brian O'Connor b605cf74d2 style in multitest 2013-09-11 14:45:46 -07:00
Brian O'Connor 220376b6e2 hwintf.py: allow intf to be specified in cmd line 2013-09-11 14:45:46 -07:00
Brian O'Connor cfb6bf95a3 adding commandline args to UserSwitch in controlnet, examples of partial 2013-09-11 14:45:46 -07:00
Brian O'Connor 3905843257 accept command line args in baresshd.py 2013-09-11 14:45:45 -07:00
Bob Lantz 501a164eba Added --test option to boot and test a VM 2013-09-11 12:00:17 -07:00
Bob Lantz 9e725cb28a Add 'mininet' prefix to output files 2013-09-11 12:00:17 -07:00
Bob Lantz e02cdc0c54 XML file cannot begin with a newline :( 2013-09-11 12:00:17 -07:00
Bob Lantz 0038720c01 Add generateOVF to finally create the OVF descriptor file! 2013-09-11 12:00:17 -07:00
Bob Lantz d4279559fa Add options; generate virtimage file (in progress) 2013-09-11 12:00:17 -07:00
Bob Lantz 1ea9d7d4de Update copyright for 2013 2013-09-11 12:00:17 -07:00
Bob Lantz f7abd084c6 Added socat, iperf, cgroup-bin to dependencies 2013-09-11 12:00:17 -07:00
Bob Lantz d82e0ef5c2 Add mtools to dependencies 2013-09-11 12:00:17 -07:00
Bob Lantz 3027856c7b Find wireshark dir using find (fix for 13.10) 2013-09-11 12:00:17 -07:00
Bob Lantz 9de7bd666d Minor additions and edits 2013-09-11 12:00:16 -07:00
Bob Lantz 92b51563b5 Remove extra ` 2013-09-11 12:00:16 -07:00
Brian O'Connor 389c7aa5af install.sh: making BUILD_DIR more robust 2013-09-11 12:00:16 -07:00
Brian O'Connor bda54a9aed updating INSTALL 2013-09-11 12:00:16 -07:00
Brian O'Connor 09b1239131 fixing comment 2013-09-11 12:00:16 -07:00
Bob Lantz 662f2447e3 Flush log file output to avoid slow buffering 2013-09-11 12:00:16 -07:00
Bob Lantz 20005f5bbc Add a space 2013-09-11 12:00:16 -07:00
Bob Lantz 803a1a5489 Write build log to file, and detect installation failure 2013-09-11 12:00:16 -07:00
Bob Lantz 20ba29590a Add 13.10 (won't work until final) 2013-09-11 12:00:16 -07:00
Bob Lantz 13554a3d83 Minor cleanup 2013-09-11 12:00:16 -07:00
Bob Lantz 9bfc7c7768 Satisfy pylint 2013-09-11 12:00:16 -07:00
Bob Lantz 045ef7b801 Add docstring to satisfy pylint 2013-09-11 12:00:15 -07:00
Bob Lantz e69355f78f One last code check fix: line too long 2013-09-11 12:00:15 -07:00
Bob Lantz 9d14c841d7 Pass code check 2013-09-11 12:00:15 -07:00
Bob Lantz f796f01f38 add spaces to satisfy pylint ;-p 2013-09-11 12:00:15 -07:00
Bob Lantz 350299786d code check fixes & add comment spaces 2013-09-11 12:00:15 -07:00
Bob Lantz 445c0959b5 Pass code check (except bogus Popen error) 2013-09-11 12:00:15 -07:00
Bob Lantz 0c5aae157a examples -> mininet/examples for code check 2013-09-11 12:00:15 -07:00
Brian O'Connor 2e7d0d4934 fixed indent issue with examples/controllers.py 2013-09-11 12:00:15 -07:00
Brian O'Connor e9a835ac55 print usage message for unknown command 2013-09-11 12:00:15 -07:00
Bob Lantz b55806017a Check for Connected in checkListening() 2013-09-11 12:00:15 -07:00
Bob Lantz b79ce2a549 Clarify actual testing in module comment 2013-09-11 12:00:14 -07:00
Bob Lantz a155795837 quetzal -> quantal 2013-09-11 12:00:14 -07:00
Brian O'Connor e935da461a added comments and cleaned up controlnet.py 2013-09-11 12:00:14 -07:00
Brian O'Connor 92bf2cf105 codecheck: removed unused variable in topo.py 2013-09-11 12:00:14 -07:00
Brian O'Connor 0840af5277 removing todos in net.py 2013-09-11 12:00:14 -07:00
Brian O'Connor 967614f64a adding examples/__init__.py 2013-09-11 12:00:14 -07:00
Brian O'Connor 891d807137 fixed multiping example 2013-09-11 12:00:14 -07:00
Brian O'Connor ecddbcf240 updated emptynet to use addLink 2013-09-11 12:00:14 -07:00
Brian O'Connor aacf7c4613 fixing controllers.py to use api 2013-09-11 12:00:14 -07:00
Brian O'Connor 3a35480c7a removing test from controlnet 2013-09-11 12:00:14 -07:00
Brian O'Connor 7c962d2f61 Fixed MininetFacade and moved main logic into run. First shot at "test" function 2013-09-11 12:00:13 -07:00
Brian O'Connor dc882d6905 clean up controlnet 2013-09-11 12:00:13 -07:00
Brian O'Connor 15146d900c changed CLI to MininetFacade; a great deal of logic also changed 2013-09-11 12:00:13 -07:00
Bob Lantz ad5a0e42d0 Explicitly create a qcow2 image 2013-09-11 12:00:13 -07:00
Bob Lantz a56e29704e Make sure that /bin/bash exists before attempting to chroot. 2013-09-11 12:00:13 -07:00
Bob Lantz f344290368 Change API for more efficient remount and unmount. 2013-09-11 12:00:13 -07:00
Bob Lantz 5ae8c936e7 Prototype implementation of bind mounts. 2013-09-11 12:00:13 -07:00
Bob Lantz 5413d2e5a3 Check for chroot dir and chroot if necessary. 2013-09-11 12:00:13 -07:00
Bob Lantz 226a1dc391 Minor edits 2013-09-11 12:00:13 -07:00
Bob Lantz ec810dd6db minor edits 2013-09-11 12:00:13 -07:00
Bob Lantz 5493212578 Add tests for OVS user switch (skipping hifi test for now)
test_hifi.py currently fails for OVS when datapath=user -
we should look at this and fix it.
2013-09-11 12:00:13 -07:00
Bob Lantz 45d365f98b Need a few more skipUnless() checks. 2013-09-11 12:00:12 -07:00
Bob Lantz 94324e3f46 Skip IVS and UserSwitch tests if they are not installed 2013-09-11 12:00:12 -07:00
Bob Lantz d2762938b7 Increase timeout (for lengthy hifi test) 2013-09-11 12:00:12 -07:00
Bob Lantz 765d126ee9 Delete leftover TAP interface from OVS with datapath=user
fixes #199
2013-09-11 12:00:12 -07:00
Bob Lantz 896c4cbccc Edits for 2.1.0 2013-09-11 12:00:12 -07:00
Bob Lantz 325074981c Initial text and version updates for 2.1.0 2013-09-11 12:00:12 -07:00
Bob Lantz b26f38a6aa Added CONTRIBUTORS file 2013-09-11 12:00:12 -07:00
Brian O'Connor d13505b6c6 updating setup to include examples 2013-08-26 15:29:05 -07:00
Bob Lantz 67f9d8f655 Remove qcow2 post conversion; drop unused etree dep 2013-08-26 11:46:25 -07:00
Bob Lantz c353e60913 correction: pexpect.timeout -> TIMEOUT 2013-08-25 18:06:22 -07:00
Bob Lantz 662fb712bc Detect failed iso download; begin virt-image support 2013-08-25 17:42:15 -07:00
Bob Lantz 28165f7b4e Check make test results 2013-08-25 16:27:43 -07:00
Bob Lantz dbcfda77d9 Update release URLS - should probably clean this up. 2013-08-25 15:51:56 -07:00
Bob Lantz 1dfa7776e1 Change to extract kernel and initrd 2013-08-25 15:25:04 -07:00
Bob Lantz 40a9c15345 Remove gigantic doxypy/texlive/fonts from install.sh -a
fixes #192
2013-08-25 13:55:50 -07:00
Bob Lantz 3dc3e066aa Update build directory name to include date. 2013-08-24 13:57:36 -07:00
Bob Lantz bbf808c347 Get rid of unused pexpect import. 2013-08-23 21:27:01 -07:00
Bob Lantz 4556e06fcf Fix erroneous tab hit before commit. 2013-08-23 21:25:07 -07:00
Bob Lantz f605a4e430 Works, more or less. 2013-08-23 20:33:25 -07:00
Bob Lantz fa1758b950 First draft of new world order (create build image from iso) 2013-08-23 17:26:46 -07:00
Bob Lantz 14903d6a05 Final gasp of cloud image version. 2013-08-22 18:40:10 -07:00
Jose Pedro Oliveira 5b08af2e8d Add a small notice about the Fedora's support. 2013-08-22 18:13:31 +01:00
Jose Pedro Oliveira 6cb05c3762 Make options -f and -b work in Fedora 19 2013-08-22 17:42:17 +01:00
Bob Lantz 94954177e5 Added support for creating a volume rather than a raw partition. 2013-08-21 21:18:11 -07:00
Jose Pedro Oliveira 3d89df13ef Handle Fedora's telnet output:
----------
*** c0 : ('echo A | telnet -e A 127.0.0.1 6633',)
telnet: connect to address 127.0.0.1: Connection refused
Telnet escape character is 'A'.
Trying 127.0.0.1...
Unable to contact the remote controller at 127.0.0.1:6633
----------
2013-08-22 00:57:14 +01:00
Jose Pedro Oliveira 15f2d240d6 Make install.sh support Fedora 19 (install.sh -n) 2013-08-22 00:47:30 +01:00
Bob Lantz 85dfac5c06 Many more improvements. 2013-08-20 13:31:15 -07:00
Bob Lantz 860bcc02c6 Minor changes and script evolution. 2013-08-20 13:31:15 -07:00
Bob Lantz 4daeeff0e3 Created first revision of VM build script. 2013-08-20 13:31:15 -07:00
Brian O'Connor 32de4c9e7c reverted iperf output and fixed regex 2013-08-16 11:16:28 -07:00
Brian O'Connor f0c123d4c0 fixing console.py graph parser 2013-08-15 19:06:31 -07:00
Brian O'Connor 8c22fe84c2 fixed iperf output parsing, changed to csv format
fixes #191
2013-08-15 18:54:07 -07:00
Brian O'Connor 9ff453a50b Changed iperf -sD to iperf -s &
fixes #190
2013-08-15 18:22:21 -07:00
Brian O'Connor 4e6b03d668 Merge pull request #188 from mininet/devel/fixlimits
Set sysctl limits when net starts
2013-08-14 17:30:43 -07:00
Brian O'Connor b635fd9edd Some cleanup and style fixes for fixlimits 2013-08-14 17:29:23 -07:00
Brian O'Connor a387952493 fixed host ip assignment and shutdown with xterms
fixes #189
2013-08-14 17:24:32 -07:00
Brian O'Connor 867a6d6731 Cleaned up sysctl and rlimit test and set
Use files instead of sysctl to set limits
2013-08-14 15:04:11 -07:00
Brian O'Connor b20c9470c7 add sysctl test and set
fixes #184
2013-08-12 16:22:19 -07:00
Brian O'Connor 7523c420bd Merge pull request #186 from mininet/devel/clifix
Replaced nodelist and nodemap in CLI with mn
2013-08-12 14:03:33 -07:00
Brian O'Connor 98cb33599f fixed comment in cli.py 2013-08-09 17:10:50 -07:00
Brian O'Connor 9281719d74 Made net compliant with dict semantics and added function comments
Fixed locals bug (now they are persisent across calls)
2013-08-09 17:07:39 -07:00
Brian O'Connor 8e04a9f844 Replaced nodelist and nodemap in CLI with mn
Updated Mininet to be more compliant with dict
Fixes #182
2013-08-09 12:20:13 -07:00
Brian O'Connor 6df4371df6 Removing test prints from user switch merge 2013-08-06 15:16:24 -07:00
Brian O'Connor be13072f0c Merge branch 'adf-userswitch-tclink' of github.com:adferguson/mininet into adferguson-adf-userswitch-tclink
Only sleep and reapply if slicing is enabled

Conflicts:
	mininet/node.py
2013-08-06 15:13:45 -07:00
Brian O'Connor 989df7454c Merge branch 'patches/examplesdoc' of github.com:ryancox/mininet into ryancox-patches/examplesdoc
Conflicts:
	examples/README
2013-08-05 18:13:37 -07:00
Brian O'Connor 7e87dbaa39 Fixed modprobe install. Checks to ensure that OVS_KMODS is set 2013-08-05 14:00:37 -07:00
Brian O'Connor 1e5cdfd805 Merge branch 'master' of github.com:mininet/mininet 2013-08-02 13:36:18 -07:00
Brian O'Connor bb0006b683 Merging MurphyMc LinearTopo pull request 2013-08-02 13:35:38 -07:00
Bob Lantz 786117dd49 Merge branch 'ivs' of https://github.com/rlane/mininet into rlane-ivs
Conflicts:
	util/install.sh

fixes #159
2013-07-31 18:20:18 -07:00
Brian O'Connor 43ba774e52 Merge pull request #181 from mininet/devel/ping
pingall now reports fraction received
2013-07-30 18:31:12 -07:00
Brian O'Connor f7439671bc pingall now reports fraction received
fixes #168
2013-07-30 18:28:38 -07:00
Brian O'Connor 48df51aa3b Merge branch 'notrace'
fixes #166
2013-07-30 18:15:56 -07:00
Brian O'Connor 4a77702473 Merge branch 'master' of github.com:mininet/mininet 2013-07-30 18:12:15 -07:00
Brian O'Connor 15c1a0e5e7 install.sh automatically detects wireshark version and installs correct version of of-dissector
fixes #180
2013-07-30 18:11:20 -07:00
Bob Lantz 9c4b734361 Fix indentation in LinearTopo() 2013-07-30 11:52:53 -07:00
Bob Lantz 5b48a7d92c Reimplemented and corrected Graph as MultiGraph
fixes #172
2013-07-30 11:51:32 -07:00
Brian O'Connor 4316be95c2 Prevent Mininet from crashing when display not set
fixes #173
2013-07-26 14:43:27 -07:00
Brian O'Connor 19bc1df15d fixed style error 2013-07-26 13:45:56 -07:00
Brian O'Connor bda2317d8b Catching exceptions thrown in mn 2013-07-25 19:27:06 -07:00
Brandon Heller 1f07530a54 install.sh: Fix break from version overrides missing, + annotate them
D'oh!  Next time test presence _and_ absense of an added env var.

OTOH, when people notice this quickly, it means they're using install.sh :-)
2013-07-24 06:01:30 +00:00
Brian O'Connor d5f5778492 Merge branch 'master' of github.com:mininet/mininet 2013-07-23 17:05:23 -07:00
Brian O'Connor 1ecc63dfec improved check for downed link in parsePingFull
fixes #176
2013-07-23 17:03:51 -07:00
Brian O'Connor 1e4e8b70d9 Merge pull request #174 from pantuza/master
Dynamic Network with Remote Controller example; Extended LinearTopo
2013-07-22 22:14:03 -07:00
Gustavo Pantuza Coelho Pinto e45cc16a90 Merge pull request #1 from bocon13/master
Simplified and refactored examples/dynamicnet.py
2013-07-21 12:53:37 -07:00
Brian O'Connor c26b4525aa Moving developer dependencies to separate function in install.sh
Developer dependencies are ~1GB
2013-07-19 16:17:16 -07:00
Brian O'Connor ea29d2b2cd Merge pull request #171 from vitalivanov/dev
Cleanup and cosmetic changes.
2013-07-19 16:07:15 -07:00
Brian O'Connor 5559a93d8a Merge pull request #170 from piyushs/cgroup-fix
Fix issue with mountCgroups not recognizing mounted cgroup
2013-07-19 16:04:48 -07:00
Brian O'Connor 921123155a Simplified and refactored examples/dynamicnet.py
Extended LinearTopo to support mulitple hosts per switch
2013-07-19 15:56:06 -07:00
Brandon Heller 2a1f2d59ee Merge pull request #175 from daviderickson/extensibility
Extensibility Improvements
2013-07-19 13:55:33 -07:00
David Erickson 3e70b01ec5 Enable OF 1.3 switch revision choice 2013-07-19 10:32:20 -07:00
David Erickson b55527739a Enable OF dissector revision choice 2013-07-19 10:29:53 -07:00
Gustavo Pantuza Coelho Pinto bf97d21c03 Added dynamicnet.py to README file of the examples 2013-07-18 18:42:10 -07:00
Gustavo Pantuza Coelho Pinto c554987912 Merge branch 'master' of github.com:pantuza/mininet 2013-07-18 18:34:21 -07:00
Gustavo Pantuza Coelho Pinto 6f09dedfad Dynamic network creation using a remote controller
The script builds a network topology based on command line
arguments and uses a remote controller
2013-07-18 18:32:08 -07:00
Rich Lane 0a54360211 IVSSwitch: support running IVS in a namespace
This change uses the `Node.cmd` method instead of `Popen`. The `cmd` method
sends the input to a shell which may be in another namespace (if --innamespace
is in use), while `Popen` would always run in the root namespace.
2013-07-18 17:50:52 -07:00
Rich Lane 5c24263779 clean: send SIGTERM before SIGKILL
IVS needs to be sent SIGTERM so it has a chance to clean up the kernel
datapath.
2013-07-18 13:50:20 -07:00
Vitaliy Ivanov 5b609ef9e2 Adding mininet doxygen installation dependencies.
Right now after installing mininet using util/install.sh there is a problem when try to generate doc:
	make doc
	doxygen doc/doxygen.cfg
	make: doxygen: Command not found
	make: *** [doc] Error 127
Adding doxygen, doxypy and texlive-fonts-recommended packages to fix the problem.
2013-07-15 14:20:16 +02:00
Vitaliy Ivanov 36bf8ac911 mnexec.c: substituting tabs with spaces. 2013-07-15 13:17:56 +03:00
Vitaliy Ivanov efe3877e3c Fixed mininet.org url in README.md.
s/http:\/\/openflow.org\/mininet/http:\/\/mininet.org/g
2013-07-15 13:17:19 +03:00
Piyush Srivastava 433ca2ecb6 Fix issue with mountCgroups not recognizing mounted cgroup
Changed mountCgroups to use the file /proc/mounts (instead of the
current case where it uses the less reliable
(http://www.mail-archive.com/lxc-devel@lists.sourceforge.net/msg00455.html)
/etc/mtab thorugh the mount program
2013-07-13 13:31:05 -07:00
Brian O'Connor fec98e2798 Added output line to ping that is closer to ping program output 2013-07-11 11:30:12 -07:00
Brian O'Connor c188bee3e3 Fixed divide by 0 error in ping command when no packets are sent
fixes #143
2013-07-11 11:17:46 -07:00
Rich Lane 0e2cc609df tests: run all tests with OVS, IVS, and userspace switches
Each switch gets its own class so that the test results are listed separately.
2013-07-10 11:19:25 -07:00
Brian O'Connor adf391fdec Fixed install.sh script to allow Mininet to be installed from any directory (not just ~/)
Fixes #94
2013-07-09 19:23:29 -07:00
Brian O'Connor 5d529edfb1 Removing unused import in mininet/link.py 2013-07-09 16:34:02 -07:00
Brian O'Connor 59eeeadbac Style changes in mininet/node.py and removing used import in mininet/link.py 2013-07-09 16:30:29 -07:00
Brian O'Connor 7265e2e88c Merge branch 'master' of github.com:mininet/mininet 2013-07-09 15:49:57 -07:00
Brian O'Connor 5c019d2aef CPULimitedHost cleanup() calls superclass method
fixes #161
2013-07-09 15:48:48 -07:00
Bob Lantz 679a3f1915 Don't stop data network controllers twice. 2013-07-09 14:34:37 -07:00
Rich Lane 60abb34497 clean: kill ivs processes 2013-07-09 08:36:36 -07:00
Rich Lane 94ff77f2f2 clean: don't wait forever for ovsdb
This could happen if OVS was installed but not running.
2013-07-09 08:34:33 -07:00
Bob Lantz e2eb95a29f Add $ to avoid h1 matching h10 2013-07-06 14:14:25 -07:00
Bob Lantz 10be691b86 Clean up intfs in root NS, and avoid deleting HW intfs
It appears that under certain conditions, such as when a
namespace exits, both ends of a veth pair may get dumped
into the root namespace. We therefore now remove an interface
both from its home namespace and from the root namespace.
2013-07-04 19:27:57 -07:00
Bob Lantz fcdb6d8a54 Remove unneeded line. 2013-07-04 00:45:08 -07:00
Bob Lantz 32502bbd1a Add controlnet.py example. 2013-07-04 00:41:30 -07:00
Rich Lane 71ffb0028e IVSSwitch: remove namespace warnings
IVS works fine using --innamespace.
2013-07-01 16:05:52 -07:00
Rich Lane 803c0a6e22 IVSSwitch: use ovs-ofctl for dpctl functionality 2013-06-29 18:11:15 -07:00
Rich Lane 8ee4aa6de4 install.sh: add support for IVS 2013-06-28 15:01:58 -07:00
Rich Lane 91261b2757 IVSSwitch: add support for dpctl
dpctl is not included with IVS. The user will need to obtain it from the
OpenFlow reference repository.
2013-06-27 17:56:46 -07:00
Rich Lane 812c91cc9e test_hifi: use SWITCH to pick the switch class 2013-06-27 14:50:59 -07:00
Rich Lane 27da832d6d add support for the IVS virtual switch
IVS is an open source virtual switch available for download at
https://github.com/floodlight/ivs. It uses the openvswitch
kernel module.
2013-06-27 14:50:59 -07:00
Bob Lantz aa554d985d Workaround: add default dpopts='--no-slicing' to UserSwitch
This disables slicing by default but fixes bandwidth limits.
Eventually we want to enable both to work together, but for now
this enables one or the other depending on the dpopts setting.
2013-06-26 06:21:59 -07:00
Bob Lantz 804c4bbfa6 Workaround: add dpopts to UserSwitch
Currently, slicing on the user switch breaks bandwidth limits.
We don't yet have a good way of using both of them at the same time.
I'm inclined to turn off slicing by default, but I have to think
about it and also see if any one is using it...
2013-06-26 06:14:43 -07:00
Bob Lantz 1a658054ab Ensure dpid is a valid hex string in OVSSwitch 2013-06-26 05:00:30 -07:00
Bob Lantz 33e39a2471 Fix some pylint messages. 2013-06-25 20:26:06 -07:00
Bob Lantz 538a856c2f Add Switch.connected() and OVSSwitch.controllerUUIDs() 2013-06-25 20:16:25 -07:00
Bob Lantz 877e7efb5f Minor comment change and text change. 2013-06-25 19:39:53 -07:00
Bob Lantz bdd43beaf3 Clean up (and fix) OVSSwitch fast reconnect 2013-06-25 19:31:27 -07:00
Bob Lantz 307d60a0c8 Replace /etc/hostname entirely; clarify sources.list edit 2013-06-25 16:35:26 -07:00
Bob Lantz 12758046e1 Fix setDefaultRoute to work with passed parameters. 2013-06-25 12:51:43 -07:00
Bob 9aaf87c19b Fix typo. 2013-06-25 01:06:00 -06:00
Bob 400bbbac11 Update archive for 13.04 2013-06-25 01:04:45 -06:00
Bob 226eae97cb Add script completion message 2013-06-24 14:34:53 -06:00
Brandon Heller e5d7b3801d topo: make new minimal Graph object a Graph, not a DiGraph
Fixes another Graph regression relative to NetworkX.

RipL broke because the NetworkX Graph object that was used previously
for topologies is an undirected graph:

>>> import networkx as nx
>>> g=nx.Graph()
>>> g.add_edge(0,1)
>>> g[1]
{0: {}}
>>> g[0]
{1: {}}

There is a separate DiGraph object in NetworkX for directed behavior.

The minimal replacement previously implemented DiGraph behavior.

>>> from mininet.topo import Graph
>>> g2=Graph()
>>> g2.add_edge(0,1)
>>> g2[0]
[1]
>>> g2[1]
[]

This commit restores undirected graph behavior.
2013-06-20 18:51:09 -07:00
Brandon Heller 4e1630e126 topo: add __getitem__ for Graph
Commit 65c35b65 'Remove networkx dependency' broke this line from RipL:

    nodes = [n for n in self.g[name] if self.layer(n) == layer]

To work around this, RipL code would have to be changed to something
like this:

    nodes = [n for n in self.g.data[name] if self.layer(n) == layer]

...which would use an internal variable, data.

It seems cleaner to add this one little feature from NetworkX Graph objects.
2013-06-20 16:27:17 -07:00
Brandon Heller 40b13c28b8 install.sh: Make OF1.3 Netbee location cmd-line configurable
If NBEEURL is defined when running install.sh, use that location.

Enables use of a local mirror for netbee download.

Thanks to David Erickson for the code.
2013-06-20 15:57:39 -07:00
Bob Lantz 2de621cda0 "file blocks" -> "disk blocks" 2013-06-19 17:27:33 -07:00
Bob Lantz 5c5a1eae8a Use dd to zero out disk space (hopefully faster) 2013-06-19 17:26:39 -07:00
Bob Lantz 8f113b48cc vm_cleanup: add apt-get autoremove, and zero disk blocks 2013-06-19 16:58:00 -07:00
Bob Lantz 949e0b3aff Separate VM finalization as install.sh -tc 2013-06-19 16:32:54 -07:00
Bob 448ac9dcd4 Merge pull request #150 from MurphyMc/ovs_fast_reconnect
node: Make OVS switches reconnect quickly
2013-06-19 12:22:28 -07:00
Bob Lantz dd21df3ce4 Don't flush ALL routes and enable OPTIONAL default route/gw
fixes #152 hopefully
2013-06-17 17:09:54 -07:00
Bob Lantz 3484389dcd Add NAT script to examples. 2013-06-12 14:57:13 -07:00
Bob ace0977930 Merge pull request #149 from MurphyMc/ovs_userspace_v2
node: Allow OVSSwitch to run in userspace mode
2013-06-06 18:35:39 -07:00
Murphy McCauley 3df07feb11 node: Make OVS switches reconnect quickly
Ordinarily, OVS switches back off when they can't reach their controllers.
Under the type of scenarios where Mininet is used, I think this is
probably just inconvenient.  This patch set controllers to attempt to
reconnect every second.
2013-06-06 16:28:13 -07:00
Murphy McCauley 153d598df3 node: Allow OVSSwitch to run in userspace mode
This adds a datapath parameter to OVSSwitch which allows one to tell OVS to
run in userspace mode rather than kernel mode.  From the commandline, this
is --switch=ovsk,datapath=user.

Note that this makes "ovsk" and the OVSKernelSwitch alias misnomers.  Since
the default behavior is still kernel mode, this is hopefully harmless.

This is the second version of this patch, which changes the argument name
and values according to Bob's suggestion.
2013-06-06 16:23:56 -07:00
Murphy McCauley a22e2618a6 topo: Add host count param to LinearTopo
Previously, LinearTopo took one parameter (k), which controlled the number
of switches; each of these got one host.  This adds a second parameter (j),
which controls the number of hosts per switch, defaulting to 1 (as before).

This is the second version of this patch, which attempts to make the
host name generation more straightforward.
2013-06-06 16:18:04 -07:00
Brandon Heller 3582facd34 install.sh: Use newer Netbee location for OF1.3 install
The previous version (12-05-16) does not compile on Ubuntu 12.10.

Also use a local variable to reduce duplication.
2013-06-04 23:53:04 -07:00
Bob Lantz 2a079911b5 Clarify controllers.py and add RemoteController 2013-06-03 17:10:12 -07:00
Bob Lantz 5fae96eb6e Change to only split once so that cargs='--foo=1 --bar=2' works.
fixes #144
2013-06-03 15:37:56 -07:00
Bob Lantz e3d07bc1a0 Add 'x' command to open an X11 tunnel (and run a client)
fixes #142
2013-05-28 22:10:27 -07:00
Bob f53866d0c0 Merge pull request #140 from fasaxc/patch-1
Fix method name mismatch for setDefaultRoute. 
This seems to be logically correct according to the intention of the code, but it may cause some trouble because routes will now be flushed by Mininet.configHosts().
2013-05-23 15:38:41 -07:00
Shaun Crampton e5754ae96f Fix method name mismatch for setDefaultRoute. 2013-05-23 14:31:27 -06:00
Bob Lantz 294bbad407 Display usage information if there are extra arguments
Fixes #130
2013-05-22 18:04:35 -07:00
Bob 83e43a42d9 Merge pull request #135 from adferguson/adf-vm-script-fix
tiny fix to vm script
2013-05-22 16:02:43 -07:00
Bob Lantz 2485d57f66 Edits to pass code check and make style consistent. 2013-05-22 15:40:12 -07:00
ryanc 65c35b6595 Remove networkx dependency
Conflicts:

	util/install.sh

closes #100
2013-05-22 15:24:22 -07:00
Bob Lantz 1ea5c91fcc Update host's IP address during name-IP substitution
fixes #139
2013-05-22 15:06:10 -07:00
Bob Lantz 76c5b9d021 Add ovs-controller to shutdown list 2013-05-22 15:03:48 -07:00
Bob Lantz 229f112ff3 Change OVSSwitch.dpctl() to call ovs-ofctl
This should fix the problem of dump-flows not showing the OpenFlow
flow table flows and only showing cached kernel flow table flows.

fixes #136
2013-04-29 14:04:46 -07:00
Andrew Ferguson fae4365983 actually, drop comment as per Bob Lantz 2013-04-26 13:11:39 -04:00
Andrew Ferguson e7f45ca90e tiny fix to vm script 2013-04-25 13:22:46 -04:00
Andrew Ferguson 3236d33b6a allow user switch to be used with TCIntf's 2013-04-21 15:47:37 -04:00
Bob Lantz 6c22e057cc Avoid false matches and detect multiple host processes 2013-04-12 13:30:50 -07:00
Bob Lantz 7bc10ebc7a Fix X11 forwarding (broken by no IPv6) for real 2013-04-09 23:26:08 -07:00
Bob Lantz c3f975aef8 Move IPv6 disable to 'other', and fix X11 forwarding
should fix #128
2013-04-09 22:46:49 -07:00
Bob Lantz 0f6bf4ce84 start xterm with TERM=ansi to preserve title from bash.bashrc
fixes #128
2013-04-09 20:10:55 -07:00
Bob Lantz 33c7e46492 Use __NR_setns so that setns has the right syscall # in 32-bit mode
fixes #127
2013-04-09 19:38:36 -07:00
Bob 7c920edc29 Merge pull request #125 from adferguson/adf-tc-renumber
Adjust numbering to support tc-based switch QoS

This looks fine to me - probably we want to change the way this works eventually, but for now renumbering it is fine and we can change the numbering later if desired.
2013-04-09 14:59:41 -07:00
Andrew Ferguson e09254eea3 Adjust numbering to support tc-based switch QoS
both the reference switch and Open vSwitch assume ids with major 1
can be used for tc-based QoS
2013-03-30 17:50:28 -04:00
Bob Lantz e5a15ced01 Change popen() to detach from terminal/process group.
This may or may not be the right thing to do - an alternative
would be to ignore SIGINT, but that would make the popen()
job unkillable by normal means! So we'll try this and see
how well it works.
Fixes #124
2013-03-28 18:14:24 -07:00
Bob Lantz c771b2d75a Add source node option to moveIntf() (note: low-level API!!)
In the future we may wish to enable moving interfaces across
nodes which are not in the root NS, and this would provide
the low-level mechanism to do so.
closes #122
2013-03-24 16:14:04 -07:00
Bob Lantz 477e84adba More code check nits. 2013-03-24 15:58:48 -07:00
Bob Lantz 3482d941e1 Fix code check. 2013-03-24 14:48:20 -07:00
Bob Lantz 1bf1a4d5e9 Tag node bash processes and add attach script
Try invoking bash processes with -s mininet:host,
for easy identification of hosts. This enables
easy attachment using the util/m script.
closes #121
2013-03-22 18:38:33 -07:00
Bob Lantz a0f69d98df Change makeTerm() to tunnel X11 using socat if needed
For local display, allow local root access
For remote display, tunnel with socat/mnexec
This should enable *wireshark in hosts* and fix #119
2013-03-22 15:48:51 -07:00
Bob Lantz 4b8b4b73e1 Clean up options and fix of13 to use sudo for netbee 2013-03-21 16:44:44 -07:00
ederlf 5b14cc2937 Add options to install OpenFlow 1.3 switch and compatible NOX controller.
Signed-off-by: Bob Lantz <rlantz@cs.stanford.edu>
2013-03-21 16:08:05 -07:00
Bob Lantz eca5a151a4 Fix usage message to note correct options and OS compatibility.
closes #85
2013-03-21 14:38:46 -07:00
Bob 4efd372223 Merge pull request #116 from yamahata/install-test-mar-2013
tools/install.sh: catch up oftest change
Looks fine to me.
2013-03-21 14:12:50 -07:00
Isaku Yamahata 356e9d8a92 tools/install.sh: update oftest
Since oftest removed tools/munger directory, install.sh fails as follows
> mininet/util/install.sh: line 399: cd: tools/mnuger: No such file or directory

oftest change set
> commit be8503a69d609d0aee844a91f3f5d66f4e2666c7
> Author: Rich Lane <rlane@bigswitch.com>
> Date:   Tue Mar 12 10:16:33 2013 -0700
>
>     remove pylibopenflow tools

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2013-03-15 10:40:51 +09:00
Bob Lantz 8838c30ea1 Remove non-functional --prefixlen (use --ipbase instead) 2013-03-13 16:18:04 -07:00
Bob Lantz 8204a1b694 fix --ipbase: fix ipAdd() and remove unused default from ipStr() 2013-03-13 16:16:20 -07:00
Bob Lantz bd558875f3 Add net['h1'] and for node in net support
thanks to Brian O'Connor for reminder + suggestion
closes #114
2013-03-08 18:28:21 -08:00
Ryan Cox 898efb69a3 Added markdown formatting to examples readme 2013-03-07 17:54:08 -08:00
Bob Lantz 31fe4f1bd0 Fix pmonitor() to not return blank lines on EOF
fixes #109 (hopefully)
2013-03-06 17:26:52 -08:00
Bob Lantz dcb3036b70 Change to use addLink() interface for symmetry/consistency. 2013-03-06 16:55:47 -08:00
Bob Lantz 9734d9d7fa Add configuration to disable IPv6, since old method no longer works.
fixes #108
2013-03-06 16:06:59 -08:00
Bob Lantz 23c70f609d Add px command which uses exec() vs. py's eval()
This is necessary since exec() isn't really a function, and
eval can't evaluate statements.
fixes #104
2013-02-28 19:14:37 -08:00
Bob Lantz f018137207 Updated to reflect new controllers.py and old controllers2.py 2013-02-28 17:59:14 -08:00
Bob Lantz ad09c1e086 Add new example of making a custom Switch() class. 2013-02-28 17:56:36 -08:00
Bob Lantz 31e1ff7154 Rename controllers.py to controllers2.py since it's less convenient. 2013-02-28 17:55:41 -08:00
Bob Lantz 8b8bb37598 Remove unnecessary addHost() function, and clarify things a bit.
Fixes #102
2013-02-28 17:40:48 -08:00
Bob Lantz 0aefb0e036 Fix Node.MAC(intf) to return intf.MAC() rather than intf.IP()
Fixes #89 ; Thanks to Nikhil S. Menon for the bug report
2012-12-19 16:11:57 -08:00
Bob Lantz 5879c492d8 Minor clarifications. 2012-12-02 15:39:17 -08:00
Bob Lantz ee66d53c54 Clean up INSTALL and make it markdown-friendly
Also fixed a few errors like the time it takes to install,
some references to NOX, etc..

Left in noxcore ref, since you can still install it.
2012-12-02 15:29:53 -08:00
Bob f95c4a4712 Update INSTALL: git clone from github.com
Thanks to @xdhanz for the catch, and pull request
closes #84
2012-12-02 15:00:46 -08:00
Bob Lantz c8b857465b pass code check 2012-11-30 21:00:23 -08:00
Bob Lantz 21366afc54 2.0.0rc1 -> 2.0.0 final 2012-11-30 20:57:53 -08:00
Brandon Heller b453e0068f node: verify telnet installation for controller checking
Reported-by: Julius Bachnick

https://mailman.stanford.edu/pipermail/mininet-discuss/2012-November/001349.html
2012-11-26 15:22:07 -08:00
Brandon Heller 1e9b5f61fc install.sh: add Telnet
Reported-by: Julius Bachnick

https://mailman.stanford.edu/pipermail/mininet-discuss/2012-November/001349.html
2012-11-26 15:22:07 -08:00
Bob Lantz 0ce366b5d2 Add sudoers entry for current user using whoami 2012-11-19 17:30:09 -08:00
Brandon Heller 3744638e5c node: add OVS passive listening support 2012-11-15 00:50:25 -08:00
Brandon Heller 915c6d4a60 node: Use space, rather than comma, to separate controllers
for OVS

Otherwise, OVS thinks the second controller is a parameter of the first, and
only creates one controller entry as seen in 'ovs-vsctl show'.
2012-11-15 00:50:25 -08:00
Brandon Heller bd964adb57 mn: change default passive listening port to 6634
Becomes consistent with the OpenFlow walkthrough & MN walkthrough web pages.
2012-11-15 00:50:25 -08:00
Brandon Heller dec1f402ed custom topo: remove author name
No need for this here, especially because this file is in the walkthrough
and will be found by web crawlers.
2012-11-15 00:50:25 -08:00
Bob Lantz b96e1596b2 Change to use Intf() class rather than string for interface.
Was broken in 2.0.0rc1
2012-11-19 15:02:38 -08:00
Bob Lantz 3569838542 Updated for new Topo API 2012-11-19 12:32:50 -08:00
Bob Lantz 8c7c4812b2 Remove vmware easy install leftovers 2012-11-19 12:31:50 -08:00
Brandon Heller 987fd7555e Fix custom topology example; outdated import
Reported-by: Julius Bachnick
2012-11-14 21:28:42 -08:00
Bob Lantz 63d669f712 Update to match launchpad. 2012-11-18 20:54:47 -08:00
Bob Lantz 078b982be1 Sync with packaging on launchpad. 2012-11-17 23:14:10 -08:00
Bob Lantz d402c66af2 Update debian copyright. ;-/ 2012-11-16 23:11:59 -08:00
Brandon Heller 03c3123bb8 test_hifi: Fix occasional test breakage
Source of error: regex to parse ps output had a single space, rather
than handling any amount of whitespace before the CPU percentage.  When
that percentage would drop below 10.0, an space would be printed,
confusing the regex.

Fixed by handling arbitrary whitespace before the percentage.
2012-11-14 10:47:00 -08:00
Bob Lantz 82c8bdaf0d Remove redundant wireshark install. 2012-11-15 22:59:43 -08:00
Bob Lantz 163a6cf3dd Fix whitespace error. 2012-11-15 22:56:24 -08:00
Bob Lantz ab594b6afe Merge branch '2.0dev' into 2.0merge
Conflicts:
	.gitignore
	.pylint
	examples/miniedit.py
	mininet/node.py
	mininet/util.py
	util/install.sh
	util/vm/install-mininet-vm.sh
2012-11-15 22:54:27 -08:00
Brandon Heller 1f1d590c7a test: Improve unit tests to verify basic functionality
Also a more complete ping test that parses all output to the CLI.

These tests expand the hifi-specific ones to not just cover whether
a topology can be created with options, but whether those options
are properly implemented within some tolerance, like CPU limits,
link bandwidth, delays, and even drops.
2012-11-14 07:57:17 -08:00
Brandon Heller fcd01592e1 Move CPU limit into net, to be reused in future unit tests 2012-11-14 07:55:10 -08:00
Brandon Heller e1205a8a49 Add a simple unit test for link/host creation with options 2012-11-14 00:43:46 -08:00
Brandon Heller d7768ab228 examples/simpleperf: Warn in docstring about effects of link settings
These include dropped pings and iperf hanging.
2012-11-13 23:28:24 -08:00
Brandon Heller bf208cdeb6 Fix SSHD example by generalizing input intf args
A number of functions in node.py look like this:
   return self.intf( intf ).<other stuff>

Previously, self.intf(...) in Node would expect a string name for an
interface and return None if an object was passed in instead of a
string name.

Now, be more permissive and assume that objects passed in are for Intf
objects.  This makes all such functions in node.py handle more flexible
input args, either name or actual Intf object.

An alternative and equally valid approach would be to raise an Exception
whenever a non-string, non-falsy value was passed in to Node.intf(), and
to modify the code in at least one place - examples/sshd.py - to pass
the interface name, rather than the interface object.

Also fix input args for examples/scratchnetuser.py - the interface name
was being passed in as the prefix len, which makes no sense.
2012-11-13 22:44:47 -08:00
Brandon Heller 12fea0f6d5 examples/baresshd: ensure root permissions
Prevent idiots like me from getting confused by non-obvious 'broken pipe'
errors when they forget to put 'sudo' in front  :-)
2012-11-13 21:33:44 -08:00
Brandon Heller bcfb3009c0 small refactor: put function to ensure root in util
Two benefits:
- One place to change if in the future, a more granular method of
  root access is used (like the BigSwitch patch).
- Makes this reusable by stuff like examples/baresshd.py that use
  the low-level Mininet API.
2012-11-13 21:32:41 -08:00
Brandon Heller 8a1264e266 Fix 'cgroups not mounted' error in U12.10
'mount' shows something slightly different in Ubuntu 12.10:

cgroup on /sys/fs/cgroup type tmpfs (rw,uid=0,gid=0,mode=0755)

Note the lack of a plural on first word cgroup, which has changed.

Still mounted at /sys/fs/cgroup, so check for both possibilities
when instantiated CPU-limited hosts.
2012-11-13 20:53:13 -08:00
Brandon Heller 36c9b040ca examples: Add new tests to README 2012-11-13 18:33:10 -08:00
Brandon Heller 2eb0593cd2 examples/cpu: Fix typo, note existence in README 2012-11-13 18:06:19 -08:00
Brandon Heller d40003e0cd examples: Make simpleperf.py executable 2012-11-13 18:05:10 -08:00
Brandon Heller 9330a33fe5 pep8: Fix E501 line-too-long errors incurred fixing other pep8 stuff :-) 2012-11-13 17:21:36 -08:00
Brandon Heller 2e089b5e4a pep8: Fix E127 continuation line over-indented
There are a bunch of these remaining, but I don't think the right course is
to 'fix' all of them to make pep8 happy, but instead to either change
the test in pep8 to consider that a continuation line may itself
be continued halfway, OR, to change the code in these lines to be more
readable by removing the need for all those nested continuations.

Personally, I find multiply-broken lines (aka nested continuations) really
hard to read.
2012-11-13 17:17:51 -08:00
Brandon Heller edf6003217 pep8: fix E128 continuation line under-indented errors
I wasn't sure this was worth fixing at first, but it does look more readable
now.
2012-11-13 16:59:10 -08:00
Brandon Heller c0095746af pep8: Fix E121/126, continuation line indention 2012-11-13 16:08:26 -08:00
Brandon Heller 33d548b412 pep8: Fix E121 continuation line indentation is not a multiple of four 2012-11-13 15:01:11 -08:00
Brandon Heller 615ebb7afa pep8: Fix E125 continuation line does not distinguish itself from next logical line 2012-11-13 14:56:49 -08:00
Brandon Heller 7a5060478b pep8: Fix E711, comparisons to None should use 'is' or 'is not'
Lengthy discussion of why this is a good thing (I didn't know) at SO:

http://stackoverflow.com/questions/2209755/python-operation-vs-is-not
2012-11-13 14:46:58 -08:00
Brandon Heller 0bd5c6519c pep8: Fix E203 whitespace before punctutation 2012-11-13 14:39:31 -08:00
Brandon Heller 1052f8a0d4 pep8: Fix E271/E272, spaces before/after keyword 2012-11-13 14:36:56 -08:00
Brandon Heller 03d211f2a9 codecheck: Make codecheck happy with a consistent version num 2012-11-12 18:08:59 -08:00
Brandon Heller f6c4239409 install: Add 'make codecheck' deps
These total to only ~200KB.
2012-11-12 18:07:19 -08:00
Brandon Heller 59897168d4 install: Update OFTest repo location
This repo has moved to git://github.com/floodlight/oftest.git
2012-11-12 16:46:29 -08:00
Brandon Heller b597ef5d55 install: Add help2man to MN deps
'make install' calls help2man, so apt-get install it beforehand.
2012-11-12 16:46:22 -08:00
Bob Lantz e3c8066a9e OK, github is broken - reverting to old spacing. 2012-11-09 00:09:41 -08:00
Bob Lantz 78e3e18c42 trying to fix list spacing 2012-11-09 00:09:11 -08:00
Bob Lantz 01e028c19f Add Mininet-HiFi comment 2012-11-09 00:07:56 -08:00
Bob Lantz d49aaf0f70 Hmm, maybe this is better. 2012-11-09 00:04:40 -08:00
Bob Lantz f7d6c9e7a1 Another attempt. 2012-11-09 00:03:36 -08:00
Bob Lantz 015aaa2107 That didn't work... 2012-11-09 00:02:54 -08:00
Bob Lantz bad8656361 More header madness. 2012-11-09 00:02:17 -08:00
Bob Lantz eb3b74ea34 sudo mn seems lonely if it takes up the whole line 2012-11-08 23:58:54 -08:00
Bob Lantz dabc0b812a Bash in tt, abolish forward single quotes. 2012-11-08 23:57:39 -08:00
Bob Lantz dd1a450b50 Mars needs commas! 2012-11-08 23:55:31 -08:00
Bob Lantz ead9f83050 Reflow text and try crazy idea for heading. 2012-11-08 23:52:07 -08:00
Bob Lantz 0fb91f186e More minor tweaks.... 2012-11-08 23:47:48 -08:00
Bob Lantz 3e38a959c3 Moved installation instructions and prereqs into INSTALL. 2012-11-08 23:31:31 -08:00
Bob Lantz 535e61d2be Still trying to fix the typeface and spacing... 2012-11-08 23:18:56 -08:00
Bob 4885cb24ed Update README.md
File and command names in typewriter text.
2012-11-08 22:05:52 -08:00
Brandon Heller 73da7204e6 Update README 2012-11-08 15:31:10 -08:00
Bob Lantz ff4b41439a Minor changes. 2012-11-03 21:59:04 -07:00
Bob Lantz 21b2c2c4aa VERSION -> 2.0.0rc1 2012-11-03 21:38:59 -07:00
Bob Lantz e2b799b815 Fix/work around setuptools' evil PYTHONPATH madness. 2012-11-03 21:36:03 -07:00
Bob Lantz 4744aa2b78 Updated README to reflect Mininet 2.0. 2012-11-03 16:53:26 -07:00
Bob Lantz c04ef88e5c Add note regarding removing old OVS junk. 2012-11-03 16:10:57 -07:00
Bob Lantz 4b1dc93bcc Avoid modifying keyword parameter dictionary in customized() 2012-10-30 16:58:51 -07:00
Bob Lantz f58f83c043 Allow controller to optionally be a list of constructors/classes 2012-10-30 16:50:12 -07:00
Bob Lantz 22b8e5e427 Add custom name to customized functions.
Note: we could probably use functools.partial.
2012-10-30 16:45:11 -07:00
Angad Singh cec4476303 Merge pull request - closes #36 2012-10-29 16:10:00 -07:00
Bob Lantz 31015ef5d8 Make doc a real subdirectory so we can put other things there. 2012-10-29 15:36:19 -07:00
Bob Lantz 600dad2498 Added package installation "instructions" 2012-10-04 19:08:37 -07:00
Bob Lantz 4ff6243fd6 Update version number to 2.0.0d3 (and pass version check) 2012-10-04 19:02:44 -07:00
Bob Lantz 9c0ed88c72 Create version check utility and add to code check.
Fixes #70
2012-10-04 19:02:27 -07:00
Bob Lantz 93f9b956e4 Updated copyright to fix #68 2012-10-01 18:01:29 -07:00
Bob Lantz b69ef234ac Fix multi-controller/failover support on User, OVSLegacy switches 2012-09-14 18:23:30 -07:00
Bob Lantz 2988429747 show method names in git diff output 2012-09-14 15:18:17 -07:00
Bob Lantz d4ece25ba6 Deprecate NOX-classic; "install" POX. Fixes #61 2012-09-11 06:49:11 -07:00
Bob ad85e44d78 Update util/install.sh
Update to reflect new NOX classic repo on github and default branch.
2012-08-29 16:00:33 -07:00
Bob 655194d3e1 Update util/install.sh
Update to reflect new NOX classic repo on github and default branch.
2012-08-29 15:10:36 -07:00
Bob Lantz 6eb01d7923 Minor formatting changes. 2012-08-23 18:36:50 -07:00
Bob Lantz ae6475598f Change README to README.md for github presentation.
This isn't the final README text, of course, but it should
show up formatted now on github.
2012-08-23 18:28:15 -07:00
Bob Lantz 62499d96df Adjust README slightly to be markdown-compatible. 2012-08-23 18:27:48 -07:00
Bob Lantz 4f33cad025 Ignore more stuff, notably generated docs and man pages. 2012-08-17 18:20:22 -07:00
Bob Lantz 2aafefc2fa Fix typo in RemoteController.__init__ comment.
Thanks to Isaku Yamahata.
2012-08-17 15:26:19 -07:00
Bob Lantz 9d5a21a799 Fix typo MANPAGE->MANPAGES
Thanks to Isaku Yamahata.
2012-08-17 15:25:06 -07:00
Bob Lantz ce15c4f67d rename Topo() methods for consistency: add_node() -> addNode() 2012-08-16 18:48:41 -07:00
Bob Lantz 01e0758e5d Add 'type mn -h for details' to usage message. 2012-08-16 16:12:55 -07:00
Bob Lantz e8238d185d Use Mininet version number from mininet.net
Contributing toward issue #46.
2012-08-10 12:47:35 -07:00
Bob Lantz 54c51c0299 Fix whitespace and change no controller exception to warning. 2012-08-06 11:41:00 -07:00
James Page 2b35a2caeb Override remote controller check to ensure that remote controller is contactable 2012-08-06 03:08:41 -07:00
James Page 9b11238467 Observe build environment flags and use PYTHONPATH when generating version number 2012-08-06 03:08:41 -07:00
Bob Lantz fa24f22d4d Re-enable slicing in UserSwitch since it's fixed with newer kernels. 2012-07-31 17:23:08 -07:00
Bob Lantz ce823507cd Fix man page install. 2012-07-31 17:22:13 -07:00
Bob Lantz cd580debb6 Removed redundant debian/mininet.manpages 2012-07-07 22:29:46 -07:00
Bob Lantz 1e9106badb Add option to mangle github tarball filename. 2012-07-07 22:23:53 -07:00
Bob Lantz 232acc8261 Track tagged versions on github directly. 2012-07-07 19:07:20 -07:00
Bob Lantz 55179737f9 Change version to 2.0.0d2 - there has to be a better way. 2012-07-06 23:44:27 -07:00
Bob Lantz 28c2cdc2c4 Workaround for openvswitch_mod rename and pass code check. 2012-07-06 23:30:14 -07:00
Bob Lantz d85a58feeb Autogenerate man page for mnexec. 2012-07-06 23:18:24 -07:00
Bob Lantz 89a6dea7f9 Remove unnecessary copy to bin/ 2012-07-06 22:43:11 -07:00
Bob Lantz 9a518b1eee Add missing packaging files from launchpad. 2012-07-06 22:30:19 -07:00
Bob Lantz d54cde46e0 Add PYTHONPATH=. to allow "make man" to work if Mininet is not installed. 2012-07-06 19:54:42 -07:00
Bob Lantz 320df7fe28 Merging in James Page's packaging tweaks for quantal. 2012-07-06 16:06:19 -07:00
Bob Lantz 0ab282400e update maintainer for ppa submission to work 2012-07-04 10:46:25 -07:00
Bob Lantz 8aa7e05d83 Added missing help2man to build deps. 2012-07-04 00:23:06 -07:00
Bob Lantz b43a67edbd Pass lintian. This is still annoyingly redundant. ;-(
y
2012-07-03 23:53:47 -07:00
Bob Lantz 9c4d047462 Ugh, it looks like lintian wants a duplication of the license in debian/copyright.... 2012-07-03 23:19:08 -07:00
Bob Lantz ccc0b1a1cf Fixed debian/copyright 2012-07-03 23:09:37 -07:00
Bob Lantz 78b2f585ae Fixed support for adding man page to debian package - to pass lintian! 2012-07-03 22:50:53 -07:00
Bob Lantz 39128f8cf8 Add VERSION string. 2012-07-03 22:08:33 -07:00
Bob Lantz 7fe847967d clean up "make man" slightly 2012-07-03 22:08:25 -07:00
Bob Lantz f2e7884ade Add support for generating man page from mn --help. 2012-07-01 23:23:56 -07:00
Bob Lantz 0809105bed Fixing some lintian problems. 2012-07-01 23:22:44 -07:00
Bob Lantz 93bf7793cb Debian copyright wants a real file, so change LICENSE to symlink. 2012-07-01 23:22:05 -07:00
Bob Lantz ec969b7f99 Change default controller for mn to ovsc (ovs-controller.)
Also add check to see if another controller is running -
eventually we should really detect errors from starting the
controller!!
2012-07-01 20:31:30 -07:00
Bob Lantz cb859243a5 Added Debian/Ubuntu packaging - thanks to James Page. 2012-07-01 19:16:41 -07:00
Bob Lantz e04c207c3c Update for Mininet 2.0.0 development. 2012-07-01 19:08:20 -07:00
Bob Lantz 0f832c9226 Propagate prefix length to host IP configuration. 2012-06-25 14:14:09 -07:00
Brandon Heller 496cd25d37 Update oftest repo location
Fixes Issue 41: https://github.com/mininet/mininet/issues/41

Reported-by: sublinhado on GitHub
2012-06-14 11:10:39 -07:00
Nikhil Handigol 107785ddf1 RED bug fix in another place 2012-06-05 12:18:26 -07:00
Nikhil Handigol 6bb5e12347 RED bug fix: change avg. packet size 2012-06-05 12:16:32 -07:00
Brandon Heller 928c0761a0 Move code from mn into mininet/util to enable reuse
Any code in mn is not usable by other Python code.

Hence, move this code into util, so other scripts can use it.
2012-05-30 00:08:01 -07:00
Brandon Heller 30b4b4e7f9 Rename and document customNode
Now customConstructor, because it general to both links and nodes.
2012-05-29 23:57:52 -07:00
Brandon Heller f509ae282d cli: add time command 2012-05-25 16:34:05 -07:00
Bob Lantz d9fd4ea245 Add VM install script 2012-05-23 22:37:53 -07:00
Bob Lantz 6c947bca07 More indent errors - curse you emacs. 2012-05-23 21:12:24 -07:00
Bob Lantz e4514a4ecb Still more indentation errors. ;-p 2012-05-23 21:09:14 -07:00
Bob Lantz 8c778bb081 Fix indentation errors. 2012-05-23 21:06:15 -07:00
Bob Lantz f1bf3c60e0 Added popenpoll.py example of using popen()/pmonitor() 2012-05-23 20:56:35 -07:00
Bob Lantz 06f7408cf2 Fix popen to allow popen( cmd, arg1, arg2, arg3 ) 2012-05-23 20:04:36 -07:00
Bob Lantz e1ca7196c7 configHosts(): don't try to configure nonexistent interfaces. 2012-05-23 13:37:02 -07:00
Bob Lantz 8f310286f8 Add setLinkInfo() which seems to be missing. 2012-05-21 23:09:11 -07:00
Nikhil Handigol b97c0392a9 make install for sch_htb.ko 2012-05-17 19:59:55 +00:00
Nikhil Handigol 9c6620d85d modified HTB to fix the perfect synchronization bug 2012-05-17 17:13:30 +00:00
Nikhil Handigol ae2ede7994 bug fix: link config 2012-05-17 17:05:37 +00:00
Bob Lantz b91008345f Fix pexec('echo foo', shell=True) 2012-05-16 23:59:12 -07:00
Bob Lantz 2f8dfe5810 Ignore error installing OVS controller, and disable its startup script. 2012-05-14 17:29:24 -07:00
Bob Lantz 79dcdc0491 Add libconfig-dev dependency for oflops. 2012-05-14 16:58:36 -07:00
Bob Lantz b0fb398833 Patch/hacks to enable NOX destiny/classic to compile on Ubuntu 12.04 2012-05-14 16:03:48 -07:00
Bob Lantz 6e64deec08 Fix typo. 2012-05-13 15:29:08 -07:00
Bob Lantz b97c1dbd56 Set dpid on OVSSwitch. 2012-05-13 15:11:41 -07:00
Bob Lantz d75e39ac61 Change wireshark install to reflect new repository location. 2012-05-13 14:43:25 -07:00
Bob Lantz 88dd4f7329 Change wireshark install to reflect new repository location. 2012-05-13 14:37:45 -07:00
Bob Lantz e8d60e0fcf Pass code check. 2012-05-10 22:37:49 -07:00
Bob Lantz 0d94548a09 Fix default dpid which should be 12 digits for reference user switch. 2012-05-10 22:36:20 -07:00
Bob Lantz 4c3ff8f184 Remove accidentally added debugging line. 2012-05-10 22:23:31 -07:00
Bob Lantz 49d84f7cfc Fix poller to only check if stdin and node are readable.
Fixes busy waiting and excessive CPU usage in CLI.
Thanks to James Zeng for pointing this out!
2012-05-10 17:35:34 -07:00
Bob Lantz 0e8cca0869 Remove unnecessary and broken --ip option. 2012-05-10 16:54:03 -07:00
Bob Lantz 0eba655d2d Fix RemoteController which was still using defaultIP rather than ip. 2012-05-10 16:52:40 -07:00
Bob Lantz cece39e439 Fix poller to only check if stdin and node are readable.
Thanks to James Zeng for pointing this out!
2012-05-10 16:32:55 -07:00
Bob Lantz cfd381134f Fix errRun to not exit until all of stdout and stderr have been read. 2012-05-09 22:59:30 -07:00
Bob Lantz 7676c17f27 Add missing libconfig-dev dependency for oflops. 2012-04-25 17:39:55 -07:00
Bob Lantz 55cf19c4de Improve error handling for defaultDpid()
I think it's worth considering how we want to specify dpids for
switches. One way would be to have Mininet (optionally) pick them
automatically. Another way, which I have currently implemented, is
to intuit them from the name, for example s1 -> 1. The latter is
slightly inefficient, but is convenient because it ensures that
there is a logical mapping between switch names and dpids, which
is very helpful for debugging an OpenFlow system!

Probably we should just clarify that the easiest way to set a dpid
is to include it in the switch name, but you can also pass it in
as a custom parameter to the constructor.
2012-04-25 14:21:39 -07:00
Bob Lantz 50cebe6753 Add pmonitor() to make it easy to monitor popen objects. 2012-04-13 17:42:37 -07:00
Bob Lantz 237a3c54cf Begin test/example for popen(). 2012-04-13 15:50:45 -07:00
Bob Lantz 5ca91f9ced White space edits for code check. 2012-04-13 15:50:45 -07:00
Bob Lantz df600200a7 CPULimiteHost.popen(): set cgroup and (optionally) RT priority 2012-04-13 15:50:45 -07:00
Bob Lantz 089e8130e4 Add popen() to regular hosts (cpu limited in progress) 2012-04-13 15:50:45 -07:00
Bob Lantz e78e8fb56a Add support for attaching to network namespace using setns(2) 2012-04-13 15:50:45 -07:00
Bob Lantz 669e420cc4 Add default value mems=0 for memory placement. 2012-04-13 07:38:35 +00:00
Brandon Heller 6143bb1395 Merge pull request #31 from mininet/devel/wireshark
Devel/wireshark
2012-04-12 10:12:53 -07:00
Bob Lantz a8c1965b90 Fix typo. 2012-04-11 13:21:07 -07:00
Bob Lantz 5507550c53 Fix wireshark dissector install on 11.10 2012-04-11 13:20:18 -07:00
Bob Lantz 4bd1a61353 Add install message for wireshark dissector. 2012-04-10 21:47:29 -07:00
Bob Lantz edd1d0f3a4 Support libwireshark[0,1] for 11.04 and 11.10 2012-04-10 21:34:07 -07:00
Bob Lantz 0919b7ca67 Use correct non-authenticated clone for of-dissector. 2012-04-10 21:23:26 -07:00
Bob Lantz 1902dd2e3a Add support for updated wireshark plugin.
Need to verify this works with 11.04.
2012-04-10 21:14:11 -07:00
Bob Lantz 7cb340b7c9 Pass code check. 2012-04-10 00:12:37 +00:00
Bob Lantz 92b601aba9 Allow fail-mode to be set.
Probably we should have a generic mechanism to specify OVS options.
2012-04-10 00:12:03 +00:00
Bob Lantz 350fdbfe50 Allow modules (node.py) to be 1500 lines. Maybe reduce this someday. 2012-04-10 00:02:56 +00:00
Bob Lantz 548580d817 Allow lists of nodes to be passed to getNodeByName
....which should perhaps be renamed!!!
2012-04-09 23:54:17 +00:00
Bob Lantz 149a1f5639 Apparently errRun isn't as flexible as I thought... 2012-04-08 20:49:21 -07:00
Bob Lantz 197b083fbc Add static cpu (and memory) assignment. 2012-04-08 20:49:12 -07:00
Bob Lantz a7648e78fb Add mountCgroups() and tweak/correct fixLimits() 2012-04-08 20:49:04 -07:00
Bob Lantz 50202e1246 Off by one... I dislike range() 2012-04-05 21:38:02 -07:00
Bob Lantz a4338de38c Fix error message. 2012-04-05 20:57:29 -07:00
Bob Lantz d08d101eba Added simpleperf.py to examples. 2012-04-03 18:49:39 -07:00
Bob Lantz 32f7847bca Change doxypy.py to doxypy. 2012-04-03 17:50:59 -07:00
Bob Lantz 1bb990357f Added multipoll and multiping examples. 2012-04-03 17:32:55 -07:00
Bob Lantz a9c28885f3 Bring up loopback interface when configuring hosts. 2012-04-03 17:22:28 -07:00
Bob Lantz d776bd3a4f Add handle 10: to netem for hifi compat, reconfiguration. 2012-04-02 16:39:37 -07:00
Bob Lantz 5d6fda932d Add openvswitch-datapath-dkms if no datapath installed. 2012-03-31 21:30:16 -07:00
Bob Lantz c1a6ae2b48 Remove blank line. 2012-03-31 21:29:56 -07:00
Bob Lantz 78606a35c9 Removed unused param in add_link. 2012-03-31 21:29:27 -07:00
Bob Lantz 1dd3de0d04 Remove unused burst. 2012-03-31 21:29:09 -07:00
Bob Lantz ece14ff4b5 Check out CS244 branch for class. 2012-03-31 20:48:12 -07:00
Bob Lantz e5653fb63b Change back to match mininet-hifi, except for max_queue_len=1000. 2012-03-27 00:31:37 -07:00
Bob Lantz 3f61ea7104 Restore deleted deleteIntfs in OVSSwitch.stop() 2012-03-25 22:10:04 -07:00
Bob Lantz 2ec866d2c5 TCLink: pass correct parameters to superclass. 2012-03-25 20:18:35 -07:00
Bob Lantz 26c61734da Add cgroup and ethtool dependencies for mininet (w/hifi integration.) 2012-03-25 15:41:02 -07:00
Bob Lantz e1246c3741 Simplify port specification.
For the moment, I've removed the ability to specify
a dict of options without using **. This is a slightly
unfortunate trade-off since it simplifies implementation
at the expense of making the API slightly less convenient
(if somewhat more consistent.)
2012-03-25 15:39:18 -07:00
Bob Lantz 2d924f8a65 Add Mininet object to locals as 'net' 2012-03-25 15:38:32 -07:00
Bob Lantz 00d9b78035 Reinstate more complicated test. 2012-03-23 18:41:25 -07:00
Bob Lantz 612b21cbe7 Pass code check. 2012-03-23 18:38:49 -07:00
Bob Lantz 8139695d46 Use 's%s' for bw speedup; change burst to fix tbf and htb performance. 2012-03-23 18:37:32 -07:00
Bob Lantz e8146dd130 Change to allow addLink() without specifying ports. 2012-03-23 18:36:13 -07:00
Bob Lantz 44af37bc2b Change default period to 100 ms, which seems to help cfs at least...
rt is still somewhat broken.
2012-03-23 18:18:48 -07:00
Bob Lantz beb05a71c8 Move dumpNetConnections to util() because it's useful! 2012-03-23 18:17:49 -07:00
Bob Lantz 74ea006d92 Increase the quota and cpu fraction to get max cfs performance. 2012-03-23 18:17:08 -07:00
Bob Lantz 335ba99b60 Add --switch ovsl for legacy OVS. 2012-03-23 13:33:31 -07:00
Bob Lantz 8dcefd5ff9 Fix OVS legacy switch. 2012-03-23 13:33:12 -07:00
Bob Lantz 28833d864c Retry deleting cgroup for the moment because it seems flaky.
Ultimately we may wish to create a mininet/ cgroup and do a recursive
delete at the end.
2012-03-22 19:08:45 -07:00
Bob Lantz a5af91d0d3 Have errFail report cmd and stderr as well as exit code. 2012-03-22 19:08:09 -07:00
Bob Lantz 4deb735425 Simple cpu limiting example. 2012-03-22 14:44:20 -07:00
Bob Lantz f89d9a4d6b Fix typo inadvertently saved in editor. 2012-03-22 14:43:52 -07:00
Bob Lantz d1b29d58df Fix printing pid for background tasks. 2012-03-22 14:43:27 -07:00
Bob Lantz ba8d4f9bd6 Add verySimpleLimit() for debugging. 2012-03-21 23:31:20 -07:00
Bob Lantz 0b7c277ec2 Save parameters for future reference (e.g. OVS/tc workaround.) 2012-03-21 23:07:40 -07:00
Bob Lantz 1aec55d960 Workaround: reapply tc config after OVS destroys it. 2012-03-21 22:39:46 -07:00
Bob Lantz 595427842c Make CPULimitedHost method sig friendlier, and make 'cfs' default sched. 2012-03-21 17:28:00 -07:00
Bob Lantz 41245f5087 Add getNodeByName for hifi compatibility. 2012-03-21 17:27:40 -07:00
Bob Lantz b684ff7844 Fix convenience configuration methods. 2012-03-20 16:23:17 -07:00
Bob Lantz ea7c326017 Ignore emacs autosaves. 2012-03-20 15:50:44 -07:00
Bob Lantz f85c1cefb4 Use upstream OVS packages. 2012-03-20 15:49:39 -07:00
Bob Lantz 9005ce3255 Whitespace fixes. 2012-03-20 15:48:06 -07:00
Bob Lantz efc991547e Add warning in defaultIntf() if host has no interfaces.
Possibly this should be in intf() instead, as intf() is assumed
to always succeed.
2012-03-20 15:46:54 -07:00
Bob Lantz 8bebd37759 Fix is_switch() to always succeed + whitespace edits. 2012-03-20 15:45:46 -07:00
Bob Lantz e52d0ee1de Fix to work with new Topo class. 2012-03-20 15:44:50 -07:00
Bob Lantz ff56881946 Add TCLink for simplified tc-limited link creation. 2012-03-20 15:43:43 -07:00
Bob Lantz 5a8bb48951 Attempt at revised/simplified topo class:
- keys are strings
- metadata is simply a dict
- buildFromTopo greatly simplified
2012-03-20 00:17:30 -07:00
Bob Lantz 318ae55e35 Allow sendCmd( [ cmd, arg1, ... ] ) 2012-03-20 00:10:11 -07:00
Brandon Heller 99222e70f7 Merge pull request #26 from mininet/devel/install-oneiric
Devel/install oneiric
2012-03-13 15:11:29 -07:00
Bob Lantz 5562e66a2d Ignore build, dist and emacs backup~ files. 2012-03-12 16:14:00 -07:00
Bob Lantz 28f46c8d2d Pass code check. 2012-03-12 16:12:38 -07:00
Bob Lantz bf9c6ab7b4 Clarify comments and finally remove ControllerParams definition. 2012-03-12 00:29:55 -07:00
Bob Lantz 14c1926081 Use port 0 for control interface on switches. 2012-03-12 00:20:48 -07:00
Bob Lantz d7e5dfc5b6 Minor tweaks: specify port, new repr() 2012-03-12 00:20:26 -07:00
Bob Lantz 8856d284c0 Fix CLI commands. 2012-03-11 19:44:04 -07:00
Bob Lantz 14ff3ad3d0 Fix codecheck and MininetWithControlNet. 2012-03-10 20:44:34 -08:00
Bob Lantz 1d814c606d disabled-msg -> disabled for current pylint 2012-03-09 19:27:04 -08:00
Bob Lantz 82f483f559 Add support for specifying host IP range with --ipbase. 2012-03-09 17:44:47 -08:00
Bob Lantz a49c85a610 Fix examples to work with new API (and vice-versa.) 2012-03-09 16:06:23 -08:00
Bob Lantz 8e3699eca6 Move init() into Mininet() and remove calls (since called automatically.)
Note: we should probably rename it "setup()" to avoid confusion.
2012-03-09 14:10:20 -08:00
Bob Lantz e3c074b881 Remove deprecated ControllerParams (for now.) 2012-03-09 13:53:13 -08:00
Bob Lantz 9addfc13ce Add OVSController to complete out-of-box Ubuntu experience. 2012-03-08 23:48:07 -08:00
Bob Lantz d27a3c52b9 Allow various subsets of (delay, bw, loss) and clean up status output. 2012-03-08 22:08:40 -08:00
Bob Lantz 2db4268ba8 Fix NOX controller so that mn --controller nox,pyswitch,... works. 2012-03-08 22:07:19 -08:00
Bob Lantz 0dbfd3a636 Add CPULimitedHost to file comment. 2012-03-08 13:48:46 -08:00
Bob Lantz a908fafad7 Change default to vanilla Intf. Also edit comments. 2012-03-08 13:48:25 -08:00
Bob Lantz 8688ca9249 Remove debugging message. 2012-03-08 13:40:03 -08:00
Bob Lantz 8a622c3a9a Reorganize CPULimitedHost and add cgroup cleanup. 2012-03-08 13:39:28 -08:00
Bob Lantz bf5becc7d5 Get rid of SWITCH_PORT_BASE since it's 1 for OF >= 1.0. 2012-03-08 13:38:46 -08:00
Bob Lantz 216a4b7c9d Support for CFS bandwidth limiting.
Also trying to fix NOX cmdline opt, but broken at the moment.
2012-03-08 00:05:45 -08:00
Bob Lantz cbe20c7587 Remove unused imports. 2012-03-08 00:05:25 -08:00
Bob Lantz edf46e9570 Slightly cleaned up setParam to match node.py. 2012-03-07 23:38:08 -08:00
Bob Lantz b1f90976a3 Remove default classes since Mininet() really handles them. 2012-03-07 00:03:38 -08:00
Bob Lantz 4ac1148e9f Example/test of link and CPU bandwidth limits. 2012-03-06 23:52:26 -08:00
Bob Lantz 84a91a14a4 New configuration scheme and support for CPU limits (RT). 2012-03-06 23:52:00 -08:00
Bob Lantz 94c02695fd Clarify precedence of default classes. 2012-03-06 23:50:46 -08:00
Bob Lantz d8c88bedf3 Add custom() function for customizing constructors. 2012-03-06 23:49:51 -08:00
Bob Lantz 7d557fd759 Remove deprecated reference kernel switch. 2012-03-06 23:48:26 -08:00
Bob Lantz 551a3666eb Tweak errRun; add errFail and numCores. 2012-03-05 15:01:08 -08:00
Bob Lantz 542fb6167e Ignore build, dist and emacs autosaves. 2012-03-02 20:36:57 -08:00
Bob Lantz ee222055f1 Use install(1) to install mnexec so that setup.py develop works. 2012-03-02 20:34:56 -08:00
Bob Lantz 03dd914edc Tease out intfList() from intfNames(). 2012-03-02 20:34:37 -08:00
Bob Lantz a6bcad8f48 Intf and Link classes. Latter support bandwidth limits using tc. 2012-03-02 15:45:21 -08:00
Bob Lantz 6f446f6e55 Make pylint happy. 2012-03-02 15:45:10 -08:00
Bob Lantz 134a75ef38 Fix pylint complaint and add natural sort key function. 2012-03-02 15:43:07 -08:00
Bob Lantz e6d8e974ce Added errcheck target which only checks for errors. 2012-03-02 15:39:05 -08:00
Bob Lantz 176856bc9b Added setting NOX_CORE_DIR in .bashrc - this should not be necessary. 2012-02-14 16:35:12 -08:00
Bob Lantz 7a106d9b0d Script for installing mininet + tutorial into new VM. 2012-02-14 15:25:22 -08:00
Bob Lantz de5d31184f Ugh, typo. 2012-02-13 20:34:59 -08:00
Bob Lantz 65d46518c0 Don't crash if we can't uninstall kernel. 2012-02-13 20:33:59 -08:00
Bob Lantz 7a0ee56c80 openvswitch-switch needs python-argparse 2012-02-13 18:52:07 -08:00
Bob Lantz 1c0b54e52a Update OVS build suffix. 2012-02-13 18:47:22 -08:00
Bob Lantz 148a3f5735 Still dealing with install directory issues... 2012-02-13 18:30:49 -08:00
Bob Lantz 8996208084 dkms needs kernel headers. 2012-02-13 18:19:24 -08:00
Bob Lantz 7eb869af85 Force config files to be installed even if removed/edited. ;-/ 2012-02-13 17:27:32 -08:00
Bob Lantz 2b26161000 More OVS install fixes. 2012-02-13 17:13:53 -08:00
Bob Lantz e5b54a3143 Only install module manually if we built OVS from source. 2012-02-13 11:35:17 -08:00
Bob Lantz a24705d784 More controller-stopping madness. 2012-02-13 11:31:53 -08:00
Bob Lantz 9d275262e2 sudo cp for wireshark plugin 2012-02-13 11:26:11 -08:00
Bob Lantz 8183cb6262 Handle libwireshark0/libwireshark1 2012-02-13 11:23:39 -08:00
Bob Lantz 46cffb3bcf Fixed arch detection - should be i686 rather than just 686 2012-02-13 11:10:11 -08:00
Bob Lantz 738ae1f3fa Make sure bc is installed. 2012-02-13 11:05:00 -08:00
Bob Lantz fb25ee0200 Disable automatic openvswitch-controller startup. 2012-02-13 01:36:02 -08:00
Bob Lantz 2a4cbe2f57 Fix OVS 1.4.0 switch and controller package build/remove/install. 2012-02-13 01:29:01 -08:00
Bob Lantz 0e3cb791b5 Add gross depends for ovsdbmonitor. 2012-02-10 23:43:30 -08:00
Bob Lantz ae5ac257dd Build tar archive of relevant OVS packages in correct order. 2012-02-10 22:25:01 -08:00
Bob Lantz 3cd2e1a6aa Add $install + various cleanup. 2012-02-10 16:16:16 -08:00
Bob Lantz 08773f8fe9 Script to build .deb packages for Open vSwitch. 2012-02-10 14:59:39 -08:00
Bob Lantz 8a7d42db0b Update OVS switch to use ovs-vsctl rather than deprecated ovs-openflowd. 2012-02-10 14:59:39 -08:00
Bob Lantz daa576c47a Add errRun to run a command with stderr, stdout, return code and monitoring. 2012-02-10 14:59:39 -08:00
Brandon Heller b80f4aeb85 install.sh: Copy Wireshark dissector to global plugin dir 2012-02-10 14:59:39 -08:00
Bob Lantz 60b5864e1d Change to not fail if OS not detected, and to print detected OS. 2012-02-10 14:57:32 -08:00
Bob Lantz 8d1444a914 Fix for 10.04 whose default kernel doesn't have CONFIG_NET_NS enabled. 2012-02-08 17:23:52 -08:00
Bob Lantz 7e79d1351c Changes (OVS 1.2.2, NOX destiny) for installation on Ubuntu 11.10 oneiric. 2012-02-03 22:25:30 -08:00
Bob Lantz c120e37897 Try to make format mostly consistent. No tabs for the moment, although
we could switch to smart tabs (i.e. tab for indent, space for align.)
2012-02-01 15:29:53 -08:00
Bob d990eb0717 Mininet Pre-Beta -> Mininet 1.0.0; (c) 2009-2011 2011-10-13 21:03:25 -07:00
Bob Lantz d2f9aea273 Minor text updates in preparation for ONS release. 2011-10-13 16:51:37 -07:00
Bob Lantz 0bfd19fe83 Have install.sh apply controller patch for > 16 switches 2011-06-29 21:14:48 -07:00
Bob Lantz 5cc808286a Revert inadvertent print in node.py 2011-06-29 19:36:44 -07:00
Bob Lantz 2668484163 Avoid printing out grep results. 2011-06-29 19:31:45 -07:00
Bob Lantz 7596de5903 Upgrade networkx on Ubuntu 10.04 LTS to avoid deprecation warning. 2011-06-29 19:25:28 -07:00
Bob Lantz 5675f2a142 Workaround in oflops build for possible autoreconf bug. 2011-06-29 17:32:00 -07:00
Bob Lantz c2e1451997 Add option to install cbench aka oflops 2011-06-29 17:16:20 -07:00
Bob Lantz 4e13f615aa Git clone oflops from openflow.org rather than www.openflow.org 2011-06-29 17:04:49 -07:00
Bob Lantz 37e1eafdbb Switch to Open vSwitch 1.1.1 for stability. 2011-06-28 16:50:14 -07:00
Bob Lantz 2b03a115d2 Changed make clean to delete mnexec; added codecheck and test messages. 2011-04-01 11:56:31 -07:00
Bob Lantz 85cc906f14 Fixed typo. 2011-03-15 00:39:50 -07:00
Bob Lantz d00fa51f4c Removed line that caused install.sh to fail with undefined variable.
Still should check to make sure Debian install works.
2011-02-02 23:47:05 -08:00
Bob Lantz 518c75b548 Fixed nox_pysw not to fail on startup, but --port still doesn't work. 2011-01-18 21:23:24 -08:00
Bob Lantz ad2fda2522 Attempt to make iperf test more robust. 2011-01-06 21:00:22 -08:00
Bob Lantz 1dcc047624 Changed to make 'output' the default log level. 2011-01-04 17:12:34 -08:00
Bob Lantz 1ee6fad705 Preliminary fixes for merge conflicts. 2010-11-17 17:17:21 -08:00
Bob Lantz 219f9de778 Pre-1.0rc0 changes to text files. 2010-10-27 21:29:05 -07:00
Bob Lantz 54d320ce9f Pass code check. 2010-10-27 21:21:54 -07:00
Bob Lantz 996098081e Not sure why, but there's an extra blank line ;-/ 2010-10-27 21:21:54 -07:00
Bob Lantz 8a130deae5 Support for generating documentation with doxygen/doxypy (such as it is.) 2010-10-27 21:21:53 -07:00
Bob Lantz 1d67218d1f Modified to add eth1. 2010-10-25 21:54:14 -07:00
Bob Lantz 76521ef1d4 Added example of adding hw interface to mininet. 2010-10-25 21:53:29 -07:00
Bob Lantz 7e643d36c0 Removed udpbwgraph - not ready for prime time. 2010-10-25 21:53:10 -07:00
Bob Lantz 11782ae0de Commented out kernel ref, moved to Open vSwitch. 2010-10-25 21:52:14 -07:00
Bob Lantz 24baea734f Changed networkx import line; we may have to deal with version issues here. 2010-10-17 17:36:48 -07:00
Bob Lantz 87737a7064 One more merge fix. 2010-10-17 17:25:16 -07:00
Bob Lantz 4876b43fe9 Merge branch 'of1.0' into testing
Conflicts:

	bin/mn
	mininet/cli.py
	mininet/moduledeps.py
	mininet/node.py
	mininet/topo.py
	util/install.sh
2010-10-17 17:23:23 -07:00
Bob Lantz 57fd19efaa Rename Controller.controller to .command 2010-09-01 20:52:29 -07:00
Bob Lantz e30f2c99c2 Rename Controller.controller to .command 2010-09-01 20:51:40 -07:00
Bob Lantz 55ca2d0c96 Pass code check. 2010-09-01 20:51:27 -07:00
Bob Lantz 74a56e2bae Pass code check. 2010-09-01 20:50:42 -07:00
Bob Lantz 444f9d8d76 Pass code check. 2010-09-01 20:50:28 -07:00
Bob Lantz 300efb2b80 Added simple example of using API just to create a namespace. 2010-09-01 19:54:10 -07:00
Bob Lantz e0e69bbeec Added new example of multiple controllers. 2010-09-01 19:53:09 -07:00
Bob Lantz 276bdaf0d3 Added more dependencies for some installs and for Debian. 2010-09-01 19:52:30 -07:00
Bob Lantz cde0c25bfe Fix for new networkx. 2010-09-01 19:51:54 -07:00
Bob Lantz 73a098a499 Use __dict__.update to update an object's fields. 2010-09-01 19:51:09 -07:00
Bob Lantz eaf5888ae0 Added controller class arg to addController(). 2010-09-01 19:50:30 -07:00
Bob Lantz 2a75022403 Fixed args for nox. 2010-09-01 19:50:00 -07:00
Bob Lantz fe769afa22 Added port to controller args; changed NOX to new arg format. 2010-09-01 19:46:48 -07:00
Bob Lantz 5c24e18639 Disable (broken) scripting for interactive commands. 2010-08-20 08:48:10 -07:00
Bob Lantz cc960215fc Added --prefixlen option - this may help with router tutorial. 2010-08-19 20:53:40 -07:00
Bob Lantz ec226c9b83 Better order - kernel first, then mininet, then everything else. 2010-08-19 16:49:06 -07:00
Bob Lantz ee7ee4065c Get the options right... 2010-08-19 16:48:02 -07:00
Bob Lantz 40beaabc14 More edits for pre-beta. 2010-08-19 16:45:11 -07:00
Bob Lantz e900a16caf Don't try to modprobe tun if it's built-in (e.g. Ubuntu.) 2010-08-19 14:42:33 -07:00
Bob Lantz 05c2d669a9 Add make to mininet deps. 2010-08-18 23:39:07 -07:00
Bob Lantz cc16d2ce29 Attempt to fix OS detection for Debian. 2010-08-18 23:33:48 -07:00
Brandon Heller 4800435d1a vm: Don't exit if some files aren't there 2010-08-18 04:43:51 -07:00
Bob Lantz f9654e5654 Better error messages when switch setup() fails. 2010-08-18 10:58:24 -07:00
Bob Lantz a77e7a029e Update for openflow.org URLs. 2010-08-18 10:23:14 -07:00
Bob Lantz bd507eecfa Oops, get rid of debug print. 2010-08-18 10:07:57 -07:00
Bob Lantz 9802686b32 Switches use high default intf; disable slicing for user switch. ;-(
This should fix --switch user --innamespace.
2010-08-18 10:04:42 -07:00
Brandon Heller 4d1c17e17e Move kernel downloads to OpenFlow web page 2010-08-18 02:30:18 -07:00
Brandon Heller 9da63d4e85 Add dpctl command, which runs on all switches 2010-08-18 02:08:35 -07:00
Brandon Heller 0a9358c9fc Add option to turn off passive listening port 2010-08-18 02:08:34 -07:00
Brandon Heller b480b6ef77 Add newline 2010-08-18 02:08:34 -07:00
Brandon Heller ccca871ae6 Add passive listening port 2010-08-18 02:08:34 -07:00
Bob Lantz 2d48b4633c More installation edits. 2010-08-17 23:11:10 -07:00
Bob Lantz f6149e4d18 More edits. 2010-08-17 23:01:12 -07:00
Bob Lantz 6555c9294b Added more hopefully useful information.
We may want to start cutting things at some point - it looks more
complicated than it really is!
2010-08-17 22:54:44 -07:00
Bob Lantz 4c85d6d3ec Quotes are better. 2010-08-17 22:36:40 -07:00
Bob Lantz 8e5892e2fd Make it easier to see what the error was on failed module load. 2010-08-17 22:35:24 -07:00
Bob Lantz 59d326295f Fixed module installation error, for real. 2010-08-17 22:32:22 -07:00
Bob Lantz dd2a2442c4 Hack: run depmod twice so it works (hopefully) on Ubuntu. 2010-08-17 20:40:53 -07:00
Bob Lantz 7268f6943c Add gcc to mininet dependencies. 2010-08-17 19:33:24 -07:00
Bob Lantz a0ca68b6b8 Install mininet along with its dependencies. 2010-08-17 17:41:01 -07:00
Bob Lantz cf9c968756 Change to not try to install kernel on ubuntu. 2010-08-17 17:31:02 -07:00
Bob Lantz 25f64a39a0 Changed to not install kernel on ubuntu. 2010-08-17 17:04:57 -07:00
Bob Lantz 57a0bb2f95 Removed unneeded lenny function. 2010-08-17 16:49:45 -07:00
Bob Lantz 01eea3503b Updated other install and help message. 2010-08-17 16:36:42 -07:00
Bob Lantz 85b69adbf8 Version that hopefully will work on Ubuntu with an ext3 root FS. 2010-08-17 16:07:07 -07:00
Bob Lantz 52c700ff0c Updated for 1.0 and to reflect install.sh. 2010-08-17 16:06:34 -07:00
Bob Lantz 5d4d630580 Getting close to Ubuntu install. 2010-08-17 03:04:30 -07:00
Bob Lantz 455194a3b8 Delete spaces around =. 2010-08-17 03:04:12 -07:00
Bob Lantz 0533e1cc1e Remove hard-wired /home/mininet directory. 2010-08-17 00:30:25 -07:00
Bob Lantz b13a2c17c5 Removed test for reference kernel implementation, for now at least. ;-( 2010-08-17 00:02:33 -07:00
Bob Lantz 2f40c85691 Added additional sanity checks for when OF/OVS isn't installed. 2010-08-17 00:02:33 -07:00
Bob Lantz ab312967fe Added pathCheck for additional sanity when OF/OVS isn't installed. 2010-08-17 00:02:32 -07:00
Bob Lantz 2c07d62b3c Remove blank lines to pass code check. 2010-08-17 00:02:31 -07:00
Bob Lantz e3a1fbb047 Added support for pre- and post-test CLI scripts. 2010-08-17 00:02:31 -07:00
Bob Lantz 9de7873bc8 Change to automatically update IP and MAC addresses. 2010-08-17 00:02:31 -07:00
Bob Lantz b7097daad4 Pass make codecheck. 2010-08-17 00:02:30 -07:00
Bob Lantz 52082ff3f9 mininet.node.SWITCH_PORT_BASE specifies first switch port number.
This should be mostly cosmetic, but it causes switches to number
their ports consistently with OpenFlow 1.0, which starts at 1.
For older versions of OpenFlow, SWITCH_PORT_BASE may be set to zero.
2010-08-17 00:02:30 -07:00
Bob Lantz b78c938201 Changed license to OpenFlow license. 2010-08-17 00:02:30 -07:00
Bob Lantz dde9c91dcf Added error message if we can't read script file. 2010-08-17 00:02:30 -07:00
Bob Lantz 9d0dbe488a Added "source" command and restored echo after noecho command.
Interactive commands should "work", sort of.
2010-08-17 00:02:29 -07:00
Bob Lantz 6d2416ecbe Removed test for reference kernel implementation, for now at least. ;-( 2010-08-16 23:02:04 -07:00
Bob Lantz f00101716b Added additional sanity checks for when OF/OVS isn't installed. 2010-08-16 23:01:31 -07:00
Bob Lantz b47cdfea26 Added pathCheck for additional sanity when OF/OVS isn't installed. 2010-08-16 23:01:06 -07:00
Bob Lantz f95aebb4f9 Remove blank lines to pass code check. 2010-08-16 23:00:43 -07:00
Bob Lantz d869d82027 Added support for pre- and post-test CLI scripts. 2010-08-16 20:21:08 -07:00
Bob Lantz 54d026f656 Change to automatically update IP and MAC addresses. 2010-08-16 19:36:00 -07:00
Bob Lantz 68c89df8a1 Pass make codecheck. 2010-08-16 19:35:49 -07:00
Bob Lantz dd159b4a73 mininet.node.SWITCH_PORT_BASE specifies first switch port number.
This should be mostly cosmetic, but it causes switches to number
their ports consistently with OpenFlow 1.0, which starts at 1.
For older versions of OpenFlow, SWITCH_PORT_BASE may be set to zero.
2010-08-16 14:49:02 -07:00
Brandon Heller 299925c22f Add more param choices for iperf udp on CLI 2010-08-16 12:04:24 -07:00
Brandon Heller 7d83d46270 Remove print statement left in 2010-08-16 12:04:24 -07:00
Brandon Heller 2fffa0bb6f Change port base from 0 to 1
OpenFlow versions > v0.9 require this.

Only tested w/FatTree topo - it's almost a guarantee that this breaks
every other topology.
2010-08-16 12:04:24 -07:00
Brandon Heller 0a6e54231e Set default switch type to OVS 2010-08-16 12:04:24 -07:00
Brandon Heller 6b2a3b187b Small OVS API change 2010-08-16 12:04:24 -07:00
Brandon Heller e282b6e29f Fix --mac breakage
The OVS interface for this moved to ovs-openflowd.

This functionality was never there for the user-space switch.  Now it's
in.
2010-08-16 12:04:23 -07:00
Brandon Heller 7abca147c4 vm: Remove SSH keychain load-on-boot script 2010-08-16 12:04:23 -07:00
Brandon Heller 71ba12c539 vm: Forgot to run boot.sh 2010-08-16 12:04:23 -07:00
Brandon Heller b97415eed4 vm: Use OVS git release
OVS1.0.1 does not work with veth pairs.
2010-08-16 12:04:23 -07:00
Brandon Heller 9f8c25515f Add missing dep for cbench 2010-08-16 12:04:23 -07:00
Brandon Heller 011b02f886 Update VM install for 1.0
Remove all OpenFlow Ref kmod stuff.
2010-08-16 12:04:23 -07:00
Bob Lantz fa8693480a Changed license to OpenFlow license. 2010-08-16 11:49:44 -07:00
Brandon Heller fc75a1b185 Add ability to specify hosts for iperf test 2010-08-16 11:41:25 -07:00
Bob Lantz 6e9074f89e Added error message if we can't read script file. 2010-08-10 18:57:00 -07:00
Bob Lantz 6aff964ea0 Added "source" command and restored echo after noecho command.
Interactive commands should "work", sort of.
2010-08-10 18:47:15 -07:00
Brandon Heller 57aae3e103 Add more param choices for iperf udp on CLI 2010-08-10 04:28:18 -07:00
Brandon Heller 60a39a7241 Add ability to specify hosts for iperf test 2010-08-10 02:16:36 -07:00
Brandon Heller 1a52deeea6 Remove print statement left in 2010-08-10 02:05:20 -07:00
Brandon Heller 956546acc7 Change port base from 0 to 1
OpenFlow versions > v0.9 require this.

Only tested w/FatTree topo - it's almost a guarantee that this breaks
every other topology.
2010-08-09 23:22:40 -07:00
Brandon Heller e9d4482e42 Set default switch type to OVS 2010-08-06 10:39:39 -07:00
Brandon Heller d26abda426 Small OVS API change 2010-08-06 10:38:15 -07:00
Brandon Heller 81d27b3c56 Fix --mac breakage
The OVS interface for this moved to ovs-openflowd.

This functionality was never there for the user-space switch.  Now it's
in.
2010-08-06 10:34:17 -07:00
Brandon Heller 72ddde869c vm: Remove SSH keychain load-on-boot script 2010-08-06 01:15:40 -07:00
Brandon Heller cd19cf520f vm: Forgot to run boot.sh 2010-08-06 00:44:29 -07:00
Brandon Heller a434c3d1b6 vm: Use OVS git release
OVS1.0.1 does not work with veth pairs.
2010-08-06 00:36:39 -07:00
Brandon Heller 6aa7f3493b Add missing dep for cbench 2010-08-05 16:56:50 -07:00
Brandon Heller 32b122bf42 Update VM install for 1.0
Remove all OpenFlow Ref kmod stuff.
2010-08-04 21:56:04 -07:00
Bob Lantz 272d496dfe Darned trailing whitespace. 2010-06-16 12:24:45 -07:00
Bob Lantz a6661f0ac1 Consistently use tcp:%s:%d for controller IP address format.
(In user, kernel and ovsk switch classes.)
2010-06-16 12:21:43 -07:00
Bob Lantz 68f5925ed6 Changed port to int type (was string, which caused %d not to work in node.py.) 2010-06-16 12:15:29 -07:00
Brandon Heller 3b48e82990 Add rough tutorial VM changes 2010-05-20 16:23:08 -07:00
Bob Lantz c26875cb55 Fixed minor breakage due to code cleanup. 2010-05-07 01:15:41 -07:00
Bob Lantz e3f6ecca97 Pass codecheck. 2010-05-06 17:48:15 -07:00
Bob Lantz 82b7207295 Pass pylint. 2010-05-06 16:24:15 -07:00
Bob Lantz 259d713315 Pass pyflakes. 2010-05-04 19:11:12 -07:00
Bob Lantz c79882b766 Fixed typo. 2010-05-04 17:32:46 -07:00
Bob Lantz fa20913b56 Added space to one line. 2010-04-29 16:18:25 -07:00
Bob Lantz 271013e0dc Minor cleanup. 2010-04-27 15:13:25 -07:00
Bob Lantz 6c5cc2bfee Fix malformed patch format.
For some reason, the leading spaces were missing.
2010-04-23 15:08:30 -07:00
Bob Lantz 83e7ea2a0d Correction: blacklist.conf -> blacklist
On debian, the module blacklist is blacklist, not
blacklist.conf.
2010-04-23 15:06:42 -07:00
Bob Lantz 6ef2973fe2 Use switches rather than switches.keys().
Minor cosmetic change, really.
2010-04-22 17:16:53 -07:00
Bob Lantz e55cbef182 Removed debugging printing.
Note now that we can pass options into switches; for example,
we could enable stp with Switch( 's1', opts='--stp' ).
2010-04-22 17:12:22 -07:00
Bob Lantz 3758da2ec8 Minor comment change. 2010-04-22 17:08:39 -07:00
Bob Lantz 121eb4496b Changed to support new cmd() interface.
It seems that it is more convenient to be able to call

cmd( 'foo', 'bar', 1)

for example. However, this may make it slightly less
efficient, so we will see how it works.
2010-04-22 17:06:34 -07:00
Bob Lantz 8bc0037938 Fixed link check and updated quietRun interface.
Link check wasn't quite right - e.g. 'eth1' could be found in
'eth10' previously.

Updated quietRun to allow passing in args directly rather than
as a list.
2010-04-22 17:05:27 -07:00
Bob Lantz 54dfb2434a Changed to use new cmd interface.
I'm still not 100% sure on this.
2010-04-22 17:04:48 -07:00
Bob Lantz b145865407 Added comment advising use of high-level API. 2010-04-22 17:04:17 -07:00
Bob Lantz 83332c1a42 Handle interfaces (e.g. real interfaces) without remote Node. 2010-04-22 17:03:26 -07:00
Bob Lantz d2ff558da7 Correctly handle xterm creation with new makeTerm interface. 2010-04-22 17:02:41 -07:00
Bob Lantz 34954fe671 Minor comment change. 2010-04-22 17:02:19 -07:00
Bob Lantz ab1fb093d1 Added output hook and graph. 2010-04-22 17:01:54 -07:00
Bob Lantz 2a554ae33c Changed 'args' to 'line' and fixed iperfudp. 2010-04-12 18:56:50 -07:00
Bob Lantz caf024bc98 Made help string a class var. 2010-04-12 18:52:00 -07:00
Bob Lantz e555f83c97 Replaced stdout.write() with output() 2010-04-12 18:45:43 -07:00
Bob Lantz c16679863b Updated comments to reflect interactive command support.
It may be fragile, but it does sort of work.
2010-04-12 18:37:33 -07:00
Bob Lantz f800e5124d Tweaks for better interactive command handling. 2010-04-12 18:34:52 -07:00
Bob Lantz f24e70a435 Added timeout option for monitor().
This allows monitor() to be used for polling. Of course, you
probably want to use poll() first anyway, but it's nice not
to have to block if there's no output.
2010-04-12 18:33:20 -07:00
Bob Lantz 3482b4467c Changed to not print control chars we don't handle. 2010-04-12 18:32:32 -07:00
Bob Lantz e7ba6b9ebb Add title to consoles. 2010-04-11 01:43:35 -07:00
Bob Lantz bbe5f8a389 Minor comment changes. 2010-04-11 01:42:58 -07:00
Bob Lantz fce4d59dc1 Added ability to show switches and controllers. 2010-04-11 01:12:23 -07:00
Bob Lantz f583900da9 Added default title of 'Node'. 2010-04-11 01:12:11 -07:00
Bob Lantz 68f97b74ad Added explicit xterm and gterm commands.
This is not as generic as having a single 'term' command, but
it's a lot more convenient to use.
2010-04-10 23:54:05 -07:00
Bob Lantz 9ab2cba870 Fixed gterm support; quote and join -e argument. 2010-04-10 23:53:00 -07:00
Bob Lantz 99c035d9ca Changed to automatically call build() if necessary. 2010-04-10 23:52:15 -07:00
Bob Lantz 6c82d1bae7 Added blurbs for new demos. 2010-04-10 23:51:57 -07:00
Bob Lantz 03e5965236 Changed to use info() and not call build() unnecessarily. 2010-04-10 23:51:34 -07:00
Bob Lantz c3a583c813 Changed comment on iperf. 2010-04-10 22:40:12 -07:00
Bob Lantz e123afea97 Changed to let iperf run indefinitely. Simplifies things. 2010-04-10 22:38:20 -07:00
Bob Lantz 7ad4829203 Added iperf command. 2010-04-10 22:27:55 -07:00
Bob Lantz a650b8e657 Fixed catch: typo. 2010-04-10 22:04:55 -07:00
Bob Lantz a4db2c2fca Removed unnecessary init() calls. 2010-04-10 21:35:58 -07:00
Bob Lantz 4720f559c3 Fixed to import TreeNet and to skip unnecessary init(). 2010-04-10 21:35:35 -07:00
Bob Lantz 56278434a8 Changed to use library TreeNet() and remove unnecessary init(). 2010-04-10 21:35:02 -07:00
Bob Lantz 4a67fc9a4a Changed screen(1) names from hN to mininet.hN.
This should make it easier for people who use screen for other purposes
to identify which sessions were created by mininet.
2010-04-10 21:31:34 -07:00
Bob Lantz 257a2f636b Added ovs-openflowd to list of zombies.
We may still need additional code to clean up after ovs.
2010-04-10 21:30:35 -07:00
Bob Lantz c6e7eaf07c Changed to not die immediately if we send in an empty command.
There might still be some issues with this however...
2010-04-10 21:29:34 -07:00
Bob Lantz cd7457480b Re-added TreeNet convenience function. 2010-04-10 21:29:11 -07:00
Bob Lantz 5fb3d5426c Restored numbering of tree nodes. 2010-04-10 21:15:15 -07:00
Bob Lantz 724f1144ac Changed messages slightly.
For a network, we create "links" rather than "edges" on a graph.

"Edges" is a bit confusing because the links may not be edge links on
the network!

Also, since you're not necessarily running a "test", I changed it to
just say that we're "Done."
2010-04-10 21:10:25 -07:00
Bob Lantz 8e4d818a60 Made the scroll bars narrower to fit ping output on my 15" screen. 2010-04-10 21:01:44 -07:00
Bob Lantz d0e53ca863 Added semi-interactive command line support.
Now you can type commands into each mini-console!
2010-04-10 20:52:45 -07:00
Bob Lantz f89015971f Added default prefix for window titles if none is specified. 2010-04-10 20:52:02 -07:00
Bob Lantz 388f54e148 Fixed regex typo. 2010-04-10 20:25:16 -07:00
Bob Lantz ff6145c015 Change import to reflect renamed mininet.term module. 2010-04-10 20:24:31 -07:00
Bob Lantz 3e6b3dd273 Added an example of how to make an empty Mininet and add things to it. 2010-04-10 19:29:04 -07:00
Bob Lantz c58bb42f57 Added updbwgraph, a demo of how to graphically monitor node output. 2010-04-10 19:28:18 -07:00
Bob Lantz afe0ce81a5 Added simple console tool demo.
The console tool spawns and monitors a bunch of nodes.
2010-04-10 19:26:54 -07:00
Bob Lantz e10abba08d Added a simple graphical network editor demo. 2010-04-10 19:26:20 -07:00
Bob Lantz b5672f1565 Cleaning up read/monitor/interrupt.
Now you don't need to specify a default read count.

Now, by default, we print the pid out in sendCmd() which allows us
to snarf it later and set lastPid correctly.

Now, we wrap os.kill() in a try block, so that if the process is
already gone we don't get an exception.
2010-04-10 19:24:47 -07:00
Bob Lantz de901ef058 Modified to allow execed nodes to work, if we ever reinstate them. 2010-04-10 19:24:11 -07:00
Bob Lantz b1affce867 Removed TreeNet() convenience function (moved to topolib.) 2010-04-10 19:23:45 -07:00
Bob Lantz 8bbd368576 Moved TreeNet() convenience function here. 2010-04-10 19:23:23 -07:00
Bob Lantz ce67093a62 Minor format tweaks. 2010-04-09 01:46:51 -07:00
Brandon Heller 15b482e375 Support gnome terminals too
Caution: code is incomplete - can't set a default type from the CLI
and in some places the phrase xterm should be replaced by terminal.
2010-04-05 02:27:00 -07:00
Brandon Heller e540ab5726 Use quit rather than kill when cleaning up screens
Kill seems to get ignored, while quit kills the detached sessions.
2010-04-05 02:07:23 -07:00
Brandon Heller ce9cd5bee5 Add command to spawn an xterm 2010-04-05 01:06:30 -07:00
Bob Lantz b14b1ee441 Remove unneeded '-' in '-n', which was causing error message. 2010-03-30 16:09:43 -07:00
Bob Lantz 06b8210ea1 Changed TreeTopo() to number hosts from h1 to hN. 2010-03-30 15:06:43 -07:00
Bob Lantz f2dee12d93 Added LICENSE.
We may wish to change this just to "mininet is copyrighted by its
authors" or something...
2010-03-26 19:05:22 -07:00
Bob Lantz 5eac2a8403 Changed help message to be a bit clearer. 2010-03-26 18:47:41 -07:00
Bob Lantz 5791f32a2d Fix --controller=remote 2010-03-26 18:41:09 -07:00
Bob Lantz ffd089ea1c Changed git clone command. 2010-03-26 17:50:37 -07:00
Bob Lantz 8eae25501c Changed installation notes to reflect VM image install. 2010-03-26 17:45:44 -07:00
Bob Lantz 9a17de9166 Minor changes for alpha.
Added alpha releas comments, inc. do not distribute yet.

Added install notes for install.sh.
2010-03-26 15:48:25 -07:00
Brandon Heller 74cd084315 Clean up a few more things 2010-03-23 00:51:45 -07:00
Bob Lantz a0c97d110c Added patches for openflow reference version.
These may not be needed if they are pushed upstream.
2010-03-26 14:05:48 -07:00
Bob Lantz 8125370d8e Minor tweaks for alpha. 2010-03-26 14:04:04 -07:00
Bob Lantz add0ee6059 Added sudo for aptitude install. 2010-03-26 13:50:13 -07:00
Bob Lantz e21aa14fac Minor comment edits. 2010-03-26 12:33:47 -07:00
Bob Lantz 3f02f15e47 Added kbuild script for 2.6.33.1 2010-03-26 12:28:55 -07:00
Brandon Heller 1e4f337584 Fix path for cleaning 2010-03-23 01:18:48 -07:00
Brandon Heller f5191b855f Revert "Add ability to pause and resume any node"
This reverts commit 07aad11081.

When the semantics are clear, functionality like this will get added back to
Mininet.

Conflicts:

	mininet/node.py
2010-03-23 01:15:51 -07:00
Brandon Heller f32a546855 Fix NOX breakage
Controllers are no longer namespace-able, and all calls need one fewer
arg.

Also use more sensible temporary variable name.
2010-03-23 00:48:35 -07:00
Brandon Heller e4370f7ee7 Run depmod for specified kernel 2010-03-22 23:56:58 -07:00
Brandon Heller c9ae0ab003 Generate initrd if missing
Works around bug in newer version of kernel-package.
2010-03-23 01:45:59 -07:00
Brandon Heller fc48e6ee7c Add VM build option for 2.6.33 OVS/OF 2010-03-22 23:17:22 -07:00
Brandon Heller 9a7717ed9d Get past NOX build error w/newer autoconf 2010-03-22 22:44:31 -07:00
Brandon Heller c532689266 Clone NOX into ~/ and fix typo 2010-03-22 22:28:13 -07:00
Brandon Heller d82b6183d6 Get past verification error 2010-03-22 22:14:57 -07:00
Brandon Heller a9aebba7f7 Restore 2.6.29 as default image 2010-03-22 22:14:10 -07:00
Brandon Heller 9098528a16 Fix CLI breakage with new test interface 2010-03-24 07:24:26 -07:00
Brandon Heller 55c335849a Add OVS patch for 2.6.33+
Thanks to Ben Pfaff who wrote the patch
2010-03-24 05:20:12 -07:00
Brandon Heller 4779fa84f9 Add bash_profile for VM build 2010-03-24 05:20:12 -07:00
Brandon Heller 0b1832ddc2 Consolidate install script and add cmd-line options
Now, the majority the install can be done with one line, but the other
to each part of the install is still available.

Also fix a few bugs and add Wireshark coloring rules.
2010-03-24 05:19:52 -07:00
Bob Lantz e91b2815fa Moved waitForNode. Maybe candidate for util.py or static method... 2010-03-24 17:21:57 -07:00
Bob Lantz c2cc1aacf6 Attempt to handle interrupts in the middle of CLI commands. 2010-03-24 17:17:24 -07:00
Bob Lantz 41badb9686 Pass code check. 2010-03-24 17:08:25 -07:00
Bob Lantz 45e82d0952 Restored treeping64 and tre1024 examples and updated README. 2010-03-24 17:04:11 -07:00
Bob Lantz d93c6ef6ce Change to use setLogLevel() 2010-03-24 17:03:57 -07:00
Bob Lantz fe414722ac Change to use setLogLevel() 2010-03-24 17:03:49 -07:00
Bob Lantz 8423875b37 Change to use new interface to mn.run() 2010-03-24 17:03:27 -07:00
Bob Lantz 47acf53974 Change to use printf rather than echo. 2010-03-24 17:02:44 -07:00
Bob Lantz 67516aa44f Change run() to allow running external functions. 2010-03-24 16:58:44 -07:00
Bob Lantz 6e4e79afc3 Add setLogLevel as an export. 2010-03-24 16:58:27 -07:00
Bob Lantz 22f807fc6f Reinstated multitest example and updated examples/README. 2010-03-24 15:20:22 -07:00
Bob Lantz b2ef87ae51 Changes to pass code check.
We should check NOXController and RemoteController to make sure that
they are not broken, but I cannot do this at the moment.
2010-03-24 15:02:28 -07:00
Bob Lantz 0774c8bbce Added two spaces before in-line # comments. 2010-03-24 14:42:42 -07:00
Bob Lantz cf6f67045b Added two spaces before in-line # comments. 2010-03-24 14:41:40 -07:00
Bob Lantz 353411422e Minor formatting changes. 2010-03-24 13:42:46 -07:00
Bob Lantz c70aab0a38 Changed mininet.link() to mininet.configLinkStatus(src,dst,status)
Also rearranged parameters in link command to

mininet> link s1 h2 up

To resemble ifconfig a bit more.
2010-03-23 15:25:12 -07:00
Bob Lantz fb2f652319 Changed mininet.link() to support multiple links.
It should also probably be renamed to something like:
configLinks(src, dst, status).
2010-03-23 15:05:55 -07:00
Bob Lantz 178a3d8410 Minor tweaks. 2010-03-22 19:34:47 -07:00
Bob Lantz c8fbd4465c Updated installation notes and added patch for controller.c. 2010-03-22 17:50:02 -07:00
Bob Lantz f2eaeac78c Added patch for 2.6.33.x kernel. 2010-03-22 16:24:22 -07:00
Bob Lantz 6ab417ccd7 Added setup for kernel switch. 2010-03-22 16:24:04 -07:00
Bob Lantz 3e624fb237 Added openvswitch kernel switch. 2010-03-17 23:43:03 -07:00
Bob Lantz 8abc3472e3 Pass code check. 2010-03-16 14:59:46 -07:00
Bob Lantz ec7b211c41 Buffered output. Added net.monitor() and node.readline()
Moved monitor() and readline() into net.py and node.py respectively,
which will hopefully be useful for monitoring large sets of hosts,
as is done in udpbwtest.py.

Changed iperf to use interactive command infrastructure (such as it
is), which may make it more reliable. Hopefully it's a bit clearer
as well, although it is slightly more complicated.
2010-03-16 14:59:45 -07:00
Bob Lantz 6ab1f1ff23 Run in non-verbose mode, and print network sizes. 2010-03-16 14:59:45 -07:00
Bob Lantz 736038f8ef Added README for examples. 2010-03-16 14:59:45 -07:00
Bob Lantz e4c82e526e Change Node.monitor() to just return output.
It seems easier to rely on node.waiting for the moment.
2010-03-16 14:59:45 -07:00
Brandon Heller a3d899123d Comment clarification 2010-03-14 03:57:25 -07:00
Brandon Heller b055728fd5 Automatically load kernel module dependencies
Before this commit, you'd have to manually insert the kernel module for
OVS or OF kernel modules, and you couldn't run one regression test with
all 3.

Now, these are kmod insert/remove is handled automatically.
2010-03-14 03:53:16 -07:00
Brandon Heller a165881049 Ignore pyc files 2010-03-14 03:53:16 -07:00
Brandon Heller e01292c167 Fix minor typo 2010-03-14 03:53:16 -07:00
Brandon Heller 956bf4f2d0 Fix param typo 2010-03-14 03:53:15 -07:00
Bob Lantz e100d1d9d0 Change ofprotocold -> ovs-openflowd in OVSKernelSwitch. 2010-03-15 19:27:55 -07:00
Bob Lantz ad824e4e84 Pass codecheck. 2010-03-15 19:24:54 -07:00
Brandon Heller 3fac5a43d7 Handle ping output for paused hosts 2010-03-13 21:44:11 -08:00
Brandon Heller 07aad11081 Add ability to pause and resume any node 2010-03-13 21:35:52 -08:00
Brandon Heller 28cd95c374 Fix link command parsing bug 2010-03-13 21:32:11 -08:00
Brandon Heller af380c8912 Show PIDs in dump() 2010-03-13 16:36:34 -08:00
Brandon Heller 8d3c2859e4 Add port status change command 2010-03-13 06:30:53 -08:00
Brandon Heller e7c787b343 Fix sending commands to switches 2010-03-13 06:02:40 -08:00
Bob Lantz cae423e543 For now, make install. 2010-03-14 19:32:10 -07:00
Bob Lantz 7f9eb9e540 Changed remaining refs to netns to refer to mnexec. 2010-03-14 19:28:19 -07:00
Bob Lantz 3465c9ea64 Updated to reflect changes and include 2.6.33 patch. 2010-03-14 19:19:10 -07:00
Bob Lantz ed097b3b9c Working a bit on text files. Removed netns. 2010-03-14 15:18:17 -07:00
Bob Lantz bca38c997e Minor config notes changes. 2010-03-14 00:18:24 -08:00
Bob Lantz 0e2a7240c3 Reinstate mnexec in install. 2010-03-14 00:11:36 -08:00
Bob Lantz 51a1482407 Removed unused variable. 2010-03-14 00:03:54 -08:00
Bob Lantz 0e3fef2fb3 Merge branch 'master' of yuba.stanford.edu:mininet
Conflicts:
	mininet/node.py
2010-03-13 18:28:48 -08:00
Bob Lantz bcacfc0510 Support for control-C. Finally.
I've changed the way things work a bit:

1. netns is replaced by mnexec, a general-purpose mininet helper.

2. For interactive commands, we now use mnexec -p, which prints out
   the pid, so we can kill it when someone hits control-C!

3. We close file descriptors for subshells. This might save memory,
   but who knows.

4. We detach our subshells from the tty using mnexec -s; thus
   control-C should not terminate everything.

5. Given 4, mn -c is now necessary if you kill mininet.
2010-03-13 18:23:07 -08:00
Bob Lantz c4ae423238 Support for control-C. Finally.
I've changed the way things work a bit:

1. netns is replaced by mnexec, a general-purpose mininet helper.

2. For interactive commands, we now use mnexec -p, which prints out
   the pid, so we can kill it when someone hits control-C!

3. We close file descriptors for subshells. This might save memory,
   but who knows.

4. We detach our subshells from the tty using mnexec -s; thus
   control-C should not terminate everything.

5. Given 4, mn -c is now necessary if you kill mininet.
2010-03-13 18:19:23 -08:00
Bob Lantz d4b53ea73d Removing setsid for the moment - breaks shutdown.
Close to solving this set of problems.
2010-03-13 16:37:13 -08:00
Bob Lantz e953444fa5 Corrected list checkin sendCmd. 2010-03-13 13:59:03 -08:00
Bob Lantz 74993b6536 Changes to note neither ^C nor interactive commands work atm. 2010-03-12 16:40:58 -08:00
Bob Lantz 7b323bd4f4 Removed executability since mn -c is easier! 2010-03-12 16:38:26 -08:00
Bob Lantz 7cbde77496 Added blank line. 2010-03-12 16:24:28 -08:00
Bob Lantz 08ed5bb68a Made executable. 2010-03-12 16:22:40 -08:00
Bob Lantz 9e7aee2061 Merge branch 'master' of yuba.stanford.edu:mininet
Conflicts:
	setup.py
2010-03-12 16:21:52 -08:00
Bob Lantz 740d7ce39a Added newline at EOF. 2010-03-12 16:17:32 -08:00
Bob Lantz 4065511abb Detach shells from tty; monitoring changes.
Call netns using setsid to detach from the tty; this is
intended to fix the problem of control-C killing your network.

sendInt() doesn't actually work - hopefully we can fix this in the
future, but it's tricky since we want to detach the many shells from
our tty, but then optionally send tty interrupts to them! Ideally we
would either know the pid of the subprocess or be able to send a signal
to bash to get it to interrupt its subprocess.

waitOutput() now uses monitor. We also handle sentinels
coming in the middle of output (but default at end should
still work well.)
2010-03-12 16:16:28 -08:00
Bob Lantz 2ad03eea40 Minor cleanup; got rid of backslash. 2010-03-12 16:16:27 -08:00
Bob Lantz 406f5da19d Change to mention 2.6.33 kernel. 2010-03-12 16:13:09 -08:00
Bob Lantz 5947e017fd Minor changes and corrections. 2010-03-12 16:13:09 -08:00
Brandon Heller 44c63c2abd Fix OVS breakage 2010-03-12 16:13:09 -08:00
Brandon Heller 77529ce550 Ignore binary and egg data 2010-03-12 16:13:08 -08:00
Brandon Heller c30e500731 Update install instructions 2010-03-12 16:13:08 -08:00
Brandon Heller b403cc7f96 Colorize git output by default in VM 2010-03-12 16:13:08 -08:00
Brandon Heller 3b1174eff6 Update install scripts
Don't build NOX and OVS as root.  Also don't nuke kernel src.  Install
newer autoconf needed for OVS install from Deb backports, not src.
2010-03-12 16:13:08 -08:00
Bob Lantz c46c1ae6ef Merge branch 'master' of yuba.stanford.edu:mininet 2010-03-11 17:23:29 -08:00
Bob Lantz 9dbe572abe Detach shells from tty; monitoring changes.
Call netns using setsid to detach from the tty; this is
intended to fix the problem of control-C killing your network.

sendInt() doesn't actually work - hopefully we can fix this in the
future, but it's tricky since we want to detach the many shells from
our tty, but then optionally send tty interrupts to them! Ideally we
would either know the pid of the subprocess or be able to send a signal
to bash to get it to interrupt its subprocess.

waitOutput() now uses monitor. We also handle sentinels
coming in the middle of output (but default at end should
still work well.)
2010-03-11 17:16:27 -08:00
Bob Lantz 9f32a08b28 Minor cleanup; got rid of backslash. 2010-03-11 16:54:30 -08:00
Bob Lantz 47abe6d950 Change to mention 2.6.33 kernel. 2010-03-11 16:53:58 -08:00
Bob Lantz 3a7d2a133e Minor changes and corrections. 2010-03-11 16:53:29 -08:00
Brandon Heller b0a7a2579a Fix OVS breakage 2010-03-10 15:44:00 -08:00
Brandon Heller 4e57ddbce1 Ignore binary and egg data 2010-03-09 22:45:54 -08:00
Brandon Heller 8f30aa0017 Update install instructions 2010-03-09 22:37:29 -08:00
Brandon Heller f7f2f977d5 Colorize git output by default in VM 2010-03-09 22:16:30 -08:00
Brandon Heller 188964c911 Update install scripts
Don't build NOX and OVS as root.  Also don't nuke kernel src.  Install
newer autoconf needed for OVS install from Deb backports, not src.
2010-03-09 22:16:30 -08:00
Bob Lantz e3a2ef011f Fixed docstrings for switch arg: name. 2010-03-09 21:52:36 -08:00
Bob Lantz d44a5843d3 Reinstantiated inNamespace and routed control network.
We need to figure out how to specify the IP addresses for the
routed control network. For now I'm going back to 192.168.12x.y

Also changed controller params to use IP strings rather than
numbers. However, we still need to clarify what ControllerParams
is actually for.
2010-03-09 21:48:14 -08:00
Bob Lantz 47dbca2921 Made iperf verbose and fixed node command output. 2010-03-09 21:47:32 -08:00
Bob Lantz 1a9d2eac29 Fixed createLink args and cleaned up slightly. 2010-03-09 21:47:02 -08:00
Bob Lantz 73a323f2a2 Made compatible with rearranged args for createLink. 2010-03-09 21:46:32 -08:00
Bob Lantz 315cbf9e79 Use IP address strings rather than hex number. 2010-03-09 21:45:32 -08:00
Bob Lantz 7ecd095c45 Allow *args and **kwargs. 2010-03-09 21:44:45 -08:00
Bob Lantz 7ba9e05542 Fixed errors due to renaming buffer to buf. 2010-03-08 15:36:09 -08:00
Bob Lantz 80be564274 Removed underscores for public Node methods. Minor cleanup & comments. 2010-03-08 15:32:41 -08:00
Bob Lantz 2626693241 Changed to report repeated pep8 issues. 2010-03-08 15:31:23 -08:00
Bob Lantz a16fae676f Tweaks to separate command and options. 2010-03-05 17:19:02 -08:00
Bob Lantz 91b9e374a0 Revived sshd.py example. 2010-03-05 17:13:44 -08:00
Bob Lantz be96355468 Added some additional explanatory comments. 2010-03-05 17:01:37 -08:00
Bob Lantz b924c5b562 Fixed printing in CLI.net() 2010-03-05 17:00:44 -08:00
Bob Lantz 73360ab95c Moved TreeTopo to mininet.topolib. 2010-03-05 15:15:40 -08:00
Bob Lantz 5156b3894c Renamed LinearTestTopo() and added full ping test. 2010-03-05 15:15:05 -08:00
Bob Lantz 11a6d400c5 Added mininet.topolib to store useful topologies. 2010-03-05 15:07:00 -08:00
Bob Lantz fd21c46f64 Restored udpbwtest.py 2010-03-05 14:49:17 -08:00
Bob Lantz c80e18cd46 Worked once on user, kernel for 1-20 switches. 2010-03-05 14:12:54 -08:00
Bob Lantz 1bda2d21ad Changed to use Node.MAC(). 2010-03-05 14:12:31 -08:00
Bob Lantz 6f45478f18 Removed spaces. 2010-03-05 13:59:52 -08:00
Bob Lantz 75d72d960b Restored accidentally deleted kill %ofpd lines. Added Node.MAC() 2010-03-05 13:58:20 -08:00
Brandon Heller cdeaca8682 Rename cliinfo debug level to output 2010-03-05 04:11:29 -08:00
Brandon Heller dfc08a869e Add none test to measure MN creation/teardown time 2010-03-05 04:08:58 -08:00
Brandon Heller c8641d7d15 Fix remote controller param 2010-03-05 01:13:22 -08:00
Brandon Heller 7ae73e677f Fix pylint warnings 2010-03-04 22:36:34 -08:00
Brandon Heller f259e2fa1c Don't try to codecheck non-existent mnclean 2010-03-04 22:26:29 -08:00
Brandon Heller 509a852f18 Add TreeTopo to cmd line 2010-03-04 21:52:41 -08:00
Brandon Heller 3eb5abe6a7 Make cleanup a param of mn, not a separate script
Also switch from print to info statements, to enable a non-verbose
clean.  Instead of 'mnclean', now run 'mn -c'.
2010-03-04 21:47:50 -08:00
Brandon Heller 4e69ae83dd Slightly reduce cliinfo verbosity 2010-03-04 21:34:01 -08:00
Brandon Heller bb941950d5 Add flexible topology input parsing
Now you can pass a topology name followed by params.  For example, to
create a switch with 3 hosts:

  sudo mn --topo single,3
2010-03-04 21:29:32 -08:00
Brandon Heller 1a40cd0477 Add new loglevel to display CLI output only
Also print warning if user chooses a loglevel that will hide CLI output.
2010-03-04 18:58:37 -08:00
Bob Lantz c246e2d55e Renamed topo_2sw_2host.py -> topo-2sw-2host.py
Still could be better though.... and we need more topology
examples.
2010-03-04 16:56:11 -08:00
Bob Lantz 95f6e7b728 linearbandwidth.py now works for kernel switch. 2010-03-04 16:55:38 -08:00
Bob Lantz 47e26cce19 Fixed to be compatible with new setIP(). 2010-03-04 16:55:21 -08:00
Bob Lantz 086ef80e8e Changed setIP to accept numeric prefix len. Added Node.deleteIntfs(). 2010-03-04 16:53:39 -08:00
Bob Lantz 48a8d297d1 Removed blank line. 2010-03-04 16:52:29 -08:00
Bob Lantz ddfbfc734c Added convenience mode to allow info( 'a', 1, 'b' )
Later we may wish to optimize this so that the arg lists are
not created if the logging level is too low.
2010-03-04 16:51:10 -08:00
Bob Lantz dc630c540a Restored scratchnet and scratchnetuser demos.
Also changed the str format for nodes to use str() rather
than repr() so we don't end up with extraneous quotes.
2010-03-03 14:37:14 -08:00
Bob Lantz efc9a01cf1 Moved link creation into Node.addIntf() and fixed util:CreateLink().
Also tweaked cmd/cmdPrint to make them more beautiful and functional,
and a few other minor changes, such as using a new idiom for verbose.

These changes support reinstating the examples.
2010-03-03 13:52:50 -08:00
Bob Lantz 04fa18dc61 Changed cmdPrint to cmd. 2010-03-03 13:51:58 -08:00
Bob Lantz a681f9b645 Added debug() convenience function. 2010-03-03 13:50:25 -08:00
Bob Lantz 54977c79cd Changed to be executable. 2010-03-03 13:49:58 -08:00
Bob Lantz 1fdcd6768c Added py command to evaluate Python expressions, e.g. h1.cmd('ls') 2010-03-03 13:46:44 -08:00
Bob Lantz 137ec3054d Removed trailing spaces. 2010-03-01 15:38:02 -08:00
Bob Lantz 63214ea2af Merge branch 'customtopos' into bl-dev 2010-03-01 15:34:40 -08:00
Bob Lantz e0cfcdd505 Tweaks to pass code check. 2010-03-01 15:21:29 -08:00
Bob Lantz 2235f21698 Minor cleanup of mn/net and fixes for CLI.
All commands should work now.
2010-02-27 23:40:05 -08:00
Bob Lantz c3a4440025 Changed custom feature so that params aren't added to globals.
There is probably a better way of doing this, but currently
parseCustomFile can modify globals (e.g. TOPOS) as well as
instance variables (self.validate) and classes (e.g. MyTopo),
which are also in the global name space.

Inconveniently enough, lambdas don't seem to be full closures
in Python; if they were, this trickiness would be unnecessary.

Even so, using execfile() seems like it might be a bit dubious...
2010-02-27 23:19:57 -08:00
Bob Lantz 5468377680 Removed blank line at EOF. 2010-02-27 13:55:12 -08:00
Bob Lantz dba3b59929 Changed to dump bad iperf output. 2010-02-27 13:54:38 -08:00
Bob Lantz 78073e1b6f Fixed to be compatible with modified Mininet() class. 2010-02-27 13:54:10 -08:00
Bob Lantz d40b0a9973 Merge branch 'customtopos' into bl-dev 2010-02-26 18:54:32 -08:00
Bob Lantz 235415cf49 Ran unpep8 on test_nets.py. 2010-02-26 17:25:38 -08:00
Bob Lantz 019bff8282 Made it possible to create a Mininet() without using a Topo object.
This increases flexibility by allowing a topology to be manually created
in Python, or specified using another format, without having to create
a Topo object first.

However, Topos are useful, and are still the default topology object!
2010-02-26 17:16:07 -08:00
Brandon Heller 28ab4a33d6 Add env var to install script 2010-02-18 12:10:36 -08:00
Brandon Heller 4f4f1dd2fa Fix KeyError for missing NOX env var 2010-02-18 11:44:08 -08:00
Brandon Heller 8ff7ee4297 Remove NOX_INSTALL file
NOX Install is covered in the wiki and in util/deb/install_nox.sh.
2010-02-18 11:37:50 -08:00
Brandon Heller 4e94bac0ae Update custom topo instructions 2010-02-18 11:36:56 -08:00
Brandon Heller fe29f64dd3 More specific topo example filename 2010-02-18 10:49:23 -08:00
Brandon Heller 2b083dd191 Add gitk to installed VM tools 2010-02-18 06:02:00 -08:00
Brandon Heller 777c90236e Add VM install scripts 2010-02-18 00:09:12 -08:00
Brandon Heller 8d8ac76e85 Move sysctl script to util 2010-02-17 22:47:03 -08:00
Bob Lantz 3e021c2579 Merge branch 'master' of yuba.stanford.edu:mininet 2010-02-16 16:04:31 -08:00
Bob Lantz 31b43002e7 Added a bit to comments, and removed trailing spaces. 2010-02-16 14:42:58 -08:00
Bob Lantz 64c451e01f Minor bug fixes and tweaks.
Shell now works (although we should use quietRun instead to avoid
file descriptor problem!)

exit/quit/EOF now all exit.

Renamed pingall and pingpair to make them easier to type - I think
commands should not require use of the shift key in general, although
ping-all and ping-pair might be OK.
2010-02-09 22:40:51 -08:00
Bob Lantz e34cd9a6cf Added warn to complement info, error. 2010-02-09 22:37:22 -08:00
Brandon Heller f52edfc545 Move sysctl params to separate file
Simplifies installation step
2010-01-31 06:58:02 -08:00
Brandon Heller befa1310df Revamp custom topology input
Defining custom topologies, switch types, controllers, and hosts is now
much easier.  Plus, all Ripcord-specific stuff has been moved out.
2010-01-30 02:46:08 -08:00
Brandon Heller 3774f234f0 Update license and add networkx dependency 2010-01-29 18:49:08 -08:00
Brandon Heller 114dcd5653 Improve CLI line editing capabilities
Convert CLI to use Python Cmd object, which provides line editing.
2010-01-29 14:42:53 -08:00
Brandon Heller 83097ff942 Fix errors from style changes 2010-01-29 13:29:12 -08:00
Bob Lantz 6d72a3cb0c Minor cleanup; clarified fdToNode (still need to test however.) 2010-02-08 15:51:43 -08:00
Bob Lantz d5886525cc Changed to use info() and error() logging aliases. 2010-02-08 15:51:25 -08:00
Bob Lantz f8952d56e1 Added info() and error() as aliases for lg.info() and lg.error() 2010-02-08 15:49:32 -08:00
Bob Lantz bd1e997f15 Remove backslash. 2010-02-08 15:43:23 -08:00
Bob Lantz 8895862acf Munged mn and mnclean into mininet style. 2010-02-08 15:42:31 -08:00
Bob Lantz 7c371cf32a Comment tweaks. 2010-02-05 17:29:15 -08:00
Bob Lantz e85f8bdf29 Removed hash-bang in module files which aren't executed directly,
with the exception of topo.py, which I haven't touched.
2010-02-05 17:22:18 -08:00
Bob Lantz 7d4b7b7f47 Comment tweaks and additions. 2010-02-05 17:18:08 -08:00
Bob Lantz 496b5f9ed0 Moved CLI into its own file. Also, MininetCLI is now just 'CLI'. 2010-02-05 17:01:03 -08:00
Bob Lantz 281f6e59db Minor changes to get 'make test' to pass.
- some namespace conflicts due to unpep8
- fixed infinite recursion caused by removing redundant makeIntfPair
2010-02-05 16:42:01 -08:00
Bob Lantz 80a8fa62d5 First crack at restoring mininet python style, assisted by handy
'unpep8' script, which does most of the work.

- topo.py is still in pep8
- not all examples work, but this is due to other issues
2010-02-05 02:33:34 -08:00
Bob Lantz bebe9dbed2 First crack at restoring Mininet style (via handy 'unpep8' script, which
does most of the work.)

topo.py is still in pep8, however
2010-02-04 23:35:07 -08:00
Bob Lantz 46fa564a8a Changed to ignore W0511, which fails on TODO, FIXME, etc..
We may wish to re-enable this later.
2010-02-04 23:13:33 -08:00
Bob Lantz 0df8b19568 Renamed logging_mod.py -> log.py
Updated other files accordingly.
2010-02-03 15:38:29 -08:00
Bob Lantz ac9554d6dc Renamed mn_run.py -> mn, mn_clean.py -> mnclean; updated Makefle
It's possible that mn_clean is a bit easier to read; mnclean may be easier
to type, however.

Added variables to Makefile so that source files are listed in a single
location.
2010-02-03 15:29:07 -08:00
Bob Lantz 799242c617 Fixed undefined variable 'custom' in setup(). 2010-02-03 15:06:41 -08:00
Brandon Heller 8f99421e02 Fix setuptools installation
The packages argument was incorrectly specified, leading to an install
process that would appear to have succeeded, but would not actually copy
code.

The error likely occurred due to copying setup.py from another project
where the source files were located in a different position relative to
setup.py.
2010-01-27 22:45:05 -08:00
Brandon Heller 8e8081c408 Add VL2 reduced topology 2010-01-25 15:27:50 -08:00
Brandon Heller 3031d31efe Add ability to read custom Mininets 2010-01-11 16:40:25 -08:00
Brandon Heller 1b6a9c3a20 Add missing pylint settings file 2010-01-09 21:12:17 -08:00
Brandon Heller f7c2df2513 Support OpenVSwitch in kernel-mode 2010-01-09 21:11:25 -08:00
Brandon Heller 723d068c51 Add static code checking for style and errors
This required a change to logging, which now uses a singleton pattern.

For all future checkins, 'make codecheck' should pass.
2010-01-09 17:59:43 -08:00
Brandon Heller ca58c896dd Restore user-space switch option
Switches and controller in root namespace only, for now.
2010-01-07 00:54:27 -08:00
Brandon Heller d856c81896 Support out-of-order link addition
Sort interface names before passing to dpctl for kernel switch, so that
links for multipath topologies can be added in any order.
2010-01-06 21:23:33 -08:00
Brandon Heller 6d2cd77b5a Add reversed version of the SingleSwitch topology
Possibly useful for adding custom port mappings.
2010-01-06 08:53:01 -08:00
Brandon Heller 80b3dbbd48 CLI: add node dump-all-data command 2010-01-06 08:52:38 -08:00
Brandon Heller 74ef761529 CLI: add interface dump command 2010-01-06 08:40:07 -08:00
Brandon Heller ee00736307 Add default ip and port for remote controller 2010-01-06 07:22:45 -08:00
David Erickson 60d9ead65a Added a RemoteController object
Now you can run a controller on a remote PC that is
not on the same pc as Mininet.
2010-01-01 03:26:58 -08:00
Brandon Heller 540379957b Add MAC auto set for switches
Also use indexing for DPIDs to avoid zeroed MAC
2010-01-01 03:16:57 -08:00
Brandon Heller 376bcba442 Add options for auto MAC and ARP setup.
Auto MAC setup sets each host MAC equal to its DPID, which simplifies
debugging.

Auto ARP setup removes the need for broadcast support for ARP, which
enables a smaller NOX controller.
2010-01-03 09:16:14 -08:00
Brandon Heller 433a7cc88c Make Ripcord-specific topologies optional
If ripcord.dctopo imports properly, then include its topologies in the
list of available ones.  Also replace topo.py with new generic
topologies and update paths.
2010-01-03 03:53:23 -08:00
Brandon Heller c98514ae44 Support more topologies 2010-01-03 02:44:08 -08:00
Brandon Heller ac65ea3ff3 Increase createLink retry count
Was seeing occasional errors with tests run back-to-back.
2010-01-03 02:43:30 -08:00
Brandon Heller fcf6a16f3d Remove accidentally-added iperf verbosity 2010-01-02 11:20:41 -08:00
Brandon Heller 0cd489a78b Add iperf UDP test 2010-01-02 10:58:28 -08:00
Brandon Heller 8a034f4f6c Add xterm support 2010-01-02 10:58:28 -08:00
Brandon Heller 1bb4412ff3 Separate kernel and user switches into separate objects 2010-01-02 10:58:28 -08:00
Brandon Heller 16c57ddb33 Enable controller-less setups 2010-01-02 10:58:28 -08:00
Brandon Heller 4804237fa7 Add more NOX options 2010-01-02 10:58:28 -08:00
Brandon Heller eeb9cb3c2b Restore iperf test
Also simplify test running.
2010-01-02 10:58:25 -08:00
Brandon Heller 83086439cc Remove/merge obsolete examples 2010-01-02 10:55:46 -08:00
Brandon Heller 8f20b95d56 Auto-install run and clean scripts
Also remove usused imports and outdated doc text.
2010-01-02 02:43:51 -08:00
Brandon Heller a6b473227f Add mn_run.py, a script to run Mininets.
Simplifies launching a Mininet or running tests on one.
2010-01-02 02:42:08 -08:00
Brandon Heller 8b5062a3a1 Move TreeNet to new Mininet API
Also remove all non-object-oriented legacy Mininet code and update
tests.

User-space compatibility is untested, but most of the code for it is
still in.
2009-12-26 14:25:48 -08:00
Brandon Heller e3621eb057 Move fixLimits function to util 2009-12-26 07:40:57 -08:00
Brandon Heller 89bf31030b Move Node functions into their own file
Nodes include Switch, Host, and Controller; move these to a separate
file.

This file still could use some attention to hide private functions.
Node seems like a primary class to extend, for adding stuff like Open
vSwitch, so it could benefit from a simpler interface.
2009-12-20 14:19:32 -08:00
Brandon Heller 4d2d52c3db Remove unused function 2009-12-20 09:46:16 -08:00
Brandon Heller 220890a0c9 Move utility functions out of mininet.py
Having a file with the same name as its package creates hard-to-diagnose
import error, so rename mininet.py to net.py.  This commit moves utility
functions, generally those dealing with network namespaces and interface
management, into their own file.

Also fix a few minor formatting bugs and clean up logging code (which
had issues when multiple files would import mininet.logging_mod).
2009-12-20 09:32:43 -08:00
Brandon Heller bc547080b8 Rewrite Ripcord test and most of mininet
Make much of the Mininet code object-oriented around the new Mininet
object, and create a generic way to build a Mininet.

Previously, each network topology was created by Mininet API calls,
which seems much less approachable for new users than passing in a
topology object along with controller, switch, and host classes.

The modified code is all in ripcordtest.py, but will need to replace the
main mininet.py code eventually.

Kernel-space support only, for now.
2009-12-20 04:03:23 -08:00
Brandon Heller 75810224ed Remove verbose command printouts 2009-12-20 03:54:37 -08:00
Brandon Heller 8e63d3cb72 Add missing newline printouts 2009-12-19 19:21:47 -08:00
Brandon Heller fabbac885f Document retry function 2009-12-19 19:21:18 -08:00
Brandon Heller 2e52801de5 Fix IP printing exception 2009-12-19 19:20:53 -08:00
Brandon Heller b426d24e45 Minor documentation 2009-12-19 19:05:09 -08:00
Brandon Heller b6423f8c4d Fix module resolution
Forgot to add __init__.py
2009-12-18 20:36:48 -08:00
Brandon Heller 15f37cc292 Add LinearNet test case 2009-12-18 20:36:48 -08:00
Brandon Heller 7b804ffbae More flexible logging support
Use customized StreamHandler from Python logging module to print
only messages for the specified loglevel to the console.
2009-12-18 20:36:36 -08:00
Brandon Heller 1095628b8a Clean up display
Don't print retry errors by default.
2009-12-18 15:51:30 -08:00
Brandon Heller 7c1d7c9f90 Don't attempt to kill processes twice
Was causing OSErrors because the process to kill no longer existed.
2009-12-18 15:42:13 -08:00
Brandon Heller 345bf7cc29 Reduce interface move delay and make configurable
Much faster now; from 1 s delay to 100 us.
2009-12-18 15:39:14 -08:00
Brandon Heller ff43615ab1 Add example unit tests and Makefile target 2009-12-18 12:15:04 -08:00
Brandon Heller fd99d67c33 Add make clean to remove dist files created by setuptools 2009-12-18 12:12:51 -08:00
Brandon Heller 51270ce4a2 Use setuptools to install python files
Now, to reference mininet files, use 'import mininet.mininet'.

PYTHONPATH mods are no longer required for installation.
2009-12-18 12:12:37 -08:00
Brandon Heller cd27f9db57 Start controller with verbose by default 2009-12-18 12:11:25 -08:00
Brandon Heller ede34b6a4d Add missing function import 2009-12-18 12:10:35 -08:00
Bob Lantz 40580731cd Added simple all-to-all UDP bandwidth test. 2009-12-17 16:31:42 -08:00
Bob Lantz 9bb15c76e9 Added missing value (60) in list. ;-) 2009-12-17 16:31:14 -08:00
Bob Lantz b7640209a8 Changed to use class vars and method to track nodes.
Useful for monitoring the output of a set of nodes.
2009-12-17 16:30:40 -08:00
Bob Lantz 1417fe7283 Changed cleanup to do fast things first. 2009-12-17 16:29:55 -08:00
Bob Lantz 7df36e476e Changed linearbandwidth.py to be much (!) smarter - it now *reuses* the network! Amazing. 2009-12-15 22:40:12 -08:00
Bob Lantz f939eb5625 Changes to mininet.py:
- invoke ofdatapath with --fail=closed (no controller = no connectivity!)
- stop hosts before switches before the controller
	- this seems slightly more sensible
	- it's the reverse of the startup order
- fix retry() so it kind of works (it's actually helpful I think!)
2009-12-15 22:38:17 -08:00
Bob Lantz 0b4ae53a7e We don't need to print the links. 2009-12-15 22:37:56 -08:00
Bob Lantz e04f092232 Bah, wasn't using correct command to remove datapaths! Fixed. 2009-12-15 21:01:19 -08:00
Bob Lantz 05cce994c3 Haha, retry is definitely not right. Time to take a break I think. 2009-12-15 19:59:48 -08:00
Bob Lantz 0a9ea29fd2 Fixed problem for empty lists in cleanup.
Added retry() function for createLink to see if it helps (probably won't.)
Random edits to docs.
2009-12-15 19:53:22 -08:00
Bob Lantz 696a619d0e Minor tweaks and corrections.
Added commentary on control network to mininet.py.
Hopefully fixed linearbandwidth.py for real.
2009-12-15 18:50:44 -08:00
Bob Lantz ea420ee29f First crack at converting cleanup to Python. 2009-12-15 18:49:46 -08:00
Bob Lantz 2708cadd40 Fixed LinearNet to pass correct parametersto GridNet.__init__() 2009-12-15 17:31:36 -08:00
Bob Lantz 657333199b Fixed treeping1024.py to import Cli, so it should work now. 2009-12-15 17:22:56 -08:00
Bob Lantz 6a30c394b1 Changed to include linux/sched.c for compiling on debian-stable. 2009-12-15 17:14:30 -08:00
Bob Lantz 93519c04f9 Fixed control network/user datapath networks. 2009-12-15 06:13:52 -08:00
Bob Lantz 9dbb68df9e Fixed iperf test.
Not sure if I want nox_core -v in nox.py - it's useful for debugging.
ripcordtest.py (and grid.py) still depend on routing, which I haven't been
able to test yet.
2009-12-14 22:37:19 -08:00
Bob Lantz 77131e8f24 OK, now we run 'routing' for the nox configurations with loops.
Unfortunately, I can't test this at the moment since nox seems not to
be able to find the routing module.

Added/renamed examples: grid.py, tree1024.py

Added -v flag to nox arguments, so we have some chance of figuring
out why nox is dying, as it generally is.
2009-12-14 22:13:53 -08:00
Bob Lantz c53fa3ba32 Second crack at a ripcordtest.py that actually works.
ripcord.py was a name conflict - ugh!
This one creates a network successfully, but ping doesn't work with
nox out of the box at least.
2009-12-14 21:35:08 -08:00
Bob Lantz 0b084dd51a Added ripcord.py, which attempts to make a FatTree using ripcord and
instantiate a mininet Network based on its topology.

Also minor cleanup of nox.py and GridNet class in mininet.py.
2009-12-14 21:01:45 -08:00
Bob Lantz 2f53491343 First crack at allowing Controller to be customized.
Network may now be used with custom controllers.
An example of doing this is in nox.py, which instantiates at TreeNet
using a custom Controller, NoxController, that runs nox_core rather
than the reference controller.
2009-12-14 20:14:44 -08:00
Bob Lantz 845dedca32 One more change to revert the broken exec behavior. 2009-12-14 19:21:17 -08:00
Brandon Heller 0608b5939b Add notes on installing NOX on Deb testing. 2009-12-12 04:47:13 -08:00
Brandon Heller ea7c8795f5 Ensure netns is in the path. 2009-12-12 02:54:52 -08:00
Bob Lantz ac75d7cff4 Inadvertently added verbosity into Node.setIP(); removed. 2009-12-14 13:46:36 -08:00
Bob Lantz fb7658c8ca Since execing controller/ofprotocol was broken, reverting to just running in background.
This should eliminate ofprotocol bogons living on past the end of a test.
2009-12-14 13:38:10 -08:00
Bob Lantz 98332cb616 Tweaks to documentation files and sshd and xterms examples.
Added scratchnetuser.
2009-12-14 13:22:03 -08:00
Bob Lantz 433503cf8a Added "from scratch" examples, to show how to create a network using
low-level primitives.

The "nox.py" example attempts to use nox as a controller rather than
controller(8).

More edits for INSTALL and README, and refinements for sshd and xterm
examples.
2009-12-14 12:43:42 -08:00
Bob Lantz 55dd936829 Cleanup of doc files.
Fixed xterm.py (and cleanup) to clean up screen sessions.
Cleaned up sshd.py (though interface is still in flux.)
Added 1024-node network example (treenet1024.py).
Added example showing multiple tests on a single network (multitest.py).
Renamed examples to make them easier to type!
2009-12-11 09:21:36 -08:00
Bob Lantz 08cef003f7 Changed cleanup to vaporize zombie screen sessions.
Other minor cleanup.
2009-12-11 06:17:42 -08:00
Bob Lantz f4d9e05d05 Fixed treePing64.
Minor tweaks to other files.
2009-12-11 04:25:31 -08:00
Bob Lantz 2a0cad3c85 Renamed and tweaked treePing64. 2009-12-11 04:01:56 -08:00
Bob Lantz b3dd44d41b Fixed bigTreePing64.
More edits for INSTALL and README files.
Batteries still not included (for the moment.) ;-)
2009-12-11 03:58:54 -08:00
Bob Lantz 3da2b1482c Place 'root namespace' in xterm title to make it clearer that
the node is running in the root namespace.
2009-12-11 03:33:38 -08:00
Bob Lantz d8ef79dff7 Tweaks for install and readme files. 2009-12-11 03:31:45 -08:00
Bob Lantz af8f0b61b6 Added INSTALL file incorporating Brandon's suggestions.
More tweaks for examples, which are still in progress.
2009-12-11 03:22:09 -08:00
Bob Lantz 42ba5d92c3 Added sshd example, which starts up sshd on each host, allowing host access via ssh.
(It also adds a route from the root namespace to the data network via
the first OpenFlow switch, so when you ssh in you go through OpenFlow!)

Modified Network() to optionally decouple starting the network, running
tests, and stopping the network. This allows multiple tests to be run
(or additional modifications to be made to the network before actually
starting the switches and controller.)

Still tweaking xterms - it sort of works but the screen sessions are not
cleaned up, which leads to nasty garbage.
2009-12-11 02:34:21 -08:00
Bob Lantz 748e35d50f Working on examples.
Added new example to create xterms.
Other minor changes.
2009-12-10 23:39:06 -08:00
Bob Lantz 4ccc7ee941 Added examples, which may or may not work yet. 2009-12-10 01:47:00 -08:00
Bob Lantz 95d9a374b2 Added README.
Modified cleanup to use dpctl to remove kernel datapaths.
2009-12-10 00:21:26 -08:00
Bob Lantz 994c68f648 Modified test infrastructure to return results.
Ping and iperf tests now return something possibly useful.
2009-12-09 23:24:27 -08:00
Bob Lantz 9011e0d22c Fixed user datapath support. 2009-12-09 22:13:46 -08:00
Bob Lantz 6bd22292b6 Added checks for tun and ofdatapath kernel modules. 2009-12-09 21:59:18 -08:00
Bob Lantz eddef947a4 Organized routines into classes:
Node -> { Host, Switch, Controller }
Network -> { TreeNet, GridNet -> LinearNet }

Modified cleanup to clean up kernel datapaths.
2009-12-09 21:13:17 -08:00
Bob Lantz 98d4f1891c Initial commit - first development version of Mininet 2009-12-08 18:08:03 -08:00
219 changed files with 20949 additions and 8773 deletions
-1
View File
@@ -1 +0,0 @@
Dockerfile
+1
View File
@@ -0,0 +1 @@
*.py diff=python
-44
View File
@@ -1,44 +0,0 @@
name: Publish Docker image
on:
push:
branches:
- master
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Login to ${{ env.REGISTRY }}
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
pull: true
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
+11 -18
View File
@@ -1,21 +1,14 @@
# Python
mnexec
*.pyc
*~
*.1
*.xcodeproj
*.xcworkspace
\#*\#
mininet.egg-info
build
dist
Mini_NDN.egg-info
*.pyc
doc/html
doc/latex
trunk
# Docs
docs/html
docs/latex
docs/_build
# Misc
.DS_Store
dl
*.apconf
# Vagrant
.vagrant
venv/
.vscode
+301
View File
@@ -0,0 +1,301 @@
# lint Python modules using external checkers.
#
# This is the main checker controlling the other ones and the reports
# generation. It is itself both a raw checker and an astng checker in order
# to:
# * handle message activation / deactivation at the module level
# * handle some basic but necessary stats'data (number of classes, methods...)
#
[MASTER]
# Specify a configuration file.
#rcfile=
# Python code to execute, usually for sys.path manipulation such as
# pygtk.require().
#init-hook=
# Profiled execution.
profile=no
# Add <file or directory> to the black list. It should be a base name, not a
# path. You may set this option multiple times.
ignore=CVS
# Pickle collected data for later comparisons.
persistent=yes
# List of plugins (as comma separated values of python modules names) to load,
# usually to register additional checkers.
load-plugins=
[MESSAGES CONTROL]
# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
# multiple time.
#enable=
# Disable the message, report, category or checker with the given id(s). You
# can either give multiple identifier separated by comma (,) or put this option
# multiple time (only on the command line, not in the configuration file where
# it should appear only once).
disable=pointless-except, invalid-name, super-init-not-called, fixme, star-args,
too-many-instance-attributes, too-few-public-methods, too-many-arguments,
too-many-locals, too-many-public-methods, duplicate-code, bad-whitespace,
locally-disabled
[REPORTS]
# Set the output format. Available formats are text, parseable, colorized, msvs
# (visual studio) and html
output-format=colorized
msg-template='{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}'
# Include message's id in output
include-ids=yes
# Put messages in a separate file for each module / package specified on the
# command line instead of printing them on stdout. Reports (if any) will be
# written in a file name "pylint_global.[txt|html]".
files-output=no
# Tells wether to display a full report or only the messages
reports=no
# Python expression which should return a note less than 10 (10 is the highes
# note). You have access to the variables errors warning, statement which
# respectivly contain the number of errors / warnings messages and the total
# number of statements analyzed. This is used by the global evaluation repor
# (R0004).
evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
# Add a comment according to your evaluation note. This is used by the global
# evaluation report (R0004).
comment=no
# Enable the report(s) with the given id(s).
#enable-report=
# Disable the report(s) with the given id(s).
#disable-report=
# checks for :
# * doc strings
# * modules / classes / functions / methods / arguments / variables name
# * number of arguments, local variables, branchs, returns and statements in
# functions, methods
# * required module attributes
# * dangerous default values as arguments
# * redefinition of function / method / class
# * uses of the global statemen
#
[BASIC]
# Required attributes for module, separated by a comma
required-attributes=
# Regular expression which should only match functions or classes name which do
# not require a docstring
no-docstring-rgx=__.*__
# Regular expression which should only match correct module names
module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
# Regular expression which should only match correct module level names
const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$
# Regular expression which should only match correct class names
class-rgx=[A-Z_][a-zA-Z0-9]+$
# Regular expression which should only match correct function names
function-rgx=[a-z_][a-z0-9_]{2,30}$
# Regular expression which should only match correct method names
method-rgx=[a-z_][a-z0-9_]{2,30}$
# Regular expression which should only match correct instance attribute names
attr-rgx=[a-z_][a-z0-9_]{2,30}$
# Regular expression which should only match correct argument names
argument-rgx=[a-z_][a-z0-9_]{2,30}$
# Regular expression which should only match correct variable names
variable-rgx=[a-z_][a-z0-9_]{2,30}$
# Regular expression which should only match correct list comprehension /
# generator expression variable names
inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
# Good variable names which should always be accepted, separated by a comma
good-names=i,j,k,ex,Run,_
# Bad variable names which should always be refused, separated by a comma
bad-names=foo,bar,baz,toto,tutu,tata
# List of builtins function names that should not be used, separated by a comma
bad-functions=map,filter,apply,inpu
# try to find bugs in the code using type inference
#
[TYPECHECK]
# Tells wether missing members accessed in mixin class should be ignored. A
# mixin class is detected if its name ends with "mixin" (case insensitive).
ignore-mixin-members=yes
# List of classes names for which member attributes should not be checked
# (useful for classes with attributes dynamicaly set).
ignored-classes=SQLObjec
# When zope mode is activated, add a predefined set of Zope acquired attributes
# to generated-members.
zope=no
# List of members which are set dynamically and missed by pylint inference
# system, and so shouldn't trigger E0201 when accessed.
generated-members=REQUEST,acl_users,aq_paren
# checks for
# * unused variables / imports
# * undefined variables
# * redefinition of variable from builtins or from an outer scope
# * use of variable before assigmen
#
[VARIABLES]
# Tells wether we should check for unused import in __init__ files.
init-import=no
# A regular expression matching names used for dummy variables (i.e. not used).
dummy-variables-rgx=_|dummy
# List of additional names supposed to be defined in builtins. Remember tha
# you should avoid to define new builtins when possible.
additional-builtins=
# checks for :
# * methods without self as first argumen
# * overridden methods signature
# * access only to existant members via self
# * attributes not defined in the __init__ method
# * supported interfaces implementation
# * unreachable code
#
[CLASSES]
# List of interface methods to ignore, separated by a comma. This is used for
# instance to not check methods defines in Zope's Interface base class.
ignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by
# List of method names used to declare (i.e. assign) instance attributes.
defining-attr-methods=__init__,__new__,setUp,build
# checks for sign of poor/misdesign:
# * number of methods, attributes, local variables...
# * size, complexity of functions, methods
#
[DESIGN]
# Maximum number of arguments for function / method
max-args=5
# Maximum number of locals for function / method body
max-locals=15
# Maximum number of return / yield for function / method body
max-returns=6
# Maximum number of branch for function / method body
max-branchs=12
# Maximum number of statements in function / method body
max-statements=50
# Maximum number of parents for a class (see R0901).
max-parents=7
# Maximum number of attributes for a class (see R0902).
max-attributes=7
# Minimum number of public methods for a class (see R0903).
min-public-methods=2
# Maximum number of public methods for a class (see R0904).
max-public-methods=20
# checks for
# * external modules dependencies
# * relative / wildcard imports
# * cyclic imports
# * uses of deprecated modules
#
[IMPORTS]
# Deprecated modules which should not be used, separated by a comma
deprecated-modules=regsub,string,TERMIOS,Bastion,rexec
# Create a graph of every (i.e. internal and external) dependencies in the
# given file (report R0402 must not be disabled)
import-graph=
# Create a graph of external dependencies in the given file (report R0402 mus
# not be disabled)
ext-import-graph=
# Create a graph of internal dependencies in the given file (report R0402 mus
# not be disabled)
int-import-graph=
# checks for :
# * unauthorized constructions
# * strict indentation
# * line length
# * use of <> instead of !=
#
[FORMAT]
# Maximum number of characters on a single line.
max-line-length=80
# Maximum number of lines in a module
# XXX 1500 -> 4000 for miniedit.py
max-module-lines=4000
# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
# tab).
indent-string=' '
# checks for:
# * warning notes in the code like FIXME, XXX
# * PEP 263: source code with non ascii character but no encoding declaration
#
[MISCELLANEOUS]
# List of note tags to take in consideration, separated by a comma.
notes=FIXME,XXX,TODO
# checks for similarities and duplicated code. This computation may be
# memory / CPU intensive, so you should disable it if you experiments some
# problems.
#
[SIMILARITIES]
# Minimum lines number of a similarity.
min-similarity-lines=4
# Ignore comments when computing similarities.
ignore-comments=yes
# Ignore docstrings when computing similarities.
ignore-docstrings=yes
-38
View File
@@ -1,38 +0,0 @@
Mini-NDN Authors
=================
The following lists maintainers, primary developers, and all much-appreciated contributors to Mini-NDN in alphabetic order.
The specific contributions of individual authors can be obtained from the git history of the [official Mini-NDN repository](https://github.com/named-data/mini-ndn).
If you would like to become a contributor to the official repository, please follow the recommendations in https://github.com/named-data/.github/blob/master/CONTRIBUTING.md.
* Alexander Afanasyev <https://users.cs.fiu.edu/~afanasyev>
* Muktadir R. Chowdhury <https://github.com/alvyC>
* Damian Coomes <https://github.com/dmcoomes>
* ***(Maintainer)*** Saurab Dulal <https://dulalsaurab.github.io>
* Laqin Fan <https://github.com/laqinfan>
* ***(Former Maintainer)*** Ashlesh Gawande <https://www.linkedin.com/in/agawande>
* Nicholas Gordon <https://github.com/gorgonical>
* Giovanni Grieco <https://github.com/GiovanniGrieco>
* ***(Maintainer)*** Alexander Lane <https://github.com/awlane>
* Vince Lehman <http://vslehman.com>
* Philipp Moll <https://github.com/phylib>
* Eric Newberry <https://ericnewberry.com>
* Junxiao Shi <https://cs.arizona.edu/~shijunxiao>
* Jeff Thompson <https://remap.ucla.edu/jeff-thompson>
* Yucheng Zhang <https://peterskycloud.wixsite.com/yzportfolio>
* Italo Valcy S Brito <https://github.com/italovalcy>
Technical Advisors
-------------------
* Lan Wang <http://www.cs.memphis.edu/~lanwang>
* Beichuan Zhang <http://cs.arizona.edu/~bzhang>
The Mini-CCNx team
-------------------
* Carlos Cabral <https://github.com/carlosmscabral>
* Caio de Moraes Elias <https://github.com/ocaio>
* Christian Esteve Rothenberg <http://www.dca.fee.unicamp.br/~chesteve>
+49
View File
@@ -0,0 +1,49 @@
Mininet Contributors
Mininet is an open source project and we gratefully acknowledge
the many contributions to the project! If you have contributed
code into the project and are not on this list, please let us know
or send a pull request.
Contributors include:
Mininet Core Team (and alumni)
Bob Lantz
Brandon Heller
Nikhil Handigol
Vimal Jeyakumar
Brian O'Connor
Cody Burkard
Additional Mininet Contributors
Tomasz Buchert
Gustavo Pantuza Coelho Pinto
Fernando Cappi
Ryan Cox
Shaun Crampton
David Erickson
Glen Gibb
Andrew Ferguson
Eder Leao Fernandes
Gregory Gee
Jon Hall
Vitaly Ivanov
Rich Lane
Rémy Léone
Zi Shen Lim
Murphy McCauley
José Pedro Oliveira
James Page
Angad Singh
Piyush Srivastava
Ed Swierk
Darshan Thaker
Andreas Wundsam
Isaku Yamahata
Baohua Yang
Thanks also to everyone who has submitted issues and pull
requests on github, and to our friendly mininet-discuss
mailing list!
-674
View File
@@ -1,674 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
-37
View File
@@ -1,37 +0,0 @@
# Setup container with Ubuntu 22.04 image
FROM ubuntu:22.04
# Set the working directory to /
WORKDIR /
# expose ports for openvswitch-switch
EXPOSE 6633 6653 6640
# Update container image
RUN apt-get update -y && \
apt-get install --no-install-recommends -y \
lsb-release sudo \
zip unzip wget git ca-certificates \
curl iproute2 iputils-ping net-tools \
python3 python3-pip \
tcpdump vim x11-xserver-utils xterm && \
update-ca-certificates && \
rm -rf /var/lib/apt/lists/* && \
alias python=python3
COPY . /mini-ndn
RUN cd mini-ndn && \
pip3 install -r requirements.txt && \
./install.sh -y --source && \
cd dl/mininet && make install && cd ../.. && \
cd dl/mininet-wifi && make install && cd ../.. && \
rm -rf dl && rm -rf /var/lib/apt/lists/* && cd /
COPY docker/ENTRYPOINT.sh /
RUN chmod +x ENTRYPOINT.sh
# Change the working directory to /mini-ndn
WORKDIR /mini-ndn
ENTRYPOINT ["/ENTRYPOINT.sh"]
+179
View File
@@ -0,0 +1,179 @@
Mininet Installation/Configuration Notes
----------------------------------------
Mininet 2.2.1d2
---
The supported installation methods for Mininet are 1) using a
pre-built VM image, and 2) native installation on Ubuntu. You can also
easily create your own Mininet VM image (4).
(Other distributions may be supported in the future - if you would
like to contribute an installation script, we would welcome it!)
1. Easiest "installation" - use our pre-built VM image!
The easiest way to get Mininet running is to start with one of our
pre-built virtual machine images from <http://mininet.org/>
Boot up the VM image, log in, and follow the instructions on the
Mininet web site.
One advantage of using the VM image is that it doesn't mess with
your native OS installation or damage it in any way.
Although a single Mininet instance can simulate multiple networks
with multiple controllers, only one Mininet instance may currently
be run at a time, and Mininet requires root access in the machine
it's running on. Therefore, if you have a multiuser system, you
may wish to consider running Mininet in a VM.
2. Next-easiest option: use our Ubuntu package!
To install Mininet itself (i.e. `mn` and the Python API) on Ubuntu
12.10+:
sudo apt-get install mininet
Note: if you are upgrading from an older version of Mininet, make
sure you remove the old OVS from `/usr/local`:
sudo rm /usr/local/bin/ovs*
sudo rm /usr/local/sbin/ovs*
3. Native installation from source
3.1. Native installation from source on Ubuntu 12.04+
If you're reading this, you've probably already done so, but the
command to download the Mininet source code is:
git clone git://github.com/mininet/mininet.git
Note that the above git command will check out the latest and greatest
Mininet (which we recommend!) If you want to run the last tagged/released
version of Mininet, you can look at the release tags using
cd mininet
git tag
and then
git checkout <release tag>
where <release tag> is the release you want to check out.
If you are running Ubuntu, Debian, or Fedora, you may be able to use
our handy `install.sh` script, which is in `mininet/util`.
*WARNING: USE AT YOUR OWN RISK!*
`install.sh` is a bit intrusive and may possibly damage your OS
and/or home directory, by creating/modifying several directories
such as `mininet`, `openflow`, `oftest`, `pox`, etc.. We recommend
trying it in a VM before trying it on a system you use from day to day.
Although we hope it won't do anything completely terrible, you may
want to look at the script before you run it, and you should make
sure your system and home directory are backed up just in case!
To install Mininet itself, the OpenFlow reference implementation, and
Open vSwitch, you may use:
mininet/util/install.sh -fnv
This should be reasonably quick, and the following command should
work after the installation:
sudo mn --test pingall
To install ALL of the software which we use for OpenFlow tutorials,
including POX, the OpenFlow WireShark dissector, the `oftest`
framework, and other potentially useful software, you may use:
mininet/util/install.sh -a
This takes about 4 minutes on our test system.
You can change the directory where the dependencies are installed using
the -s <directory> flag.
mininet/util/install.sh -s <directory> -a
3.2. Native installation from source on Fedora 18+.
As root execute the following operations:
* install git
yum install git
* create an user account (e.g. mininet) and add it to the wheel group
useradd [...] mininet
usermod -a -G wheel mininet
* change the SElinux setting to permissive. It can be done
temporarily with:
setenforce 0
then login with the new account (e.g. mininet) and do the following:
* clone the Mininet repository
git clone git://github.com/mininet/mininet.git
* install Mininet, the OpenFlow reference implementation, and
Open vSwitch
mininet/util/install.sh -fnv
* enable and start openvswitch
sudo systemctl enable openvswitch
sudo systemctl start openvswitch
* test the mininet installation
sudo mn --test pingall
4. Creating your own Mininet/OpenFlow tutorial VM
Creating your own Ubuntu Mininet VM for use with the OpenFlow tutorial
is easy! First, create a new Ubuntu VM. Next, run two commands in it:
wget https://raw.github.com/mininet/mininet/master/util/vm/install-mininet-vm.sh
time install-mininet-vm.sh
Finally, verify that Mininet is installed and working in the VM:
sudo mn --test pingall
5. Installation on other Linux distributions
Although we don't support other Linux distributions directly, it
should be possible to install and run Mininet with some degree of
manual effort.
In general, you must have:
* A Linux kernel compiled with network namespace support enabled
* An compatible software switch such as Open vSwitch or
the Linux bridge.
* Python, `bash`, `ping`, `iperf`, etc.
* Root privileges (required for network device access)
We encourage contribution of patches to the `install.sh` script to
support other Linux distributions.
Good luck!
Mininet Team
---
+33
View File
@@ -0,0 +1,33 @@
Mininet 2.2.1d2 License
Copyright (c) 2013-2015 Open Networking Laboratory
Copyright (c) 2009-2012 Bob Lantz and The Board of Trustees of
The Leland Stanford Junior University
Original authors: Bob Lantz and Brandon Heller
We are making Mininet available for public use and benefit with the
expectation that others will use, modify and enhance the Software and
contribute those enhancements back to the community. However, since we
would like to make the Software available for broadest use, with as few
restrictions as possible permission is hereby granted, free of charge, to
any person obtaining a copy of this Software to deal in the Software
under the copyrights without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
The name and trademarks of copyright holder(s) may NOT be used in
advertising or publicity pertaining to the Software or any derivatives
without specific, written prior permission.
+73
View File
@@ -0,0 +1,73 @@
MININET = mininet/*.py
TEST = mininet/test/*.py
EXAMPLES = mininet/examples/*.py
MN = bin/mn
BIN = $(MN)
PYSRC = $(MININET) $(TEST) $(EXAMPLES) $(BIN)
MNEXEC = mnexec
MANPAGES = mn.1 mnexec.1
P8IGN = E251,E201,E302,E202,E126,E127,E203,E226
BINDIR = /usr/bin
MANDIR = /usr/share/man/man1
DOCDIRS = doc/html doc/latex
PDF = doc/latex/refman.pdf
CFLAGS += -Wall -Wextra
all: codecheck test
clean:
rm -rf build dist *.egg-info *.pyc $(MNEXEC) $(MANPAGES) $(DOCDIRS)
codecheck: $(PYSRC)
-echo "Running code check"
util/versioncheck.py
pyflakes $(PYSRC)
pylint --rcfile=.pylint $(PYSRC)
# Exclude miniedit from pep8 checking for now
pep8 --repeat --ignore=$(P8IGN) `ls $(PYSRC) | grep -v miniedit.py`
errcheck: $(PYSRC)
-echo "Running check for errors only"
pyflakes $(PYSRC)
pylint -E --rcfile=.pylint $(PYSRC)
test: $(MININET) $(TEST)
-echo "Running tests"
mininet/test/test_nets.py
mininet/test/test_hifi.py
slowtest: $(MININET)
-echo "Running slower tests (walkthrough, examples)"
mininet/test/test_walkthrough.py -v
mininet/examples/test/runner.py -v
mnexec: mnexec.c $(MN) mininet/net.py
cc $(CFLAGS) $(LDFLAGS) -DVERSION=\"`PYTHONPATH=. $(MN) --version`\" $< -o $@
install: $(MNEXEC) $(MANPAGES)
install $(MNEXEC) $(BINDIR)
install $(MANPAGES) $(MANDIR)
python setup.py install
develop: $(MNEXEC) $(MANPAGES)
# Perhaps we should link these as well
install $(MNEXEC) $(BINDIR)
install $(MANPAGES) $(MANDIR)
python setup.py develop
man: $(MANPAGES)
mn.1: $(MN)
PYTHONPATH=. help2man -N -n "create a Mininet network." \
--no-discard-stderr $< -o $@
mnexec.1: mnexec
help2man -N -n "execution utility for Mininet." \
-h "-h" -v "-v" --no-discard-stderr ./$< -o $@
.PHONY: doc
doc: man
doxygen doc/doxygen.cfg
make -C doc/latex
+122 -22
View File
@@ -1,32 +1,132 @@
Mini-NDN
========
Mininet: Rapid Prototyping for Software Defined Networks
========================================================
If you are new to the NDN community of software generally, read the
[Contributor's Guide](https://github.com/named-data/.github/blob/master/CONTRIBUTING.md).
*The best way to emulate almost any network on your laptop!*
### What is Mini-NDN?
Mininet 2.2.1d2
Mini-NDN is a lightweight networking emulation tool that enables testing, experimentation, and
research on the NDN platform based on [Mininet](https://github.com/mininet/mininet).
Mini-NDN uses the NDN libraries, NFD, NLSR, and tools released by the
[NDN project](http://named-data.net/codebase/platform/) to emulate an NDN network on a single system.
### What is Mininet?
Mini-NDN is open and free software licensed under the GPL 3.0 license. Mini-NDN is free to all
users and developers. For more information about licensing details and limitations,
please refer to [COPYING.md](COPYING.md).
Mininet emulates a complete network of hosts, links, and switches
on a single machine. To create a sample two-host, one-switch network,
just run:
The first release of Mini-NDN is developed by members of the NSF-sponsored NDN project team.
Mini-NDN is open to contribution from the public.
For more details, please refer to [AUTHORS.rst](AUTHORS.rst).
Bug reports and feedback are highly appreciated and can be made through our
[Redmine site](http://redmine.named-data.net/projects/mini-ndn) and the
[mini-ndn mailing list](http://www.lists.cs.ucla.edu/mailman/listinfo/mini-ndn).
`sudo mn`
Mininet is useful for interactive development, testing, and demos,
especially those using OpenFlow and SDN. OpenFlow-based network
controllers prototyped in Mininet can usually be transferred to
hardware with minimal changes for full line-rate execution.
### How does it work?
Mininet creates virtual networks using process-based virtualization
and network namespaces - features that are available in recent Linux
kernels. In Mininet, hosts are emulated as `bash` processes running in
a network namespace, so any code that would normally run on a Linux
server (like a web server or client program) should run just fine
within a Mininet "Host". The Mininet "Host" will have its own private
network interface and can only see its own processes. Switches in
Mininet are software-based switches like Open vSwitch or the OpenFlow
reference switch. Links are virtual ethernet pairs, which live in the
Linux kernel and connect our emulated switches to emulated hosts
(processes).
### Features
Mininet includes:
* A command-line launcher (`mn`) to instantiate networks.
* A handy Python API for creating networks of varying sizes and
topologies.
* Examples (in the `examples/` directory) to help you get started.
* Full API documentation via Python `help()` docstrings, as well as
the ability to generate PDF/HTML documentation with `make doc`.
* Parametrized topologies (`Topo` subclasses) using the Mininet
object. For example, a tree network may be created with the
command:
`mn --topo tree,depth=2,fanout=3`
* A command-line interface (`CLI` class) which provides useful
diagnostic commands (like `iperf` and `ping`), as well as the
ability to run a command to a node. For example,
`mininet> h11 ifconfig -a`
tells host h11 to run the command `ifconfig -a`
* A "cleanup" command to get rid of junk (interfaces, processes, files
in /tmp, etc.) which might be left around by Mininet or Linux. Try
this if things stop working!
`mn -c`
### New features in this release
This is primarily a performance improvement and bug fix release.
- Batch startup has been implemented for Open vSwitch, improving
startup performance.
- OVS patch links have been implemented via OVSLink and --link ovs
Warning! These links have *serious limitations* compared to
virtual Ethernet pairs: they are not attached to real Linux
interfaces so you cannot use tcpdump or wireshark with them;
they also cannot be used in long chains - we don't recommend more
than 64 OVSLinks, for example --linear,64. However, they can offer
significantly better performance than veth pairs, for certain
configurations.
- Additional information for this release and previous releases
may be found in the release notes on docs.mininet.org
### Installation
See `INSTALL` for installation instructions and details.
### Documentation
Please refer to http://minindn.memphis.edu/ or [docs/index.rst](docs/index.rst) for installation, usage, and other documentation.
The documentation can be built using:
In addition to the API documentation (`make doc`), much useful
information, including a Mininet walkthrough and an introduction
to the Python API, is available on the
[Mininet Web Site](http://mininet.org).
There is also a wiki which you are encouraged to read and to
contribute to, particularly the Frequently Asked Questions (FAQ.)
./docs/build.sh
### Support
Mininet is community-supported. We encourage you to join the
Mininet mailing list, `mininet-discuss` at:
<https://mailman.stanford.edu/mailman/listinfo/mininet-discuss>
### Join Us
Mininet is an open source project and is currently hosted
at <https://github.com/mininet>. You are encouraged to download
the code, examine it, modify it, and submit bug reports, bug fixes,
feature requests, new features and other issues and pull requests.
Thanks to everyone who has contributed code to the Mininet project
(see CONTRIBUTORS for more info!) It is because of everyone's
hard work that Mininet continues to grow and improve.
### Enjoy Mininet
Best wishes, and we look forward to seeing what you can do with
Mininet to change the networking world!
The Mininet Core Team:
* Bob Lantz
* Brian O'Connor
* Cody Burkard
Thanks again to all of the Mininet contributors, particularly Gregory
Gee for his work on MiniEdit.
and is available under `docs/_build/html`.
Executable
+403
View File
@@ -0,0 +1,403 @@
#!/usr/bin/env python
"""
Mininet runner
author: Brandon Heller (brandonh@stanford.edu)
To see options:
sudo mn -h
Example to pull custom params (topo, switch, etc.) from a file:
sudo mn --custom ~/mininet/custom/custom_example.py
"""
from optparse import OptionParser
import os
import sys
import time
# Fix setuptools' evil madness, and open up (more?) security holes
if 'PYTHONPATH' in os.environ:
sys.path = os.environ[ 'PYTHONPATH' ].split( ':' ) + sys.path
from mininet.clean import cleanup
from mininet.cli import CLI
from mininet.log import lg, LEVELS, info, debug, warn, error
from mininet.net import Mininet, MininetWithControlNet, VERSION
from mininet.node import ( Host, CPULimitedHost, Controller, OVSController,
Ryu, NOX, RemoteController, findController,
DefaultController,
UserSwitch, OVSSwitch, OVSBridge,
IVSSwitch )
from mininet.nodelib import LinuxBridge
from mininet.link import Link, TCLink, OVSLink
from mininet.topo import SingleSwitchTopo, LinearTopo, SingleSwitchReversedTopo
from mininet.topolib import TreeTopo, TorusTopo
from mininet.util import customClass, specialClass, splitArgs
from mininet.util import buildTopo
from functools import partial
# Experimental! cluster edition prototype
from mininet.examples.cluster import ( MininetCluster, RemoteHost,
RemoteOVSSwitch, RemoteLink,
SwitchBinPlacer, RandomPlacer,
ClusterCleanup )
from mininet.examples.clustercli import ClusterCLI
PLACEMENT = { 'block': SwitchBinPlacer, 'random': RandomPlacer }
# built in topologies, created only when run
TOPODEF = 'minimal'
TOPOS = { 'minimal': lambda: SingleSwitchTopo( k=2 ),
'linear': LinearTopo,
'reversed': SingleSwitchReversedTopo,
'single': SingleSwitchTopo,
'tree': TreeTopo,
'torus': TorusTopo }
SWITCHDEF = 'default'
SWITCHES = { 'user': UserSwitch,
'ovs': OVSSwitch,
'ovsbr' : OVSBridge,
# Keep ovsk for compatibility with 2.0
'ovsk': OVSSwitch,
'ivs': IVSSwitch,
'lxbr': LinuxBridge,
'default': OVSSwitch }
HOSTDEF = 'proc'
HOSTS = { 'proc': Host,
'rt': specialClass( CPULimitedHost, defaults=dict( sched='rt' ) ),
'cfs': specialClass( CPULimitedHost, defaults=dict( sched='cfs' ) ) }
CONTROLLERDEF = 'default'
CONTROLLERS = { 'ref': Controller,
'ovsc': OVSController,
'nox': NOX,
'remote': RemoteController,
'ryu': Ryu,
'default': DefaultController, # Note: replaced below
'none': lambda name: None }
LINKDEF = 'default'
LINKS = { 'default': Link,
'tc': TCLink,
'ovs': OVSLink }
# optional tests to run
TESTS = [ 'cli', 'build', 'pingall', 'pingpair', 'iperf', 'all', 'iperfudp',
'none' ]
ALTSPELLING = { 'pingall': 'pingAll',
'pingpair': 'pingPair',
'iperfudp': 'iperfUdp',
'iperfUDP': 'iperfUdp' }
def addDictOption( opts, choicesDict, default, name, helpStr=None, **kwargs ):
"""Convenience function to add choices dicts to OptionParser.
opts: OptionParser instance
choicesDict: dictionary of valid choices, must include default
default: default choice key
name: long option name
helpStr: help string
kwargs: additional arguments to add_option"""
if not helpStr:
helpStr = ( '|'.join( sorted( choicesDict.keys() ) ) +
'[,param=value...]' )
params = dict( type='string', default=default, help=helpStr )
params.update( **kwargs )
opts.add_option( '--' + name, **params )
def version( *_args ):
"Print Mininet version and exit"
print "%s" % VERSION
exit()
class MininetRunner( object ):
"Build, setup, and run Mininet."
def __init__( self ):
"Init."
self.options = None
self.args = None # May be used someday for more CLI scripts
self.validate = None
self.parseArgs()
self.setup()
self.begin()
def custom( self, _option, _opt_str, value, _parser ):
"""Parse custom file and add params.
option: option e.g. --custom
opt_str: option string e.g. --custom
value: the value the follows the option
parser: option parser instance"""
files = []
if os.path.isfile( value ):
# Accept any single file (including those with commas)
files.append( value )
else:
# Accept a comma-separated list of filenames
files += value.split(',')
for fileName in files:
customs = {}
if os.path.isfile( fileName ):
execfile( fileName, customs, customs )
for name, val in customs.iteritems():
self.setCustom( name, val )
else:
raise Exception( 'could not find custom file: %s' % fileName )
def setCustom( self, name, value ):
"Set custom parameters for MininetRunner."
if name in ( 'topos', 'switches', 'hosts', 'controllers' ):
# Update dictionaries
param = name.upper()
globals()[ param ].update( value )
elif name == 'validate':
# Add custom validate function
self.validate = value
else:
# Add or modify global variable or class
globals()[ name ] = value
def setNat( self, _option, opt_str, value, parser ):
"Set NAT option(s)"
assert self # satisfy pylint
parser.values.nat = True
# first arg, first char != '-'
if parser.rargs and parser.rargs[ 0 ][ 0 ] != '-':
value = parser.rargs.pop( 0 )
_, args, kwargs = splitArgs( opt_str + ',' + value )
parser.values.nat_args = args
parser.values.nat_kwargs = kwargs
else:
parser.values.nat_args = []
parser.values.nat_kwargs = {}
def parseArgs( self ):
"""Parse command-line args and return options object.
returns: opts parse options dict"""
desc = ( "The %prog utility creates Mininet network from the\n"
"command line. It can create parametrized topologies,\n"
"invoke the Mininet CLI, and run tests." )
usage = ( '%prog [options]\n'
'(type %prog -h for details)' )
opts = OptionParser( description=desc, usage=usage )
addDictOption( opts, SWITCHES, SWITCHDEF, 'switch' )
addDictOption( opts, HOSTS, HOSTDEF, 'host' )
addDictOption( opts, CONTROLLERS, [], 'controller', action='append' )
addDictOption( opts, LINKS, LINKDEF, 'link' )
addDictOption( opts, TOPOS, TOPODEF, 'topo' )
opts.add_option( '--clean', '-c', action='store_true',
default=False, help='clean and exit' )
opts.add_option( '--custom', action='callback',
callback=self.custom,
type='string',
help='read custom classes or params from .py file(s)'
)
opts.add_option( '--test', type='choice', choices=TESTS,
default=TESTS[ 0 ],
help='|'.join( TESTS ) )
opts.add_option( '--xterms', '-x', action='store_true',
default=False, help='spawn xterms for each node' )
opts.add_option( '--ipbase', '-i', type='string', default='10.0.0.0/8',
help='base IP address for hosts' )
opts.add_option( '--mac', action='store_true',
default=False, help='automatically set host MACs' )
opts.add_option( '--arp', action='store_true',
default=False, help='set all-pairs ARP entries' )
opts.add_option( '--verbosity', '-v', type='choice',
choices=LEVELS.keys(), default = 'info',
help = '|'.join( LEVELS.keys() ) )
opts.add_option( '--innamespace', action='store_true',
default=False, help='sw and ctrl in namespace?' )
opts.add_option( '--listenport', type='int', default=6634,
help='base port for passive switch listening' )
opts.add_option( '--nolistenport', action='store_true',
default=False, help="don't use passive listening " +
"port")
opts.add_option( '--pre', type='string', default=None,
help='CLI script to run before tests' )
opts.add_option( '--post', type='string', default=None,
help='CLI script to run after tests' )
opts.add_option( '--pin', action='store_true',
default=False, help="pin hosts to CPU cores "
"(requires --host cfs or --host rt)" )
opts.add_option( '--nat', action='callback', callback=self.setNat,
help="adds a NAT to the topology that"
" connects Mininet hosts to the physical network."
" Warning: This may route any traffic on the machine"
" that uses Mininet's"
" IP subnet into the Mininet network."
" If you need to change"
" Mininet's IP subnet, see the --ipbase option." )
opts.add_option( '--version', action='callback', callback=version,
help='prints the version and exits' )
opts.add_option( '--cluster', type='string', default=None,
metavar='server1,server2...',
help=( 'run on multiple servers (experimental!)' ) )
opts.add_option( '--placement', type='choice',
choices=PLACEMENT.keys(), default='block',
metavar='block|random',
help=( 'node placement for --cluster '
'(experimental!) ' ) )
self.options, self.args = opts.parse_args()
# We don't accept extra arguments after the options
if self.args:
opts.print_help()
exit()
def setup( self ):
"Setup and validate environment."
# set logging verbosity
if LEVELS[self.options.verbosity] > LEVELS['output']:
print ( '*** WARNING: selected verbosity level (%s) will hide CLI '
'output!\n'
'Please restart Mininet with -v [debug, info, output].'
% self.options.verbosity )
lg.setLogLevel( self.options.verbosity )
# Maybe we'll reorganize this someday...
# pylint: disable=too-many-branches,too-many-statements
def begin( self ):
"Create and run mininet."
if self.options.cluster:
servers = self.options.cluster.split( ',' )
for server in servers:
ClusterCleanup.add( server )
if self.options.clean:
cleanup()
exit()
start = time.time()
if not self.options.controller:
# Update default based on available controllers
CONTROLLERS[ 'default' ] = findController()
self.options.controller = [ 'default' ]
if not CONTROLLERS[ 'default' ]:
self.options.controller = [ 'none' ]
if self.options.switch == 'default':
info( '*** No default OpenFlow controller found '
'for default switch!\n' )
info( '*** Falling back to OVS Bridge\n' )
self.options.switch = 'ovsbr'
elif self.options.switch not in ( 'ovsbr', 'lxbr' ):
raise Exception( "Could not find a default controller "
"for switch %s" %
self.options.switch )
topo = buildTopo( TOPOS, self.options.topo )
switch = customClass( SWITCHES, self.options.switch )
host = customClass( HOSTS, self.options.host )
controller = [ customClass( CONTROLLERS, c )
for c in self.options.controller ]
link = customClass( LINKS, self.options.link )
if self.validate:
self.validate( self.options )
ipBase = self.options.ipbase
xterms = self.options.xterms
mac = self.options.mac
arp = self.options.arp
pin = self.options.pin
listenPort = None
if not self.options.nolistenport:
listenPort = self.options.listenport
# Handle inNamespace, cluster options
inNamespace = self.options.innamespace
cluster = self.options.cluster
if inNamespace and cluster:
print "Please specify --innamespace OR --cluster"
exit()
Net = MininetWithControlNet if inNamespace else Mininet
cli = ClusterCLI if cluster else CLI
if cluster:
warn( '*** WARNING: Experimental cluster mode!\n'
'*** Using RemoteHost, RemoteOVSSwitch, RemoteLink\n' )
host, switch, link = RemoteHost, RemoteOVSSwitch, RemoteLink
Net = partial( MininetCluster, servers=servers,
placement=PLACEMENT[ self.options.placement ] )
mn = Net( topo=topo,
switch=switch, host=host, controller=controller,
link=link,
ipBase=ipBase,
inNamespace=inNamespace,
xterms=xterms, autoSetMacs=mac,
autoStaticArp=arp, autoPinCpus=pin,
listenPort=listenPort )
if self.options.ensure_value( 'nat', False ):
nat = mn.addNAT( *self.options.nat_args,
**self.options.nat_kwargs )
nat.configDefault()
if self.options.pre:
cli( mn, script=self.options.pre )
test = self.options.test
test = ALTSPELLING.get( test, test )
mn.start()
if test == 'none':
pass
elif test == 'all':
mn.waitConnected()
mn.start()
mn.ping()
mn.iperf()
elif test == 'cli':
cli( mn )
elif test != 'build':
mn.waitConnected()
getattr( mn, test )()
if self.options.post:
cli( mn, script=self.options.post )
mn.stop()
elapsed = float( time.time() - start )
info( 'completed in %0.3f seconds\n' % elapsed )
if __name__ == "__main__":
try:
MininetRunner()
except KeyboardInterrupt:
info( "\n\nKeyboard Interrupt. Shutting down and cleaning up...\n\n")
cleanup()
except Exception:
# Print exception
type_, val_, trace_ = sys.exc_info()
errorMsg = ( "-"*80 + "\n" +
"Caught exception. Cleaning up...\n\n" +
"%s: %s\n" % ( type_.__name__, val_ ) +
"-"*80 + "\n" )
error( errorMsg )
# Print stack trace to debug log
import traceback
stackTrace = traceback.format_exc()
debug( stackTrace + "\n" )
cleanup()
+6
View File
@@ -0,0 +1,6 @@
This directory should hold configuration files for custom mininets.
See custom_example.py, which loads the default minimal topology. The advantage of defining a mininet in a separate file is that you then use the --custom option in mn to run the CLI or specific tests with it.
To start up a mininet with the provided custom topology, do:
sudo mn --custom custom_example.py --topo mytopo
+34
View File
@@ -0,0 +1,34 @@
"""Custom topology example
Two directly connected switches plus a host for each switch:
host --- switch --- switch --- host
Adding the 'topos' dict with a key/value pair to generate our newly defined
topology enables one to pass in '--topo=mytopo' from the command line.
"""
from mininet.topo import Topo
class MyTopo( Topo ):
"Simple topology example."
def __init__( self ):
"Create custom topo."
# Initialize topology
Topo.__init__( self )
# Add hosts and switches
leftHost = self.addHost( 'h1' )
rightHost = self.addHost( 'h2' )
leftSwitch = self.addSwitch( 's3' )
rightSwitch = self.addSwitch( 's4' )
# Add links
self.addLink( leftHost, leftSwitch )
self.addLink( leftSwitch, rightSwitch )
self.addLink( rightSwitch, rightHost )
topos = { 'mytopo': ( lambda: MyTopo() ) }
+33
View File
@@ -0,0 +1,33 @@
mininet (2.1.0-0ubuntu1) saucy; urgency=low
* Add 2.1.0 final packaging
-- Bob Lantz <rlantz@cs.stanford.edu> Wed, 18 Sep 2013 22:43:47 -0700
mininet (2.1.0~rc1-0ubuntu1) saucy; urgency=low
* New upstream release candidate:
- d/control: Drop dependency on python-networkx, add iperf, socat
and cgroup-bin to Depends.
-- James Page <james.page@ubuntu.com> Wed, 28 Aug 2013 10:10:20 +0100
mininet (2.0.0-0ubuntu1) raring; urgency=low
* New upstream release.
-- James Page <james.page@ubuntu.com> Wed, 19 Dec 2012 15:48:01 +0000
mininet (2.0.0~rc1-0ubuntu1) quantal; urgency=low
* New upstream release.
* Update copyright to match upstream release
* Fix this message
-- Bob Lantz <rlantz@cs.stanford.edu> Sun, 18 Nov 2012 00:15:09 -0800
mininet (2.0.0~d4-0ubuntu1) quantal; urgency=low
* Initial release.
-- Bob Lantz <rlantz@cs.stanford.edu> Tue, 07 Aug 2012 14:11:27 -0700
+1
View File
@@ -0,0 +1 @@
9
+31
View File
@@ -0,0 +1,31 @@
Source: mininet
Section: net
Priority: extra
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
XSBC-Original-Maintainer: Bob Lantz <rlantz@cs.stanford.edu>
Standards-Version: 3.9.3
Build-Depends:
debhelper (>= 9~),
help2man,
python-dev,
python-pkg-resources,
python-setuptools
Homepage: http://openflow.org/mininet
Package: mininet
Architecture: any
Depends:
openvswitch-switch,
telnet,
socat,
iperf,
cgroup-bin,
${misc:Depends},
${python:Depends},
${shlibs:Depends}
Recommends: openvswitch-controller
Description: Process-based network emulator
Mininet is a network emulator which uses lightweight
virtualization to create virtual networks for rapid
prototyping of Software-Defined Network (SDN) designs
using OpenFlow.
+37
View File
@@ -0,0 +1,37 @@
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0
Upstream-Name: mininet
Source: https://github.com/mininet/mininet
Files: *
Copyright: 2012-2013 Open Networking Laboratory,
2009-2012 Bob Lantz,
2009-2012 The Board of Trustees of the Leland Stanford Junior
University
License:
Original authors: Bob Lantz and Brandon Heller
.
We are making Mininet available for public use and benefit with the
expectation that others will use, modify and enhance the Software and
contribute those enhancements back to the community. However, since we
would like to make the Software available for broadest use, with as few
restrictions as possible permission is hereby granted, free of charge, to
any person obtaining a copy of this Software to deal in the Software
under the copyrights without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
.
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
.
The name and trademarks of copyright holder(s) may NOT be used in
advertising or publicity pertaining to the Software or any derivatives
without specific, written prior permission.
Vendored
+1
View File
@@ -0,0 +1 @@
README.md
+1
View File
@@ -0,0 +1 @@
examples/*
+1
View File
@@ -0,0 +1 @@
mnexec /usr/bin
+1
View File
@@ -0,0 +1 @@
*.1
Vendored Executable
+12
View File
@@ -0,0 +1,12 @@
#!/usr/bin/make -f
%:
dh $@ --buildsystem=python_distutils --with=python2
override_dh_auto_build:
make man
make mnexec
dh_auto_build
get-orig-source:
uscan --force-download --rename
+1
View File
@@ -0,0 +1 @@
3.0 (quilt)
+3
View File
@@ -0,0 +1,3 @@
version=3
opts=filenamemangle=s/(.*)\/archive/$1/,uversionmangle=s/([abdr].*)\.tar\.gz/~$1/ \
https://github.com/mininet/mininet/tags .*/archive\/(\d.*\.tar\.gz)
-11
View File
@@ -1,11 +0,0 @@
#!/usr/bin/env bash
# set python3 alias, but needs permanent fix in image directly
alias python=python3
service openvswitch-switch start
ovs-vsctl set-manager ptcp:6640
bash
service openvswitch-switch stop
-35
View File
@@ -1,35 +0,0 @@
[comments]: The original author of Mini-NDN docker is Md Ashiqur Rahman (marahman@email.arizona.edu)
## Running Mini-NDN inside Docker
You can use the nightly build from GitHub package registry
```bash
docker run -m 4g --cpus=4 -it --privileged \
-v /lib/modules:/lib/modules \
ghcr.io/named-data/mini-ndn:master bash
```
## Building your own image
The Dockerfile can be used directly to `build` an image from scratch.
* Build with `Dockerfile`:
* Clone the repository and type.
```bash
docker build -t minindn .
```
* You can then access the container through shell with,
```bash
docker run -m 4g --cpus=4 -it --privileged \
-v /lib/modules:/lib/modules \
minindn bin/bash
```
### Notes:
* Memory (-m), CPU (--cpus) are recommended by Mini-NDN.
* `--privileged` is mandatory for underlying [Mininet](http://mininet.org/) to utilize virtual switch
* Root directory on `run` is `/mini-ndn` containing the installation and examples.
* GUI may not work for now due to docker and xterm setup issues and is independent from Mini-NDN.
If you intend to run the GUI, pass `-e DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix` to the `docker run` command.
-20
View File
@@ -1,20 +0,0 @@
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
-1
View File
@@ -1 +0,0 @@
.. include:: ../AUTHORS.rst
-36
View File
@@ -1,36 +0,0 @@
#!/bin/bash
# -*- Mode:bash; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
#
# Copyright (C) 2015-2021, The University of Memphis,
# Arizona Board of Regents,
# Regents of the University of California.
#
# This file is part of Mini-NDN.
# See AUTHORS.md for a complete list of Mini-NDN authors and contributors.
#
# Mini-NDN is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Mini-NDN is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Mini-NDN, e.g., in COPYING.md file.
# If not, see <http://www.gnu.org/licenses/>.
set -eo pipefail
cd "$(dirname "${BASH_SOURCE[0]}")"
PIP='python3 -m pip'
for PIPPKG in sphinx sphinx_rtd_theme; do
if ! $PIP show $PIPPKG >/dev/null; then
sudo $PIP install $PIPPKG
fi
done
make clean html
-61
View File
@@ -1,61 +0,0 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))
from datetime import datetime
from minindn import __version__
# -- Project information -----------------------------------------------------
project = 'Mini-NDN'
copyright = '2015-{}, Mini-NDN. This research is partially supported by NSF.'.format(datetime.now().year)
author = 'Mini-NDN'
# The full version, including alpha/beta/rc tags
release = __version__
version = __version__
# -- General configuration ---------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
# -- Options for HTML output -------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# Need to specify the line below if custom conf.py
# https://github.com/readthedocs/readthedocs.org/issues/2569
# https://stackoverflow.com/questions/56336234/build-fail-sphinx-error-contents-rst-not-found
master_doc = 'index'
-274
View File
@@ -1,274 +0,0 @@
Experiment
==========
Configuration
-------------
Mini-NDN uses a configuration file describing the topology and its parameters to setup a network.
The [nodes] section:
At the bare minimum, the node section describes the nodes present in the
topology.
::
[nodes]
a: key1=value1 key2=value2
b: key1=value1
Any key and value passed here is accessible in Mini-NDN as:
::
ndn = Minindn(...)
value = ndn.net.hosts[0].params['params'].get('key1', "defaultValue")
One can specify log levels for each node's NFD and NLSR using this key-value system:
::
[nodes]
a: nfd-log-level=DEBUG nlsr-log-level=DEBUG
b: nfd-log-level=INFO
To specify a log level for certain modules of NFD, the following line can be added to `nfd.py`:
::
node.cmd('infoedit -f {} -s log.Forwarder -v {}'.format(self.confFile, 'INFO'))
This will turn on FORWARDER logging to INFO for all nodes.
.. Todo: Add switch section
The [links] section:
The links section describes the links in the topology.
::
e.g.)
[links]
a:b delay=10ms
This would create a link between a and b. 'b:a' would also result in the
same. The following parameters can be configured for a node:
- delay : Delay parameter is a required parameter which defines the
delay of the link (1-1000ms)
- bw : Bandwidth of a link (<1-1000> Mbps)
- loss : Percentage of packet loss (<1-100>)
Example configuration file
::
[nodes]
a:
b:
[links]
a:b delay=10ms bw=100
See ``ndn_utils/topologies`` for more sample files
Sample
------
Sample experiment may written as follows:
.. code:: python
from mininet.log import setLogLevel, info
from minindn.minindn import Minindn
from minindn.util import MiniNDNCLI
from minindn.apps.appmanager import AppManager
from minindn.apps.nfd import Nfd
from minindn.apps.nlsr import Nlsr
from minindn.helpers.routing_helper import IPRoutingHelper
if __name__ == '__main__':
setLogLevel('info')
Minindn.cleanUp()
Minindn.verifyDependencies()
# Can pass a custom parser, custom topology, or any Mininet params here
ndn = Minindn()
ndn.start()
# IP reachability if needed
# IPRoutingHelper.calcAllRoutes(ndn.net)
# info("IP routes configured, start ping\n")
# ndn.net.pingAll()
# Start apps with AppManager which registers a clean up function with ndn
info('Starting NFD on nodes\n')
nfds = AppManager(ndn, ndn.net.hosts, Nfd)
info('Starting NLSR on nodes\n')
nlsrs = AppManager(ndn, ndn.net.hosts, Nlsr)
# or can not start NLSRs with some delay in between:
# nlsrs = AppManager(ndn, ndn.net.hosts, Nlsr)
# for host in ndn.net.hosts:
# nlsrs.startOnNode(host)
# time.sleep(30)
MiniNDNCLI(ndn.net)
# Calls the clean up functions registered via AppManager
ndn.stop()
Users may look at how the NFD and NLSR applications are written as a sub class of Application
in the ``minindn/apps`` folder. Or users may choose to directly run their application on nodes
such as ndnpingserver is run in ``minindn/helpers/experiment.py``.
**Note:** A certain log-level can be set-up for all the NFD or NLSR nodes at once by passing it as an argument during the startup.
``nfds = AppManager(self.ndn, self.ndn.net.hosts, Nfd, logLevel='DEBUG')`` (same for NLSR)
Execution
---------
To run Mini-NDN with the default topology,
``ndn_utils/topologies/default-topology.conf``, type:
::
sudo python examples/minindn.py
To run Mini-NDN with a topology file, provide the filename as the first
argument:
::
sudo python examples/minindn.py my-topology.conf
After Mini-NDN is installed, users can run examples from anywhere with python directly as follows:
::
sudo python /path/to/myexample.py
The user no longer needs to create an experiment in the old Mini-NDN way, then install it to the system before executing it via the minindn binary. The new examples can be separate from the Mini-NDN folder if the core is not being modified.
CLI Interface
_____________
During set up, the list of nodes in the network will be listed as they
are initialized:
::
*** Adding hosts:
a b c d
After set up, the command-line interface (CLI) will display a prompt.
::
mini-ndn>
To interact with a node, first type the node's name and then the command
to be executed:
::
mini-ndn> a echo "Hello, world!"
Hello, world!
To see the status of the forwarder on the node:
::
mini-ndn> a nfdc status report
To see the status of routing on the node:
::
mini-ndn> a nlsrc status
To exit Mini-NDN, type ``quit`` in the CLI or use ``ctrl + D``:
::
mini-ndn> quit
``Ctrl + C`` is used to quit an application run in the foreground of the command line.
For a more in depth explanation of the CLI, please see the `Mininet
Walkthrough <http://mininet.org/walkthrough/>`__.
To run NDN commands from the outside the command line user can also open a new terminal
and export the HOME folder of a node ``export HOME=/tmp/minindn/a && cd ~``
Working Directory Structure
---------------------------
Currently Mini-NDN uses /tmp/minindn as the working directory if not
specified otherwise by using the option --work-dir.
Each node is given a HOME directory under /tmp/minindn/<node-name> where
<node-name> is the name of the node specified in the [nodes] section of
the conf file.
NFD
___
- NFD conf file is stored at ``/tmp/minindn/<node-name>/nfd.conf``
- NFD log file is stored at ``/tmp/minindn/<node-name>/log/nfd.log``
- ``.ndn`` folder is stored at ``/tmp/minindn/<node-name>/.ndn``
NLSR
____
- NLSR conf file is stored at ``/tmp/minindn/<node-name>/nlsr.conf``
- NLSR log file is stored at ``/tmp/minindn/<node-name>/log/nlsr.log``
When security is enabled, NLSR security certificates are stored in:
``/tmp/minindn/<node-name>/security`` Note that no NLSR publishes the root
certificate, Mini-NDN installs root.cert in security folder for each
NLSR.
While a host's NLSR neighbors are by default populated by adjacent nodes in wired scenarios,
for those running NLSR on wifi stations it is required that you specify "neighbor" faces
manually. The framework for this is provided either via a dictionary object or through
additional sections in topology files, and may also be used for wired experiments.
See an example of a topo of this sort in ``mini-ndn/topologies/wifi/nlsr_wifi_example.conf``.
NLSR faces to be created can be manually specified from topology files in a ``[faces]``
section, with the format ``nodeA:nodeB [cost=X]``. You should then call the ``setupFaces()``
method of an initialized Mini-NDN object to get a dictionary based on this parse in the format
``faceA:[(faceB, cost), (faceC, cost),...]``, which can finally be passed to the NLSR
helper via the faceDict parameter. An example experiment using this methodology is located
at ``mini-ndn/examples/wifi/nlsr_wifi.py``. Note that the aforementioned dict can also be
created manually in the previously established format.
Routing Options
----------------
Link State Routing (NLSR)
_________________________
By default, Mini-NDN uses `NLSR <https://github.com/named-data/NLSR>`__ for route management i.e route computation, route installation and so on. Additionally, the command line utility ``nlsrc`` can be used to advertise and withdraw prefixes and route status.
NDN Routing Helper
____________________
Computes link-state or hyperbolic route/s from a given minindn topology and installs them in the FIB. The major benefit of the routing helper is to eliminate the overhead of NLSR when using larger topology. See ``examples/static_routing_experiment.py`` on how to use the helper class.
**IMPORTANT:** NLSR and NDN Routing Helper are mutually exclusive, meaning you can only use one at a time, not both.
**Note:** The current version of ``ndn_routing_helper`` is still in the experimental phase. It doesn't support node or link failure and runtime prefix advertisement/withdrawal. If you find any bug please report `here <https://redmine.named-data.net/projects/mini-ndn>`__ or contact the :doc:`authors <authors>`.
IP Routing Helper
____________________
The routing helper allows to run IP-based evaluations with Mini-NDN. It configures static IP routes to all nodes, which means that all nodes can reach all other nodes in the network
reachable, even when relaying is required. Please see ``examples/ip_rounting_experiment.py`` for a simple example.
-48
View File
@@ -1,48 +0,0 @@
FAQ
=========
* ``How does Mini-NDN work?``
Mini-NDN's principles of operation most heavily rely on the underlying Mininet code it relies on.
Mininet uses a combination of limited containerization via network namespaces (which give processes
isolated interfaces and routing tables) and emulated ethernet connections via veth connections.
In practical terms, Mini-NDN ensures that processes running on distinct nodes will run seperately
and without interfering with each other.
* ``How does Mini-NDN apply link loss/delay/etc.?``
Mini-NDN relies on Mininet's code, which in turn uses the Linux tc utility on a stations' virtualized
interfaces to apply configurations known as qdiscs to these links. Note that these will only be applied
on egress packets from a station where it's applied.
For more information on qdiscs and tc, view the information `here <http://wiki.linuxwall.info/doku.php/en%3aressources%3adossiers%3anetworking%3atraffic_control>`_.
* ``Why use Mini-NDN rather than a simulator such as ndnSIM?``
Mini-NDN is easier and faster to use because, rather than serving as a mathematical model of a network,
it is instead running real NDN code on a real Linux kernel. This also means it's quite useful for testing code changes, as it can more accurately test the interaction of software componenents.
+--------------------------------+-----------------------------------------------------------+-----------------------------------------+
| Criteria | Mini-NDN | ndnSIM |
+--------------------------------+-----------------------------------------------------------+-----------------------------------------+
| Based On | Mininet | ns-3 |
+--------------------------------+-----------------------------------------------------------+-----------------------------------------+
| Language | Python | C++ |
+--------------------------------+-----------------------------------------------------------+-----------------------------------------+
| Library/Forwarder/Applications | Use system binaries (free to use any compatible versions) | Integrated (fixed release version) |
+--------------------------------+-----------------------------------------------------------+-----------------------------------------+
| Application language | C++ (ndn-cxx), CCL (ndn-cpp, PyNDN, ndn-js, jNDN) | C++ (ndn-cxx) |
+--------------------------------+-----------------------------------------------------------+-----------------------------------------+
| Simulation size | Medium - Large (cluster edition in development) | Large (can be parallelized using MPI) |
+--------------------------------+-----------------------------------------------------------+-----------------------------------------+
| Simulation time | Real time | Quick (depending on size/memory) |
+--------------------------------+-----------------------------------------------------------+-----------------------------------------+
| Porting real applications | Drop in | Changes required |
+--------------------------------+-----------------------------------------------------------+-----------------------------------------+
| Interactivity | Can interact directly with NFD, NLSR or Apps | Can show stats while running |
+--------------------------------+-----------------------------------------------------------+-----------------------------------------+
| Logs | May need to manually setup to collect | Available with tracer |
+--------------------------------+-----------------------------------------------------------+-----------------------------------------+
| Post processing scripts | Not available, users need to write their own | Available to use to process the logs |
+--------------------------------+-----------------------------------------------------------+-----------------------------------------+
| Other | Not yet supported (Wifi in development) | WiFi, LTE, etc available from ns-3 |
+--------------------------------+-----------------------------------------------------------+-----------------------------------------+
-10
View File
@@ -1,10 +0,0 @@
Past NDN Hackathon projects
===========================
- 1st NDN Hackathon: `NFD integration test <http://ndncomm.github.io/mini-ndn/>`_.
- 2st NDN Hackathon: `Mini-NDN metrics <https://github.com/2nd-ndn-hackathon/mini-ndn-metrics>`_.
- 3rd NDN Hackathon: `Mini-NDN cluster <https://github.com/3rd-ndn-hackathon/mini-NDN-cluster>`_.
- 4th NDN Hackathon: `Mini-NDN wifi <https://github.com/4th-ndn-hackathon/Mini-NDN-Wi-Fi>`_.
- 7th NDN Hackathon: `Mini-NDN documentation <https://github.com/7th-ndn-hackathon/mini-ndn-documentation>`_.
- 11th NDN Hackathon: `Mini-NDN improvements <https://11th-ndn-hackathon.named-data.net/hacks.html#8-mini-ndn-improvements>`_.
- 12th NDN Hackathon: `Mini-NDN improvements and Refactoring <https://12th-ndn-hackathon.named-data.net/hacks.html#7-mini-ndn-improvements>`_.
-128
View File
@@ -1,128 +0,0 @@
Howtos
======
Connect Mini-NDN nodes to an outside network
---------------------------------------------
Mini-NDN nodes can be connected to an outside network indirectly by
running NFD on the local machine:
::
(Mini-NDN node) ------ (NFD running on the host machine where Mini-NDN is running) ------- (External Network)
Add a node in root namespace
____________________________
For this simple example, we can use a single node topology with node 'a'
If we want node 'a' to connect to the host machine, we need to add a
"root" node which has a link with node "a."
Then the following code can be used:
.. code:: python
topo = Topo()
root = topo.addHost('root', inNamespace=False)
a = topo.addHost('a')
topo.addLink(root, a, delay='10ms')
ndn = Minindn(topo=topo)
...
Configuration
_____________
Run Mini-NDN with the above code and issue ifconfig on the local
machine to confirm the addition of the interface. You should be able to
locate "root-eth0":
::
root-eth0 Link encap:Ethernet HWaddr 3e:eb:77:d2:6f:1f
inet addr:1.0.0.9 Bcast:1.0.0.11 Mask:255.255.255.252
inet6 addr: fe80::3ceb:77ff:fed2:6f1f/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:34 errors:0 dropped:0 overruns:0 frame:0
TX packets:33 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2667 (2.6 KB) TX bytes:2797 (2.7 KB)
To make the IP address associated with this interface persistent, add
the following line to /etc/network/interfaces and reboot your machine:
::
iface root-eth0 inet manual
Check connection
________________
After rebooting, run Mini-NDN and issue the following command:
::
mini-ndn>net
a a-eth0:b-eth0 a-eth1:c-eth0 a-eth2:root-eth0
Node "a" is connected to "root-eth0". Now issue "ifconfig a-eth2" on
node "a":
::
mini-ndn>a ifconfig a-eth2
a-eth2 Link encap:Ethernet HWaddr fa:76:d4:86:d3:ba
inet addr:1.0.0.10 Bcast:1.0.0.11 Mask:255.255.255.252
As learned from the previous step, the IP address of root-eth0 is
1.0.0.9.
::
mini-ndn>a ping 1.0.0.9
PING 1.0.0.9 (1.0.0.9) 56(84) bytes of data.
64 bytes from 1.0.0.9: icmp_seq=1 ttl=64 time=0.137 ms
64 bytes from 1.0.0.9: icmp_seq=2 ttl=64 time=0.123 ms
The host machine will also be able to ping node "a":
::
VirtualBox:~$ ping 1.0.0.10
PING 1.0.0.10 (1.0.0.10) 56(84) bytes of data.
64 bytes from 1.0.0.10: icmp_seq=1 ttl=64 time=0.086 ms
Run NFD on local machine and register route
___________________________________________
Start NFD on the local machine by using:
::
sudo nfd
The "nfd-start" script cannot be used, since the script allows only one
instance of NFD at a time. The NFD processes running on the Mini-NDN
nodes will prevent the "nfd-start" script from working.
Now, using "nfdc register", we can register a route from node "a" in
Mini-NDN to the NFD process on the host machine and from the host
machine to an external machine.
Also, if the local machine has a public IP, Mini-NDN nodes can be
reached via external machines.
Generate NDN testbed topology
___________________________________________
Run the following install.sh command
::
python3 util/testbed_topo_generator.py
This will place a "testbed.conf" file in the topologies subdirectory,
where it can be referenced as desired. To update the topology, simply
rerun this command.
-30
View File
@@ -1,30 +0,0 @@
.. Mini-NDN documentation master file, created by
sphinx-quickstart on Mon Sep 23 11:15:54 2019.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Mini-NDN: A Mininet-based NDN emulator
======================================
.. toctree::
:maxdepth: 2
:caption: Contents
introduction
install
experiment
howtos
release-notes
faq
hackathon
videos
Helpful Links
-------------
* `NDN Website <http://named-data.net/>`_
* `NDN Contributor's Guide <https://github.com/named-data/NFD/blob/master/CONTRIBUTING.md>`_
* `Mininet Documentation <http://mininet.org/>`_
* `Mini-NDN redmine <https://redmine.named-data.net/projects/mini-ndn>`_
* `Mailing list <http://www.lists.cs.ucla.edu/mailman/listinfo/mini-ndn>`_
* :doc:`Mini-NDN Team <authors>`
-184
View File
@@ -1,184 +0,0 @@
Install
=======
Prerequisites
-------------
Mini-NDN is tested on the following Linux distributions:
- Ubuntu 20.04 (recommended)
- Ubuntu 22.04
- Debian 11 (WiFi scenario does not work)
- Fedora 33 (WiFi scenario does not work)
You must have sudo privileges to install and run Mini-NDN.
Using Vagrantfile
-----------------
With Vagrant installed, simply do ``vagrant up`` which will bring up an Ubuntu 18.04 virtual machine
and install Mini-NDN and all its dependencies on it. Please make sure to tweak the CPU core count
(default 4 cores) and RAM (default 4GB) according to your needs before doing vagrant up. Mini-NDN
can be found in /home/vagrant/mini-ndn which is a symlink to /vagrant if Vagrantfile was used from within mini-ndn cloned on the host. Otherwise it is an actual clone of mini-ndn.
Using install.sh
----------------
Mini-NDN has the following dependencies:
- `NDN Forwarding Daemon (NFD) <https://named-data.net/doc/NFD/>`_
- `Named Data Link State Routing (NLSR) <https://named-data.net/doc/NLSR/>`_
- `NDN Essential Tools (ndn-tools) <https://github.com/named-data/ndn-tools>`_
- `NDN Traffic Generator <https://github.com/named-data/ndn-traffic-generator>`_
- `infoedit <https://github.com/NDN-Routing/infoedit>`_
- `Mininet <http://mininet.org/>`_
- `Mininet-WiFi <https://mininet-wifi.github.io/>`_ (optional)
To install Mini-NDN and its dependencies, clone this repository and run:
::
./install.sh
The script accepts various command line flags.
Some notable flags are:
- ``-y`` skips interactive confirmation before installation.
- ``--ppa`` prefers installing NDN software from `named-data PPA <https://launchpad.net/~named-data/+archive/ubuntu/ppa>`_.
This shortens installation time by downloading binary packages, but is only available on Ubuntu.
- ``--source`` prefers installing NDN software from source code.
IMPORTANT: For now, Mininet-WiFi only works with ``--source`` installation because the current NFD release (0.7.1) doesn't
incorporate `issue 5155 <https://redmine.named-data.net/issues/5155>`, a required patch for WiFi module to work properly.
With the next NFD release, Mininet-WiFi will work with both ``source`` and ``ppa``. Alternatively, you can
checkout (at your own risk) a third-party source "`Use NFD nightly with Mini-NDN <https://yoursunny.com/t/2021/NFD-nightly-minindn/>`", which provides
NFD-nightly version and contains all the necessary patches.
- ``--dummy-keychain`` patches ndn-cxx to use an in-memory dummy KeyChain, which reduces CPU overhead
and allows you to scale up Mini-NDN experiments. Large Mini-NDN experiments would run significantly
faster after applying this patch. However, your experiments cannot use any NDN security related
features (signatures, verifier, access control, etc).
- ``--no-wifi`` skips Mininet-WiFi dependency.
Currently Mininet-WiFi only works on Ubuntu, so that you must specify this option when installing on other distros.
You can see all command line flags by running:
::
./install.sh -h
The script uses ``setup.py develop`` to point the system install of Python packages to the codebase
directory. Therefore, you can modify ``mininet``, ``mininet-wifi``, and ``mini-ndn``, and the
changes will be reflected immediately.
If NDN software is installed from source code (not PPA), the code is downloaded to ``dl`` directory
under your ``mini-ndn`` clone. If you modify the source code, you need to manually recompile and
reinstall the software (``./waf && sudo ./waf install``).
Installing Dependencies
-----------------------
This section outlines how to install dependnecies manually.
If you used ``install.sh``, you do not need to perform these steps.
Mininet
_______
Mini-NDN is based on Mininet. To install Mininet:
::
git clone --depth 1 https://github.com/mininet/mininet.git
After Mininet source is on your system, run the following command to
install Mininet core dependencies and Open vSwitch:
::
./util/install.sh -nv
To check if Mininet is working correctly, run this test:
::
sudo mn --test pingall
This will print out a series of statements that show the test setup and
the results of the test. Look for ``Results:`` two-thirds of the way
down where it will indicate the percentage of dropped packets. Your
results should show "0% dropped (2/2 received)".
NOTE: Mini-NDN, while providing a high level of emulation of hosts,
requires programs to be installed onto your computer. It will not work
if they are not installed. If you do not want NDN software installed
onto your computer, you can use a virtual machine, which can be quite
simply set up with the provided Vagrantfile.
NDN dependencies
________________
Each node in Mini-NDN will run the official implementation of NDN
installed on your system. The following dependencies are needed:
Mini-NDN uses NFD, NLSR, and ndn-tools.
- To install NFD: https://named-data.net/doc/NFD/current/INSTALL.html
- To install NLSR: https://named-data.net/doc/NLSR/current/INSTALL.html
- To install ndn-tools: https://github.com/named-data/ndn-tools
.. warning::
Please do not try to install NDN software from both the source (GitHub) and PPA (apt).
It will not work in most cases! If you used ./install.sh -a in the past but now want
to use apt, please run ``sudo ./waf uninstall`` in all the NDN projects before proceeding
with apt. Similarly, remove from apt if switching to source.
Please see the :ref:`scaling-note <scaling-note>` to learn about disabling
security for better scalability.
Note that all three of these can be installed from the Named Data PPA.
Instructions for setting it up can be found in the NFD installation
instructions. Note that PPA and installs from source **cannot** be
mixed. You must completely remove PPA installs from the system if switching
to source and vice-versa.
For PPA installs, if you are using a custom nfd.conf file in an experiment, you should
place it in /usr/local/etc/ndn/ rather than /etc/ndn/. This is to avoid
a bug from the default configuration file for the PPA, which is
incompatible with Mini-NDN.
Infoedit
________
Infoedit is used to edit configuration files for NFD and NLSR.
To install infoedit:
::
git clone --depth 1 https://github.com/NDN-Routing/infoedit
cd infoedit
make
sudo make install
Verification
------------
You can execute the following example to bring up the Mini-NDN command line
with NFD and NLSR running on each node:
::
sudo python examples/mnndn.py
You can use these steps to run the sample pingall experiment:
1. Issue the command: ``sudo python examples/nlsr/pingall.py``
2. When the ``mini-ndn>`` CLI prompt appears, the experiment has
finished. On the Mini-NDN CLI, issue the command ``exit`` to exit the
experiment.
3. Issue the command:
``grep -c content /tmp/minindn/*/ping-data/*.txt``. Each file should
report a count of 50.
4. Issue the command:
``grep -c timeout /tmp/minindn/*/ping-data/*.txt``. Each file should
report a count of 0.
-40
View File
@@ -1,40 +0,0 @@
Introduction
=================
If you are new to the NDN community of software generally, read the
`Contributor's Guide <https://github.com/named-data/NFD/blob/master/CONTRIBUTING.md>`_.
What is Mini-NDN?
-----------------
Mini-NDN is a lightweight networking emulation tool that enables testing, experimentation, and
research on the NDN platform. It was initially based on `Mini-CCNx <https://github.com/chesteve/mn-ccnx>`_ which was a fork of `Mininet <https://github.com/mininet/mininet>`_. Mini-NDN uses the NDN libraries, NFD, NLSR, and tools released by the `NDN project <http://named-data.net/codebase/platform/>`_ to emulate an NDN network on a single system.
The first release of Mini-NDN is developed by members of the NSF-sponsored NDN project team.
Mini-NDN is open to contribution from the public.
.. image:: minindnnet.svg
License
_______
Mini-NDN is open and free software licensed under the GPL 3.0 license. Mini-NDN is free to all
users and developers. For more information about licensing details and limitations,
please refer to COPYING.md.
Feedback/Mailing List
_____________________
Bug reports and feedback are highly appreciated and can be made through our
`Redmine site <http://redmine.named-data.net/projects/mini-ndn>`_ and the
`mini-ndn mailing list <http://www.lists.cs.ucla.edu/mailman/listinfo/mini-ndn>`_.
Video
_____
.. raw:: html
<div id="video-container" class="col-md-6 ">
<p>Mini-NDN (content maybe outdated)</p>
<iframe width="600" height="345" src="https://www.youtube.com/embed/UxHPqaUwefg" frameborder="0" allowfullscreen=""></iframe>
</div>
-126
View File
@@ -1,126 +0,0 @@
<svg width="692" height="380" xmlns="http://www.w3.org/2000/svg">
<metadata id="metadata7">image/svg+xml</metadata>
<g>
<title>background</title>
<rect fill="none" id="canvas_background" height="382" width="694" y="-1" x="-1"/>
</g>
<g>
<title>Layer 1</title>
<g stroke="null" id="g3790">
<rect stroke="#000000" fill="#ffffff" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="4" id="rect2985" width="680.84682" height="350.443392" x="4.962804" y="5.773119" rx="0.324652"/>
<path stroke="#000000" fill="none" stroke-miterlimit="4" d="m4,175.828501l681.727736,1.357954" id="path3770"/>
</g>
<rect stroke="#000000" fill="#e3dedb" stroke-width="0.99538" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="4" stroke-dashoffset="0" rx="2.988095" y="176.111777" x="5.140841" height="180.524655" width="680.312936" id="rect3813"/>
<rect stroke="#000000" fill="#ffffff" stroke-width="1.602133" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="4" stroke-dasharray="4.80639973, 4.80639973" stroke-dashoffset="0" ry="8.582684" rx="7.476771" y="44.78072" x="55.492192" height="195.219243" width="148.366914" id="rect3764"/>
<rect stroke="#000000" fill="#ffffff" stroke-width="1.638042" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="4" stroke-dasharray="4.9141253, 4.9141253" stroke-dashoffset="0" id="rect3772" width="155.115252" height="195.190135" x="270.220868" y="46.153231" rx="7.816845" ry="8.581405"/>
<rect stroke="#000000" fill="#ffffff" stroke-width="1.602133" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="4" stroke-dasharray="4.80639973, 4.80639973" stroke-dashoffset="0" ry="8.582684" rx="7.476771" y="45.459696" x="489.86568" height="195.219243" width="148.366914" id="rect3774"/>
<text transform="matrix(1.0192718802397343,0,0,0.9115536073383187,-2.8313337784806336,-12.183034089773187) " font-size="16.005802px" font-style="normal" font-weight="normal" fill="#000000" font-family="Sans" id="text3776" y="392.709737" x="551.171304" xml:space="preserve">
<tspan stroke="null" font-weight="normal" y="398.194877" x="552.152396" id="tspan3778">Kernel Space</tspan>
</text>
<text transform="matrix(1.0524848569125234,0,0,0.8827879284304422,-52.30106698198968,-77.5201889102731) " font-size="14.180006px" font-style="normal" font-weight="normal" fill="#000000" font-family="Sans" xml:space="preserve" x="601.466013" y="108.524983" id="text3782">
<tspan stroke="null" font-weight="normal" id="tspan3784" x="602.416145" y="114.188857">User Space</tspan>
</text>
<path stroke="#000000" fill="none" stroke-width="1px" id="path3796" d="m488.56554,176.773764c1.782236,0.480113 1.527628,0.360085 1.527628,0.360085"/>
<rect stroke="#000000" fill="#ffffff" stroke-width="0.649807" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="4" stroke-dashoffset="0" rx="0.838801" y="202.851471" x="84.255138" height="26.434283" width="94.537572" id="rect3815"/>
<rect stroke="#000000" fill="#ffffff" stroke-width="0.792138" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="4" stroke-dashoffset="0" id="rect3817" width="131.339764" height="28.275376" x="282.077514" y="201.912133" rx="1.165334"/>
<path stroke="#000000" fill="none" stroke-width="0.865499px" id="path3823" d="m347.74739,201.086282l0,28.351986"/>
<text transform="matrix(0.7776670647796514,0,0,1.19475416519067,-52.30106724263901,-77.52018902784596) " font-size="12.623897px" font-style="normal" font-weight="normal" fill="#000000" font-family="Sans" xml:space="preserve" x="434.634023" y="248.956571" id="text3835">
<tspan stroke="null" font-size="15.579311px" font-weight="bold" font-family="Monospace" x="435.91992" y="253.141532" id="tspan3837">n2-eth0</tspan>
</text>
<text transform="matrix(0.9031157255303414,0,0,1.0287949657006918,-2.8313337284492768,-13.069358400177762) " font-size="13.163442px" font-style="normal" font-weight="normal" fill="#000000" font-family="Sans" xml:space="preserve" x="110.835751" y="225.210496" id="text3863">
<tspan stroke="null" font-size="16.245171px" font-weight="bold" font-family="Monospace" x="111.943029" y="230.070551" id="tspan3865">n1-eth0</tspan>
</text>
<path stroke="#000000" fill="none" stroke-width="0.992521px" id="path3887" d="m131.263954,229.882774l0,67.221296l176.555867,-0.960307l1.337531,-65.300682"/>
<rect stroke="#000000" fill="#ffffff" stroke-width="0.676601" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="4" stroke-dashoffset="0" id="rect3891" width="95.679394" height="28.317195" x="515.346399" y="202.85306" rx="0.848932"/>
<path stroke="#000000" fill="none" stroke-width="0.992521px" d="m383.833251,230.842992l0,67.221296l176.555867,-0.960307l1.337531,-65.300682" id="path3897"/>
<text transform="matrix(0.9778213687833123,0,0,0.9501950205038839,-52.301066914088324,-76.5370021990862) " font-size="16.459864px" font-style="normal" font-weight="normal" fill="#000000" font-family="Sans" xml:space="preserve" x="164.136782" y="409.888383" id="text3907">
<tspan stroke="null" id="tspan3915" x="165.159464" y="415.15046">isolated point to point link</tspan>
</text>
<text transform="matrix(0.9778213687833123,0,0,0.9501950205038839,-52.301066914088324,-76.5370021990862) " font-size="16.459864px" font-style="normal" font-weight="normal" fill="#000000" font-family="Sans" id="text3919" y="409.573373" x="429.378262" xml:space="preserve">
<tspan stroke="null" y="414.83545" x="430.400944" id="tspan3921">isolated point to point link</tspan>
</text>
<text transform="matrix(0.9778213687833123,0,0,0.9501950205038839,-52.301066914088324,-76.5370021990862) " font-size="16.459864px" font-style="normal" font-weight="normal" fill="#000000" font-family="Sans" id="text3923" y="428.078233" x="194.615642" xml:space="preserve">
<tspan stroke="null" font-weight="bold" y="433.34031" x="195.638324" id="tspan3925">(eg: 1Mbps, 10ms)</tspan>
</text>
<text transform="matrix(0.9778213687833123,0,0,0.9501950205038839,-52.301066914088324,-76.5370021990862) " font-size="16.459864px" font-style="normal" font-weight="normal" fill="#000000" font-family="Sans" id="text3927" y="409.888383" x="164.136782" xml:space="preserve">
<tspan stroke="null" y="415.15046" x="165.159464" id="tspan3929">Isolated point to point link</tspan>
</text>
<text transform="matrix(0.9778213687833123,0,0,0.9501950205038839,-52.301066914088324,-76.5370021990862) " font-size="16.459864px" font-style="normal" font-weight="normal" fill="#000000" font-family="Sans" xml:space="preserve" x="429.378262" y="409.573373" id="text3931">
<tspan stroke="null" id="tspan3933" x="430.400944" y="414.83545">Isolated point to point link</tspan>
</text>
<text transform="matrix(0.877827228897152,0,0,1.0584326041598764,-53.30106731891522,-78.4233265445007) " font-size="13.706223px" font-style="normal" font-weight="normal" fill="#000000" font-family="Sans" id="text3935" y="282.545218" x="661.482605" xml:space="preserve">
<tspan stroke="null" font-size="16.915024px" font-weight="bold" font-family="Monospace" id="tspan3937" y="287.269185" x="662.621781">n3-eth0</tspan>
</text>
<text transform="matrix(0.7776670647796514,0,0,1.19475416519067,-52.30106724263901,-77.52018902784596) " font-size="12.623897px" font-style="normal" font-weight="normal" fill="#000000" font-family="Sans" id="text3939" y="248.297391" x="520.751053" xml:space="preserve">
<tspan stroke="null" font-size="15.579311px" font-weight="bold" font-family="Monospace" id="tspan3941" y="252.482352" x="522.03695">n2-eth1</tspan>
</text>
<text transform="matrix(0.8745385143393076,0,0,1.0624128521471832,-2.8313338199928846,-14.069358364146652) " font-size="16.205975px" font-style="normal" font-weight="normal" fill="#000000" font-family="Sans" id="text3943" y="80.648481" x="141.655977" xml:space="preserve">
<tspan stroke="null" font-size="20px" font-weight="bold" font-family="Monospace" id="tspan3945" y="85.354749" x="142.799437">n1</tspan>
</text>
<text transform="matrix(0.8745385143393076,0,0,1.0624128521471832,-2.8313338199928846,-14.069358364146652) " font-size="16.205975px" font-style="normal" font-weight="normal" fill="#000000" font-family="Sans" xml:space="preserve" x="385.430517" y="78.840861" id="text3955">
<tspan stroke="null" font-size="20px" font-weight="bold" font-family="Monospace" x="386.573977" y="83.547129" id="tspan3957">n2</tspan>
</text>
<text transform="matrix(0.8745385143393076,0,0,1.0624128521471832,-2.8313338199928846,-14.069358364146652) " font-size="16.205975px" font-style="normal" font-weight="normal" fill="#000000" font-family="Sans" id="text3959" y="79.181231" x="632.310457" xml:space="preserve">
<tspan stroke="null" font-size="20px" font-weight="bold" font-family="Monospace" id="tspan3961" y="83.887499" x="633.453917">n3</tspan>
</text>
<text transform="matrix(0.9526376792163275,0,0,0.9753141035001042,-53.30106707952308,-77.42332645354041) " font-size="14.959435px" font-style="normal" font-weight="normal" fill="#000000" font-family="Sans" xml:space="preserve" x="125.371536" y="171.060971" id="text3967">
<tspan stroke="null" font-weight="normal" id="tspan3969" x="126.421253" y="176.187525">(NDN Container)</tspan>
</text>
<text transform="matrix(0.9526376792163275,0,0,0.9753141035001042,-53.30106707952308,-77.42332645354041) " font-size="14.959435px" font-style="normal" font-weight="normal" fill="#000000" font-family="Sans" id="text3979" y="170.076461" x="352.011746" xml:space="preserve">
<tspan stroke="null" font-weight="normal" y="175.203015" x="353.061463" id="tspan3981">(NDN Container)</tspan>
</text>
<text transform="matrix(0.9526376792163275,0,0,0.9753141035001042,-53.30106707952308,-77.42332645354041) " font-size="14.959435px" font-style="normal" font-weight="normal" fill="#000000" font-family="Sans" xml:space="preserve" x="580.077396" y="169.091931" id="text3983">
<tspan stroke="null" font-weight="normal" id="tspan3985" x="581.127113" y="174.218485">(NDN Container)</tspan>
</text>
<text transform="matrix(0.9526376792163275,0,0,0.9753141035001042,-53.30106707952308,-77.42332645354041) " font-size="14.959435px" font-style="normal" font-weight="normal" fill="#000000" font-family="Sans" id="text3987" y="193.704961" x="123.946116" xml:space="preserve">
<tspan stroke="null" font-weight="bold" y="198.831515" x="124.995833" id="tspan3989">NFD</tspan>
</text>
<text transform="matrix(0.9526376792163275,0,0,0.9753141035001042,-53.30106707952308,-77.42332645354041) " font-size="14.959435px" font-style="normal" font-weight="normal" fill="#000000" font-family="Sans" xml:space="preserve" x="140.791686" y="208.664491" id="text3991">
<tspan stroke="null" font-weight="normal" id="tspan3993" x="141.841403" y="213.791045">n1.sock</tspan>
</text>
<text transform="matrix(0.9526376792163275,0,0,0.9753141035001042,-53.30106707952308,-77.42332645354041) " font-size="14.959435px" font-style="normal" font-weight="normal" fill="#000000" font-family="Sans" xml:space="preserve" x="123.946116" y="225.286191" id="text3995">
<tspan stroke="null" font-weight="bold" id="tspan3997" x="124.995833" y="230.412745">NLSR</tspan>
</text>
<text transform="matrix(0.9526376792163275,0,0,0.9753141035001042,-53.30106707952308,-77.42332645354041) " font-size="14.959435px" font-style="normal" font-weight="normal" fill="#000000" font-family="Sans" id="text3999" y="240.245731" x="138.385176" xml:space="preserve">
<tspan stroke="null" font-weight="normal" y="245.372285" x="139.434893" id="tspan4001">%C1.Router/n1</tspan>
</text>
<text transform="matrix(0.9526376792163275,0,0,0.9753141035001042,-53.30106707952308,-77.42332645354041) " font-size="14.959435px" font-style="normal" font-weight="normal" fill="#000000" font-family="Sans" xml:space="preserve" x="352.011746" y="191.735901" id="text4003">
<tspan stroke="null" font-weight="bold" id="tspan4005" x="353.061463" y="196.862455">NFD</tspan>
</text>
<text transform="matrix(0.9526376792163275,0,0,0.9753141035001042,-53.30106707952308,-77.42332645354041) " font-size="14.959435px" font-style="normal" font-weight="normal" fill="#000000" font-family="Sans" id="text4007" y="206.695431" x="366.450896" xml:space="preserve">
<tspan stroke="null" font-weight="normal" y="211.821985" x="367.500613" id="tspan4009">n2.sock</tspan>
</text>
<text transform="matrix(0.9526376792163275,0,0,0.9753141035001042,-53.30106707952308,-77.42332645354041) " font-size="14.959435px" font-style="normal" font-weight="normal" fill="#000000" font-family="Sans" id="text4011" y="223.317141" x="352.011746" xml:space="preserve">
<tspan stroke="null" font-weight="bold" y="228.443695" x="353.061463" id="tspan4013">NLSR</tspan>
</text>
<text transform="matrix(0.9526376792163275,0,0,0.9753141035001042,-53.30106707952308,-77.42332645354041) " font-size="14.959435px" font-style="normal" font-weight="normal" fill="#000000" font-family="Sans" xml:space="preserve" x="366.450896" y="238.276671" id="text4015">
<tspan stroke="null" font-weight="normal" id="tspan4017" x="367.500613" y="243.403225">%C1.Router/n2</tspan>
</text>
<text transform="matrix(0.9526376792163275,0,0,0.9753141035001042,-53.30106707952308,-77.42332645354041) " font-size="14.959435px" font-style="normal" font-weight="normal" fill="#000000" font-family="Sans" id="text4019" y="190.751371" x="582.928226" xml:space="preserve">
<tspan stroke="null" font-weight="bold" y="195.877925" x="583.977943" id="tspan4021">NFD</tspan>
</text>
<text transform="matrix(0.9526376792163275,0,0,0.9753141035001042,-53.30106707952308,-77.42332645354041) " font-size="14.959435px" font-style="normal" font-weight="normal" fill="#000000" font-family="Sans" xml:space="preserve" x="599.773686" y="205.710911" id="text4023">
<tspan stroke="null" font-weight="normal" id="tspan4025" x="600.823403" y="210.837465">n3.sock</tspan>
</text>
<text transform="matrix(0.9526376792163275,0,0,0.9753141035001042,-53.30106707952308,-77.42332645354041) " font-size="14.959435px" font-style="normal" font-weight="normal" fill="#000000" font-family="Sans" xml:space="preserve" x="582.928226" y="222.332611" id="text4027">
<tspan stroke="null" font-weight="bold" id="tspan4029" x="583.977943" y="227.459165">NLSR</tspan>
</text>
<text transform="matrix(0.9526376792163275,0,0,0.9753141035001042,-53.30106707952308,-77.42332645354041) " font-size="14.959435px" font-style="normal" font-weight="normal" fill="#000000" font-family="Sans" id="text4031" y="237.292141" x="597.367186" xml:space="preserve">
<tspan stroke="null" font-weight="normal" y="242.418695" x="598.416903" id="tspan4033">%C1.Router/n3</tspan>
</text>
<text transform="matrix(0.9778213687833123,0,0,0.9501950205038839,-52.301066914088324,-76.5370021990862) " font-size="16.459864px" font-style="normal" font-weight="normal" fill="#000000" font-family="Sans" id="text4035" y="102.475413" x="322.701992" xml:space="preserve">
<tspan stroke="null" y="107.73749" x="323.724674" id="tspan4037">Isolated NDN nodes</tspan>
</text>
<text transform="matrix(0.935021961689298,0,0,0.9936889310882339,-2.9798247609055646,-12.086171479984756) " font-size="11.279781px" font-style="normal" font-weight="normal" fill="#000000" font-family="Sans" xml:space="preserve" x="75.549398" y="206.131281" id="text4039">
<tspan stroke="null" id="tspan4041" x="76.618892" y="211.163037">Private network space</tspan>
</text>
<text transform="matrix(0.935021961689298,0,0,0.9936889310882339,-2.9798247609055646,-12.086171479984756) " font-size="11.279781px" font-style="normal" font-weight="normal" fill="#000000" font-family="Sans" id="text4043" y="206.946991" x="308.474828" xml:space="preserve">
<tspan stroke="null" y="211.978747" x="309.544322" id="tspan4045">Private network space</tspan>
</text>
<text transform="matrix(0.935021961689298,0,0,0.9936889310882339,-2.9798247609055646,-12.086171479984756) " font-size="11.279781px" font-style="normal" font-weight="normal" fill="#000000" font-family="Sans" xml:space="preserve" x="540.174348" y="206.131281" id="text4047">
<tspan stroke="null" id="tspan4049" x="541.243842" y="211.163037">Private network space</tspan>
</text>
<text xml:space="preserve" text-anchor="start" font-family="Helvetica,Arial,sans-serif" font-size="15px" id="svg_1" y="377" x="203.5" stroke-width="null" stroke="null" fill="#333">Figure: Relationship between Minindn and Mininet</text>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 16 KiB

-286
View File
@@ -1,286 +0,0 @@
Release Notes
=============
Mini-NDN version 0.6.0 (Major changes since version 0.5.0)
----------------------------------------------------------
**Breaking Changes**:
- Rewrite install script (`issue: 4630 <https://redmine.named-data.net/issues/4630>`__)
- Set dependency versions: PPA, git repository & commit
- Separate download and build+install steps
- Don't reinstall package if it's already installed
- More details `here <https://github.com/named-data/mini-ndn/blob/master/docs/install.rst>`__
- `Note: <https://redmine.named-data.net/issues/5161>`__ We have dropped support for python 2, the latest Mini-NDN requires at least python 3.0
**New features**:
- Update Mini-NDN codebase with Mini-NDN-Wifi code (`issue: 4858 <https://redmine.named-data.net/issues/4858>`__)
- Provide pre-built Mini-NDN Vagrant box and Docker container
- Added several new examples:
- consumer/producer
- ndnping
- traffic generator
- catchunks/putchunks
- Allow for creation of net object without topology (`issue: 5162 <https://redmine.named-data.net/issues/5162>`__)
**Improvements and Bug Fixes**:
- Support running NDN applications on mixed topologies (`issue: 5160 <https://redmine.named-data.net/issues/5160>`__)
- Support route addition using face-id in `Nfdc` helper (`issue: 5130 <https://redmine.named-data.net/issues/5130>`__)
- Add wrapper for `ndnpingserver` and fix passing the Mininet host object as a prefix on ndnpingclient
- Show status of route calculation in `NdnRoutingHelper`
- Incorporate changes of `NDNPing` Class (wrapper of pingserver and pingclient) in the examples
- Support simple topology files with no additional parameters
Mini-NDN version 0.5.0 (Major changes since version 0.4.0)
----------------------------------------------------------
**Breaking Changes**:
- `Mini-NDN re-design <https://redmine.named-data.net/issues/5062>`__: simple and robust design with better quality, control, and more consistency with Mininet
**New features**:
- Add a script to generate up-to-date NDN testbed topologies for Mini-NDN
- Add Mini-NDN utility application for PCAP logging
- Add NDN routing helper to compute centralized LS and HR routes
- Add routing helper to allow IP communication in experiments
- Add startup experiments for NLSR and current testbed topology
- Move the NDNPing wrapper method to a helper class
- Create a helper class to provide a wrapper around ``nfdc``
**Improvements and Bug Fixes**:
- Change workDir and resultDir to be class attribute
- Quiet apt install for Vagrant
- Fix route computation bug in ``ndn_routing_helper``
- Fix overwriting of existing prefixes in ``ndn_routing_helper``
- Move log files to resultDir after evaluation finishes
- Check for duplicate HR coordinates in the topology file
- Check PSync integration and add a tests case for it
- Bug fixes in nfdc and experiments
- Added functionality to check Mini-NDN dependencies
- Parser fix to avoid an infinite loop
- Allow use of NFD and NLSR PPA with Mini-NDN
- Remove arbitrary arguments in favor of parsing arguments from experiment files
- Auto-complete command-line arguments
- Add option to set CS size
- Adjust to use ndn-cxx logging
Mini-NDN version 0.4.0 (changes since version 0.3.0)
----------------------------------------------------
Release date: January 10, 2018
**New features**:
- Use SIGQUIT to quit Mini-NDN, SIGINT to kill programs
- Use Infoedit to edit NFD and NLSR configuration files
- Use nlsr.conf installed in the system
- Provide a Vagrantfile to setup Mini-NDN and NDN
- Provide option to disable NLSR
- Provide an option to run NLSR in dry-run mode
- Add option to specify whether to use TCP or UDP face in nlsr.conf
- Add option to specify arbitrary arguments to use in experiments
- Include a single option to install Mini-NDN and all the dependencies
**Bug fixes**:
- Fix "key does not exist error" after NLSR starts
- Update install.sh to call ldconfig after installing ChronoSync
- Add hyperbolic coordinates to default topology
**Misc changes**:
- Add an experiment to test nlsrc
- Create faces in NFD for each neighbor in NLSR
- Update to latest ndn-cxx
- Use /tmp/minindn folder as default work dir instead of /tmp
Mini-NDN version 0.3.0 (changes since version 0.2.0)
----------------------------------------------------
Release date: March 3, 2017
**New features**:
- Mini-NDN cluster edition
- New experiments for making NLSR testing easier
**Bug fixes**:
- Set site name correctly
- Install missing certificates in NLSR security config
- Fix quitting of NLSR due to key not found error
**Misc changes**:
- Removed nlsr.conf file, generate it within the code
- Use argparse instead of deprecated optparse
- Update security config section for NLSR
- Change mininet prompt to mini-ndn
- Set network name at one place
- Update install.sh script to install openssl
- Update install.sh script to install cryptopp from package instead of
compiling from source
- Update install.sh to clean build folder every time to get rid of
removed files such as old experiments
- Fix old code - use net.hosts instead of storing hosts in a variable
- Use nfdc instead of deprecated nfd-status
Mini-NDN version 0.2.0 (changes since version 0.1.1)
----------------------------------------------------
Release date: August 18, 2016
**New features**:
- Automatic security configuration for NLSR
- Use /usr/local/etc/ndn/nfd.conf as default config file for NFD
- Class to monitor /proc/$PID/stat file for PID
- Mini-NDN exits gracefully on SIGINT and non-convergence
- Faster Mini-NDN install script - does not do apt-get update everytime
- NLSR is launched with explicit config file for easier process
identification
- Add and update more documentation
**Bug fixes**:
- NFD is killed correctly on exit
- Best route strategy is set correctly
Mini-NDN version 0.1.1 (changes since version 0.1.0)
----------------------------------------------------
Release date: November 4, 2015
**New features**:
- Use nfd.conf.sample from currently installed NFD
- Add working directory option to allow execution environment outside
of /tmp
- Add results directory option to store experiment results after
completion
- Add support for switches in GUI and configuration file
- Add failNode and recoverNode methods to Experiment class
- Add most connected node (MCN) failure experiment
- Add option to specify percentage of nodes pinged
**Code changes**:
- Refactor program options into container class
- Remove unused "FIB Entries" option from NDN host options
**Bug fixes**:
- Abort start up if experiment name is invalid
- Restart pings after recovery in failure experiment
Mini-NDN version 0.1.0 (initial release)
----------------------------------------
Release date: July 15, 2015
Mini-NDN is a lightweight networking emulation tool that enables
testing, experimentation, and research on the NDN platform. Based on
Mininet, Mini-NDN uses the NDN libraries, NFD, NLSR, and tools released
by the `NDN project <http://named-data.net/codebase/platform/>`__ to
emulate an NDN network on a single system.
**Included features**:
- Run a complete NDN network on a single system
- Automatic configuration of NLSR to provide a routable NDN network
- Supports user created NDN applications
- Create a topology using the included Mini-NDN Edit GUI application
- Allows individual configuration of NFD and NLSR parameters for each
node
- Provides an experiment management framework for easy creation of
custom networking experiments
- Uses a simple topology file format to define hosts, links, and
configuration values
- Configure network link parameters including bandwidth, delay, and
loss rate
- Includes a pre-configured topology file to replicate the NDN testbed
-18
View File
@@ -1,18 +0,0 @@
Video Tutorials
===============
Maybe outdated since version 0.5.0.
.. raw:: html
<div id="video-container" class="col-md-6 ">
<p>Mini-NDN Demo at ACM, 2017</p>
<iframe width="400" height="230" src="https://www.youtube.com/embed/xYRPHZe18o0" frameborder="0" allowfullscreen=""></iframe>
</div>
.. raw:: html
<div id="video-container" class="col-md-6 "">
<p>Mini-NDN Overview </p>
<iframe width="400" height="230" src="https://www.youtube.com/embed/Da7t8yBWzv0" frameborder="0" allowfullscreen="">
</div>
+179
View File
@@ -0,0 +1,179 @@
Mininet Examples
========================================================
These examples are intended to help you get started using
Mininet's Python API.
========================================================
#### baresshd.py:
This example uses Mininet's medium-level API to create an sshd
process running in a namespace. Doesn't use OpenFlow.
#### bind.py:
This example shows how you can create private directories for each
node in a Mininet topology.
#### cluster.py:
This example contains all of the code for experimental cluster
edition. Remote classes and MininetCluster can be imported from
here to create a topology with nodes on remote machines.
#### clusterSanity.py:
This example runs cluster edition locally as a sanity check to test
basic functionality.
#### clustercli.py:
This example contains a CLI for experimental cluster edition.
#### clusterdemo.py:
This example is a basic demo of cluster edition on 3 servers with
a tree topology of depth 3 and fanout 3.
#### consoles.py:
This example creates a grid of console windows, one for each node,
and allows interaction with and monitoring of each console, including
graphical monitoring.
#### controllers.py:
This example creates a network with multiple controllers, by
using a custom `Switch()` subclass.
#### controllers2.py:
This example creates a network with multiple controllers by
creating an empty network, adding nodes to it, and manually
starting the switches.
#### controlnet.py:
This examples shows how you can model the control network as well
as the data network, by actually creating two Mininet objects.
#### cpu.py:
This example tests iperf bandwidth for varying CPU limits.
#### emptynet.py:
This example demonstrates creating an empty network (i.e. with no
topology object) and adding nodes to it.
#### hwintf.py:
This example shows how to add an interface (for example a real
hardware interface) to a network after the network is created.
#### intfoptions.py:
This example reconfigures a TCIntf during runtime with different
traffic control commands to test bandwidth, loss, and delay.
#### limit.py:
This example shows how to use link and CPU limits.
#### linearbandwidth.py:
This example shows how to create a custom topology programatically
by subclassing Topo, and how to run a series of tests on it.
#### linuxrouter.py:
This example shows how to create and configure a router in Mininet
that uses Linux IP forwarding.
#### miniedit.py:
This example demonstrates creating a network via a graphical editor.
#### mobility.py:
This example demonstrates detaching an interface from one switch and
attaching it another as a basic way to move a host around a network.
#### multiLink.py:
This example demonstrates the creation of multiple links between
nodes using a custom Topology class.
#### multiping.py:
This example demonstrates one method for
monitoring output from multiple hosts, using `node.monitor()`.
#### multipoll.py:
This example demonstrates monitoring output files from multiple hosts.
#### multitest.py:
This example creates a network and runs multiple tests on it.
#### nat.py:
This example shows how to connect a Mininet network to the Internet
using NAT. It also answers the eternal question "why can't I ping
`google.com`?"
#### natnet.py:
This example demonstrates how to create a network using a NAT node
to connect hosts to the internet.
#### numberedports.py:
This example verifies the mininet ofport numbers match up to the ovs port numbers.
It also verifies that the port numbers match up to the interface numbers
#### popen.py:
This example monitors a number of hosts using `host.popen()` and
`pmonitor()`.
#### popenpoll.py:
This example demonstrates monitoring output from multiple hosts using
the `node.popen()` interface (which returns `Popen` objects) and `pmonitor()`.
#### scratchnet.py, scratchnetuser.py:
These two examples demonstrate how to create a network by using the lowest-
level Mininet functions. Generally the higher-level API is easier to use,
but scratchnet shows what is going on behind the scenes.
#### simpleperf.py:
A simple example of configuring network and CPU bandwidth limits.
#### sshd.py:
This example shows how to run an `sshd` process in each host, allowing
you to log in via `ssh`. This requires connecting the Mininet data network
to an interface in the root namespace (generaly the control network
already lives in the root namespace, so it does not need to be explicitly
connected.)
#### tree1024.py:
This example attempts to create a 1024-host network, and then runs the
CLI on it. It may run into scalability limits, depending on available
memory and `sysctl` configuration (see `INSTALL`.)
#### treeping64.py:
This example creates a 64-host tree network, and attempts to check full
connectivity using `ping`, for different switch/datapath types.
#### vlanhost.py:
An example of how to subclass Host to use a VLAN on its primary interface.
+4
View File
@@ -0,0 +1,4 @@
"""
Mininet Examples
See README for details
"""
+43
View File
@@ -0,0 +1,43 @@
#!/usr/bin/python
"This example doesn't use OpenFlow, but attempts to run sshd in a namespace."
import sys
from mininet.node import Host
from mininet.util import ensureRoot, waitListening
ensureRoot()
timeout = 5
print "*** Creating nodes"
h1 = Host( 'h1' )
root = Host( 'root', inNamespace=False )
print "*** Creating links"
h1.linkTo( root )
print h1
print "*** Configuring nodes"
h1.setIP( '10.0.0.1', 8 )
root.setIP( '10.0.0.2', 8 )
print "*** Creating banner file"
f = open( '/tmp/%s.banner' % h1.name, 'w' )
f.write( 'Welcome to %s at %s\n' % ( h1.name, h1.IP() ) )
f.close()
print "*** Running sshd"
cmd = '/usr/sbin/sshd -o UseDNS=no -u0 -o "Banner /tmp/%s.banner"' % h1.name
# add arguments from the command line
if len( sys.argv ) > 1:
cmd += ' ' + ' '.join( sys.argv[ 1: ] )
h1.cmd( cmd )
listening = waitListening( server=h1, port=22, timeout=timeout )
if listening:
print "*** You may now ssh into", h1.name, "at", h1.IP()
else:
print ( "*** Warning: after %s seconds, %s is not listening on port 22"
% ( timeout, h1.name ) )
+67
View File
@@ -0,0 +1,67 @@
#!/usr/bin/python
"""
bind.py: Bind mount example
This creates hosts with private directories that the user specifies.
These hosts may have persistent directories that will be available
across multiple mininet session, or temporary directories that will
only last for one mininet session. To specify a persistent
directory, add a tuple to a list of private directories:
[ ( 'directory to be mounted on', 'directory to be mounted' ) ]
String expansion may be used to create a directory template for
each host. To do this, add a %(name)s in place of the host name
when creating your list of directories:
[ ( '/var/run', '/tmp/%(name)s/var/run' ) ]
If no persistent directory is specified, the directories will default
to temporary private directories. To do this, simply create a list of
directories to be made private. A tmpfs will then be mounted on them.
You may use both temporary and persistent directories at the same
time. In the following privateDirs string, each host will have a
persistent directory in the root filesystem at
"/tmp/(hostname)/var/run" mounted on "/var/run". Each host will also
have a temporary private directory mounted on "/var/log".
[ ( '/var/run', '/tmp/%(name)s/var/run' ), '/var/log' ]
This example has both persistent directories mounted on '/var/log'
and '/var/run'. It also has a temporary private directory mounted
on '/var/mn'
"""
from mininet.net import Mininet
from mininet.node import Host
from mininet.cli import CLI
from mininet.topo import SingleSwitchTopo
from mininet.log import setLogLevel, info
from functools import partial
# Sample usage
def testHostWithPrivateDirs():
"Test bind mounts"
topo = SingleSwitchTopo( 10 )
privateDirs = [ ( '/var/log', '/tmp/%(name)s/var/log' ),
( '/var/run', '/tmp/%(name)s/var/run' ),
'/var/mn' ]
host = partial( Host,
privateDirs=privateDirs )
net = Mininet( topo=topo, host=host )
net.start()
directories = [ directory[ 0 ] if isinstance( directory, tuple )
else directory for directory in privateDirs ]
info( 'Private Directories:', directories, '\n' )
CLI( net )
net.stop()
if __name__ == '__main__':
setLogLevel( 'info' )
testHostWithPrivateDirs()
info( 'Done.\n')
-95
View File
@@ -1,95 +0,0 @@
# -*- Mode:python; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
#
# Copyright (C) 2015-2021, The University of Memphis,
# Arizona Board of Regents,
# Regents of the University of California.
#
# This file is part of Mini-NDN.
# See AUTHORS.md for a complete list of Mini-NDN authors and contributors.
#
# Mini-NDN is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Mini-NDN is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Mini-NDN, e.g., in COPYING.md file.
# If not, see <http://www.gnu.org/licenses/>.
"""
This example demonstrates the functionality of the ndncatchunks and ndnputchunks. There are
programs to transfer a file as Data segments in NDN.
https://github.com/named-data/ndn-tools/tree/master/tools/chunks.
"""
from time import sleep
import subprocess
from mininet.log import setLogLevel, info
from minindn.minindn import Minindn
from minindn.util import MiniNDNCLI
from minindn.apps.app_manager import AppManager
from minindn.apps.nfd import Nfd
from minindn.apps.nlsr import Nlsr
def sendFile(node, prefix, file):
"""
Publish a file using ndnputchunks
:parma mininet.node.Host node: mininet node object
:param string prefix: prefix to publish the chunks of the file
:param string file: file to publish
"""
info ("File published:", file)
cmd = 'ndnputchunks {}/{} < {} > putchunks.log 2>&1 &'.format(prefix, "fname", file)
node.cmd(cmd)
# Sleep for appropriate time based on the file size
sleep(5)
def receiveFile(node, prefix, filename):
"""
Fetch a file using ndncatchunks
:parma mininet.node.Host node: mininet node object
:param string prefix: producer's prefix under which the file the published
:param string file: name given to the file that will be received
"""
info ("Fething file: ", filename)
cmd = 'ndncatchunks {}/{} > {} 2> catchunks.log &'.format(prefix, "fname", filename)
node.cmd(cmd)
if __name__ == '__main__':
setLogLevel('info')
# Create a test file to publish
testFile = "/tmp/test-chunks"
cmd = 'echo "demonstrate file transfer using catchunks and putchunks" > {}'.format(testFile)
subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE).communicate()
Minindn.cleanUp()
Minindn.verifyDependencies()
ndn = Minindn()
ndn.start()
nfds = AppManager(ndn, ndn.net.hosts, Nfd)
nlsrs = AppManager(ndn, ndn.net.hosts, Nlsr)
sleep(70)
# Default topology is used in this experiment "/topologies/default-topology.conf"
# lets make node "a" as a producer node, and node "c" as a conumer node
producer = ndn.net['a']
producerPrefix = "/test-producer" # prefix under which the file will be published
consumer = ndn.net['c']
# Advertise the producer prefix to the network
producer.cmd('nlsrc advertise {}'.format(producerPrefix))
sleep (5) # sleep for routing convergence.
sendFile(producer, producerPrefix, testFile)
receiveFile(consumer, producerPrefix, "test-chunks")
MiniNDNCLI(ndn.net)
ndn.stop()
+914
View File
@@ -0,0 +1,914 @@
#!/usr/bin/python
"""
cluster.py: prototyping/experimentation for distributed Mininet,
aka Mininet: Cluster Edition
Author: Bob Lantz
Core classes:
RemoteNode: a Node() running on a remote server
RemoteOVSSwitch(): an OVSSwitch() running on a remote server
RemoteLink: a Link() on a remote server
Tunnel: a Link() between a local Node() and a RemoteNode()
These are largely interoperable with local objects.
- One Mininet to rule them all
It is important that the same topologies, APIs, and CLI can be used
with minimal or no modification in both local and distributed environments.
- Multiple placement models
Placement should be as easy as possible. We should provide basic placement
support and also allow for explicit placement.
Questions:
What is the basic communication mechanism?
To start with? Probably a single multiplexed ssh connection between each
pair of mininet servers that needs to communicate.
How are tunnels created?
We have several options including ssh, GRE, OF capsulator, socat, VDE, l2tp,
etc.. It's not clear what the best one is. For now, we use ssh tunnels since
they are encrypted and semi-automatically shared. We will probably want to
support GRE as well because it's very easy to set up with OVS.
How are tunnels destroyed?
They are destroyed when the links are deleted in Mininet.stop()
How does RemoteNode.popen() work?
It opens a shared ssh connection to the remote server and attaches to
the namespace using mnexec -a -g.
Is there any value to using Paramiko vs. raw ssh?
Maybe, but it doesn't seem to support L2 tunneling.
Should we preflight the entire network, including all server-to-server
connections?
Yes! We don't yet do this with remote server-to-server connections yet.
Should we multiplex the link ssh connections?
Yes, this is done automatically with ControlMaster=auto.
Note on ssh and DNS:
Please add UseDNS: no to your /etc/ssh/sshd_config!!!
Things to do:
- asynchronous/pipelined/parallel startup
- ssh debugging/profiling
- make connections into real objects
- support for other tunneling schemes
- tests and benchmarks
- hifi support (e.g. delay compensation)
"""
from mininet.node import Node, Host, OVSSwitch, Controller
from mininet.link import Link, Intf
from mininet.net import Mininet
from mininet.topo import LinearTopo
from mininet.topolib import TreeTopo
from mininet.util import quietRun, errRun
from mininet.examples.clustercli import CLI
from mininet.log import setLogLevel, debug, info, error
from mininet.clean import addCleanupCallback
from signal import signal, SIGINT, SIG_IGN
from subprocess import Popen, PIPE, STDOUT
import os
from random import randrange
import sys
import re
from itertools import groupby
from operator import attrgetter
from distutils.version import StrictVersion
def findUser():
"Try to return logged-in (usually non-root) user"
return (
# If we're running sudo
os.environ.get( 'SUDO_USER', False ) or
# Logged-in user (if we have a tty)
( quietRun( 'who am i' ).split() or [ False ] )[ 0 ] or
# Give up and return effective user
quietRun( 'whoami' ) )
class ClusterCleanup( object ):
"Cleanup callback"
inited = False
serveruser = {}
@classmethod
def add( cls, server, user='' ):
"Add an entry to server: user dict"
if not cls.inited:
addCleanupCallback( cls.cleanup )
if not user:
user = findUser()
cls.serveruser[ server ] = user
@classmethod
def cleanup( cls ):
"Clean up"
info( '*** Cleaning up cluster\n' )
for server, user in cls.serveruser.iteritems():
if server == 'localhost':
# Handled by mininet.clean.cleanup()
continue
else:
cmd = [ 'su', user, '-c',
'ssh %s@%s sudo mn -c' % ( user, server ) ]
info( cmd, '\n' )
info( quietRun( cmd ) )
# BL note: so little code is required for remote nodes,
# we will probably just want to update the main Node()
# class to enable it for remote access! However, there
# are a large number of potential failure conditions with
# remote nodes which we may want to detect and handle.
# Another interesting point is that we could put everything
# in a mix-in class and easily add cluster mode to 2.0.
class RemoteMixin( object ):
"A mix-in class to turn local nodes into remote nodes"
# ssh base command
# -q: don't print stupid diagnostic messages
# BatchMode yes: don't ask for password
# ForwardAgent yes: forward authentication credentials
sshbase = [ 'ssh', '-q',
'-o', 'BatchMode=yes',
'-o', 'ForwardAgent=yes', '-tt' ]
def __init__( self, name, server='localhost', user=None, serverIP=None,
controlPath=False, splitInit=False, **kwargs):
"""Instantiate a remote node
name: name of remote node
server: remote server (optional)
user: user on remote server (optional)
controlPath: specify shared ssh control path (optional)
splitInit: split initialization?
**kwargs: see Node()"""
# We connect to servers by IP address
self.server = server if server else 'localhost'
self.serverIP = ( serverIP if serverIP
else self.findServerIP( self.server ) )
self.user = user if user else findUser()
ClusterCleanup.add( server=server, user=user )
if controlPath is True:
# Set a default control path for shared SSH connections
controlPath = '/tmp/mn-%r@%h:%p'
self.controlPath = controlPath
self.splitInit = splitInit
if self.user and self.server != 'localhost':
self.dest = '%s@%s' % ( self.user, self.serverIP )
self.sshcmd = [ 'sudo', '-E', '-u', self.user ] + self.sshbase
if self.controlPath:
self.sshcmd += [ '-o', 'ControlPath=' + self.controlPath,
'-o', 'ControlMaster=auto',
'-o', 'ControlPersist=' + '1' ]
self.sshcmd += [ self.dest ]
self.isRemote = True
else:
self.dest = None
self.sshcmd = []
self.isRemote = False
# Satisfy pylint
self.shell, self.pid = None, None
super( RemoteMixin, self ).__init__( name, **kwargs )
# Determine IP address of local host
_ipMatchRegex = re.compile( r'\d+\.\d+\.\d+\.\d+' )
@classmethod
def findServerIP( cls, server ):
"Return our server's IP address"
# First, check for an IP address
ipmatch = cls._ipMatchRegex.findall( server )
if ipmatch:
return ipmatch[ 0 ]
# Otherwise, look up remote server
output = quietRun( 'getent ahostsv4 %s' % server )
ips = cls._ipMatchRegex.findall( output )
ip = ips[ 0 ] if ips else None
return ip
# Command support via shell process in namespace
def startShell( self, *args, **kwargs ):
"Start a shell process for running commands"
if self.isRemote:
kwargs.update( mnopts='-c' )
super( RemoteMixin, self ).startShell( *args, **kwargs )
# Optional split initialization
self.sendCmd( 'echo $$' )
if not self.splitInit:
self.finishInit()
def finishInit( self ):
"Wait for split initialization to complete"
self.pid = int( self.waitOutput() )
def rpopen( self, *cmd, **opts ):
"Return a Popen object on underlying server in root namespace"
params = { 'stdin': PIPE,
'stdout': PIPE,
'stderr': STDOUT,
'sudo': True }
params.update( opts )
return self._popen( *cmd, **params )
def rcmd( self, *cmd, **opts):
"""rcmd: run a command on underlying server
in root namespace
args: string or list of strings
returns: stdout and stderr"""
popen = self.rpopen( *cmd, **opts )
# print 'RCMD: POPEN:', popen
# These loops are tricky to get right.
# Once the process exits, we can read
# EOF twice if necessary.
result = ''
while True:
poll = popen.poll()
result += popen.stdout.read()
if poll is not None:
break
return result
@staticmethod
def _ignoreSignal():
"Detach from process group to ignore all signals"
os.setpgrp()
def _popen( self, cmd, sudo=True, tt=True, **params):
"""Spawn a process on a remote node
cmd: remote command to run (list)
**params: parameters to Popen()
returns: Popen() object"""
if type( cmd ) is str:
cmd = cmd.split()
if self.isRemote:
if sudo:
cmd = [ 'sudo', '-E' ] + cmd
if tt:
cmd = self.sshcmd + cmd
else:
# Hack: remove -tt
sshcmd = list( self.sshcmd )
sshcmd.remove( '-tt' )
cmd = sshcmd + cmd
else:
if self.user and not sudo:
# Drop privileges
cmd = [ 'sudo', '-E', '-u', self.user ] + cmd
params.update( preexec_fn=self._ignoreSignal )
debug( '_popen', cmd, '\n' )
popen = super( RemoteMixin, self )._popen( cmd, **params )
return popen
def popen( self, *args, **kwargs ):
"Override: disable -tt"
return super( RemoteMixin, self).popen( *args, tt=False, **kwargs )
def addIntf( self, *args, **kwargs ):
"Override: use RemoteLink.moveIntf"
kwargs.update( moveIntfFn=RemoteLink.moveIntf )
return super( RemoteMixin, self).addIntf( *args, **kwargs )
class RemoteNode( RemoteMixin, Node ):
"A node on a remote server"
pass
class RemoteHost( RemoteNode ):
"A RemoteHost is simply a RemoteNode"
pass
class RemoteOVSSwitch( RemoteMixin, OVSSwitch ):
"Remote instance of Open vSwitch"
OVSVersions = {}
def __init__( self, *args, **kwargs ):
# No batch startup yet
kwargs.update( batch=True )
super( RemoteOVSSwitch, self ).__init__( *args, **kwargs )
def isOldOVS( self ):
"Is remote switch using an old OVS version?"
cls = type( self )
if self.server not in cls.OVSVersions:
# pylint: disable=not-callable
vers = self.cmd( 'ovs-vsctl --version' )
# pylint: enable=not-callable
cls.OVSVersions[ self.server ] = re.findall(
r'\d+\.\d+', vers )[ 0 ]
return ( StrictVersion( cls.OVSVersions[ self.server ] ) <
StrictVersion( '1.10' ) )
@classmethod
def batchStartup( cls, switches, **_kwargs ):
"Start up switches in per-server batches"
key = attrgetter( 'server' )
for server, switchGroup in groupby( sorted( switches, key=key ), key ):
info( '(%s)' % server )
group = tuple( switchGroup )
switch = group[ 0 ]
OVSSwitch.batchStartup( group, run=switch.cmd )
return switches
@classmethod
def batchShutdown( cls, switches, **_kwargs ):
"Stop switches in per-server batches"
key = attrgetter( 'server' )
for server, switchGroup in groupby( sorted( switches, key=key ), key ):
info( '(%s)' % server )
group = tuple( switchGroup )
switch = group[ 0 ]
OVSSwitch.batchShutdown( group, run=switch.rcmd )
return switches
class RemoteLink( Link ):
"A RemoteLink is a link between nodes which may be on different servers"
def __init__( self, node1, node2, **kwargs ):
"""Initialize a RemoteLink
see Link() for parameters"""
# Create links on remote node
self.node1 = node1
self.node2 = node2
self.tunnel = None
kwargs.setdefault( 'params1', {} )
kwargs.setdefault( 'params2', {} )
self.cmd = None # satisfy pylint
Link.__init__( self, node1, node2, **kwargs )
def stop( self ):
"Stop this link"
if self.tunnel:
self.tunnel.terminate()
self.intf1.delete()
self.intf2.delete()
else:
Link.stop( self )
self.tunnel = None
def makeIntfPair( self, intfname1, intfname2, addr1=None, addr2=None,
node1=None, node2=None, deleteIntfs=True ):
"""Create pair of interfaces
intfname1: name of interface 1
intfname2: name of interface 2
(override this method [and possibly delete()]
to change link type)"""
node1 = self.node1 if node1 is None else node1
node2 = self.node2 if node2 is None else node2
server1 = getattr( node1, 'server', 'localhost' )
server2 = getattr( node2, 'server', 'localhost' )
if server1 == server2:
# Link within same server
return Link.makeIntfPair( intfname1, intfname2, addr1, addr2,
node1, node2, deleteIntfs=deleteIntfs )
# Otherwise, make a tunnel
self.tunnel = self.makeTunnel( node1, node2, intfname1, intfname2,
addr1, addr2 )
return self.tunnel
@staticmethod
def moveIntf( intf, node, printError=True ):
"""Move remote interface from root ns to node
intf: string, interface
dstNode: destination Node
srcNode: source Node or None (default) for root ns
printError: if true, print error"""
intf = str( intf )
cmd = 'ip link set %s netns %s' % ( intf, node.pid )
node.rcmd( cmd )
links = node.cmd( 'ip link show' )
if not ' %s:' % intf in links:
if printError:
error( '*** Error: RemoteLink.moveIntf: ' + intf +
' not successfully moved to ' + node.name + '\n' )
return False
return True
def makeTunnel( self, node1, node2, intfname1, intfname2,
addr1=None, addr2=None ):
"Make a tunnel across switches on different servers"
# We should never try to create a tunnel to ourselves!
assert node1.server != 'localhost' or node2.server != 'localhost'
# And we can't ssh into this server remotely as 'localhost',
# so try again swappping node1 and node2
if node2.server == 'localhost':
return self.makeTunnel( node2, node1, intfname2, intfname1,
addr2, addr1 )
# 1. Create tap interfaces
for node in node1, node2:
# For now we are hard-wiring tap9, which we will rename
cmd = 'ip tuntap add dev tap9 mode tap user ' + node.user
result = node.rcmd( cmd )
if result:
raise Exception( 'error creating tap9 on %s: %s' %
( node, result ) )
# 2. Create ssh tunnel between tap interfaces
# -n: close stdin
dest = '%s@%s' % ( node2.user, node2.serverIP )
cmd = [ 'ssh', '-n', '-o', 'Tunnel=Ethernet', '-w', '9:9',
dest, 'echo @' ]
self.cmd = cmd
tunnel = node1.rpopen( cmd, sudo=False )
# When we receive the character '@', it means that our
# tunnel should be set up
debug( 'Waiting for tunnel to come up...\n' )
ch = tunnel.stdout.read( 1 )
if ch != '@':
raise Exception( 'makeTunnel:\n',
'Tunnel setup failed for',
'%s:%s' % ( node1, node1.dest ), 'to',
'%s:%s\n' % ( node2, node2.dest ),
'command was:', cmd, '\n' )
# 3. Move interfaces if necessary
for node in node1, node2:
if not self.moveIntf( 'tap9', node ):
raise Exception( 'interface move failed on node %s' % node )
# 4. Rename tap interfaces to desired names
for node, intf, addr in ( ( node1, intfname1, addr1 ),
( node2, intfname2, addr2 ) ):
if not addr:
result = node.cmd( 'ip link set tap9 name', intf )
else:
result = node.cmd( 'ip link set tap9 name', intf,
'address', addr )
if result:
raise Exception( 'error renaming %s: %s' % ( intf, result ) )
return tunnel
def status( self ):
"Detailed representation of link"
if self.tunnel:
if self.tunnel.poll() is not None:
status = "Tunnel EXITED %s" % self.tunnel.returncode
else:
status = "Tunnel Running (%s: %s)" % (
self.tunnel.pid, self.cmd )
else:
status = "OK"
result = "%s %s" % ( Link.status( self ), status )
return result
# Some simple placement algorithms for MininetCluster
class Placer( object ):
"Node placement algorithm for MininetCluster"
def __init__( self, servers=None, nodes=None, hosts=None,
switches=None, controllers=None, links=None ):
"""Initialize placement object
servers: list of servers
nodes: list of all nodes
hosts: list of hosts
switches: list of switches
controllers: list of controllers
links: list of links
(all arguments are optional)
returns: server"""
self.servers = servers or []
self.nodes = nodes or []
self.hosts = hosts or []
self.switches = switches or []
self.controllers = controllers or []
self.links = links or []
def place( self, node ):
"Return server for a given node"
assert self, node # satisfy pylint
# Default placement: run locally
return 'localhost'
class RandomPlacer( Placer ):
"Random placement"
def place( self, nodename ):
"""Random placement function
nodename: node name"""
assert nodename # please pylint
# This may be slow with lots of servers
return self.servers[ randrange( 0, len( self.servers ) ) ]
class RoundRobinPlacer( Placer ):
"""Round-robin placement
Note this will usually result in cross-server links between
hosts and switches"""
def __init__( self, *args, **kwargs ):
Placer.__init__( self, *args, **kwargs )
self.next = 0
def place( self, nodename ):
"""Round-robin placement function
nodename: node name"""
assert nodename # please pylint
# This may be slow with lots of servers
server = self.servers[ self.next ]
self.next = ( self.next + 1 ) % len( self.servers )
return server
class SwitchBinPlacer( Placer ):
"""Place switches (and controllers) into evenly-sized bins,
and attempt to co-locate hosts and switches"""
def __init__( self, *args, **kwargs ):
Placer.__init__( self, *args, **kwargs )
# Easy lookup for servers and node sets
self.servdict = dict( enumerate( self.servers ) )
self.hset = frozenset( self.hosts )
self.sset = frozenset( self.switches )
self.cset = frozenset( self.controllers )
# Server and switch placement indices
self.placement = self.calculatePlacement()
@staticmethod
def bin( nodes, servers ):
"Distribute nodes evenly over servers"
# Calculate base bin size
nlen = len( nodes )
slen = len( servers )
# Basic bin size
quotient = int( nlen / slen )
binsizes = { server: quotient for server in servers }
# Distribute remainder
remainder = nlen % slen
for server in servers[ 0 : remainder ]:
binsizes[ server ] += 1
# Create binsize[ server ] tickets for each server
tickets = sum( [ binsizes[ server ] * [ server ]
for server in servers ], [] )
# And assign one ticket to each node
return { node: ticket for node, ticket in zip( nodes, tickets ) }
def calculatePlacement( self ):
"Pre-calculate node placement"
placement = {}
# Create host-switch connectivity map,
# associating host with last switch that it's
# connected to
switchFor = {}
for src, dst in self.links:
if src in self.hset and dst in self.sset:
switchFor[ src ] = dst
if dst in self.hset and src in self.sset:
switchFor[ dst ] = src
# Place switches
placement = self.bin( self.switches, self.servers )
# Place controllers and merge into placement dict
placement.update( self.bin( self.controllers, self.servers ) )
# Co-locate hosts with their switches
for h in self.hosts:
if h in placement:
# Host is already placed - leave it there
continue
if h in switchFor:
placement[ h ] = placement[ switchFor[ h ] ]
else:
raise Exception(
"SwitchBinPlacer: cannot place isolated host " + h )
return placement
def place( self, node ):
"""Simple placement algorithm:
place switches into evenly sized bins,
and place hosts near their switches"""
return self.placement[ node ]
class HostSwitchBinPlacer( Placer ):
"""Place switches *and hosts* into evenly-sized bins
Note that this will usually result in cross-server
links between hosts and switches"""
def __init__( self, *args, **kwargs ):
Placer.__init__( self, *args, **kwargs )
# Calculate bin sizes
scount = len( self.servers )
self.hbin = max( int( len( self.hosts ) / scount ), 1 )
self.sbin = max( int( len( self.switches ) / scount ), 1 )
self.cbin = max( int( len( self.controllers ) / scount ), 1 )
info( 'scount:', scount )
info( 'bins:', self.hbin, self.sbin, self.cbin, '\n' )
self.servdict = dict( enumerate( self.servers ) )
self.hset = frozenset( self.hosts )
self.sset = frozenset( self.switches )
self.cset = frozenset( self.controllers )
self.hind, self.sind, self.cind = 0, 0, 0
def place( self, nodename ):
"""Simple placement algorithm:
place nodes into evenly sized bins"""
# Place nodes into bins
if nodename in self.hset:
server = self.servdict[ self.hind / self.hbin ]
self.hind += 1
elif nodename in self.sset:
server = self.servdict[ self.sind / self.sbin ]
self.sind += 1
elif nodename in self.cset:
server = self.servdict[ self.cind / self.cbin ]
self.cind += 1
else:
info( 'warning: unknown node', nodename )
server = self.servdict[ 0 ]
return server
# The MininetCluster class is not strictly necessary.
# However, it has several purposes:
# 1. To set up ssh connection sharing/multiplexing
# 2. To pre-flight the system so that everything is more likely to work
# 3. To allow connection/connectivity monitoring
# 4. To support pluggable placement algorithms
class MininetCluster( Mininet ):
"Cluster-enhanced version of Mininet class"
# Default ssh command
# BatchMode yes: don't ask for password
# ForwardAgent yes: forward authentication credentials
sshcmd = [ 'ssh', '-o', 'BatchMode=yes', '-o', 'ForwardAgent=yes' ]
def __init__( self, *args, **kwargs ):
"""servers: a list of servers to use (note: include
localhost or None to use local system as well)
user: user name for server ssh
placement: Placer() subclass"""
params = { 'host': RemoteHost,
'switch': RemoteOVSSwitch,
'link': RemoteLink,
'precheck': True }
params.update( kwargs )
servers = params.pop( 'servers', [ 'localhost' ] )
servers = [ s if s else 'localhost' for s in servers ]
self.servers = servers
self.serverIP = params.pop( 'serverIP', {} )
if not self.serverIP:
self.serverIP = { server: RemoteMixin.findServerIP( server )
for server in self.servers }
self.user = params.pop( 'user', findUser() )
if params.pop( 'precheck' ):
self.precheck()
self.connections = {}
self.placement = params.pop( 'placement', SwitchBinPlacer )
# Make sure control directory exists
self.cdir = os.environ[ 'HOME' ] + '/.ssh/mn'
errRun( [ 'mkdir', '-p', self.cdir ] )
Mininet.__init__( self, *args, **params )
def popen( self, cmd ):
"Popen() for server connections"
assert self # please pylint
old = signal( SIGINT, SIG_IGN )
conn = Popen( cmd, stdin=PIPE, stdout=PIPE, close_fds=True )
signal( SIGINT, old )
return conn
def baddLink( self, *args, **kwargs ):
"break addlink for testing"
pass
def precheck( self ):
"""Pre-check to make sure connection works and that
we can call sudo without a password"""
result = 0
info( '*** Checking servers\n' )
for server in self.servers:
ip = self.serverIP[ server ]
if not server or server == 'localhost':
continue
info( server, '' )
dest = '%s@%s' % ( self.user, ip )
cmd = [ 'sudo', '-E', '-u', self.user ]
cmd += self.sshcmd + [ '-n', dest, 'sudo true' ]
debug( ' '.join( cmd ), '\n' )
_out, _err, code = errRun( cmd )
if code != 0:
error( '\nstartConnection: server connection check failed '
'to %s using command:\n%s\n'
% ( server, ' '.join( cmd ) ) )
result |= code
if result:
error( '*** Server precheck failed.\n'
'*** Make sure that the above ssh command works'
' correctly.\n'
'*** You may also need to run mn -c on all nodes, and/or\n'
'*** use sudo -E.\n' )
sys.exit( 1 )
info( '\n' )
def modifiedaddHost( self, *args, **kwargs ):
"Slightly modify addHost"
assert self # please pylint
kwargs[ 'splitInit' ] = True
return Mininet.addHost( *args, **kwargs )
def placeNodes( self ):
"""Place nodes on servers (if they don't have a server), and
start shell processes"""
if not self.servers or not self.topo:
# No shirt, no shoes, no service
return
nodes = self.topo.nodes()
placer = self.placement( servers=self.servers,
nodes=self.topo.nodes(),
hosts=self.topo.hosts(),
switches=self.topo.switches(),
links=self.topo.links() )
for node in nodes:
config = self.topo.nodeInfo( node )
# keep local server name consistent accross nodes
if 'server' in config.keys() and config[ 'server' ] is None:
config[ 'server' ] = 'localhost'
server = config.setdefault( 'server', placer.place( node ) )
if server:
config.setdefault( 'serverIP', self.serverIP[ server ] )
info( '%s:%s ' % ( node, server ) )
key = ( None, server )
_dest, cfile, _conn = self.connections.get(
key, ( None, None, None ) )
if cfile:
config.setdefault( 'controlPath', cfile )
def addController( self, *args, **kwargs ):
"Patch to update IP address to global IP address"
controller = Mininet.addController( self, *args, **kwargs )
# Update IP address for controller that may not be local
if ( isinstance( controller, Controller)
and controller.IP() == '127.0.0.1'
and ' eth0:' in controller.cmd( 'ip link show' ) ):
Intf( 'eth0', node=controller ).updateIP()
return controller
def buildFromTopo( self, *args, **kwargs ):
"Start network"
info( '*** Placing nodes\n' )
self.placeNodes()
info( '\n' )
Mininet.buildFromTopo( self, *args, **kwargs )
def testNsTunnels():
"Test tunnels between nodes in namespaces"
net = Mininet( host=RemoteHost, link=RemoteLink )
h1 = net.addHost( 'h1' )
h2 = net.addHost( 'h2', server='ubuntu2' )
net.addLink( h1, h2 )
net.start()
net.pingAll()
net.stop()
# Manual topology creation with net.add*()
#
# This shows how node options may be used to manage
# cluster placement using the net.add*() API
def testRemoteNet( remote='ubuntu2' ):
"Test remote Node classes"
print '*** Remote Node Test'
net = Mininet( host=RemoteHost, switch=RemoteOVSSwitch,
link=RemoteLink )
c0 = net.addController( 'c0' )
# Make sure controller knows its non-loopback address
Intf( 'eth0', node=c0 ).updateIP()
print "*** Creating local h1"
h1 = net.addHost( 'h1' )
print "*** Creating remote h2"
h2 = net.addHost( 'h2', server=remote )
print "*** Creating local s1"
s1 = net.addSwitch( 's1' )
print "*** Creating remote s2"
s2 = net.addSwitch( 's2', server=remote )
print "*** Adding links"
net.addLink( h1, s1 )
net.addLink( s1, s2 )
net.addLink( h2, s2 )
net.start()
print 'Mininet is running on', quietRun( 'hostname' ).strip()
for node in c0, h1, h2, s1, s2:
print 'Node', node, 'is running on', node.cmd( 'hostname' ).strip()
net.pingAll()
CLI( net )
net.stop()
# High-level/Topo API example
#
# This shows how existing Mininet topologies may be used in cluster
# mode by creating node placement functions and a controller which
# can be accessed remotely. This implements a very compatible version
# of cluster edition with a minimum of code!
remoteHosts = [ 'h2' ]
remoteSwitches = [ 's2' ]
remoteServer = 'ubuntu2'
def HostPlacer( name, *args, **params ):
"Custom Host() constructor which places hosts on servers"
if name in remoteHosts:
return RemoteHost( name, *args, server=remoteServer, **params )
else:
return Host( name, *args, **params )
def SwitchPlacer( name, *args, **params ):
"Custom Switch() constructor which places switches on servers"
if name in remoteSwitches:
return RemoteOVSSwitch( name, *args, server=remoteServer, **params )
else:
return RemoteOVSSwitch( name, *args, **params )
def ClusterController( *args, **kwargs):
"Custom Controller() constructor which updates its eth0 IP address"
controller = Controller( *args, **kwargs )
# Find out its IP address so that cluster switches can connect
Intf( 'eth0', node=controller ).updateIP()
return controller
def testRemoteTopo():
"Test remote Node classes using Mininet()/Topo() API"
topo = LinearTopo( 2 )
net = Mininet( topo=topo, host=HostPlacer, switch=SwitchPlacer,
link=RemoteLink, controller=ClusterController )
net.start()
net.pingAll()
net.stop()
# Need to test backwards placement, where each host is on
# a server other than its switch!! But seriously we could just
# do random switch placement rather than completely random
# host placement.
def testRemoteSwitches():
"Test with local hosts and remote switches"
servers = [ 'localhost', 'ubuntu2']
topo = TreeTopo( depth=4, fanout=2 )
net = MininetCluster( topo=topo, servers=servers,
placement=RoundRobinPlacer )
net.start()
net.pingAll()
net.stop()
#
# For testing and demo purposes it would be nice to draw the
# network graph and color it based on server.
# The MininetCluster() class integrates pluggable placement
# functions, for maximum ease of use. MininetCluster() also
# pre-flights and multiplexes server connections.
def testMininetCluster():
"Test MininetCluster()"
servers = [ 'localhost', 'ubuntu2' ]
topo = TreeTopo( depth=3, fanout=3 )
net = MininetCluster( topo=topo, servers=servers,
placement=SwitchBinPlacer )
net.start()
net.pingAll()
net.stop()
def signalTest():
"Make sure hosts are robust to signals"
h = RemoteHost( 'h0', server='ubuntu1' )
h.shell.send_signal( SIGINT )
h.shell.poll()
if h.shell.returncode is None:
print 'OK: ', h, 'has not exited'
else:
print 'FAILURE:', h, 'exited with code', h.shell.returncode
h.stop()
if __name__ == '__main__':
setLogLevel( 'info' )
# testRemoteTopo()
# testRemoteNet()
# testMininetCluster()
# testRemoteSwitches()
signalTest()
+22
View File
@@ -0,0 +1,22 @@
#!/usr/bin/env python
'''
A sanity check for cluster edition
'''
from mininet.examples.cluster import MininetCluster
from mininet.log import setLogLevel
from mininet.examples.clustercli import ClusterCLI as CLI
from mininet.topo import SingleSwitchTopo
def clusterSanity():
"Sanity check for cluster mode"
topo = SingleSwitchTopo()
net = MininetCluster( topo=topo )
net.start()
CLI( net )
net.stop()
if __name__ == '__main__':
setLogLevel( 'info' )
clusterSanity()
+100
View File
@@ -0,0 +1,100 @@
#!/usr/bin/python
"CLI for Mininet Cluster Edition prototype demo"
from mininet.cli import CLI
from mininet.log import output, error
# pylint: disable=global-statement
nx, graphviz_layout, plt = None, None, None # Will be imported on demand
class ClusterCLI( CLI ):
"CLI with additional commands for Cluster Edition demo"
@staticmethod
def colorsFor( seq ):
"Return a list of background colors for a sequence"
colors = [ 'red', 'lightgreen', 'cyan', 'yellow', 'orange',
'magenta', 'pink', 'grey', 'brown',
'white' ]
slen, clen = len( seq ), len( colors )
reps = max( 1, slen / clen )
colors = colors * reps
colors = colors[ 0 : slen ]
return colors
def do_plot( self, _line ):
"Plot topology colored by node placement"
# Import networkx if needed
global nx, plt
if not nx:
try:
# pylint: disable=import-error
import networkx
nx = networkx # satisfy pylint
from matplotlib import pyplot
plt = pyplot # satisfiy pylint
import pygraphviz
assert pygraphviz # silence pyflakes
# pylint: enable=import-error
except ImportError:
error( 'plot requires networkx, matplotlib and pygraphviz - '
'please install them and try again\n' )
return
# Make a networkx Graph
g = nx.Graph()
mn = self.mn
servers, hosts, switches = mn.servers, mn.hosts, mn.switches
nodes = hosts + switches
g.add_nodes_from( nodes )
links = [ ( link.intf1.node, link.intf2.node )
for link in self.mn.links ]
g.add_edges_from( links )
# Pick some shapes and colors
# shapes = hlen * [ 's' ] + slen * [ 'o' ]
color = dict( zip( servers, self.colorsFor( servers ) ) )
# Plot it!
pos = nx.graphviz_layout( g )
opts = { 'ax': None, 'font_weight': 'bold',
'width': 2, 'edge_color': 'darkblue' }
hcolors = [ color[ getattr( h, 'server', 'localhost' ) ]
for h in hosts ]
scolors = [ color[ getattr( s, 'server', 'localhost' ) ]
for s in switches ]
nx.draw_networkx( g, pos=pos, nodelist=hosts, node_size=800,
label='host', node_color=hcolors, node_shape='s',
**opts )
nx.draw_networkx( g, pos=pos, nodelist=switches, node_size=1000,
node_color=scolors, node_shape='o', **opts )
# Get rid of axes, add title, and show
fig = plt.gcf()
ax = plt.gca()
ax.get_xaxis().set_visible( False )
ax.get_yaxis().set_visible( False )
fig.canvas.set_window_title( 'Mininet')
plt.title( 'Node Placement', fontweight='bold' )
plt.show()
def do_status( self, _line ):
"Report on node shell status"
nodes = self.mn.hosts + self.mn.switches
for node in nodes:
node.shell.poll()
exited = [ node for node in nodes
if node.shell.returncode is not None ]
if exited:
for node in exited:
output( '%s has exited with code %d\n'
% ( node, node.shell.returncode ) )
else:
output( 'All nodes are still running.\n' )
def do_placement( self, _line ):
"Describe node placement"
mn = self.mn
nodes = mn.hosts + mn.switches + mn.controllers
for server in mn.servers:
names = [ n.name for n in nodes if hasattr( n, 'server' )
and n.server == server ]
output( '%s: %s\n' % ( server, ' '.join( names ) ) )
+22
View File
@@ -0,0 +1,22 @@
#!/usr/bin/python
"clusterdemo.py: demo of Mininet Cluster Edition prototype"
from mininet.examples.cluster import MininetCluster, SwitchBinPlacer
from mininet.topolib import TreeTopo
from mininet.log import setLogLevel
from mininet.examples.clustercli import ClusterCLI as CLI
def demo():
"Simple Demo of Cluster Mode"
servers = [ 'localhost', 'ubuntu2', 'ubuntu3' ]
topo = TreeTopo( depth=3, fanout=3 )
net = MininetCluster( topo=topo, servers=servers,
placement=SwitchBinPlacer )
net.start()
CLI( net )
net.stop()
if __name__ == '__main__':
setLogLevel( 'info' )
demo()
+466
View File
@@ -0,0 +1,466 @@
#!/usr/bin/python
"""
consoles.py: bring up a bunch of miniature consoles on a virtual network
This demo shows how to monitor a set of nodes by using
Node's monitor() and Tkinter's createfilehandler().
We monitor nodes in a couple of ways:
- First, each individual node is monitored, and its output is added
to its console window
- Second, each time a console window gets iperf output, it is parsed
and accumulated. Once we have output for all consoles, a bar is
added to the bandwidth graph.
The consoles also support limited interaction:
- Pressing "return" in a console will send a command to it
- Pressing the console's title button will open up an xterm
Bob Lantz, April 2010
"""
import re
from Tkinter import Frame, Button, Label, Text, Scrollbar, Canvas, Wm, READABLE
from mininet.log import setLogLevel
from mininet.topolib import TreeNet
from mininet.term import makeTerms, cleanUpScreens
from mininet.util import quietRun
class Console( Frame ):
"A simple console on a host."
def __init__( self, parent, net, node, height=10, width=32, title='Node' ):
Frame.__init__( self, parent )
self.net = net
self.node = node
self.prompt = node.name + '# '
self.height, self.width, self.title = height, width, title
# Initialize widget styles
self.buttonStyle = { 'font': 'Monaco 7' }
self.textStyle = {
'font': 'Monaco 7',
'bg': 'black',
'fg': 'green',
'width': self.width,
'height': self.height,
'relief': 'sunken',
'insertbackground': 'green',
'highlightcolor': 'green',
'selectforeground': 'black',
'selectbackground': 'green'
}
# Set up widgets
self.text = self.makeWidgets( )
self.bindEvents()
self.sendCmd( 'export TERM=dumb' )
self.outputHook = None
def makeWidgets( self ):
"Make a label, a text area, and a scroll bar."
def newTerm( net=self.net, node=self.node, title=self.title ):
"Pop up a new terminal window for a node."
net.terms += makeTerms( [ node ], title )
label = Button( self, text=self.node.name, command=newTerm,
**self.buttonStyle )
label.pack( side='top', fill='x' )
text = Text( self, wrap='word', **self.textStyle )
ybar = Scrollbar( self, orient='vertical', width=7,
command=text.yview )
text.configure( yscrollcommand=ybar.set )
text.pack( side='left', expand=True, fill='both' )
ybar.pack( side='right', fill='y' )
return text
def bindEvents( self ):
"Bind keyboard and file events."
# The text widget handles regular key presses, but we
# use special handlers for the following:
self.text.bind( '<Return>', self.handleReturn )
self.text.bind( '<Control-c>', self.handleInt )
self.text.bind( '<KeyPress>', self.handleKey )
# This is not well-documented, but it is the correct
# way to trigger a file event handler from Tk's
# event loop!
self.tk.createfilehandler( self.node.stdout, READABLE,
self.handleReadable )
# We're not a terminal (yet?), so we ignore the following
# control characters other than [\b\n\r]
ignoreChars = re.compile( r'[\x00-\x07\x09\x0b\x0c\x0e-\x1f]+' )
def append( self, text ):
"Append something to our text frame."
text = self.ignoreChars.sub( '', text )
self.text.insert( 'end', text )
self.text.mark_set( 'insert', 'end' )
self.text.see( 'insert' )
outputHook = lambda x, y: True # make pylint happier
if self.outputHook:
outputHook = self.outputHook
outputHook( self, text )
def handleKey( self, event ):
"If it's an interactive command, send it to the node."
char = event.char
if self.node.waiting:
self.node.write( char )
def handleReturn( self, event ):
"Handle a carriage return."
cmd = self.text.get( 'insert linestart', 'insert lineend' )
# Send it immediately, if "interactive" command
if self.node.waiting:
self.node.write( event.char )
return
# Otherwise send the whole line to the shell
pos = cmd.find( self.prompt )
if pos >= 0:
cmd = cmd[ pos + len( self.prompt ): ]
self.sendCmd( cmd )
# Callback ignores event
def handleInt( self, _event=None ):
"Handle control-c."
self.node.sendInt()
def sendCmd( self, cmd ):
"Send a command to our node."
if not self.node.waiting:
self.node.sendCmd( cmd )
def handleReadable( self, _fds, timeoutms=None ):
"Handle file readable event."
data = self.node.monitor( timeoutms )
self.append( data )
if not self.node.waiting:
# Print prompt
self.append( self.prompt )
def waiting( self ):
"Are we waiting for output?"
return self.node.waiting
def waitOutput( self ):
"Wait for any remaining output."
while self.node.waiting:
# A bit of a trade-off here...
self.handleReadable( self, timeoutms=1000)
self.update()
def clear( self ):
"Clear all of our text."
self.text.delete( '1.0', 'end' )
class Graph( Frame ):
"Graph that we can add bars to over time."
def __init__( self, parent=None, bg = 'white', gheight=200, gwidth=500,
barwidth=10, ymax=3.5,):
Frame.__init__( self, parent )
self.bg = bg
self.gheight = gheight
self.gwidth = gwidth
self.barwidth = barwidth
self.ymax = float( ymax )
self.xpos = 0
# Create everything
self.title, self.scale, self.graph = self.createWidgets()
self.updateScrollRegions()
self.yview( 'moveto', '1.0' )
def createScale( self ):
"Create a and return a new canvas with scale markers."
height = float( self.gheight )
width = 25
ymax = self.ymax
scale = Canvas( self, width=width, height=height,
background=self.bg )
opts = { 'fill': 'red' }
# Draw scale line
scale.create_line( width - 1, height, width - 1, 0, **opts )
# Draw ticks and numbers
for y in range( 0, int( ymax + 1 ) ):
ypos = height * (1 - float( y ) / ymax )
scale.create_line( width, ypos, width - 10, ypos, **opts )
scale.create_text( 10, ypos, text=str( y ), **opts )
return scale
def updateScrollRegions( self ):
"Update graph and scale scroll regions."
ofs = 20
height = self.gheight + ofs
self.graph.configure( scrollregion=( 0, -ofs,
self.xpos * self.barwidth, height ) )
self.scale.configure( scrollregion=( 0, -ofs, 0, height ) )
def yview( self, *args ):
"Scroll both scale and graph."
self.graph.yview( *args )
self.scale.yview( *args )
def createWidgets( self ):
"Create initial widget set."
# Objects
title = Label( self, text='Bandwidth (Gb/s)', bg=self.bg )
width = self.gwidth
height = self.gheight
scale = self.createScale()
graph = Canvas( self, width=width, height=height, background=self.bg)
xbar = Scrollbar( self, orient='horizontal', command=graph.xview )
ybar = Scrollbar( self, orient='vertical', command=self.yview )
graph.configure( xscrollcommand=xbar.set, yscrollcommand=ybar.set,
scrollregion=(0, 0, width, height ) )
scale.configure( yscrollcommand=ybar.set )
# Layout
title.grid( row=0, columnspan=3, sticky='new')
scale.grid( row=1, column=0, sticky='nsew' )
graph.grid( row=1, column=1, sticky='nsew' )
ybar.grid( row=1, column=2, sticky='ns' )
xbar.grid( row=2, column=0, columnspan=2, sticky='ew' )
self.rowconfigure( 1, weight=1 )
self.columnconfigure( 1, weight=1 )
return title, scale, graph
def addBar( self, yval ):
"Add a new bar to our graph."
percent = yval / self.ymax
c = self.graph
x0 = self.xpos * self.barwidth
x1 = x0 + self.barwidth
y0 = self.gheight
y1 = ( 1 - percent ) * self.gheight
c.create_rectangle( x0, y0, x1, y1, fill='green' )
self.xpos += 1
self.updateScrollRegions()
self.graph.xview( 'moveto', '1.0' )
def clear( self ):
"Clear graph contents."
self.graph.delete( 'all' )
self.xpos = 0
def test( self ):
"Add a bar for testing purposes."
ms = 1000
if self.xpos < 10:
self.addBar( self.xpos / 10 * self.ymax )
self.after( ms, self.test )
def setTitle( self, text ):
"Set graph title"
self.title.configure( text=text, font='Helvetica 9 bold' )
class ConsoleApp( Frame ):
"Simple Tk consoles for Mininet."
menuStyle = { 'font': 'Geneva 7 bold' }
def __init__( self, net, parent=None, width=4 ):
Frame.__init__( self, parent )
self.top = self.winfo_toplevel()
self.top.title( 'Mininet' )
self.net = net
self.menubar = self.createMenuBar()
cframe = self.cframe = Frame( self )
self.consoles = {} # consoles themselves
titles = {
'hosts': 'Host',
'switches': 'Switch',
'controllers': 'Controller'
}
for name in titles:
nodes = getattr( net, name )
frame, consoles = self.createConsoles(
cframe, nodes, width, titles[ name ] )
self.consoles[ name ] = Object( frame=frame, consoles=consoles )
self.selected = None
self.select( 'hosts' )
self.cframe.pack( expand=True, fill='both' )
cleanUpScreens()
# Close window gracefully
Wm.wm_protocol( self.top, name='WM_DELETE_WINDOW', func=self.quit )
# Initialize graph
graph = Graph( cframe )
self.consoles[ 'graph' ] = Object( frame=graph, consoles=[ graph ] )
self.graph = graph
self.graphVisible = False
self.updates = 0
self.hostCount = len( self.consoles[ 'hosts' ].consoles )
self.bw = 0
self.pack( expand=True, fill='both' )
def updateGraph( self, _console, output ):
"Update our graph."
m = re.search( r'(\d+.?\d*) ([KMG]?bits)/sec', output )
if not m:
return
val, units = float( m.group( 1 ) ), m.group( 2 )
#convert to Gbps
if units[0] == 'M':
val *= 10 ** -3
elif units[0] == 'K':
val *= 10 ** -6
elif units[0] == 'b':
val *= 10 ** -9
self.updates += 1
self.bw += val
if self.updates >= self.hostCount:
self.graph.addBar( self.bw )
self.bw = 0
self.updates = 0
def setOutputHook( self, fn=None, consoles=None ):
"Register fn as output hook [on specific consoles.]"
if consoles is None:
consoles = self.consoles[ 'hosts' ].consoles
for console in consoles:
console.outputHook = fn
def createConsoles( self, parent, nodes, width, title ):
"Create a grid of consoles in a frame."
f = Frame( parent )
# Create consoles
consoles = []
index = 0
for node in nodes:
console = Console( f, self.net, node, title=title )
consoles.append( console )
row = index / width
column = index % width
console.grid( row=row, column=column, sticky='nsew' )
index += 1
f.rowconfigure( row, weight=1 )
f.columnconfigure( column, weight=1 )
return f, consoles
def select( self, groupName ):
"Select a group of consoles to display."
if self.selected is not None:
self.selected.frame.pack_forget()
self.selected = self.consoles[ groupName ]
self.selected.frame.pack( expand=True, fill='both' )
def createMenuBar( self ):
"Create and return a menu (really button) bar."
f = Frame( self )
buttons = [
( 'Hosts', lambda: self.select( 'hosts' ) ),
( 'Switches', lambda: self.select( 'switches' ) ),
( 'Controllers', lambda: self.select( 'controllers' ) ),
( 'Graph', lambda: self.select( 'graph' ) ),
( 'Ping', self.ping ),
( 'Iperf', self.iperf ),
( 'Interrupt', self.stop ),
( 'Clear', self.clear ),
( 'Quit', self.quit )
]
for name, cmd in buttons:
b = Button( f, text=name, command=cmd, **self.menuStyle )
b.pack( side='left' )
f.pack( padx=4, pady=4, fill='x' )
return f
def clear( self ):
"Clear selection."
for console in self.selected.consoles:
console.clear()
def waiting( self, consoles=None ):
"Are any of our hosts waiting for output?"
if consoles is None:
consoles = self.consoles[ 'hosts' ].consoles
for console in consoles:
if console.waiting():
return True
return False
def ping( self ):
"Tell each host to ping the next one."
consoles = self.consoles[ 'hosts' ].consoles
if self.waiting( consoles ):
return
count = len( consoles )
i = 0
for console in consoles:
i = ( i + 1 ) % count
ip = consoles[ i ].node.IP()
console.sendCmd( 'ping ' + ip )
def iperf( self ):
"Tell each host to iperf to the next one."
consoles = self.consoles[ 'hosts' ].consoles
if self.waiting( consoles ):
return
count = len( consoles )
self.setOutputHook( self.updateGraph )
for console in consoles:
# Sometimes iperf -sD doesn't return,
# so we run it in the background instead
console.node.cmd( 'iperf -s &' )
i = 0
for console in consoles:
i = ( i + 1 ) % count
ip = consoles[ i ].node.IP()
console.sendCmd( 'iperf -t 99999 -i 1 -c ' + ip )
def stop( self, wait=True ):
"Interrupt all hosts."
consoles = self.consoles[ 'hosts' ].consoles
for console in consoles:
console.handleInt()
if wait:
for console in consoles:
console.waitOutput()
self.setOutputHook( None )
# Shut down any iperfs that might still be running
quietRun( 'killall -9 iperf' )
def quit( self ):
"Stop everything and quit."
self.stop( wait=False)
Frame.quit( self )
# Make it easier to construct and assign objects
def assign( obj, **kwargs ):
"Set a bunch of fields in an object."
obj.__dict__.update( kwargs )
class Object( object ):
"Generic object you can stuff junk into."
def __init__( self, **kwargs ):
assign( self, **kwargs )
if __name__ == '__main__':
setLogLevel( 'info' )
network = TreeNet( depth=2, fanout=4 )
network.start()
app = ConsoleApp( network, width=4 )
app.mainloop()
network.stop()
-70
View File
@@ -1,70 +0,0 @@
# -*- Mode:python; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
#
# Copyright (C) 2015-2021, The University of Memphis,
# Arizona Board of Regents,
# Regents of the University of California.
#
# This file is part of Mini-NDN.
# See AUTHORS.md for a complete list of Mini-NDN authors and contributors.
#
# Mini-NDN is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Mini-NDN is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Mini-NDN, e.g., in COPYING.md file.
# If not, see <http://www.gnu.org/licenses/>.
from time import sleep
from mininet.log import setLogLevel, info
from minindn.minindn import Minindn
from minindn.util import MiniNDNCLI
from minindn.apps.app_manager import AppManager
from minindn.apps.nfd import Nfd
from minindn.apps.nlsr import Nlsr
"""
This example demonstrates a basic consumer-producer using Mini-NDN. It uses ndnpeek and ndnpoke as
a consumer and a producer respectively. If you want to build your own consumer/producer program, you
can take help from here: https://github.com/named-data/ndn-cxx/tree/master/examples and
here: https://github.com/dulalsaurab/multicast-supression-ndn/tree/main/ndn-src/consumer-producer
"""
if __name__ == '__main__':
setLogLevel('info')
Minindn.cleanUp()
Minindn.verifyDependencies()
ndn = Minindn()
ndn.start()
info('Starting nfd and nlsr on nodes')
nfds = AppManager(ndn, ndn.net.hosts, Nfd)
nlsrs = AppManager(ndn, ndn.net.hosts, Nlsr)
sleep(90)
# Default topology is used in this experiment "/topologies/default-topology.conf"
# lets make node "a" as a producer node, and node "c" as a consumer node
producer = ndn.net['a']
consumer = ndn.net['c']
# start producer
producerPrefix = "/example"
producer.cmd('nlsrc advertise {}'.format(producerPrefix))
sleep(5) # sleep for routing convergence
# Make sure that basic consumer/producer example are compiled and installed in the system
info('Starting consumer and producer application')
producer.cmd("echo 'HELLO WORLD' | ndnpoke {} &> producer.log &".format(producerPrefix))
consumer.cmd("ndnpeek -p {} &> consumer.log &".format(producerPrefix))
MiniNDNCLI(ndn.net)
ndn.stop()
+36
View File
@@ -0,0 +1,36 @@
#!/usr/bin/python
"""
Create a network where different switches are connected to
different controllers, by creating a custom Switch() subclass.
"""
from mininet.net import Mininet
from mininet.node import OVSSwitch, Controller, RemoteController
from mininet.topolib import TreeTopo
from mininet.log import setLogLevel
from mininet.cli import CLI
setLogLevel( 'info' )
# Two local and one "external" controller (which is actually c0)
# Ignore the warning message that the remote isn't (yet) running
c0 = Controller( 'c0', port=6633 )
c1 = Controller( 'c1', port=6634 )
c2 = RemoteController( 'c2', ip='127.0.0.1' )
cmap = { 's1': c0, 's2': c1, 's3': c2 }
class MultiSwitch( OVSSwitch ):
"Custom Switch() subclass that connects to different controllers"
def start( self, controllers ):
return OVSSwitch.start( self, [ cmap[ self.name ] ] )
topo = TreeTopo( depth=2, fanout=2 )
net = Mininet( topo=topo, switch=MultiSwitch, build=False )
for c in [ c0, c1 ]:
net.addController(c)
net.build()
net.start()
CLI( net )
net.stop()
+61
View File
@@ -0,0 +1,61 @@
#!/usr/bin/python
"""
This example creates a multi-controller network from semi-scratch by
using the net.add*() API and manually starting the switches and controllers.
This is the "mid-level" API, which is an alternative to the "high-level"
Topo() API which supports parametrized topology classes.
Note that one could also create a custom switch class and pass it into
the Mininet() constructor.
"""
from mininet.net import Mininet
from mininet.node import Controller, OVSSwitch
from mininet.cli import CLI
from mininet.log import setLogLevel
def multiControllerNet():
"Create a network from semi-scratch with multiple controllers."
net = Mininet( controller=Controller, switch=OVSSwitch )
print "*** Creating (reference) controllers"
c1 = net.addController( 'c1', port=6633 )
c2 = net.addController( 'c2', port=6634 )
print "*** Creating switches"
s1 = net.addSwitch( 's1' )
s2 = net.addSwitch( 's2' )
print "*** Creating hosts"
hosts1 = [ net.addHost( 'h%d' % n ) for n in 3, 4 ]
hosts2 = [ net.addHost( 'h%d' % n ) for n in 5, 6 ]
print "*** Creating links"
for h in hosts1:
net.addLink( s1, h )
for h in hosts2:
net.addLink( s2, h )
net.addLink( s1, s2 )
print "*** Starting network"
net.build()
c1.start()
c2.start()
s1.start( [ c1 ] )
s2.start( [ c2 ] )
print "*** Testing network"
net.pingAll()
print "*** Running CLI"
CLI( net )
print "*** Stopping network"
net.stop()
if __name__ == '__main__':
setLogLevel( 'info' ) # for CLI output
multiControllerNet()
+158
View File
@@ -0,0 +1,158 @@
#!/usr/bin/python
"""
controlnet.py: Mininet with a custom control network
We create two Mininet() networks, a control network
and a data network, running four DataControllers on the
control network to control the data network.
Since we're using UserSwitch on the data network,
it should correctly fail over to a backup controller.
We also use a Mininet Facade to talk to both the
control and data networks from a single CLI.
"""
from functools import partial
from mininet.net import Mininet
from mininet.node import Controller, UserSwitch
from mininet.cli import CLI
from mininet.topo import Topo
from mininet.topolib import TreeTopo
from mininet.log import setLogLevel, info
# Some minor hacks
class DataController( Controller ):
"""Data Network Controller.
patched to avoid checkListening error and to delete intfs"""
def checkListening( self ):
"Ignore spurious error"
pass
def stop( self, *args, **kwargs ):
"Make sure intfs are deleted"
kwargs.update( deleteIntfs=True )
super( DataController, self ).stop( *args, **kwargs )
class MininetFacade( object ):
"""Mininet object facade that allows a single CLI to
talk to one or more networks"""
def __init__( self, net, *args, **kwargs ):
"""Create MininetFacade object.
net: Primary Mininet object
args: unnamed networks passed as arguments
kwargs: named networks passed as arguments"""
self.net = net
self.nets = [ net ] + list( args ) + kwargs.values()
self.nameToNet = kwargs
self.nameToNet['net'] = net
def __getattr__( self, name ):
"returns attribute from Primary Mininet object"
return getattr( self.net, name )
def __getitem__( self, key ):
"returns primary/named networks or node from any net"
#search kwargs for net named key
if key in self.nameToNet:
return self.nameToNet[ key ]
#search each net for node named key
for net in self.nets:
if key in net:
return net[ key ]
def __iter__( self ):
"Iterate through all nodes in all Mininet objects"
for net in self.nets:
for node in net:
yield node
def __len__( self ):
"returns aggregate number of nodes in all nets"
count = 0
for net in self.nets:
count += len(net)
return count
def __contains__( self, key ):
"returns True if node is a member of any net"
return key in self.keys()
def keys( self ):
"returns a list of all node names in all networks"
return list( self )
def values( self ):
"returns a list of all nodes in all networks"
return [ self[ key ] for key in self ]
def items( self ):
"returns (key,value) tuple list for every node in all networks"
return zip( self.keys(), self.values() )
# A real control network!
class ControlNetwork( Topo ):
"Control Network Topology"
def __init__( self, n, dataController=DataController, **kwargs ):
"""n: number of data network controller nodes
dataController: class for data network controllers"""
Topo.__init__( self, **kwargs )
# Connect everything to a single switch
cs0 = self.addSwitch( 'cs0' )
# Add hosts which will serve as data network controllers
for i in range( 0, n ):
c = self.addHost( 'c%s' % i, cls=dataController,
inNamespace=True )
self.addLink( c, cs0 )
# Connect switch to root namespace so that data network
# switches will be able to talk to us
root = self.addHost( 'root', inNamespace=False )
self.addLink( root, cs0 )
# Make it Happen!!
def run():
"Create control and data networks, and invoke the CLI"
info( '* Creating Control Network\n' )
ctopo = ControlNetwork( n=4, dataController=DataController )
cnet = Mininet( topo=ctopo, ipBase='192.168.123.0/24', controller=None )
info( '* Adding Control Network Controller\n')
cnet.addController( 'cc0', controller=Controller )
info( '* Starting Control Network\n')
cnet.start()
info( '* Creating Data Network\n' )
topo = TreeTopo( depth=2, fanout=2 )
# UserSwitch so we can easily test failover
sw = partial( UserSwitch, opts='--inactivity-probe=1 --max-backoff=1' )
net = Mininet( topo=topo, switch=sw, controller=None )
info( '* Adding Controllers to Data Network\n' )
for host in cnet.hosts:
if isinstance(host, Controller):
net.addController( host )
info( '* Starting Data Network\n')
net.start()
mn = MininetFacade( net, cnet=cnet )
CLI( mn )
info( '* Stopping Data Network\n' )
net.stop()
info( '* Stopping Control Network\n' )
cnet.stop()
if __name__ == '__main__':
setLogLevel( 'info' )
run()
+73
View File
@@ -0,0 +1,73 @@
#!/usr/bin/python
"""
cpu.py: test iperf bandwidth for varying cpu limits
"""
from mininet.net import Mininet
from mininet.node import CPULimitedHost
from mininet.topolib import TreeTopo
from mininet.util import custom, waitListening
from mininet.log import setLogLevel, info
def bwtest( cpuLimits, period_us=100000, seconds=5 ):
"""Example/test of link and CPU bandwidth limits
cpu: cpu limit as fraction of overall CPU time"""
topo = TreeTopo( depth=1, fanout=2 )
results = {}
for sched in 'rt', 'cfs':
print '*** Testing with', sched, 'bandwidth limiting'
for cpu in cpuLimits:
host = custom( CPULimitedHost, sched=sched,
period_us=period_us,
cpu=cpu )
try:
net = Mininet( topo=topo, host=host )
# pylint: disable=bare-except
except:
info( '*** Skipping host %s\n' % sched )
break
net.start()
net.pingAll()
hosts = [ net.getNodeByName( h ) for h in topo.hosts() ]
client, server = hosts[ 0 ], hosts[ -1 ]
server.cmd( 'iperf -s -p 5001 &' )
waitListening( client, server, 5001 )
result = client.cmd( 'iperf -yc -t %s -c %s' % (
seconds, server.IP() ) ).split( ',' )
bps = float( result[ -1 ] )
server.cmdPrint( 'kill %iperf' )
net.stop()
updated = results.get( sched, [] )
updated += [ ( cpu, bps ) ]
results[ sched ] = updated
return results
def dump( results ):
"Dump results"
fmt = '%s\t%s\t%s'
print
print fmt % ( 'sched', 'cpu', 'client MB/s' )
print
for sched in sorted( results.keys() ):
entries = results[ sched ]
for cpu, bps in entries:
pct = '%.2f%%' % ( cpu * 100 )
mbps = bps / 1e6
print fmt % ( sched, pct, mbps )
if __name__ == '__main__':
setLogLevel( 'info' )
limits = [ .45, .4, .3, .2, .1 ]
out = bwtest( limits )
dump( out )
+44
View File
@@ -0,0 +1,44 @@
#!/usr/bin/python
"""
This example shows how to create an empty Mininet object
(without a topology object) and add nodes to it manually.
"""
from mininet.net import Mininet
from mininet.node import Controller
from mininet.cli import CLI
from mininet.log import setLogLevel, info
def emptyNet():
"Create an empty network and add nodes to it."
net = Mininet( controller=Controller )
info( '*** Adding controller\n' )
net.addController( 'c0' )
info( '*** Adding hosts\n' )
h1 = net.addHost( 'h1', ip='10.0.0.1' )
h2 = net.addHost( 'h2', ip='10.0.0.2' )
info( '*** Adding switch\n' )
s3 = net.addSwitch( 's3' )
info( '*** Creating links\n' )
net.addLink( h1, s3 )
net.addLink( h2, s3 )
info( '*** Starting network\n')
net.start()
info( '*** Running CLI\n' )
CLI( net )
info( '*** Stopping network' )
net.stop()
if __name__ == '__main__':
setLogLevel( 'info' )
emptyNet()
+52
View File
@@ -0,0 +1,52 @@
#!/usr/bin/python
"""
This example shows how to add an interface (for example a real
hardware interface) to a network after the network is created.
"""
import re
import sys
from mininet.cli import CLI
from mininet.log import setLogLevel, info, error
from mininet.net import Mininet
from mininet.link import Intf
from mininet.topolib import TreeTopo
from mininet.util import quietRun
def checkIntf( intf ):
"Make sure intf exists and is not configured."
if ( ' %s:' % intf ) not in quietRun( 'ip link show' ):
error( 'Error:', intf, 'does not exist!\n' )
exit( 1 )
ips = re.findall( r'\d+\.\d+\.\d+\.\d+', quietRun( 'ifconfig ' + intf ) )
if ips:
error( 'Error:', intf, 'has an IP address,'
'and is probably in use!\n' )
exit( 1 )
if __name__ == '__main__':
setLogLevel( 'info' )
# try to get hw intf from the command line; by default, use eth1
intfName = sys.argv[ 1 ] if len( sys.argv ) > 1 else 'eth1'
info( '*** Connecting to hw intf: %s' % intfName )
info( '*** Checking', intfName, '\n' )
checkIntf( intfName )
info( '*** Creating network\n' )
net = Mininet( topo=TreeTopo( depth=1, fanout=2 ) )
switch = net.switches[ 0 ]
info( '*** Adding hardware interface', intfName, 'to switch',
switch.name, '\n' )
_intf = Intf( intfName, node=switch )
info( '*** Note: you may need to reconfigure the interfaces for '
'the Mininet hosts:\n', net.hosts, '\n' )
net.start()
CLI( net )
net.stop()
+48
View File
@@ -0,0 +1,48 @@
#!/usr/bin/python
'''
example of using various TCIntf options.
reconfigures a single interface using intf.config()
to use different traffic control commands to test
bandwidth, loss, and delay
'''
from mininet.net import Mininet
from mininet.log import setLogLevel, info
from mininet.link import TCLink
def intfOptions():
"run various traffic control commands on a single interface"
net = Mininet( autoStaticArp=True )
net.addController( 'c0' )
h1 = net.addHost( 'h1' )
h2 = net.addHost( 'h2' )
s1 = net.addSwitch( 's1' )
link1 = net.addLink( h1, s1, cls=TCLink )
net.addLink( h2, s1 )
net.start()
# flush out latency from reactive forwarding delay
net.pingAll()
info( '\n*** Configuring one intf with bandwidth of 5 Mb\n' )
link1.intf1.config( bw=5 )
info( '\n*** Running iperf to test\n' )
net.iperf()
info( '\n*** Configuring one intf with loss of 50%\n' )
link1.intf1.config( loss=50 )
info( '\n' )
net.iperf( ( h1, h2 ), l4Type='UDP' )
info( '\n*** Configuring one intf with delay of 15ms\n' )
link1.intf1.config( delay='15ms' )
info( '\n*** Run a ping to confirm delay\n' )
net.pingPairFull()
info( '\n*** Done testing\n' )
net.stop()
if __name__ == '__main__':
setLogLevel( 'info' )
intfOptions()
-62
View File
@@ -1,62 +0,0 @@
# -*- Mode:python; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
#
# Copyright (C) 2015-2020, The University of Memphis,
# Arizona Board of Regents,
# Regents of the University of California.
#
# This file is part of Mini-NDN.
# See AUTHORS.md for a complete list of Mini-NDN authors and contributors.
#
# Mini-NDN is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Mini-NDN is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Mini-NDN, e.g., in COPYING.md file.
# If not, see <http://www.gnu.org/licenses/>.
from mininet.log import setLogLevel, info
from minindn.minindn import Minindn
from minindn.apps.app_manager import AppManager
from minindn.apps.nfd import Nfd
from minindn.apps.nlsr import Nlsr
from minindn.helpers.ip_routing_helper import IPRoutingHelper
"""
This scenario demonstrates the functionality of the IPRoutingHelper. First, the routing helper
calculates and configures routes between all nodes and then calls the `pingAll` command to
demonstrate that all nodes are reachable.
Successful experiments end with: `*** Results: 0% dropped`
To demonstrate the IPRoutingHelper in more complex scenarios, consider starting the experiment with
the Geant-Topology (topologies/geant.conf).
"""
if __name__ == '__main__':
setLogLevel('info')
Minindn.cleanUp()
Minindn.verifyDependencies()
ndn = Minindn()
ndn.start()
info('Starting NFD on nodes\n')
nfds = AppManager(ndn, ndn.net.hosts, Nfd)
info('Starting NLSR on nodes\n')
nlsrs = AppManager(ndn, ndn.net.hosts, Nlsr)
# Calculate all routes for IP routing
IPRoutingHelper.calcAllRoutes(ndn.net)
info("IP routes configured, start ping\n")
ndn.net.pingAll()
ndn.stop()
+60
View File
@@ -0,0 +1,60 @@
#!/usr/bin/python
"""
limit.py: example of using link and CPU limits
"""
from mininet.net import Mininet
from mininet.link import TCIntf
from mininet.node import CPULimitedHost
from mininet.topolib import TreeTopo
from mininet.util import custom, quietRun
from mininet.log import setLogLevel, info
def testLinkLimit( net, bw ):
"Run bandwidth limit test"
info( '*** Testing network %.2f Mbps bandwidth limit\n' % bw )
net.iperf()
def limit( bw=10, cpu=.1 ):
"""Example/test of link and CPU bandwidth limits
bw: interface bandwidth limit in Mbps
cpu: cpu limit as fraction of overall CPU time"""
intf = custom( TCIntf, bw=bw )
myTopo = TreeTopo( depth=1, fanout=2 )
for sched in 'rt', 'cfs':
info( '*** Testing with', sched, 'bandwidth limiting\n' )
if sched == 'rt':
release = quietRun( 'uname -r' ).strip('\r\n')
output = quietRun( 'grep CONFIG_RT_GROUP_SCHED /boot/config-%s'
% release )
if output == '# CONFIG_RT_GROUP_SCHED is not set\n':
info( '*** RT Scheduler is not enabled in your kernel. '
'Skipping this test\n' )
continue
host = custom( CPULimitedHost, sched=sched, cpu=cpu )
net = Mininet( topo=myTopo, intf=intf, host=host )
net.start()
testLinkLimit( net, bw=bw )
net.runCpuLimitTest( cpu=cpu )
net.stop()
def verySimpleLimit( bw=150 ):
"Absurdly simple limiting test"
intf = custom( TCIntf, bw=bw )
net = Mininet( intf=intf )
h1, h2 = net.addHost( 'h1' ), net.addHost( 'h2' )
net.addLink( h1, h2 )
net.start()
net.pingAll()
net.iperf()
h1.cmdPrint( 'tc -s qdisc ls dev', h1.defaultIntf() )
h2.cmdPrint( 'tc -d class show dev', h2.defaultIntf() )
h1.cmdPrint( 'tc -s qdisc ls dev', h1.defaultIntf() )
h2.cmdPrint( 'tc -d class show dev', h2.defaultIntf() )
net.stop()
if __name__ == '__main__':
setLogLevel( 'info' )
limit()
+126
View File
@@ -0,0 +1,126 @@
#!/usr/bin/python
"""
Test bandwidth (using iperf) on linear networks of varying size,
using both kernel and user datapaths.
We construct a network of N hosts and N-1 switches, connected as follows:
h1 <-> s1 <-> s2 .. sN-1
| | |
h2 h3 hN
WARNING: by default, the reference controller only supports 16
switches, so this test WILL NOT WORK unless you have recompiled
your controller to support 100 switches (or more.)
In addition to testing the bandwidth across varying numbers
of switches, this example demonstrates:
- creating a custom topology, LinearTestTopo
- using the ping() and iperf() tests from Mininet()
- testing both the kernel and user switches
"""
from mininet.net import Mininet
from mininet.node import UserSwitch, OVSKernelSwitch, Controller
from mininet.topo import Topo
from mininet.log import lg
from mininet.util import irange, quietRun
from mininet.link import TCLink
from functools import partial
import sys
flush = sys.stdout.flush
class LinearTestTopo( Topo ):
"Topology for a string of N hosts and N-1 switches."
def __init__( self, N, **params ):
# Initialize topology
Topo.__init__( self, **params )
# Create switches and hosts
hosts = [ self.addHost( 'h%s' % h )
for h in irange( 1, N ) ]
switches = [ self.addSwitch( 's%s' % s )
for s in irange( 1, N - 1 ) ]
# Wire up switches
last = None
for switch in switches:
if last:
self.addLink( last, switch )
last = switch
# Wire up hosts
self.addLink( hosts[ 0 ], switches[ 0 ] )
for host, switch in zip( hosts[ 1: ], switches ):
self.addLink( host, switch )
def linearBandwidthTest( lengths ):
"Check bandwidth at various lengths along a switch chain."
results = {}
switchCount = max( lengths )
hostCount = switchCount + 1
switches = { 'reference user': UserSwitch,
'Open vSwitch kernel': OVSKernelSwitch }
# UserSwitch is horribly slow with recent kernels.
# We can reinstate it once its performance is fixed
del switches[ 'reference user' ]
topo = LinearTestTopo( hostCount )
# Select TCP Reno
output = quietRun( 'sysctl -w net.ipv4.tcp_congestion_control=reno' )
assert 'reno' in output
for datapath in switches.keys():
print "*** testing", datapath, "datapath"
Switch = switches[ datapath ]
results[ datapath ] = []
link = partial( TCLink, delay='1ms' )
net = Mininet( topo=topo, switch=Switch,
controller=Controller, waitConnected=True,
link=link )
net.start()
print "*** testing basic connectivity"
for n in lengths:
net.ping( [ net.hosts[ 0 ], net.hosts[ n ] ] )
print "*** testing bandwidth"
for n in lengths:
src, dst = net.hosts[ 0 ], net.hosts[ n ]
# Try to prime the pump to reduce PACKET_INs during test
# since the reference controller is reactive
src.cmd( 'telnet', dst.IP(), '5001' )
print "testing", src.name, "<->", dst.name,
bandwidth = net.iperf( [ src, dst ], seconds=10 )
print bandwidth
flush()
results[ datapath ] += [ ( n, bandwidth ) ]
net.stop()
for datapath in switches.keys():
print
print "*** Linear network results for", datapath, "datapath:"
print
result = results[ datapath ]
print "SwitchCount\tiperf Results"
for switchCount, bandwidth in result:
print switchCount, '\t\t',
print bandwidth[ 0 ], 'server, ', bandwidth[ 1 ], 'client'
print
print
if __name__ == '__main__':
lg.setLogLevel( 'info' )
sizes = [ 1, 10, 20, 40, 60, 80, 100 ]
print "*** Running linearBandwidthTest", sizes
linearBandwidthTest( sizes )
+89
View File
@@ -0,0 +1,89 @@
#!/usr/bin/python
"""
linuxrouter.py: Example network with Linux IP router
This example converts a Node into a router using IP forwarding
already built into Linux.
The example topology creates a router and three IP subnets:
- 192.168.1.0/24 (r0-eth1, IP: 192.168.1.1)
- 172.16.0.0/12 (r0-eth2, IP: 172.16.0.1)
- 10.0.0.0/8 (r0-eth3, IP: 10.0.0.1)
Each subnet consists of a single host connected to
a single switch:
r0-eth1 - s1-eth1 - h1-eth0 (IP: 192.168.1.100)
r0-eth2 - s2-eth1 - h2-eth0 (IP: 172.16.0.100)
r0-eth3 - s3-eth1 - h3-eth0 (IP: 10.0.0.100)
The example relies on default routing entries that are
automatically created for each router interface, as well
as 'defaultRoute' parameters for the host interfaces.
Additional routes may be added to the router or hosts by
executing 'ip route' or 'route' commands on the router or hosts.
"""
from mininet.topo import Topo
from mininet.net import Mininet
from mininet.node import Node
from mininet.log import setLogLevel, info
from mininet.cli import CLI
class LinuxRouter( Node ):
"A Node with IP forwarding enabled."
def config( self, **params ):
super( LinuxRouter, self).config( **params )
# Enable forwarding on the router
self.cmd( 'sysctl net.ipv4.ip_forward=1' )
def terminate( self ):
self.cmd( 'sysctl net.ipv4.ip_forward=0' )
super( LinuxRouter, self ).terminate()
class NetworkTopo( Topo ):
"A LinuxRouter connecting three IP subnets"
def build( self, **_opts ):
defaultIP = '192.168.1.1/24' # IP address for r0-eth1
router = self.addNode( 'r0', cls=LinuxRouter, ip=defaultIP )
s1, s2, s3 = [ self.addSwitch( s ) for s in 's1', 's2', 's3' ]
self.addLink( s1, router, intfName2='r0-eth1',
params2={ 'ip' : defaultIP } ) # for clarity
self.addLink( s2, router, intfName2='r0-eth2',
params2={ 'ip' : '172.16.0.1/12' } )
self.addLink( s3, router, intfName2='r0-eth3',
params2={ 'ip' : '10.0.0.1/8' } )
h1 = self.addHost( 'h1', ip='192.168.1.100/24',
defaultRoute='via 192.168.1.1' )
h2 = self.addHost( 'h2', ip='172.16.0.100/12',
defaultRoute='via 172.16.0.1' )
h3 = self.addHost( 'h3', ip='10.0.0.100/8',
defaultRoute='via 10.0.0.1' )
for h, s in [ (h1, s1), (h2, s2), (h3, s3) ]:
self.addLink( h, s )
def run():
"Test linux router"
topo = NetworkTopo()
net = Mininet( topo=topo ) # controller is used by s1-s3
net.start()
info( '*** Routing Table on Router:\n' )
print net[ 'r0' ].cmd( 'route' )
CLI( net )
net.stop()
if __name__ == '__main__':
setLogLevel( 'info' )
run()
+3584
View File
File diff suppressed because it is too large Load Diff
-49
View File
@@ -1,49 +0,0 @@
# -*- Mode:python; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
#
# Copyright (C) 2015-2020, The University of Memphis,
# Arizona Board of Regents,
# Regents of the University of California.
#
# This file is part of Mini-NDN.
# See AUTHORS.md for a complete list of Mini-NDN authors and contributors.
#
# Mini-NDN is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Mini-NDN is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Mini-NDN, e.g., in COPYING.md file.
# If not, see <http://www.gnu.org/licenses/>.
from mininet.log import setLogLevel, info
from minindn.minindn import Minindn
from minindn.util import MiniNDNCLI
from minindn.apps.app_manager import AppManager
from minindn.apps.nfd import Nfd
from minindn.apps.nlsr import Nlsr
if __name__ == '__main__':
setLogLevel('info')
Minindn.cleanUp()
Minindn.verifyDependencies()
ndn = Minindn()
ndn.start()
info('Starting NFD on nodes\n')
nfds = AppManager(ndn, ndn.net.hosts, Nfd)
info('Starting NLSR on nodes\n')
nlsrs = AppManager(ndn, ndn.net.hosts, Nlsr)
MiniNDNCLI(ndn.net)
ndn.stop()
+134
View File
@@ -0,0 +1,134 @@
#!/usr/bin/python
"""
Simple example of Mobility with Mininet
(aka enough rope to hang yourself.)
We move a host from s1 to s2, s2 to s3, and then back to s1.
Gotchas:
The reference controller doesn't support mobility, so we need to
manually flush the switch flow tables!
Good luck!
to-do:
- think about wifi/hub behavior
- think about clearing last hop - why doesn't that work?
"""
from mininet.net import Mininet
from mininet.node import OVSSwitch
from mininet.topo import LinearTopo
from mininet.log import output, warn
from random import randint
class MobilitySwitch( OVSSwitch ):
"Switch that can reattach and rename interfaces"
def delIntf( self, intf ):
"Remove (and detach) an interface"
port = self.ports[ intf ]
del self.ports[ intf ]
del self.intfs[ port ]
del self.nameToIntf[ intf.name ]
def addIntf( self, intf, rename=False, **kwargs ):
"Add (and reparent) an interface"
OVSSwitch.addIntf( self, intf, **kwargs )
intf.node = self
if rename:
self.renameIntf( intf )
def attach( self, intf ):
"Attach an interface and set its port"
port = self.ports[ intf ]
if port:
if self.isOldOVS():
self.cmd( 'ovs-vsctl add-port', self, intf )
else:
self.cmd( 'ovs-vsctl add-port', self, intf,
'-- set Interface', intf,
'ofport_request=%s' % port )
self.validatePort( intf )
def validatePort( self, intf ):
"Validate intf's OF port number"
ofport = int( self.cmd( 'ovs-vsctl get Interface', intf,
'ofport' ) )
if ofport != self.ports[ intf ]:
warn( 'WARNING: ofport for', intf, 'is actually', ofport,
'\n' )
def renameIntf( self, intf, newname='' ):
"Rename an interface (to its canonical name)"
intf.ifconfig( 'down' )
if not newname:
newname = '%s-eth%d' % ( self.name, self.ports[ intf ] )
intf.cmd( 'ip link set', intf, 'name', newname )
del self.nameToIntf[ intf.name ]
intf.name = newname
self.nameToIntf[ intf.name ] = intf
intf.ifconfig( 'up' )
def moveIntf( self, intf, switch, port=None, rename=True ):
"Move one of our interfaces to another switch"
self.detach( intf )
self.delIntf( intf )
switch.addIntf( intf, port=port, rename=rename )
switch.attach( intf )
def printConnections( switches ):
"Compactly print connected nodes to each switch"
for sw in switches:
output( '%s: ' % sw )
for intf in sw.intfList():
link = intf.link
if link:
intf1, intf2 = link.intf1, link.intf2
remote = intf1 if intf1.node != sw else intf2
output( '%s(%s) ' % ( remote.node, sw.ports[ intf ] ) )
output( '\n' )
def moveHost( host, oldSwitch, newSwitch, newPort=None ):
"Move a host from old switch to new switch"
hintf, sintf = host.connectionsTo( oldSwitch )[ 0 ]
oldSwitch.moveIntf( sintf, newSwitch, port=newPort )
return hintf, sintf
def mobilityTest():
"A simple test of mobility"
print '* Simple mobility test'
net = Mininet( topo=LinearTopo( 3 ), switch=MobilitySwitch )
print '* Starting network:'
net.start()
printConnections( net.switches )
print '* Testing network'
net.pingAll()
print '* Identifying switch interface for h1'
h1, old = net.get( 'h1', 's1' )
for s in 2, 3, 1:
new = net[ 's%d' % s ]
port = randint( 10, 20 )
print '* Moving', h1, 'from', old, 'to', new, 'port', port
hintf, sintf = moveHost( h1, old, new, newPort=port )
print '*', hintf, 'is now connected to', sintf
print '* Clearing out old flows'
for sw in net.switches:
sw.dpctl( 'del-flows' )
print '* New network:'
printConnections( net.switches )
print '* Testing connectivity:'
net.pingAll()
old = new
net.stop()
if __name__ == '__main__':
mobilityTest()
+36
View File
@@ -0,0 +1,36 @@
#!/usr/bin/python
"""
This is a simple example that demonstrates multiple links
between nodes.
"""
from mininet.cli import CLI
from mininet.log import setLogLevel
from mininet.net import Mininet
from mininet.topo import Topo
def runMultiLink():
"Create and run multiple link network"
topo = simpleMultiLinkTopo( n=2 )
net = Mininet( topo=topo )
net.start()
CLI( net )
net.stop()
class simpleMultiLinkTopo( Topo ):
"Simple topology with multiple links"
def __init__( self, n, **kwargs ):
Topo.__init__( self, **kwargs )
h1, h2 = self.addHost( 'h1' ), self.addHost( 'h2' )
s1 = self.addSwitch( 's1' )
for _ in range( n ):
self.addLink( s1, h1 )
self.addLink( s1, h2 )
if __name__ == '__main__':
setLogLevel( 'info' )
runMultiLink()
+83
View File
@@ -0,0 +1,83 @@
#!/usr/bin/python
"""
multiping.py: monitor multiple sets of hosts using ping
This demonstrates how one may send a simple shell script to
multiple hosts and monitor their output interactively for a period=
of time.
"""
from mininet.net import Mininet
from mininet.node import Node
from mininet.topo import SingleSwitchTopo
from mininet.log import setLogLevel
from select import poll, POLLIN
from time import time
def chunks( l, n ):
"Divide list l into chunks of size n - thanks Stackoverflow"
return [ l[ i: i + n ] for i in range( 0, len( l ), n ) ]
def startpings( host, targetips ):
"Tell host to repeatedly ping targets"
targetips = ' '.join( targetips )
# Simple ping loop
cmd = ( 'while true; do '
' for ip in %s; do ' % targetips +
' echo -n %s "->" $ip ' % host.IP() +
' `ping -c1 -w 1 $ip | grep packets` ;'
' sleep 1;'
' done; '
'done &' )
print ( '*** Host %s (%s) will be pinging ips: %s' %
( host.name, host.IP(), targetips ) )
host.cmd( cmd )
def multiping( netsize, chunksize, seconds):
"Ping subsets of size chunksize in net of size netsize"
# Create network and identify subnets
topo = SingleSwitchTopo( netsize )
net = Mininet( topo=topo )
net.start()
hosts = net.hosts
subnets = chunks( hosts, chunksize )
# Create polling object
fds = [ host.stdout.fileno() for host in hosts ]
poller = poll()
for fd in fds:
poller.register( fd, POLLIN )
# Start pings
for subnet in subnets:
ips = [ host.IP() for host in subnet ]
#adding bogus to generate packet loss
ips.append( '10.0.0.200' )
for host in subnet:
startpings( host, ips )
# Monitor output
endTime = time() + seconds
while time() < endTime:
readable = poller.poll(1000)
for fd, _mask in readable:
node = Node.outToNode[ fd ]
print '%s:' % node.name, node.monitor().strip()
# Stop pings
for host in hosts:
host.cmd( 'kill %while' )
net.stop()
if __name__ == '__main__':
setLogLevel( 'info' )
multiping( netsize=20, chunksize=4, seconds=10 )
+81
View File
@@ -0,0 +1,81 @@
#!/usr/bin/python
"""
Simple example of sending output to multiple files and
monitoring them
"""
from mininet.topo import SingleSwitchTopo
from mininet.net import Mininet
from mininet.log import setLogLevel
from time import time
from select import poll, POLLIN
from subprocess import Popen, PIPE
def monitorFiles( outfiles, seconds, timeoutms ):
"Monitor set of files and return [(host, line)...]"
devnull = open( '/dev/null', 'w' )
tails, fdToFile, fdToHost = {}, {}, {}
for h, outfile in outfiles.iteritems():
tail = Popen( [ 'tail', '-f', outfile ],
stdout=PIPE, stderr=devnull )
fd = tail.stdout.fileno()
tails[ h ] = tail
fdToFile[ fd ] = tail.stdout
fdToHost[ fd ] = h
# Prepare to poll output files
readable = poll()
for t in tails.values():
readable.register( t.stdout.fileno(), POLLIN )
# Run until a set number of seconds have elapsed
endTime = time() + seconds
while time() < endTime:
fdlist = readable.poll(timeoutms)
if fdlist:
for fd, _flags in fdlist:
f = fdToFile[ fd ]
host = fdToHost[ fd ]
# Wait for a line of output
line = f.readline().strip()
yield host, line
else:
# If we timed out, return nothing
yield None, ''
for t in tails.values():
t.terminate()
devnull.close() # Not really necessary
def monitorTest( N=3, seconds=3 ):
"Run pings and monitor multiple hosts"
topo = SingleSwitchTopo( N )
net = Mininet( topo )
net.start()
hosts = net.hosts
print "Starting test..."
server = hosts[ 0 ]
outfiles, errfiles = {}, {}
for h in hosts:
# Create and/or erase output files
outfiles[ h ] = '/tmp/%s.out' % h.name
errfiles[ h ] = '/tmp/%s.err' % h.name
h.cmd( 'echo >', outfiles[ h ] )
h.cmd( 'echo >', errfiles[ h ] )
# Start pings
h.cmdPrint('ping', server.IP(),
'>', outfiles[ h ],
'2>', errfiles[ h ],
'&' )
print "Monitoring output for", seconds, "seconds"
for h, line in monitorFiles( outfiles, seconds, timeoutms=500 ):
if h:
print '%s: %s' % ( h.name, line )
for h in hosts:
h.cmd('kill %ping')
net.stop()
if __name__ == '__main__':
setLogLevel('info')
monitorTest()
+35
View File
@@ -0,0 +1,35 @@
#!/usr/bin/python
"""
This example shows how to create a network and run multiple tests.
For a more complicated test example, see udpbwtest.py.
"""
from mininet.cli import CLI
from mininet.log import lg, info
from mininet.net import Mininet
from mininet.node import OVSKernelSwitch
from mininet.topolib import TreeTopo
def ifconfigTest( net ):
"Run ifconfig on all hosts in net."
hosts = net.hosts
for host in hosts:
info( host.cmd( 'ifconfig' ) )
if __name__ == '__main__':
lg.setLogLevel( 'info' )
info( "*** Initializing Mininet and kernel modules\n" )
OVSKernelSwitch.setup()
info( "*** Creating network\n" )
network = Mininet( TreeTopo( depth=2, fanout=2 ), switch=OVSKernelSwitch )
info( "*** Starting network\n" )
network.start()
info( "*** Running ping test\n" )
network.pingAll()
info( "*** Running ifconfig test\n" )
ifconfigTest( network )
info( "*** Starting CLI (type 'exit' to exit)\n" )
CLI( network )
info( "*** Stopping network\n" )
network.stop()
+112
View File
@@ -0,0 +1,112 @@
#!/usr/bin/python
"""
Example to create a Mininet topology and connect it to the internet via NAT
through eth0 on the host.
Glen Gibb, February 2011
(slight modifications by BL, 5/13)
"""
from mininet.cli import CLI
from mininet.log import lg
from mininet.node import Node
from mininet.topolib import TreeNet
#################################
def startNAT( root, inetIntf='eth0', subnet='10.0/8' ):
"""Start NAT/forwarding between Mininet and external network
root: node to access iptables from
inetIntf: interface for internet access
subnet: Mininet subnet (default 10.0/8)="""
# Identify the interface connecting to the mininet network
localIntf = root.defaultIntf()
# Flush any currently active rules
root.cmd( 'iptables -F' )
root.cmd( 'iptables -t nat -F' )
# Create default entries for unmatched traffic
root.cmd( 'iptables -P INPUT ACCEPT' )
root.cmd( 'iptables -P OUTPUT ACCEPT' )
root.cmd( 'iptables -P FORWARD DROP' )
# Configure NAT
root.cmd( 'iptables -I FORWARD -i', localIntf, '-d', subnet, '-j DROP' )
root.cmd( 'iptables -A FORWARD -i', localIntf, '-s', subnet, '-j ACCEPT' )
root.cmd( 'iptables -A FORWARD -i', inetIntf, '-d', subnet, '-j ACCEPT' )
root.cmd( 'iptables -t nat -A POSTROUTING -o ', inetIntf, '-j MASQUERADE' )
# Instruct the kernel to perform forwarding
root.cmd( 'sysctl net.ipv4.ip_forward=1' )
def stopNAT( root ):
"""Stop NAT/forwarding between Mininet and external network"""
# Flush any currently active rules
root.cmd( 'iptables -F' )
root.cmd( 'iptables -t nat -F' )
# Instruct the kernel to stop forwarding
root.cmd( 'sysctl net.ipv4.ip_forward=0' )
def fixNetworkManager( root, intf ):
"""Prevent network-manager from messing with our interface,
by specifying manual configuration in /etc/network/interfaces
root: a node in the root namespace (for running commands)
intf: interface name"""
cfile = '/etc/network/interfaces'
line = '\niface %s inet manual\n' % intf
config = open( cfile ).read()
if line not in config:
print '*** Adding', line.strip(), 'to', cfile
with open( cfile, 'a' ) as f:
f.write( line )
# Probably need to restart network-manager to be safe -
# hopefully this won't disconnect you
root.cmd( 'service network-manager restart' )
def connectToInternet( network, switch='s1', rootip='10.254', subnet='10.0/8'):
"""Connect the network to the internet
switch: switch to connect to root namespace
rootip: address for interface in root namespace
subnet: Mininet subnet"""
switch = network.get( switch )
prefixLen = subnet.split( '/' )[ 1 ]
# Create a node in root namespace
root = Node( 'root', inNamespace=False )
# Prevent network-manager from interfering with our interface
fixNetworkManager( root, 'root-eth0' )
# Create link between root NS and switch
link = network.addLink( root, switch )
link.intf1.setIP( rootip, prefixLen )
# Start network that now includes link to root namespace
network.start()
# Start NAT and establish forwarding
startNAT( root )
# Establish routes from end hosts
for host in network.hosts:
host.cmd( 'ip route flush root 0/0' )
host.cmd( 'route add -net', subnet, 'dev', host.defaultIntf() )
host.cmd( 'route add default gw', rootip )
return root
if __name__ == '__main__':
lg.setLogLevel( 'info')
net = TreeNet( depth=1, fanout=4 )
# Configure and start NATted connectivity
rootnode = connectToInternet( net )
print "*** Hosts are running and should have internet connectivity"
print "*** Type 'exit' or control-D to shut down network"
CLI( net )
# Shut down NAT
stopNAT( rootnode )
net.stop()
+69
View File
@@ -0,0 +1,69 @@
#!/usr/bin/python
"""
natnet.py: Example network with NATs
h0
|
s0
|
----------------
| |
nat1 nat2
| |
s1 s2
| |
h1 h2
"""
from mininet.topo import Topo
from mininet.net import Mininet
from mininet.nodelib import NAT
from mininet.log import setLogLevel
from mininet.cli import CLI
from mininet.util import irange
class InternetTopo(Topo):
"Single switch connected to n hosts."
def __init__(self, n=2, **opts):
Topo.__init__(self, **opts)
# set up inet switch
inetSwitch = self.addSwitch('s0')
# add inet host
inetHost = self.addHost('h0')
self.addLink(inetSwitch, inetHost)
# add local nets
for i in irange(1, n):
inetIntf = 'nat%d-eth0' % i
localIntf = 'nat%d-eth1' % i
localIP = '192.168.%d.1' % i
localSubnet = '192.168.%d.0/24' % i
natParams = { 'ip' : '%s/24' % localIP }
# add NAT to topology
nat = self.addNode('nat%d' % i, cls=NAT, subnet=localSubnet,
inetIntf=inetIntf, localIntf=localIntf)
switch = self.addSwitch('s%d' % i)
# connect NAT to inet and local switches
self.addLink(nat, inetSwitch, intfName1=inetIntf)
self.addLink(nat, switch, intfName1=localIntf, params1=natParams)
# add host and connect to local switch
host = self.addHost('h%d' % i,
ip='192.168.%d.100/24' % i,
defaultRoute='via %s' % localIP)
self.addLink(host, switch)
def run():
"Create network and run the CLI"
topo = InternetTopo()
net = Mininet(topo=topo)
net.start()
CLI(net)
net.stop()
if __name__ == '__main__':
setLogLevel('info')
run()
-79
View File
@@ -1,79 +0,0 @@
# -*- Mode:python; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
#
# Copyright (C) 2015-2019, The University of Memphis,
# Arizona Board of Regents,
# Regents of the University of California.
#
# This file is part of Mini-NDN.
# See AUTHORS.md for a complete list of Mini-NDN authors and contributors.
#
# Mini-NDN is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Mini-NDN is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Mini-NDN, e.g., in COPYING.md file.
# If not, see <http://www.gnu.org/licenses/>.
import time
import sys
from mininet.log import setLogLevel, info
from mininet.topo import Topo
from minindn.minindn import Minindn
from minindn.apps.app_manager import AppManager
from minindn.apps.nfd import Nfd
from minindn.apps.nlsr import Nlsr
from nlsr_common import getParser
if __name__ == '__main__':
setLogLevel('info')
topo = Topo()
h1 = topo.addHost('h1')
h2 = topo.addHost('h2')
topo.addLink(h1, h2, delay='10ms')
ndn = Minindn(parser=getParser(), topo=topo)
args = ndn.args
ndn.start()
nfds = AppManager(ndn, ndn.net.hosts, Nfd)
nlsrs = AppManager(ndn, [], Nlsr)
host1 = ndn.net.hosts[0]
nlsrs.startOnNode(host1, security=args.security, faceType=args.faceType,
nFaces=args.faces, routingType=args.routingType)
expectedTotalCount = 500
for i in range(0, expectedTotalCount):
host1.cmd('nlsrc advertise /long/name/to/exceed/max/packet/size/host1/{}'.format(i))
time.sleep(60)
host2 = ndn.net.hosts[1]
nlsrs.startOnNode(host2, security=args.security, faceType=args.faceType,
nFaces=args.faces, routingType=args.routingType)
time.sleep(60)
advertiseCount = int(host2.cmd('nfdc fib | grep host1 | wc -l'))
info(advertiseCount)
if advertiseCount == expectedTotalCount:
info('\nSuccessfully advertised {} prefixes\n'.format(expectedTotalCount))
else:
info('\nAdvertising {} prefixes failed. Exiting...\n'.format(expectedTotalCount))
ndn.stop()
sys.exit(1)
ndn.stop()
-64
View File
@@ -1,64 +0,0 @@
# -*- Mode:python; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
#
# Copyright (C) 2015-2019, The University of Memphis,
# Arizona Board of Regents,
# Regents of the University of California.
#
# This file is part of Mini-NDN.
# See AUTHORS.md for a complete list of Mini-NDN authors and contributors.
#
# Mini-NDN is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Mini-NDN is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Mini-NDN, e.g., in COPYING.md file.
# If not, see <http://www.gnu.org/licenses/>.
import time
from mininet.log import setLogLevel, info
from minindn.minindn import Minindn
from minindn.apps.app_manager import AppManager
from minindn.apps.nfd import Nfd
from minindn.apps.nlsr import Nlsr
from minindn.helpers.experiment import Experiment
from nlsr_common import getParser
if __name__ == '__main__':
setLogLevel('info')
ndn = Minindn(parser=getParser())
args = ndn.args
ndn.start()
nfds = AppManager(ndn, ndn.net.hosts, Nfd)
nlsrs = AppManager(ndn, [], Nlsr)
i = 1
info('Starting NLSR on nodes\n')
for host in ndn.net.hosts:
nlsrs.startOnNode(host, security=args.security, sync=args.sync, faceType=args.faceType,
nFaces=args.faces, routingType=args.routingType)
# Wait 1/2 minute between starting NLSRs
# Wait 1 hour before starting last NLSR
if i == len(ndn.net.hosts) - 1:
info('Sleeping 1 hour before starting last NLSR\n')
time.sleep(3600)
else:
time.sleep(30)
i += 1
Experiment.checkConvergence(ndn, ndn.net.hosts, args.ctime, quit=True)
ndn.stop()
-90
View File
@@ -1,90 +0,0 @@
# -*- Mode:python; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
#
# Copyright (C) 2015-2021, The University of Memphis,
# Arizona Board of Regents,
# Regents of the University of California.
#
# This file is part of Mini-NDN.
# See AUTHORS.md for a complete list of Mini-NDN authors and contributors.
#
# Mini-NDN is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Mini-NDN is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Mini-NDN, e.g., in COPYING.md file.
# If not, see <http://www.gnu.org/licenses/>.
import time
from mininet.log import setLogLevel, info
from minindn.minindn import Minindn
from minindn.util import MiniNDNCLI
from minindn.apps.app_manager import AppManager
from minindn.apps.nfd import Nfd
from minindn.apps.nlsr import Nlsr
from minindn.helpers.experiment import Experiment
from minindn.helpers.nfdc import Nfdc
from minindn.helpers.ndnping import NDNPing
from nlsr_common import getParser
def mcnFailure(ndn, nfds, nlsrs, args):
Experiment.checkConvergence(ndn, ndn.net.hosts, args.ctime, quit=True)
if args.nPings != 0:
Experiment.setupPing(ndn.net.hosts, Nfdc.STRATEGY_BEST_ROUTE)
pingedDict = Experiment.startPctPings(ndn.net, args.nPings, args.pctTraffic)
PING_COLLECTION_TIME_BEFORE_FAILURE = 60
PING_COLLECTION_TIME_AFTER_RECOVERY = 120
time.sleep(PING_COLLECTION_TIME_BEFORE_FAILURE)
mcn = max(ndn.net.hosts, key=lambda host: len(host.intfNames()))
info('Bringing down node {}\n'.format(mcn.name))
nlsrs[mcn.name].stop()
nfds[mcn.name].stop()
time.sleep(args.ctime)
info('Bringing up node {}\n'.format(mcn.name))
nfds[mcn.name].start()
nlsrs[mcn.name].start()
# Restart pings
if args.nPings != 0:
Experiment.setupPing([mcn], Nfdc.STRATEGY_BEST_ROUTE)
for nodeToPing in pingedDict[mcn]:
NDNPing.ping(mcn, nodeToPing, nPings=PING_COLLECTION_TIME_AFTER_RECOVERY)
time.sleep(PING_COLLECTION_TIME_AFTER_RECOVERY)
Experiment.checkConvergence(ndn, ndn.net.hosts, args.ctime, quit=True)
if __name__ == '__main__':
setLogLevel('info')
ndn = Minindn(parser=getParser())
args = ndn.args
ndn.start()
nfds = AppManager(ndn, ndn.net.hosts, Nfd)
nlsrs = AppManager(ndn, ndn.net.hosts, Nlsr, sync=args.sync,
security=args.security, faceType=args.faceType,
nFaces=args.faces, routingType=args.routingType)
mcnFailure(ndn, nfds, nlsrs, args)
if args.isCliEnabled:
MiniNDNCLI(ndn.net)
ndn.stop()
-109
View File
@@ -1,109 +0,0 @@
# -*- Mode:python; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
#
# Copyright (C) 2015-2021, The University of Memphis,
# Arizona Board of Regents,
# Regents of the University of California.
#
# This file is part of Mini-NDN.
# See AUTHORS.md for a complete list of Mini-NDN authors and contributors.
#
# Mini-NDN is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Mini-NDN is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Mini-NDN, e.g., in COPYING.md file.
# If not, see <http://www.gnu.org/licenses/>.
import time
from mininet.log import setLogLevel, info
from minindn.minindn import Minindn
from minindn.util import MiniNDNCLI
from minindn.apps.app_manager import AppManager
from minindn.apps.nfd import Nfd
from minindn.apps.nlsr import Nlsr
from minindn.helpers.experiment import Experiment
from minindn.helpers.nfdc import Nfdc
from minindn.helpers.ndnping import NDNPing
from nlsr_common import getParser
def multipleFailure(ndn, nfds, nlsrs, args):
Experiment.checkConvergence(ndn, ndn.net.hosts, args.ctime, quit=True)
Experiment.setupPing(ndn.net.hosts, Nfdc.STRATEGY_BEST_ROUTE)
PING_COLLECTION_TIME_BEFORE_FAILURE = 60
FAILURE_INTERVAL = 60
RECOVERY_INTERVAL = 60
# Number of pings required to make it through the full experiment
nInitialPings = (PING_COLLECTION_TIME_BEFORE_FAILURE +
len(ndn.net.hosts) * (FAILURE_INTERVAL + RECOVERY_INTERVAL))
print('Scheduling with {} initial pings'.format(nInitialPings))
pingedDict = Experiment.startPctPings(ndn.net, nInitialPings, args.pctTraffic)
time.sleep(PING_COLLECTION_TIME_BEFORE_FAILURE)
nNodesRemainingToFail = len(ndn.net.hosts)
for host in ndn.net.hosts:
# Fail the node
info('Bringing down node {}\n'.format(host.name))
nlsrs[host.name].stop()
nfds[host.name].stop()
# Stay in failure state for FAILURE_INTERVAL seconds
time.sleep(FAILURE_INTERVAL)
# Bring the node back up
start_time = time.time()
info('Bringing up node {}\n'.format(host.name))
nfds[host.name].start()
nlsrs[host.name].start()
Experiment.setupPing([host], Nfdc.STRATEGY_BEST_ROUTE)
recovery_time = int(time.time() - start_time)
# Number of pings required to reach the end of the test
nNodesRemainingToFail -= 1
nPings = ((RECOVERY_INTERVAL - recovery_time) +
nNodesRemainingToFail * (FAILURE_INTERVAL + RECOVERY_INTERVAL))
info('Scheduling with {} remaining pings\n'.format(nPings))
# Restart pings
for nodeToPing in pingedDict[host]:
NDNPing.ping(host, nodeToPing, nPings=nPings)
time.sleep(RECOVERY_INTERVAL - recovery_time)
Experiment.checkConvergence(ndn, ndn.net.hosts, args.ctime, quit=True)
if __name__ == '__main__':
setLogLevel('info')
ndn = Minindn(parser=getParser())
args = ndn.args
ndn.start()
nfds = AppManager(ndn, ndn.net.hosts, Nfd)
nlsrs = AppManager(ndn, ndn.net.hosts, Nlsr, sync=args.sync,
security=args.security, faceType=args.faceType,
nFaces=args.faces, routingType=args.routingType)
multipleFailure(ndn, nfds, nlsrs, args)
if args.isCliEnabled:
MiniNDNCLI(ndn.net)
ndn.stop()
-57
View File
@@ -1,57 +0,0 @@
# -*- Mode:python; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
#
# Copyright (C) 2015-2019, The University of Memphis,
# Arizona Board of Regents,
# Regents of the University of California.
#
# This file is part of Mini-NDN.
# See AUTHORS.md for a complete list of Mini-NDN authors and contributors.
#
# Mini-NDN is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Mini-NDN is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Mini-NDN, e.g., in COPYING.md file.
# If not, see <http://www.gnu.org/licenses/>.
import argparse
def getParser():
parser = argparse.ArgumentParser()
parser.add_argument('--ctime', type=int, default=60,
help='Specify convergence time for the topology (Default: 60 seconds)')
parser.add_argument('--faces', type=int, default=3,
help='Specify number of max faces per prefix for NLSR 0-60')
parser.add_argument('--routing', dest='routingType', default='link-state',
choices=['link-state', 'hr', 'dry'],
help='''Choose routing type, dry = link-state is used
but hr is calculated for comparision.''')
parser.add_argument('--sync', dest='sync', default='psync',
choices=['chronosync', 'psync'],
help='choose the sync protocol to be used by NLSR.')
parser.add_argument('--security', action='store_true', dest='security',
help='Enables NLSR security')
parser.add_argument('--face-type', dest='faceType', default='udp', choices=['udp', 'tcp'])
parser.add_argument('--no-cli', action='store_false', dest='isCliEnabled',
help='Run experiments and exit without showing the command line interface')
parser.add_argument('--pct-traffic', dest='pctTraffic', type=float, default=1.0,
help='Specify the percentage of nodes each node should ping')
parser.add_argument('--nPings', type=int, default=300,
help='Number of pings to perform between each node in the experiment')
return parser
-63
View File
@@ -1,63 +0,0 @@
# -*- Mode:python; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
#
# Copyright (C) 2015-2019, The University of Memphis,
# Arizona Board of Regents,
# Regents of the University of California.
#
# This file is part of Mini-NDN.
# See AUTHORS.md for a complete list of Mini-NDN authors and contributors.
#
# Mini-NDN is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Mini-NDN is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Mini-NDN, e.g., in COPYING.md file.
# If not, see <http://www.gnu.org/licenses/>.
import time
from mininet.log import setLogLevel
from minindn.minindn import Minindn
from minindn.util import MiniNDNCLI
from minindn.apps.app_manager import AppManager
from minindn.apps.nfd import Nfd
from minindn.apps.nlsr import Nlsr
from minindn.helpers.experiment import Experiment
from minindn.helpers.nfdc import Nfdc
from nlsr_common import getParser
if __name__ == '__main__':
setLogLevel('info')
ndn = Minindn(parser=getParser())
args = ndn.args
ndn.start()
nfds = AppManager(ndn, ndn.net.hosts, Nfd)
nlsrs = AppManager(ndn, ndn.net.hosts, Nlsr, sync=args.sync,
security=args.security, faceType=args.faceType,
nFaces=args.faces, routingType=args.routingType,
logLevel='ndn.*=TRACE:nlsr.*=TRACE')
Experiment.checkConvergence(ndn, ndn.net.hosts, args.ctime, quit=False)
if args.nPings != 0:
Experiment.setupPing(ndn.net.hosts, Nfdc.STRATEGY_BEST_ROUTE)
Experiment.startPctPings(ndn.net, args.nPings, args.pctTraffic)
time.sleep(args.nPings + 10)
if args.isCliEnabled:
MiniNDNCLI(ndn.net)
ndn.stop()
-85
View File
@@ -1,85 +0,0 @@
# -*- Mode:python; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
#
# Copyright (C) 2015-2021, The University of Memphis,
# Arizona Board of Regents,
# Regents of the University of California.
#
# This file is part of Mini-NDN.
# See AUTHORS.md for a complete list of Mini-NDN authors and contributors.
#
# Mini-NDN is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Mini-NDN is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Mini-NDN, e.g., in COPYING.md file.
# If not, see <http://www.gnu.org/licenses/>.
import time
import sys
from mininet.log import setLogLevel, info
from minindn.minindn import Minindn
from minindn.util import MiniNDNCLI
from minindn.apps.app_manager import AppManager
from minindn.apps.nfd import Nfd
from minindn.apps.nlsr import Nlsr
from minindn.helpers.experiment import Experiment
from nlsr_common import getParser
if __name__ == '__main__':
setLogLevel('info')
ndn = Minindn(parser=getParser())
args = ndn.args
ndn.start()
nfds = AppManager(ndn, ndn.net.hosts, Nfd)
nlsrs = AppManager(ndn, ndn.net.hosts, Nlsr, sync=args.sync,
security=args.security, faceType=args.faceType,
nFaces=args.faces, routingType=args.routingType)
Experiment.checkConvergence(ndn, ndn.net.hosts, args.ctime, quit=True)
firstNode = ndn.net.hosts[0]
if args.security:
firstNode.cmd('ndnsec-set-default /ndn/{}-site/%C1.Operator/op'.format(firstNode.name))
info('Testing advertise\n')
firstNode.cmd('nlsrc advertise /testPrefix')
time.sleep(30)
for host in ndn.net.hosts:
if host.name != firstNode.name:
if (int(host.cmd('nfdc fib | grep testPrefix | wc -l')) != 1 or
int(host.cmd('nlsrc status | grep testPrefix | wc -l')) != 1):
info('Advertise test failed\n')
ndn.stop()
sys.exit(1)
info('Testing withdraw\n')
firstNode.cmd('nlsrc withdraw /testPrefix')
time.sleep(30)
for host in ndn.net.hosts:
if host.name != firstNode.name:
if (int(host.cmd('nfdc fib | grep testPrefix | wc -l')) != 0 or
int(host.cmd('nlsrc status | grep testPrefix | wc -l')) != 0):
info('Withdraw test failed\n')
ndn.stop()
sys.exit(1)
if args.isCliEnabled:
MiniNDNCLI(ndn.net)
ndn.stop()
+79
View File
@@ -0,0 +1,79 @@
#!/usr/bin/python
"""
Create a network with 5 hosts, numbered 1-4 and 9.
Validate that the port numbers match to the interface name,
and that the ovs ports match the mininet ports.
"""
from mininet.net import Mininet
from mininet.node import Controller
from mininet.log import setLogLevel, info, warn
def validatePort( switch, intf ):
"Validate intf's OF port number"
ofport = int( switch.cmd( 'ovs-vsctl get Interface', intf,
'ofport' ) )
if ofport != switch.ports[ intf ]:
warn( 'WARNING: ofport for', intf, 'is actually', ofport, '\n' )
return 0
else:
return 1
def testPortNumbering():
"""Test port numbering:
Create a network with 5 hosts (using Mininet's
mid-level API) and check that implicit and
explicit port numbering works as expected."""
net = Mininet( controller=Controller )
info( '*** Adding controller\n' )
net.addController( 'c0' )
info( '*** Adding hosts\n' )
h1 = net.addHost( 'h1', ip='10.0.0.1' )
h2 = net.addHost( 'h2', ip='10.0.0.2' )
h3 = net.addHost( 'h3', ip='10.0.0.3' )
h4 = net.addHost( 'h4', ip='10.0.0.4' )
h5 = net.addHost( 'h5', ip='10.0.0.5' )
info( '*** Adding switch\n' )
s1 = net.addSwitch( 's1' )
info( '*** Creating links\n' )
# host 1-4 connect to ports 1-4 on the switch
net.addLink( h1, s1 )
net.addLink( h2, s1 )
net.addLink( h3, s1 )
net.addLink( h4, s1 )
# specify a different port to connect host 5 to on the switch.
net.addLink( h5, s1, port1=1, port2= 9)
info( '*** Starting network\n' )
net.start()
# print the interfaces and their port numbers
info( '\n*** printing and validating the ports '
'running on each interface\n' )
for intfs in s1.intfList():
if not intfs.name == "lo":
info( intfs, ': ', s1.ports[intfs],
'\n' )
info( 'Validating that', intfs,
'is actually on port', s1.ports[intfs], '... ' )
if validatePort( s1, intfs ):
info( 'Validated.\n' )
print '\n'
# test the network with pingall
net.pingAll()
print '\n'
info( '*** Stopping network' )
net.stop()
if __name__ == '__main__':
setLogLevel( 'info' )
testPortNumbering()
-53
View File
@@ -1,53 +0,0 @@
# -*- Mode:python; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
#
# Copyright (C) 2015-2020, The University of Memphis,
# Arizona Board of Regents,
# Regents of the University of California.
#
# This file is part of Mini-NDN.
# See AUTHORS.md for a complete list of Mini-NDN authors and contributors.
#
# Mini-NDN is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Mini-NDN is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Mini-NDN, e.g., in COPYING.md file.
# If not, see <http://www.gnu.org/licenses/>.
from mininet.log import setLogLevel, info
from minindn.minindn import Minindn
from minindn.apps.app_manager import AppManager
from minindn.util import MiniNDNCLI
from minindn.apps.nfd import Nfd
from minindn.apps.nlsr import Nlsr
from minindn.apps.tshark import Tshark
if __name__ == '__main__':
setLogLevel('info')
Minindn.cleanUp()
Minindn.verifyDependencies()
ndn = Minindn()
ndn.start()
info('Starting tshark logging on nodes\n')
tshark = AppManager(ndn, ndn.net.hosts, Tshark, logFolder="./log/", singleLogFile=False)
info('Starting NFD on nodes\n')
nfds = AppManager(ndn, ndn.net.hosts, Nfd)
info('Starting NLSR on nodes\n')
nlsrs = AppManager(ndn, ndn.net.hosts, Nlsr)
MiniNDNCLI(ndn.net)
ndn.stop()
-121
View File
@@ -1,121 +0,0 @@
# -*- Mode:python; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
#
# Copyright (C) 2015-2021, The University of Memphis,
# Arizona Board of Regents,
# Regents of the University of California.
#
# This file is part of Mini-NDN.
# See AUTHORS.md for a complete list of Mini-NDN authors and contributors.
#
# Mini-NDN is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Mini-NDN is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Mini-NDN, e.g., in COPYING.md file.
# If not, see <http://www.gnu.org/licenses/>.
from subprocess import PIPE
from mininet.log import setLogLevel, info
from mininet.topo import Topo
from minindn.minindn import Minindn
from minindn.apps.app_manager import AppManager
from minindn.util import MiniNDNCLI, getPopen
from minindn.apps.nfd import Nfd
from minindn.helpers.nfdc import Nfdc
PREFIX = "/example"
def printOutput(output):
_out = output.decode("utf-8").split("\n")
for _line in _out:
info(_line + "\n")
def run():
Minindn.cleanUp()
Minindn.verifyDependencies()
# Topology can be created/modified using Mininet topo object
topo = Topo()
info("Setup\n")
# add hosts
a = topo.addHost('a')
b = topo.addHost('b')
c = topo.addHost('c')
# add links
topo.addLink(a, b, delay='10ms', bw=2.5) # bw = bandwidth
topo.addLink(b, c, delay='10ms', bw=2.5)
info(topo.links(withInfo=True))
ndn = Minindn(topo=topo)
ndn.start()
# configure and start nfd on each node
info("Configuring NFD111\n")
AppManager(ndn, ndn.net.hosts, Nfd, logLevel="DEBUG")
"""
There are multiple ways of setting up routes in Mini-NDN
refer: https://minindn.memphis.edu/experiment.html#routing-options
It can also be set manually as follows. The important bit to note here
is the use of the Nfdc command
"""
for link in topo.links(withInfo=True):
node1, node2, node_info = link
host1 = ndn.net[node1]
host2 = ndn.net[node2]
interface = host2.connectionsTo(host1)[0][0]
interface_ip = interface.IP()
bandwidth = interface.params.get("bw", 100) * 1000000
info(f"Setting up route from {node1} to {node2} with bandwidth {bandwidth}\n")
Nfdc.createFace(host1, interface_ip, bandwidth=bandwidth)
Nfdc.registerRoute(host1, PREFIX, interface_ip, cost=0)
# links = {"a":["b"], "b":["c"]}
# for first in links:
# for second in links[first]:
# host1 = ndn.net[first]
# host2 = ndn.net[second]
# interface = host2.connectionsTo(host1)[0][0]
# interface_ip = interface.IP()
# Nfdc.createFace(host1, interface_ip)
# Nfdc.registerRoute(host1, PREFIX, interface_ip, cost=0)
# Start ping server
info("Starting pings...\n")
pingserver_log = open("{}/c/ndnpingserver.log".format(ndn.workDir), "w")
getPopen(ndn.net["c"], "ndnpingserver {}".format(PREFIX), stdout=pingserver_log,\
stderr=pingserver_log)
# start ping client
ping1 = getPopen(ndn.net["a"], "ndnping {} -c 5".format(PREFIX), stdout=PIPE, stderr=PIPE)
ping1.wait()
printOutput(ping1.stdout.read())
interface = ndn.net["b"].connectionsTo(ndn.net["a"])[0][0]
info("Failing link\n") # failing link by setting link loss to 100%
interface.config(delay="10ms", bw=10, loss=100)
info ("\n starting ping2 client \n")
ping2 = getPopen(ndn.net["a"], "ndnping {} -c 5".format(PREFIX), stdout=PIPE, stderr=PIPE)
ping2.wait()
printOutput(ping2.stdout.read())
interface.config(delay="10ms", bw=10, loss=0) # bringing back the link
info("\nExperiment Completed!\n")
MiniNDNCLI(ndn.net)
ndn.stop()
if __name__ == '__main__':
setLogLevel("info")
run()
+36
View File
@@ -0,0 +1,36 @@
#!/usr/bin/python
"""
This example monitors a number of hosts using host.popen() and
pmonitor()
"""
from mininet.net import Mininet
from mininet.node import CPULimitedHost
from mininet.topo import SingleSwitchTopo
from mininet.log import setLogLevel
from mininet.util import custom, pmonitor
def monitorhosts( hosts=5, sched='cfs' ):
"Start a bunch of pings and monitor them using popen"
mytopo = SingleSwitchTopo( hosts )
cpu = .5 / hosts
myhost = custom( CPULimitedHost, cpu=cpu, sched=sched )
net = Mininet( topo=mytopo, host=myhost )
net.start()
# Start a bunch of pings
popens = {}
last = net.hosts[ -1 ]
for host in net.hosts:
popens[ host ] = host.popen( "ping -c5 %s" % last.IP() )
last = host
# Monitor them and print output
for host, line in pmonitor( popens ):
if host:
print "<%s>: %s" % ( host.name, line.strip() )
# Done
net.stop()
if __name__ == '__main__':
setLogLevel( 'info' )
monitorhosts( hosts=5 )
+33
View File
@@ -0,0 +1,33 @@
#!/usr/bin/python
"Monitor multiple hosts using popen()/pmonitor()"
from mininet.net import Mininet
from mininet.topo import SingleSwitchTopo
from mininet.util import pmonitor
from time import time
from signal import SIGINT
def pmonitorTest( N=3, seconds=10 ):
"Run pings and monitor multiple hosts using pmonitor"
topo = SingleSwitchTopo( N )
net = Mininet( topo )
net.start()
hosts = net.hosts
print "Starting test..."
server = hosts[ 0 ]
popens = {}
for h in hosts:
popens[ h ] = h.popen('ping', server.IP() )
print "Monitoring output for", seconds, "seconds"
endTime = time() + seconds
for h, line in pmonitor( popens, timeoutms=500 ):
if h:
print '<%s>: %s' % ( h.name, line ),
if time() >= endTime:
for p in popens.values():
p.send_signal( SIGINT )
net.stop()
if __name__ == '__main__':
pmonitorTest()
-81
View File
@@ -1,81 +0,0 @@
# -*- Mode:python; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
#
# Copyright (C) 2015-2019, The University of Memphis,
# Arizona Board of Regents,
# Regents of the University of California.
#
# This file is part of Mini-NDN.
# See AUTHORS.md for a complete list of Mini-NDN authors and contributors.
#
# Mini-NDN is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Mini-NDN is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Mini-NDN, e.g., in COPYING.md file.
# If not, see <http://www.gnu.org/licenses/>.
import time
import sys
from mininet.log import setLogLevel, info
from minindn.minindn import Minindn
from minindn.apps.app_manager import AppManager
from minindn.apps.nfd import Nfd
from minindn.helpers.nfdc import Nfdc
def registerRouteToAllNeighbors(ndn, host, syncPrefix):
for node in ndn.net.hosts:
for neighbor in node.connectionsTo(host):
ip = node.IP(neighbor[0])
faceID = Nfdc.createFace(host, ip)
Nfdc.registerRoute(host, syncPrefix, faceID)
if __name__ == '__main__':
setLogLevel('info')
ndn = Minindn()
args = ndn.args
ndn.start()
nfds = AppManager(ndn, ndn.net.hosts, Nfd)
syncPrefix = "/sync"
numUserPrefixesPerNode = 2
maxUpdatesPerUserPrefixPerNode = 3
for host in ndn.net.hosts:
Nfdc.setStrategy(host, syncPrefix, Nfdc.STRATEGY_MULTICAST)
registerRouteToAllNeighbors(ndn, host, syncPrefix)
info('Starting psync-full-sync on all the nodes\n')
for host in ndn.net.hosts:
host.cmd('export NDN_LOG=examples.FullSyncApp=INFO')
host.cmd('psync-full-sync {} {} {} {} &> psync.logs &'
.format(syncPrefix, host.name, numUserPrefixesPerNode,
maxUpdatesPerUserPrefixPerNode))
info('Sleeping 5 minutes for convergence\n')
# Estimated time for 4 node default topology
time.sleep(300)
totalUpdates = int(host.cmd('grep -r Update {}/*/psync.logs | wc -l'
.format(ndn.workDir)))
expectedUpdates = (maxUpdatesPerUserPrefixPerNode *
len(ndn.net.hosts) * (len(ndn.net.hosts) - 1) * numUserPrefixesPerNode)
if totalUpdates == expectedUpdates:
info('PSync full sync has successfully converged.\n')
else:
info('PSync full sync convergence was not successful. Exiting...\n')
ndn.stop()
sys.exit(1)
-67
View File
@@ -1,67 +0,0 @@
# -*- Mode:python; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
#
# Copyright (C) 2015-2019, The University of Memphis,
# Arizona Board of Regents,
# Regents of the University of California.
#
# This file is part of Mini-NDN.
# See AUTHORS.md for a complete list of Mini-NDN authors and contributors.
#
# Mini-NDN is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Mini-NDN is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Mini-NDN, e.g., in COPYING.md file.
# If not, see <http://www.gnu.org/licenses/>.
import time
import sys
from mininet.log import setLogLevel, info
from mininet.topo import Topo
from minindn.minindn import Minindn
from minindn.apps.app_manager import AppManager
from minindn.apps.nfd import Nfd
if __name__ == '__main__':
setLogLevel('info')
topo = Topo()
topo.addHost('h1')
ndn = Minindn(topo=topo)
args = ndn.args
ndn.start()
nfds = AppManager(ndn, ndn.net.hosts, Nfd)
host1 = ndn.net.hosts[0]
host1.cmd('export NDN_LOG=examples.PartialSyncProducerApp=INFO')
host1.cmd('psync-producer /sync /{} 10 1 &> producer.log &'.format(host1.name))
time.sleep(1)
host1.cmd('export NDN_LOG=examples.PartialSyncConsumerApp=INFO:$NDN_LOG')
host1.cmd('psync-consumer /sync 5 &> consumer.log &')
info('Sleeping 90 seconds for convergence\n')
time.sleep(90)
consumerSubs = int(host1.cmd('cat consumer.log | grep -c Subscribing'))
consumerUpdates = int(host1.cmd('cat consumer.log | grep -c Update'))
producerPublish = int(host1.cmd('cat producer.log | grep -c Publish'))
if consumerSubs == 5 and consumerUpdates == 5 and producerPublish == 10:
info('PSync partial sync has successfully converged.\n')
else:
info('PSync partial sync convergence was not successful. Exiting...\n')
ndn.stop()
sys.exit(1)
-111
View File
@@ -1,111 +0,0 @@
# -*- Mode:python; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
#
# Copyright (C) 2015-2021, The University of Memphis,
# Arizona Board of Regents,
# Regents of the University of California.
#
# This file is part of Mini-NDN.
# See AUTHORS.md for a complete list of Mini-NDN authors and contributors.
#
# Mini-NDN is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Mini-NDN is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Mini-NDN, e.g., in COPYING.md file.
# If not, see <http://www.gnu.org/licenses/>.
from subprocess import PIPE
from mininet.log import setLogLevel, info
from mininet.topo import Topo
from minindn.minindn import Minindn
from minindn.apps.app_manager import AppManager
from minindn.util import MiniNDNCLI, getPopen
from minindn.apps.nfd import Nfd
from minindn.helpers.nfdc import Nfdc
PREFIX = "/A"
def printOutput(output):
_out = output.decode("utf-8").split("\n")
for _line in _out:
info(_line + "\n")
def run():
Minindn.cleanUp()
Minindn.verifyDependencies()
# Topology can be created/modified using Mininet topo object
topo = Topo()
info("Setup\n")
# add hosts
a = topo.addHost('a')
b = topo.addHost('b')
# add links
topo.addLink(a, b, delay='10ms', bw=10) # bw = bandwidth
info(topo.links(withInfo=True))
ndn = Minindn(topo=topo)
ndn.start()
# configure and start nfd on each node
info("Configuring NFD\n")
AppManager(ndn, ndn.net.hosts, Nfd, logLevel="INFO")
"""
There are multiple ways of setting up routes in Mini-NDN
refer: https://minindn.memphis.edu/experiment.html#routing-options
It can also be set manually as follows. The important bit to note here
is the use of the Nfdc command
"""
for link in topo.links(withInfo=True):
node1, node2, node_info = link
host1 = ndn.net[node1]
host2 = ndn.net[node2]
interface = host2.connectionsTo(host1)[0][0]
interface_ip = interface.IP()
bandwidth = interface.params.get("bw", 100) * 1000000
info(f"Setting up route from {node1} to {node2} with bandwidth {bandwidth}\n")
Nfdc.createFace(host1, interface_ip, bandwidth=bandwidth)
Nfdc.registerRoute(host1, PREFIX, interface_ip, cost=0)
# Start cc server
info("Starting cc...\n")
qsccp_server_log = open(f"{ndn.workDir}/qsccp-demo/qsccp-server.log", "w")
getPopen(ndn.net["b"], "cc-producer --prefix {}".format(PREFIX), stdout=qsccp_server_log,\
stderr=qsccp_server_log)
# start cc client
qsccp_client_log = open(f"{ndn.workDir}/qsccp-demo/qsccp-client.log", "w")
ping1 = getPopen(ndn.net["a"], "qsccp-client --prefix {} --timingStop 10000".format(PREFIX), stdout=qsccp_client_log, stderr=qsccp_client_log)
ping1.wait()
# printOutput(ping1.stdout.read())
# interface = ndn.net["b"].connectionsTo(ndn.net["a"])[0][0]
# info("Failing link\n") # failing link by setting link loss to 100%
# interface.config(delay="10ms", bw=10, loss=100)
# info ("\n starting ping2 client \n")
# ping2 = getPopen(ndn.net["a"], "ndnping {} -c 5".format(PREFIX), stdout=PIPE, stderr=PIPE)
# ping2.wait()
# printOutput(ping2.stdout.read())
# interface.config(delay="10ms", bw=10, loss=0) # bringing back the link
info("\nExperiment Completed!\n")
MiniNDNCLI(ndn.net)
ndn.stop()
if __name__ == '__main__':
setLogLevel("info")
run()
+68
View File
@@ -0,0 +1,68 @@
#!/usr/bin/python
"""
Build a simple network from scratch, using mininet primitives.
This is more complicated than using the higher-level classes,
but it exposes the configuration details and allows customization.
For most tasks, the higher-level API will be preferable.
"""
from mininet.net import Mininet
from mininet.node import Node
from mininet.link import Link
from mininet.log import setLogLevel, info
from mininet.util import quietRun
from time import sleep
def scratchNet( cname='controller', cargs='-v ptcp:' ):
"Create network from scratch using Open vSwitch."
info( "*** Creating nodes\n" )
controller = Node( 'c0', inNamespace=False )
switch = Node( 's0', inNamespace=False )
h0 = Node( 'h0' )
h1 = Node( 'h1' )
info( "*** Creating links\n" )
Link( h0, switch )
Link( h1, switch )
info( "*** Configuring hosts\n" )
h0.setIP( '192.168.123.1/24' )
h1.setIP( '192.168.123.2/24' )
info( str( h0 ) + '\n' )
info( str( h1 ) + '\n' )
info( "*** Starting network using Open vSwitch\n" )
controller.cmd( cname + ' ' + cargs + '&' )
switch.cmd( 'ovs-vsctl del-br dp0' )
switch.cmd( 'ovs-vsctl add-br dp0' )
for intf in switch.intfs.values():
print switch.cmd( 'ovs-vsctl add-port dp0 %s' % intf )
# Note: controller and switch are in root namespace, and we
# can connect via loopback interface
switch.cmd( 'ovs-vsctl set-controller dp0 tcp:127.0.0.1:6633' )
info( '*** Waiting for switch to connect to controller' )
while 'is_connected' not in quietRun( 'ovs-vsctl show' ):
sleep( 1 )
info( '.' )
info( '\n' )
info( "*** Running test\n" )
h0.cmdPrint( 'ping -c1 ' + h1.IP() )
info( "*** Stopping network\n" )
controller.cmd( 'kill %' + cname )
switch.cmd( 'ovs-vsctl del-br dp0' )
switch.deleteIntfs()
info( '\n' )
if __name__ == '__main__':
setLogLevel( 'info' )
info( '*** Scratch network demo (kernel datapath)\n' )
Mininet.init()
scratchNet()
+73
View File
@@ -0,0 +1,73 @@
#!/usr/bin/python
"""
Build a simple network from scratch, using mininet primitives.
This is more complicated than using the higher-level classes,
but it exposes the configuration details and allows customization.
For most tasks, the higher-level API will be preferable.
This version uses the user datapath and an explicit control network.
"""
from mininet.net import Mininet
from mininet.node import Node
from mininet.link import Link
from mininet.log import setLogLevel, info
def linkIntfs( node1, node2 ):
"Create link from node1 to node2 and return intfs"
link = Link( node1, node2 )
return link.intf1, link.intf2
def scratchNetUser( cname='controller', cargs='ptcp:' ):
"Create network from scratch using user switch."
# It's not strictly necessary for the controller and switches
# to be in separate namespaces. For performance, they probably
# should be in the root namespace. However, it's interesting to
# see how they could work even if they are in separate namespaces.
info( '*** Creating Network\n' )
controller = Node( 'c0' )
switch = Node( 's0')
h0 = Node( 'h0' )
h1 = Node( 'h1' )
cintf, sintf = linkIntfs( controller, switch )
h0intf, sintf1 = linkIntfs( h0, switch )
h1intf, sintf2 = linkIntfs( h1, switch )
info( '*** Configuring control network\n' )
controller.setIP( '10.0.123.1/24', intf=cintf )
switch.setIP( '10.0.123.2/24', intf=sintf)
info( '*** Configuring hosts\n' )
h0.setIP( '192.168.123.1/24', intf=h0intf )
h1.setIP( '192.168.123.2/24', intf=h1intf )
info( '*** Network state:\n' )
for node in controller, switch, h0, h1:
info( str( node ) + '\n' )
info( '*** Starting controller and user datapath\n' )
controller.cmd( cname + ' ' + cargs + '&' )
switch.cmd( 'ifconfig lo 127.0.0.1' )
intfs = [ str( i ) for i in sintf1, sintf2 ]
switch.cmd( 'ofdatapath -i ' + ','.join( intfs ) + ' ptcp: &' )
switch.cmd( 'ofprotocol tcp:' + controller.IP() + ' tcp:localhost &' )
info( '*** Running test\n' )
h0.cmdPrint( 'ping -c1 ' + h1.IP() )
info( '*** Stopping network\n' )
controller.cmd( 'kill %' + cname )
switch.cmd( 'kill %ofdatapath' )
switch.cmd( 'kill %ofprotocol' )
switch.deleteIntfs()
info( '\n' )
if __name__ == '__main__':
setLogLevel( 'info' )
info( '*** Scratch network demo (user datapath)\n' )
Mininet.init()
scratchNetUser()
+48
View File
@@ -0,0 +1,48 @@
#!/usr/bin/python
"""
Simple example of setting network and CPU parameters
NOTE: link params limit BW, add latency, and loss.
There is a high chance that pings WILL fail and that
iperf will hang indefinitely if the TCP handshake fails
to complete.
"""
from mininet.topo import Topo
from mininet.net import Mininet
from mininet.node import CPULimitedHost
from mininet.link import TCLink
from mininet.util import dumpNodeConnections
from mininet.log import setLogLevel
class SingleSwitchTopo(Topo):
"Single switch connected to n hosts."
def __init__(self, n=2, **opts):
Topo.__init__(self, **opts)
switch = self.addSwitch('s1')
for h in range(n):
# Each host gets 50%/n of system CPU
host = self.addHost('h%s' % (h + 1),
cpu=.5 / n)
# 10 Mbps, 5ms delay, 10% loss
self.addLink(host, switch,
bw=10, delay='5ms', loss=10, use_htb=True)
def perfTest():
"Create network and run simple performance test"
topo = SingleSwitchTopo( n=4 )
net = Mininet( topo=topo,
host=CPULimitedHost, link=TCLink,
autoStaticArp=True )
net.start()
print "Dumping host connections"
dumpNodeConnections(net.hosts)
print "Testing bandwidth between h1 and h4"
h1, h4 = net.getNodeByName('h1', 'h4')
net.iperf( ( h1, h4 ), l4Type='UDP' )
net.stop()
if __name__ == '__main__':
setLogLevel('info')
perfTest()
+85
View File
@@ -0,0 +1,85 @@
#!/usr/bin/python
"""
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
"""
import sys
from mininet.net import Mininet
from mininet.cli import CLI
from mininet.log import lg
from mininet.node import Node
from mininet.topolib import TreeTopo
from mininet.util import waitListening
def TreeNet( depth=1, fanout=2, **kwargs ):
"Convenience function for creating tree networks."
topo = TreeTopo( depth, fanout )
return Mininet( topo, **kwargs )
def connectToRootNS( network, switch, ip, routes ):
"""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"""
# Create a node in root namespace and link to switch 0
root = Node( 'root', inNamespace=False )
intf = network.addLink( root, switch ).intf1
root.setIP( ip, intf=intf )
# Start network that now includes link to root namespace
network.start()
# Add routes from root ns to hosts
for route in routes:
root.cmd( 'route add -net ' + route + ' dev ' + str( intf ) )
def sshd( network, cmd='/usr/sbin/sshd', opts='-D',
ip='10.123.123.1/32', routes=None, switch=None ):
"""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)"""
if not switch:
switch = network[ 's1' ] # switch to use
if not routes:
routes = [ '10.0.0.0/24' ]
connectToRootNS( network, switch, ip, routes )
for host in network.hosts:
host.cmd( cmd + ' ' + opts + '&' )
print "*** Waiting for ssh daemons to start"
for server in network.hosts:
waitListening( server=server, port=22, timeout=5 )
print
print "*** Hosts are running sshd at the following addresses:"
print
for host in network.hosts:
print host.name, host.IP()
print
print "*** Type 'exit' or control-D to shut down network"
CLI( network )
for host in network.hosts:
host.cmd( 'kill %' + cmd )
network.stop()
if __name__ == '__main__':
lg.setLogLevel( 'info')
net = TreeNet( depth=1, fanout=4 )
# get sshd args from the command line or use default args
# useDNS=no -u0 to avoid reverse DNS lookup timeout
argvopts = ' '.join( sys.argv[ 1: ] ) if len( sys.argv ) > 1 else (
'-D -o UseDNS=no -u0' )
sshd( net, opts=argvopts )
-100
View File
@@ -1,100 +0,0 @@
# -*- Mode:python; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
#
# Copyright (C) 2015-2020, The University of Memphis,
# Arizona Board of Regents,
# Regents of the University of California.
#
# This file is part of Mini-NDN.
# See AUTHORS.md for a complete list of Mini-NDN authors and contributors.
#
# Mini-NDN is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Mini-NDN is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Mini-NDN, e.g., in COPYING.md file.
# If not, see <http://www.gnu.org/licenses/>.
import argparse
import sys
from mininet.log import setLogLevel, info
from mininet.topo import Topo
from minindn.minindn import Minindn
from minindn.util import MiniNDNCLI
from minindn.apps.app_manager import AppManager
from minindn.apps.nfd import Nfd
from minindn.helpers.ndn_routing_helper import NdnRoutingHelper
if __name__ == '__main__':
setLogLevel('info')
Minindn.cleanUp()
Minindn.verifyDependencies()
parser = argparse.ArgumentParser()
parser.add_argument('--face-type', dest='faceType', default='udp', choices=['udp', 'tcp'])
parser.add_argument('--routing', dest='routingType', default='link-state',
choices=['link-state', 'hr', 'dry'],
help='''Choose routing type, dry = link-state is used
but hr is calculated for comparision.''')
'''
Experiment run with default topology, test cases won't work with other topologies
# With calculateNPossibleRoutes,
10 # routing = hr, N = All, from A, 3 routes needs to added to NFD.
a +++++++ b # a - b -- cost 10
+ + # a - c -- cost 10
10 + + 10 # a - d -- cost 20
+ + # Same goes for B being a source.
c d #
'''
topo = Topo()
a = topo.addHost('a')
b = topo.addHost('b')
c = topo.addHost('c')
d = topo.addHost('d')
topo.addLink(a, b, delay='10ms')
topo.addLink(a, c, delay='10ms')
topo.addLink(b, d, delay='10ms')
ndn = Minindn(parser=parser, topo=topo)
ndn.start()
info('Starting NFD on nodes\n')
nfds = AppManager(ndn, ndn.net.hosts, Nfd)
info('Adding static routes to NFD\n')
grh = NdnRoutingHelper(ndn.net, ndn.args.faceType, ndn.args.routingType)
# For all host, pass ndn.net.hosts or a list, [ndn.net['a'], ..] or [ndn.net.hosts[0],.]
grh.addOrigin([ndn.net['a']], ["/abc"])
grh.calculateNPossibleRoutes()
'''
prefix "/abc" is advertise from node A, it should be reachable from all other nodes.
'''
routesFromA = ndn.net['a'].cmd("nfdc route | grep -v '/localhost/nfd'")
if '/ndn/b-site/b' not in routesFromA or \
'/ndn/c-site/c' not in routesFromA or \
'/ndn/d-site/d' not in routesFromA:
info("Route addition failed\n")
routesToPrefix = ndn.net['b'].cmd("nfdc fib | grep '/abc'")
if '/abc' not in routesToPrefix:
info("Missing route to advertised prefix, Route addition failed\n")
ndn.net.stop()
sys.exit(1)
info('Route addition to NFD completed\n')
MiniNDNCLI(ndn.net)
ndn.stop()
+41
View File
@@ -0,0 +1,41 @@
#!/usr/bin/env python
"""
Run all mininet.examples tests
-v : verbose output
-quick : skip tests that take more than ~30 seconds
"""
import unittest
import os
import sys
from mininet.util import ensureRoot
from mininet.clean import cleanup
class MininetTestResult( unittest.TextTestResult ):
def addFailure( self, test, err ):
super( MininetTestResult, self ).addFailure( test, err )
cleanup()
def addError( self,test, err ):
super( MininetTestResult, self ).addError( test, err )
cleanup()
class MininetTestRunner( unittest.TextTestRunner ):
def _makeResult( self ):
return MininetTestResult( self.stream, self.descriptions, self.verbosity )
def runTests( testDir, verbosity=1 ):
"discover and run all tests in testDir"
# ensure root and cleanup before starting tests
ensureRoot()
cleanup()
# discover all tests in testDir
testSuite = unittest.defaultTestLoader.discover( testDir )
# run tests
MininetTestRunner( verbosity=verbosity ).run( testSuite )
if __name__ == '__main__':
# get the directory containing example tests
testDir = os.path.dirname( os.path.realpath( __file__ ) )
verbosity = 2 if '-v' in sys.argv else 1
runTests( testDir, verbosity )
+64
View File
@@ -0,0 +1,64 @@
#!/usr/bin/env python
"""
Tests for baresshd.py
"""
import unittest
import pexpect
from mininet.clean import cleanup, sh
class testBareSSHD( unittest.TestCase ):
opts = [ 'Welcome to h1', pexpect.EOF, pexpect.TIMEOUT ]
def connected( self ):
"Log into ssh server, check banner, then exit"
p = pexpect.spawn( 'ssh 10.0.0.1 -o StrictHostKeyChecking=no -i /tmp/ssh/test_rsa exit' )
while True:
index = p.expect( self.opts )
if index == 0:
return True
else:
return False
def setUp( self ):
# verify that sshd is not running
self.assertFalse( self.connected() )
# create public key pair for testing
sh( 'rm -rf /tmp/ssh' )
sh( 'mkdir /tmp/ssh' )
sh( "ssh-keygen -t rsa -P '' -f /tmp/ssh/test_rsa" )
sh( 'cat /tmp/ssh/test_rsa.pub >> /tmp/ssh/authorized_keys' )
# run example with custom sshd args
cmd = ( 'python -m mininet.examples.baresshd '
'-o AuthorizedKeysFile=/tmp/ssh/authorized_keys '
'-o StrictModes=no' )
p = pexpect.spawn( cmd )
runOpts = [ 'You may now ssh into h1 at 10.0.0.1',
'after 5 seconds, h1 is not listening on port 22',
pexpect.EOF, pexpect.TIMEOUT ]
while True:
index = p.expect( runOpts )
if index == 0:
break
else:
self.tearDown()
self.fail( 'sshd failed to start in host h1' )
def testSSH( self ):
"Simple test to verify that we can ssh into h1"
result = False
# try to connect up to 3 times; sshd can take a while to start
result = self.connected()
self.assertTrue( result )
def tearDown( self ):
# kill the ssh process
sh( "ps aux | grep 'ssh.*Banner' | awk '{ print $2 }' | xargs kill" )
cleanup()
# remove public key pair
sh( 'rm -rf /tmp/ssh' )
if __name__ == '__main__':
unittest.main()
+66
View File
@@ -0,0 +1,66 @@
#!/usr/bin/env python
"""
Tests for bind.py
"""
import unittest
import pexpect
class testBind( unittest.TestCase ):
prompt = 'mininet>'
def setUp( self ):
self.net = pexpect.spawn( 'python -m mininet.examples.bind' )
self.net.expect( "Private Directories: \[([\w\s,'/]+)\]" )
self.directories = []
# parse directories from mn output
for d in self.net.match.group(1).split(', '):
self.directories.append( d.strip("'") )
self.net.expect( self.prompt )
self.assertTrue( len( self.directories ) > 0 )
def testCreateFile( self ):
"Create a file, a.txt, in the first private directory and verify"
fileName = 'a.txt'
directory = self.directories[ 0 ]
path = directory + '/' + fileName
self.net.sendline( 'h1 touch %s; ls %s' % ( path, directory ) )
index = self.net.expect( [ fileName, self.prompt ] )
self.assertTrue( index == 0 )
self.net.expect( self.prompt )
self.net.sendline( 'h1 rm %s' % path )
self.net.expect( self.prompt )
def testIsolation( self ):
"Create a file in two hosts and verify that contents are different"
fileName = 'b.txt'
directory = self.directories[ 0 ]
path = directory + '/' + fileName
contents = { 'h1' : '1', 'h2' : '2' }
# Verify file doesn't exist, then write private copy of file
for host in contents:
value = contents[ host ]
self.net.sendline( '%s cat %s' % ( host, path ) )
self.net.expect( 'No such file' )
self.net.expect( self.prompt )
self.net.sendline( '%s echo %s > %s' % ( host, value, path ) )
self.net.expect( self.prompt )
# Verify file contents
for host in contents:
value = contents[ host ]
self.net.sendline( '%s cat %s' % ( host, path ) )
self.net.expect( value )
self.net.expect( self.prompt )
self.net.sendline( '%s rm %s' % ( host, path ) )
self.net.expect( self.prompt )
# TODO: need more tests
def tearDown( self ):
self.net.sendline( 'exit' )
self.net.wait()
if __name__ == '__main__':
unittest.main()
+27
View File
@@ -0,0 +1,27 @@
#!/usr/bin/env python
'''
A simple sanity check test for cluster edition
'''
import unittest
import pexpect
class clusterSanityCheck( unittest.TestCase ):
prompt = 'mininet>'
def testClusterPingAll( self ):
p = pexpect.spawn( 'python -m mininet.examples.clusterSanity' )
p.expect( self.prompt )
p.sendline( 'pingall' )
p.expect ( '(\d+)% dropped' )
percent = int( p.match.group( 1 ) ) if p.match else -1
self.assertEqual( percent, 0 )
p.expect( self.prompt )
p.sendline( 'exit' )
p.wait()
if __name__ == '__main__':
unittest.main()
+48
View File
@@ -0,0 +1,48 @@
#!/usr/bin/env python
"""
Tests for controllers.py and controllers2.py
"""
import unittest
import pexpect
class testControllers( unittest.TestCase ):
prompt = 'mininet>'
def connectedTest( self, name, cmap ):
"Verify that switches are connected to the controller specified by cmap"
p = pexpect.spawn( 'python -m %s' % name )
p.expect( self.prompt )
# but first a simple ping test
p.sendline( 'pingall' )
p.expect ( '(\d+)% dropped' )
percent = int( p.match.group( 1 ) ) if p.match else -1
self.assertEqual( percent, 0 )
p.expect( self.prompt )
# verify connected controller
for switch in cmap:
p.sendline( 'sh ovs-vsctl get-controller %s' % switch )
p.expect( 'tcp:([\d.:]+)')
actual = p.match.group(1)
expected = cmap[ switch ]
self.assertEqual( actual, expected )
p.expect( self.prompt )
p.sendline( 'exit' )
p.wait()
def testControllers( self ):
c0 = '127.0.0.1:6633'
c1 = '127.0.0.1:6634'
cmap = { 's1': c0, 's2': c1, 's3': c0 }
self.connectedTest( 'mininet.examples.controllers', cmap )
def testControllers2( self ):
c0 = '127.0.0.1:6633'
c1 = '127.0.0.1:6634'
cmap = { 's1': c0, 's2': c1 }
self.connectedTest( 'mininet.examples.controllers2', cmap )
if __name__ == '__main__':
unittest.main()

Some files were not shown because too many files have changed in this diff Show More