Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6eb8973c0b | |||
| 0848c5f3c1 | |||
| 41ac7c4a6e | |||
| 5ae59fdbc9 | |||
| ac7c68089b | |||
| ba569f4d82 | |||
| 615f37dbbe | |||
| aaa8886328 | |||
| 05ee42ee3c | |||
| 7685e41a3e | |||
| 39103f4c9d | |||
| 5b1b376336 | |||
| 8725056d7b | |||
| 88f14e946a | |||
| 0cefa0b8de | |||
| 1b4c7d706d |
@@ -2,7 +2,7 @@
|
||||
Mininet Installation/Configuration Notes
|
||||
----------------------------------------
|
||||
|
||||
Mininet 2.3.1b3
|
||||
Mininet 2.3.1b4
|
||||
---
|
||||
|
||||
The supported installation methods for Mininet are 1) using a
|
||||
@@ -112,7 +112,7 @@ like to contribute an installation script, we would welcome it!)
|
||||
|
||||
Mininet supports Python 3 and Python 2. By default, `install.sh`
|
||||
will use whatever `python` is on your system. To specify a
|
||||
specific version of Pythonm, you can set the PYTHON environment
|
||||
specific version of Python, you can set the PYTHON environment
|
||||
variable:
|
||||
|
||||
PYTHON=python3 util/install.sh -fnv
|
||||
|
||||
@@ -2,7 +2,7 @@ Mininet: Rapid Prototyping for Software Defined Networks
|
||||
========================================================
|
||||
*The best way to emulate almost any network on your laptop!*
|
||||
|
||||
Mininet 2.3.1b3
|
||||
Mininet 2.3.1b4
|
||||
|
||||
[![Build Status][1]](https://github.com/mininet/mininet/actions)
|
||||
|
||||
@@ -70,7 +70,7 @@ Mininet includes:
|
||||
|
||||
### Python 3 Support
|
||||
|
||||
- Mininet 2.3.1b3 supports Python 3 and Python 2
|
||||
- Mininet 2.3.1b4 supports Python 3 and Python 2
|
||||
|
||||
- You can install both the Python 3 and Python 2 versions of
|
||||
Mininet side by side, but the most recent installation will
|
||||
|
||||
@@ -1420,7 +1420,7 @@ class MiniEdit( Frame ):
|
||||
|
||||
def convertJsonUnicode(self, text):
|
||||
"Some part of Mininet don't like Unicode"
|
||||
unicode = globals.get( 'unicode', str )
|
||||
unicode = globals().get( 'unicode', str )
|
||||
if isinstance(text, dict):
|
||||
return {self.convertJsonUnicode(key): self.convertJsonUnicode(value) for key, value in text.items()}
|
||||
if isinstance(text, list):
|
||||
|
||||
@@ -49,13 +49,19 @@ def perfTest( lossy=True ):
|
||||
net.start()
|
||||
info( "Dumping host connections\n" )
|
||||
dumpNodeConnections(net.hosts)
|
||||
info( "Testing bandwidth between h1 and h4\n" )
|
||||
info( "Testing bandwidth between h1 and h4 (lossy=%s)\n" % lossy )
|
||||
h1, h4 = net.getNodeByName('h1', 'h4')
|
||||
net.iperf( ( h1, h4 ), l4Type='UDP' )
|
||||
# Debugging
|
||||
h1.cmd('jobs')
|
||||
h4.cmd('jobs')
|
||||
net.stop()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
setLogLevel( 'info' )
|
||||
# Debug for now
|
||||
if 'testmode' in argv:
|
||||
setLogLevel( 'debug' )
|
||||
# Prevent test_simpleperf from failing due to packet loss
|
||||
perfTest( lossy=( 'testmode' not in argv ) )
|
||||
|
||||
@@ -19,9 +19,12 @@ class testSimplePerf( unittest.TestCase ):
|
||||
# 10 Mb/s, plus or minus 20% tolerance
|
||||
BW = 10
|
||||
TOLERANCE = .2
|
||||
p = pexpect.spawn( 'python -m mininet.examples.simpleperf testmode' )
|
||||
p = pexpect.spawn(
|
||||
'python -m mininet.examples.simpleperf testmode' )
|
||||
# Log since this seems to be failing intermittently
|
||||
p.logfile = sys.stdout
|
||||
# check iperf results
|
||||
p.expect( "Results: \['10M', '([\d\.]+) .bits/sec", timeout=480 )
|
||||
p.expect( "Results: \['10M', '([\d\.]+) .bits/sec", timeout=90 )
|
||||
measuredBw = float( p.match.group( 1 ) )
|
||||
lowerBound = BW * ( 1 - TOLERANCE )
|
||||
upperBound = BW + ( 1 + TOLERANCE )
|
||||
@@ -30,5 +33,5 @@ class testSimplePerf( unittest.TestCase ):
|
||||
p.wait()
|
||||
|
||||
if __name__ == '__main__':
|
||||
setLogLevel( 'warning' )
|
||||
setLogLevel( 'debug' )
|
||||
unittest.main()
|
||||
|
||||
+5
-3
@@ -98,7 +98,7 @@ from itertools import chain, groupby
|
||||
from math import ceil
|
||||
|
||||
from mininet.cli import CLI
|
||||
from mininet.log import info, error, output, warn
|
||||
from mininet.log import info, error, output, warn, debug
|
||||
from mininet.node import ( Node, Host, OVSKernelSwitch, DefaultController,
|
||||
Controller )
|
||||
from mininet.nodelib import NAT
|
||||
@@ -109,7 +109,7 @@ from mininet.util import ( quietRun, fixLimits, numCores, ensureRoot,
|
||||
from mininet.term import cleanUpScreens, makeTerms
|
||||
|
||||
# Mininet version: should be consistent with README and LICENSE
|
||||
VERSION = "2.3.1b3"
|
||||
VERSION = "2.3.1b4"
|
||||
|
||||
class Mininet( object ):
|
||||
"Network emulation with hosts spawned in network namespaces."
|
||||
@@ -443,7 +443,7 @@ class Mininet( object ):
|
||||
host.configDefault( ip=None, mac=None )
|
||||
# You're low priority, dude!
|
||||
# BL: do we want to do this here or not?
|
||||
# May not make sense if we have CPU lmiting...
|
||||
# May not make sense if we have CPU limiting...
|
||||
# quietRun( 'renice +18 -p ' + repr( host.pid ) )
|
||||
# This may not be the right place to do this, but
|
||||
# it needs to be done somewhere.
|
||||
@@ -843,6 +843,7 @@ class Mininet( object ):
|
||||
cliout = client.cmd( iperfArgs + '-t %d -c ' % seconds +
|
||||
server.IP() + ' ' + bwArgs )
|
||||
cvals = self._iperfVals( cliout, serverip )
|
||||
debug( 'iperf client output:', cliout, cvals )
|
||||
serverout = ''
|
||||
# Wait for output from the client session
|
||||
while True:
|
||||
@@ -852,6 +853,7 @@ class Mininet( object ):
|
||||
if ( svals and cvals[ 'sport' ] == svals[ 'sport' ]
|
||||
and int( svals[ 'rate' ] ) > 0 ):
|
||||
break
|
||||
debug( 'iperf server output:', serverout, svals )
|
||||
server.sendInt()
|
||||
serverout += server.waitOutput()
|
||||
result = [ fmtBps( svals[ 'rate'], fmt ),
|
||||
|
||||
+2
-2
@@ -99,7 +99,7 @@ class Node( object ):
|
||||
# Stash configuration parameters for future reference
|
||||
self.params = params
|
||||
|
||||
# dict of port numbers to interfacse
|
||||
# dict of port numbers to interfaces
|
||||
self.intfs = {}
|
||||
|
||||
# dict of interfaces to port numbers
|
||||
@@ -689,7 +689,7 @@ class CPULimitedHost( Host ):
|
||||
Host.__init__( self, name, **params )
|
||||
# BL: Setting the correct period/quota is tricky, particularly
|
||||
# for RT. RT allows very small quotas, but the overhead
|
||||
# seems to be high. CFS has a mininimum quota of 1 ms, but
|
||||
# seems to be high. CFS has a minimum quota of 1 ms, but
|
||||
# still does better with larger period values.
|
||||
self.period_us = params.get( 'period_us', 100000 )
|
||||
self.sched = sched
|
||||
|
||||
@@ -131,7 +131,7 @@ class testOptionsTopoCommon( object ):
|
||||
BW_TOLERANCE = 0.8 # BW fraction below which test should fail
|
||||
# Verify ability to create limited-link topo first;
|
||||
lopts = { 'bw': BW, 'use_htb': True }
|
||||
# Also verify correctness of limit limitng within a bound.
|
||||
# Also verify correctness of limit limiting within a bound.
|
||||
mn = Mininet( SingleSwitchOptionsTopo( n=N, lopts=lopts ),
|
||||
link=TCLink, switch=self.switchClass,
|
||||
waitConnected=True )
|
||||
|
||||
@@ -51,7 +51,7 @@ class TestSwitchDpidAssignmentOVS( unittest.TestCase ):
|
||||
|
||||
def testDefaultDpidAssignmentFailure( self ):
|
||||
"""Verify that Default dpid assignment raises an Exception if the
|
||||
name of the switch does not contin a digit. Also verify the
|
||||
name of the switch does not contain a digit. Also verify the
|
||||
exception message."""
|
||||
net = Mininet( Topo(), self.switchClass, Host, Controller )
|
||||
with self.assertRaises( Exception ) as raises_cm:
|
||||
@@ -80,7 +80,7 @@ class OVSUser( OVSSwitch):
|
||||
OVSSwitch.__init__( self, *args, **kwargs )
|
||||
|
||||
class testSwitchOVSUser( TestSwitchDpidAssignmentOVS ):
|
||||
"Test dpid assignnment of OVS User Switch."
|
||||
"Test dpid assignment of OVS User Switch."
|
||||
switchClass = OVSUser
|
||||
|
||||
@unittest.skipUnless( quietRun( 'which ivs-ctl' ),
|
||||
|
||||
@@ -24,6 +24,9 @@
|
||||
#include <sched.h>
|
||||
#include <ctype.h>
|
||||
#include <sys/mount.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <dirent.h>
|
||||
|
||||
#if !defined(VERSION)
|
||||
#define VERSION "(devel)"
|
||||
@@ -96,18 +99,26 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
int c;
|
||||
int fd;
|
||||
DIR *dir;
|
||||
struct dirent *de;
|
||||
char path[PATH_MAX];
|
||||
int nsid;
|
||||
int pid;
|
||||
char *cwd = get_current_dir_name();
|
||||
|
||||
static struct sched_param sp;
|
||||
|
||||
while ((c = getopt(argc, argv, "+cdnpa:g:r:vh")) != -1)
|
||||
switch(c) {
|
||||
case 'c':
|
||||
/* close file descriptors except stdin/out/error */
|
||||
for (fd = getdtablesize(); fd > 2; fd--)
|
||||
close(fd);
|
||||
if ((dir = opendir("/proc/self/fd"))) {
|
||||
while ((de = readdir(dir)))
|
||||
if ((fd = atoi(de->d_name)) > 2)
|
||||
close(fd);
|
||||
}
|
||||
/* fall back to old method if needed */
|
||||
else for (fd = getdtablesize(); fd > 2; fd--)
|
||||
close(fd);
|
||||
break;
|
||||
case 'd':
|
||||
/* detach from tty */
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
"Setuptools params"
|
||||
|
||||
from setuptools import setup, find_packages
|
||||
from setuptools import setup
|
||||
from os.path import join
|
||||
|
||||
# Get version number from source tree
|
||||
|
||||
@@ -169,7 +169,7 @@ echo
|
||||
if $persistent; then
|
||||
echo '***Setting up persistent SSH configuration between all nodes'
|
||||
persistentSetup
|
||||
echo $'\n*** Sucessfully set up ssh throughout the cluster!'
|
||||
echo $'\n*** Successfully set up ssh throughout the cluster!'
|
||||
|
||||
else
|
||||
echo '*** Setting up temporary SSH configuration between all nodes'
|
||||
|
||||
+5
-5
@@ -17,7 +17,7 @@ MININET_DIR="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )/../.." && pwd -P )"
|
||||
# in which case we use the directory containing mininet
|
||||
BUILD_DIR="$(pwd -P)"
|
||||
case $BUILD_DIR in
|
||||
$MININET_DIR/*) BUILD_DIR=$MININET_DIR;; # currect directory is a subdirectory
|
||||
$MININET_DIR/*) BUILD_DIR=$MININET_DIR;; # current directory is a subdirectory
|
||||
*) BUILD_DIR=$BUILD_DIR;;
|
||||
esac
|
||||
|
||||
@@ -165,7 +165,7 @@ function mn_deps {
|
||||
$install gcc make socat psmisc xterm openssh-clients iperf \
|
||||
iproute telnet python-setuptools libcgroup-tools \
|
||||
ethtool help2man net-tools
|
||||
$install ${PYPKG}-pyflakes pylint ${PYPKG}-pep8-naming
|
||||
$install ${PYPKG}-pyflakes pylint ${PYPKG}-pep8-naming \
|
||||
${PYPKG}-pexpect
|
||||
elif [ "$DIST" = "SUSE LINUX" ]; then
|
||||
$install gcc make socat psmisc xterm openssh iperf \
|
||||
@@ -798,7 +798,7 @@ function vm_clean {
|
||||
sudo rm -rf /tmp/*
|
||||
sudo rm -rf openvswitch*.tar.gz
|
||||
|
||||
# Remove sensistive files
|
||||
# Remove sensitive files
|
||||
history -c # note this won't work if you have multiple bash sessions
|
||||
rm -f ~/.bash_history # need to clear in memory and remove on disk
|
||||
rm -f ~/.ssh/id_rsa* ~/.ssh/known_hosts
|
||||
@@ -842,7 +842,7 @@ exit 0
|
||||
}
|
||||
|
||||
function usage {
|
||||
printf '\nUsage: %s [-abcdfhikmnprtvVwxy03]\n\n' $(basename $0) >&2
|
||||
printf '\nUsage: %s [-abcdefhikmnprtvVwxy03]\n\n' $(basename $0) >&2
|
||||
|
||||
printf 'This install script attempts to install useful packages\n' >&2
|
||||
printf 'for Mininet. It should (hopefully) work on Ubuntu 11.10+\n' >&2
|
||||
@@ -869,8 +869,8 @@ function usage {
|
||||
printf -- ' -v: install Open (V)switch\n' >&2
|
||||
printf -- ' -V <version>: install a particular version of Open (V)switch on Ubuntu\n' >&2
|
||||
printf -- ' -w: install OpenFlow (W)ireshark dissector\n' >&2
|
||||
printf -- ' -x: install NO(X) Classic OpenFlow controller\n' >&2
|
||||
printf -- ' -y: install R(y)u Controller\n' >&2
|
||||
printf -- ' -x: install NO(X) Classic OpenFlow controller\n' >&2
|
||||
printf -- ' -0: (default) -0[fx] installs OpenFlow 1.0 versions\n' >&2
|
||||
printf -- ' -3: -3[fx] installs OpenFlow 1.3 versions\n' >&2
|
||||
exit 2
|
||||
|
||||
+2
-2
@@ -64,7 +64,7 @@ VMImageDir = os.environ[ 'HOME' ] + '/vm-images'
|
||||
Prompt = '\$ ' # Shell prompt that pexpect will wait for
|
||||
|
||||
|
||||
# URLs for Ubunto .iso images
|
||||
# URLs for Ubuntu .iso images
|
||||
|
||||
def serverURL( version, arch ):
|
||||
"Return .iso URL for Ubuntu version and arch"
|
||||
@@ -227,7 +227,7 @@ def attachNBD( cow, flags='' ):
|
||||
|
||||
|
||||
def detachNBD( nbd ):
|
||||
"Detatch an nbd device"
|
||||
"Detach an nbd device"
|
||||
srun( 'qemu-nbd -d ' + nbd )
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user