Vince Lehman | b8b1806 | 2015-07-14 13:07:22 -0500 | [diff] [blame] | 1 | # -*- Mode:python; c-file-style:"gnu"; indent-tabs-mode:nil -*- */ |
| 2 | # |
Alexander Lane | 9944cf5 | 2018-05-17 12:16:50 -0500 | [diff] [blame] | 3 | # Copyright (C) 2015-2018, The University of Memphis, |
Vince Lehman | 5d5a566 | 2015-12-02 12:33:12 -0600 | [diff] [blame] | 4 | # Arizona Board of Regents, |
| 5 | # Regents of the University of California. |
Vince Lehman | b8b1806 | 2015-07-14 13:07:22 -0500 | [diff] [blame] | 6 | # |
| 7 | # This file is part of Mini-NDN. |
| 8 | # See AUTHORS.md for a complete list of Mini-NDN authors and contributors. |
| 9 | # |
| 10 | # Mini-NDN is free software: you can redistribute it and/or modify |
| 11 | # it under the terms of the GNU General Public License as published by |
| 12 | # the Free Software Foundation, either version 3 of the License, or |
| 13 | # (at your option) any later version. |
| 14 | # |
| 15 | # Mini-NDN is distributed in the hope that it will be useful, |
| 16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 18 | # GNU General Public License for more details. |
| 19 | # |
| 20 | # You should have received a copy of the GNU General Public License |
| 21 | # along with Mini-NDN, e.g., in COPYING.md file. |
| 22 | # If not, see <http://www.gnu.org/licenses/>. |
| 23 | # |
| 24 | # This file incorporates work covered by the following copyright and |
| 25 | # permission notice: |
| 26 | # |
Ashlesh Gawande | f5f304b | 2016-06-16 16:42:41 -0500 | [diff] [blame] | 27 | # Mininet 2.3.0d1 License |
Vince Lehman | b8b1806 | 2015-07-14 13:07:22 -0500 | [diff] [blame] | 28 | # |
Ashlesh Gawande | f5f304b | 2016-06-16 16:42:41 -0500 | [diff] [blame] | 29 | # Copyright (c) 2013-2016 Open Networking Laboratory |
Vince Lehman | b8b1806 | 2015-07-14 13:07:22 -0500 | [diff] [blame] | 30 | # Copyright (c) 2009-2012 Bob Lantz and The Board of Trustees of |
| 31 | # The Leland Stanford Junior University |
| 32 | # |
| 33 | # Original authors: Bob Lantz and Brandon Heller |
| 34 | # |
| 35 | # We are making Mininet available for public use and benefit with the |
| 36 | # expectation that others will use, modify and enhance the Software and |
| 37 | # contribute those enhancements back to the community. However, since we |
| 38 | # would like to make the Software available for broadest use, with as few |
| 39 | # restrictions as possible permission is hereby granted, free of charge, to |
| 40 | # any person obtaining a copy of this Software to deal in the Software |
| 41 | # under the copyrights without restriction, including without limitation |
| 42 | # the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 43 | # and/or sell copies of the Software, and to permit persons to whom the |
| 44 | # Software is furnished to do so, subject to the following conditions: |
| 45 | # |
| 46 | # The above copyright notice and this permission notice shall be included |
| 47 | # in all copies or substantial portions of the Software. |
| 48 | # |
| 49 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
| 50 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 51 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
| 52 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY |
| 53 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
| 54 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
| 55 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 56 | # |
| 57 | # The name and trademarks of copyright holder(s) may NOT be used in |
| 58 | # advertising or publicity pertaining to the Software or any derivatives |
| 59 | # without specific, written prior permission. |
ashu | ef3490b | 2015-02-17 11:01:04 -0600 | [diff] [blame] | 60 | |
| 61 | from mininet.topo import Topo |
| 62 | from mininet.net import Mininet |
| 63 | from mininet.log import setLogLevel, output, info |
ashu | ef3490b | 2015-02-17 11:01:04 -0600 | [diff] [blame] | 64 | from mininet.link import TCLink |
ashu | 2ad32e2 | 2015-05-29 13:37:40 -0500 | [diff] [blame] | 65 | from mininet.util import ipStr, ipParse |
ashu | ef3490b | 2015-02-17 11:01:04 -0600 | [diff] [blame] | 66 | |
Ashlesh Gawande | f5f304b | 2016-06-16 16:42:41 -0500 | [diff] [blame] | 67 | from mininet.examples.cluster import MininetCluster, RoundRobinPlacer, ClusterCleanup |
| 68 | from mininet.examples.clustercli import ClusterCLI |
Vince Lehman | 3b8bc65 | 2015-06-18 15:01:47 -0500 | [diff] [blame] | 69 | |
| 70 | from ndn import ExperimentManager |
Ashlesh Gawande | f5f304b | 2016-06-16 16:42:41 -0500 | [diff] [blame] | 71 | from ndn.ndn_host import NdnHost, CpuLimitedNdnHost, RemoteNdnHost |
Vince Lehman | fbd47c9 | 2015-10-14 16:00:06 -0500 | [diff] [blame] | 72 | from ndn.conf_parser import parse_hosts, parse_switches, parse_links |
Ashlesh Gawande | f5f304b | 2016-06-16 16:42:41 -0500 | [diff] [blame] | 73 | from ndn.remote_ndn_link import RemoteNdnLink, RemoteGRENdnLink |
| 74 | from ndn.placer import GuidedPlacer, PopulatePlacement |
Ashlesh Gawande | 95789cc | 2017-02-27 12:38:04 -0600 | [diff] [blame] | 75 | from ndn.util import ssh, scp, MiniNDNCLI |
Alexander Lane | 6f7a64f | 2018-05-17 15:01:14 -0500 | [diff] [blame^] | 76 | from ndn.nlsr import Nlsr, NlsrConfigGenerator |
| 77 | from ndn.nfd import Nfd |
| 78 | from ndn.apps.nfdc import Nfdc |
ashu | ef3490b | 2015-02-17 11:01:04 -0600 | [diff] [blame] | 79 | |
| 80 | import os.path, time |
Yucheng Zhang | 14aa596 | 2016-04-05 17:10:15 -0500 | [diff] [blame] | 81 | import shutil |
Ashlesh Gawande | 044611d | 2016-12-21 14:24:49 -0600 | [diff] [blame] | 82 | import argparse |
ashu | ef3490b | 2015-02-17 11:01:04 -0600 | [diff] [blame] | 83 | import datetime |
ashu | 01b62f7 | 2015-03-12 15:16:11 -0500 | [diff] [blame] | 84 | from os.path import expanduser |
Vince Lehman | 3b8bc65 | 2015-06-18 15:01:47 -0500 | [diff] [blame] | 85 | import sys |
Ashlesh Gawande | 3807c1b | 2016-08-05 16:27:02 -0500 | [diff] [blame] | 86 | import signal |
Yucheng Zhang | 14aa596 | 2016-04-05 17:10:15 -0500 | [diff] [blame] | 87 | from subprocess import call |
Ashlesh Gawande | f5f304b | 2016-06-16 16:42:41 -0500 | [diff] [blame] | 88 | import glob |
| 89 | from functools import partial |
| 90 | import re |
ashu | ef3490b | 2015-02-17 11:01:04 -0600 | [diff] [blame] | 91 | |
Ashlesh Gawande | 212cb82 | 2017-02-07 10:42:13 -0600 | [diff] [blame] | 92 | try: |
| 93 | import argcomplete |
| 94 | except ImportError: |
| 95 | pass |
| 96 | |
Ashlesh Gawande | 670ff15 | 2018-06-08 12:26:39 -0500 | [diff] [blame] | 97 | VERSION_NUMBER = "0.4.0" |
Ashlesh Gawande | 044611d | 2016-12-21 14:24:49 -0600 | [diff] [blame] | 98 | INSTALL_DIR='/usr/local/etc/mini-ndn/' |
Vince Lehman | e9f116d | 2015-07-15 10:40:21 -0500 | [diff] [blame] | 99 | |
Ashlesh Gawande | 044611d | 2016-12-21 14:24:49 -0600 | [diff] [blame] | 100 | class PrintExperimentNames(argparse.Action): |
| 101 | def __init__(self, option_strings, dest, nargs=0, help=None): |
| 102 | super(PrintExperimentNames, self).__init__(option_strings=option_strings, dest=dest, nargs=nargs, help=help) |
Vince Lehman | 3b8bc65 | 2015-06-18 15:01:47 -0500 | [diff] [blame] | 103 | |
Ashlesh Gawande | 044611d | 2016-12-21 14:24:49 -0600 | [diff] [blame] | 104 | def __call__(self, parser, namespace, values, option_string=None): |
| 105 | experimentNames = ExperimentManager.getExperimentNames() |
Vince Lehman | 3b8bc65 | 2015-06-18 15:01:47 -0500 | [diff] [blame] | 106 | |
Ashlesh Gawande | 044611d | 2016-12-21 14:24:49 -0600 | [diff] [blame] | 107 | print("Mini-NDN experiments:") |
| 108 | for experiment in experimentNames: |
Ashlesh Gawande | 501d4d6 | 2017-10-25 13:12:11 -0500 | [diff] [blame] | 109 | print(" {}".format(experiment)) |
Vince Lehman | 194be24 | 2015-10-15 18:01:42 -0500 | [diff] [blame] | 110 | |
Ashlesh Gawande | 044611d | 2016-12-21 14:24:49 -0600 | [diff] [blame] | 111 | sys.exit(0) |
Vince Lehman | e9f116d | 2015-07-15 10:40:21 -0500 | [diff] [blame] | 112 | |
Vince Lehman | 194be24 | 2015-10-15 18:01:42 -0500 | [diff] [blame] | 113 | class ProgramOptions: |
| 114 | def __init__(self): |
| 115 | self.ctime = 60 |
| 116 | self.experimentName = None |
| 117 | self.nFaces = 3 |
| 118 | self.templateFile = "minindn.conf" |
dmcoomes | 7adc7f7 | 2017-10-06 12:01:28 -0500 | [diff] [blame] | 119 | self.routingType = "link-state" |
dmcoomes | ecf9c5a | 2017-10-11 10:17:46 -0500 | [diff] [blame] | 120 | self.isNlsrEnabled = True |
Vince Lehman | 194be24 | 2015-10-15 18:01:42 -0500 | [diff] [blame] | 121 | self.isCliEnabled = True |
Vince Lehman | 5d5a566 | 2015-12-02 12:33:12 -0600 | [diff] [blame] | 122 | self.nlsrSecurity = False |
Vince Lehman | 194be24 | 2015-10-15 18:01:42 -0500 | [diff] [blame] | 123 | self.nPings = 300 |
| 124 | self.testbed = False |
dmcoomes | 80eeea1 | 2017-10-27 12:49:10 -0500 | [diff] [blame] | 125 | self.workDir = "/tmp/minindn" |
Ashlesh Gawande | d829bfc | 2015-10-14 16:38:10 -0500 | [diff] [blame] | 126 | self.resultDir = None |
Ashlesh Gawande | d9c9e52 | 2015-10-15 16:40:12 -0500 | [diff] [blame] | 127 | self.pctTraffic = 1.0 |
Ashlesh Gawande | f5f304b | 2016-06-16 16:42:41 -0500 | [diff] [blame] | 128 | self.cluster = None |
| 129 | self.servers = None |
| 130 | self.guided = None |
| 131 | self.placer = None |
| 132 | self.tunnelType = None |
Ashlesh Gawande | 708fcca | 2017-06-23 14:04:12 -0500 | [diff] [blame] | 133 | self.faceType = "udp" |
Alexander Lane | 1bc9b47 | 2018-05-16 15:07:16 -0500 | [diff] [blame] | 134 | self.arguments = None |
Ashlesh Gawande | 532302b | 2018-02-15 18:58:20 -0600 | [diff] [blame] | 135 | self.csSize = 65536 |
Ashlesh Gawande | d829bfc | 2015-10-14 16:38:10 -0500 | [diff] [blame] | 136 | |
dmcoomes | 7adc7f7 | 2017-10-06 12:01:28 -0500 | [diff] [blame] | 137 | def createResultsDir(resultDir, faces, rType): |
Ashlesh Gawande | d829bfc | 2015-10-14 16:38:10 -0500 | [diff] [blame] | 138 | if faces == 0: |
| 139 | faces = "all" |
| 140 | |
dmcoomes | 7adc7f7 | 2017-10-06 12:01:28 -0500 | [diff] [blame] | 141 | routingChoice = "/{}/".format(rType) |
Ashlesh Gawande | d829bfc | 2015-10-14 16:38:10 -0500 | [diff] [blame] | 142 | |
dmcoomes | 7adc7f7 | 2017-10-06 12:01:28 -0500 | [diff] [blame] | 143 | resultDir = "{}/{}/faces-{}".format(resultDir, routingChoice, faces) |
Ashlesh Gawande | d829bfc | 2015-10-14 16:38:10 -0500 | [diff] [blame] | 144 | resultDir = os.path.abspath(resultDir) |
| 145 | |
| 146 | if not os.path.isdir(resultDir): |
| 147 | os.makedirs(resultDir) |
| 148 | else: |
| 149 | print("Results directory (%s) already exists!" % resultDir) |
Ashlesh Gawande | 212cb82 | 2017-02-07 10:42:13 -0600 | [diff] [blame] | 150 | sys.exit(1) |
Ashlesh Gawande | d829bfc | 2015-10-14 16:38:10 -0500 | [diff] [blame] | 151 | |
Ashlesh Gawande | 044611d | 2016-12-21 14:24:49 -0600 | [diff] [blame] | 152 | print("Results will be stored at: %s" % resultDir) |
Ashlesh Gawande | d829bfc | 2015-10-14 16:38:10 -0500 | [diff] [blame] | 153 | return resultDir |
Vince Lehman | 194be24 | 2015-10-15 18:01:42 -0500 | [diff] [blame] | 154 | |
ashu | ef3490b | 2015-02-17 11:01:04 -0600 | [diff] [blame] | 155 | def parse_args(): |
Ashlesh Gawande | 044611d | 2016-12-21 14:24:49 -0600 | [diff] [blame] | 156 | parser = argparse.ArgumentParser(prog='minindn') |
ashu | ef3490b | 2015-02-17 11:01:04 -0600 | [diff] [blame] | 157 | |
Ashlesh Gawande | 044611d | 2016-12-21 14:24:49 -0600 | [diff] [blame] | 158 | # nargs='?' required here since optional argument |
| 159 | parser.add_argument('tempfile', nargs='?', default=INSTALL_DIR + 'default-topology.conf', |
Ashlesh Gawande | 532302b | 2018-02-15 18:58:20 -0600 | [diff] [blame] | 160 | help="If no template_file is given, topologies/default-topology.conf (given sample file) will be used.") |
ashu | ef3490b | 2015-02-17 11:01:04 -0600 | [diff] [blame] | 161 | |
Ashlesh Gawande | 044611d | 2016-12-21 14:24:49 -0600 | [diff] [blame] | 162 | parser.add_argument("--ctime", type=int, default=60, |
| 163 | help="Specify convergence time for the topology (Default: 60 seconds)") |
ashu | ef3490b | 2015-02-17 11:01:04 -0600 | [diff] [blame] | 164 | |
Ashlesh Gawande | 212cb82 | 2017-02-07 10:42:13 -0600 | [diff] [blame] | 165 | parser.add_argument("--experiment", choices=[experiment for experiment in ExperimentManager.getExperimentNames()], |
Ashlesh Gawande | 044611d | 2016-12-21 14:24:49 -0600 | [diff] [blame] | 166 | help="Runs the specified experiment") |
Vince Lehman | 3b8bc65 | 2015-06-18 15:01:47 -0500 | [diff] [blame] | 167 | |
Ashlesh Gawande | 044611d | 2016-12-21 14:24:49 -0600 | [diff] [blame] | 168 | parser.add_argument("--faces", type=int, default=3, |
Ashlesh Gawande | 212cb82 | 2017-02-07 10:42:13 -0600 | [diff] [blame] | 169 | help="Specify number of max faces per prefix for NLSR 0-60") |
ashu | ef3490b | 2015-02-17 11:01:04 -0600 | [diff] [blame] | 170 | |
dmcoomes | 7adc7f7 | 2017-10-06 12:01:28 -0500 | [diff] [blame] | 171 | parser.add_argument("--routing", dest="routingType", default='link-state', choices=['link-state', 'hr', 'dry'], |
| 172 | help="""choices for routing are 'link-state' for link state, 'hr' for hyperbolic, and 'dry' |
| 173 | to test hyperbolic routing and compare with link state. Default is link-state.""") |
Vince Lehman | 194be24 | 2015-10-15 18:01:42 -0500 | [diff] [blame] | 174 | |
dmcoomes | ecf9c5a | 2017-10-11 10:17:46 -0500 | [diff] [blame] | 175 | parser.add_argument("--no-nlsr", action="store_false", dest="isNlsrEnabled", |
| 176 | help="Run mini-ndn without NLSR routing") |
| 177 | |
Ashlesh Gawande | 044611d | 2016-12-21 14:24:49 -0600 | [diff] [blame] | 178 | parser.add_argument("--list-experiments", action=PrintExperimentNames, |
| 179 | help="Lists the names of all available experiments") |
Vince Lehman | 194be24 | 2015-10-15 18:01:42 -0500 | [diff] [blame] | 180 | |
Ashlesh Gawande | 044611d | 2016-12-21 14:24:49 -0600 | [diff] [blame] | 181 | parser.add_argument("--no-cli", action="store_false", dest="isCliEnabled", |
| 182 | help="Run experiments and exit without showing the command line interface") |
Vince Lehman | 194be24 | 2015-10-15 18:01:42 -0500 | [diff] [blame] | 183 | |
Ashlesh Gawande | 044611d | 2016-12-21 14:24:49 -0600 | [diff] [blame] | 184 | parser.add_argument("--nPings", type=int, default=300, |
| 185 | help="Number of pings to perform between each node in the experiment") |
Vince Lehman | 194be24 | 2015-10-15 18:01:42 -0500 | [diff] [blame] | 186 | |
dmcoomes | 7adc7f7 | 2017-10-06 12:01:28 -0500 | [diff] [blame] | 187 | # store_true stores default value of False |
Ashlesh Gawande | 044611d | 2016-12-21 14:24:49 -0600 | [diff] [blame] | 188 | parser.add_argument("--nlsr-security", action="store_true", dest="nlsrSecurity", |
| 189 | help="Enables NLSR security") |
Vince Lehman | 5d5a566 | 2015-12-02 12:33:12 -0600 | [diff] [blame] | 190 | |
Ashlesh Gawande | 044611d | 2016-12-21 14:24:49 -0600 | [diff] [blame] | 191 | parser.add_argument("-t", "--testbed", action="store_true", dest="testbed", |
| 192 | help="Instantiates a snapshot of the NDN Testbed irrespective of the tempfile provided") |
ashu | ef3490b | 2015-02-17 11:01:04 -0600 | [diff] [blame] | 193 | |
dmcoomes | 80eeea1 | 2017-10-27 12:49:10 -0500 | [diff] [blame] | 194 | parser.add_argument("--work-dir", action="store", dest="workDir", default="/tmp/minindn", |
| 195 | help="Specify the working directory; default is /tmp/minindn") |
Ashlesh Gawande | 1b66369 | 2015-10-14 16:38:10 -0500 | [diff] [blame] | 196 | |
Ashlesh Gawande | 044611d | 2016-12-21 14:24:49 -0600 | [diff] [blame] | 197 | parser.add_argument("--result-dir", action="store", dest="resultDir", default=None, |
| 198 | help="Specify the full path destination folder where experiment results will be moved") |
Ashlesh Gawande | d829bfc | 2015-10-14 16:38:10 -0500 | [diff] [blame] | 199 | |
Ashlesh Gawande | 044611d | 2016-12-21 14:24:49 -0600 | [diff] [blame] | 200 | parser.add_argument("--pct-traffic", dest="pctTraffic", type=float, default=1.0, |
| 201 | help="Specify the percentage of nodes each node should ping") |
Ashlesh Gawande | d9c9e52 | 2015-10-15 16:40:12 -0500 | [diff] [blame] | 202 | |
Ashlesh Gawande | 044611d | 2016-12-21 14:24:49 -0600 | [diff] [blame] | 203 | parser.add_argument('--version', '-V', action='version', version='%(prog)s ' + VERSION_NUMBER, |
| 204 | help='Displays version information') |
Vince Lehman | e9f116d | 2015-07-15 10:40:21 -0500 | [diff] [blame] | 205 | |
Ashlesh Gawande | f5f304b | 2016-06-16 16:42:41 -0500 | [diff] [blame] | 206 | parser.add_argument("--cluster", metavar='localhost,server2,...', |
| 207 | help="Run cluster edition") |
| 208 | |
| 209 | parser.add_argument("--placement", default='guided', |
| 210 | choices=['roundRobin', 'guided']) |
| 211 | |
| 212 | parser.add_argument("--place-list", dest="placeList", |
| 213 | help="""Provide corresponding number of nodes (comma separated) to put on |
| 214 | each node respectively of --cluster when guided placement is used""") |
| 215 | |
| 216 | parser.add_argument("--tunnel-type", dest="tunnelType", default='ssh', |
| 217 | choices=['ssh', 'gre']) |
| 218 | |
Ashlesh Gawande | 708fcca | 2017-06-23 14:04:12 -0500 | [diff] [blame] | 219 | parser.add_argument("--face-type", dest='faceType', default='udp', choices=['udp', 'tcp']) |
| 220 | |
Ashlesh Gawande | 532302b | 2018-02-15 18:58:20 -0600 | [diff] [blame] | 221 | parser.add_argument("--cs-size", dest='csSize', type=int, default=65536, |
| 222 | help="Set CS size in NFD's conf file") |
| 223 | |
Alexander Lane | 1bc9b47 | 2018-05-16 15:07:16 -0500 | [diff] [blame] | 224 | ExperimentManager.addExperimentArgs(parser) |
| 225 | |
Ashlesh Gawande | 212cb82 | 2017-02-07 10:42:13 -0600 | [diff] [blame] | 226 | if "argcomplete" in sys.modules: |
| 227 | argcomplete.autocomplete(parser) |
| 228 | |
Ashlesh Gawande | 044611d | 2016-12-21 14:24:49 -0600 | [diff] [blame] | 229 | args = parser.parse_args() |
ashu | ef3490b | 2015-02-17 11:01:04 -0600 | [diff] [blame] | 230 | |
Vince Lehman | 194be24 | 2015-10-15 18:01:42 -0500 | [diff] [blame] | 231 | options = ProgramOptions() |
Ashlesh Gawande | 044611d | 2016-12-21 14:24:49 -0600 | [diff] [blame] | 232 | options.templateFile = args.tempfile |
Vince Lehman | 194be24 | 2015-10-15 18:01:42 -0500 | [diff] [blame] | 233 | options.ctime = args.ctime |
| 234 | options.experimentName = args.experiment |
| 235 | options.nFaces = args.faces |
dmcoomes | 7adc7f7 | 2017-10-06 12:01:28 -0500 | [diff] [blame] | 236 | options.routingType = args.routingType |
dmcoomes | ecf9c5a | 2017-10-11 10:17:46 -0500 | [diff] [blame] | 237 | options.isNlsrEnabled = args.isNlsrEnabled |
Vince Lehman | 194be24 | 2015-10-15 18:01:42 -0500 | [diff] [blame] | 238 | options.isCliEnabled = args.isCliEnabled |
Vince Lehman | 5d5a566 | 2015-12-02 12:33:12 -0600 | [diff] [blame] | 239 | options.nlsrSecurity = args.nlsrSecurity |
Vince Lehman | 194be24 | 2015-10-15 18:01:42 -0500 | [diff] [blame] | 240 | options.nPings = args.nPings |
Vince Lehman | 5d5a566 | 2015-12-02 12:33:12 -0600 | [diff] [blame] | 241 | |
Vince Lehman | 194be24 | 2015-10-15 18:01:42 -0500 | [diff] [blame] | 242 | options.testbed = args.testbed |
Ashlesh Gawande | 1b66369 | 2015-10-14 16:38:10 -0500 | [diff] [blame] | 243 | options.workDir = args.workDir |
Ashlesh Gawande | d829bfc | 2015-10-14 16:38:10 -0500 | [diff] [blame] | 244 | options.resultDir = args.resultDir |
Ashlesh Gawande | d9c9e52 | 2015-10-15 16:40:12 -0500 | [diff] [blame] | 245 | options.pctTraffic = args.pctTraffic |
Ashlesh Gawande | f5f304b | 2016-06-16 16:42:41 -0500 | [diff] [blame] | 246 | options.cluster = args.cluster |
| 247 | options.placement = args.placement |
| 248 | options.tunnelType = args.tunnelType |
| 249 | options.placeList = args.placeList |
Ashlesh Gawande | 708fcca | 2017-06-23 14:04:12 -0500 | [diff] [blame] | 250 | options.faceType = args.faceType |
Ashlesh Gawande | 532302b | 2018-02-15 18:58:20 -0600 | [diff] [blame] | 251 | options.csSize = args.csSize |
Alexander Lane | 1bc9b47 | 2018-05-16 15:07:16 -0500 | [diff] [blame] | 252 | options.arguments = args |
Ashlesh Gawande | 501d4d6 | 2017-10-25 13:12:11 -0500 | [diff] [blame] | 253 | |
Vince Lehman | 194be24 | 2015-10-15 18:01:42 -0500 | [diff] [blame] | 254 | if options.experimentName is not None and options.experimentName not in ExperimentManager.getExperimentNames(): |
| 255 | print("No experiment named %s" % options.experimentName) |
Ashlesh Gawande | 044611d | 2016-12-21 14:24:49 -0600 | [diff] [blame] | 256 | sys.exit(1) |
Vince Lehman | 3b8bc65 | 2015-06-18 15:01:47 -0500 | [diff] [blame] | 257 | |
Ashlesh Gawande | d829bfc | 2015-10-14 16:38:10 -0500 | [diff] [blame] | 258 | if options.experimentName is not None and options.resultDir is None: |
Ashlesh Gawande | 044611d | 2016-12-21 14:24:49 -0600 | [diff] [blame] | 259 | print("No results folder specified; experiment results will remain in the working directory") |
ashu | ef3490b | 2015-02-17 11:01:04 -0600 | [diff] [blame] | 260 | |
Ashlesh Gawande | f5f304b | 2016-06-16 16:42:41 -0500 | [diff] [blame] | 261 | if options.cluster is not None: |
| 262 | servers = options.cluster.split(',') |
| 263 | for server in servers: |
| 264 | ClusterCleanup.add(server) |
| 265 | options.servers = servers |
| 266 | |
| 267 | if options.placement == "roundRobin": |
| 268 | options.placement = RoundRobinPlacer |
| 269 | elif options.placement == "guided": |
| 270 | if options.placeList is None or not re.match("^[0-9,]+$", options.placeList): |
| 271 | print("Please specify correctly how many nodes you want to place on each node!") |
| 272 | sys.exit(1) |
| 273 | else: |
| 274 | try: |
| 275 | options.placeList = map(int, options.placeList.split(",")) |
| 276 | except ValueError: |
| 277 | print("Please specify the nodes correctly, no comma at the beginning/end!") |
| 278 | sys.exit(1) |
| 279 | |
| 280 | PopulatePlacement(options.placeList) |
| 281 | options.placement = GuidedPlacer |
| 282 | |
| 283 | if options.tunnelType == "ssh": |
| 284 | options.tunnelType = RemoteNdnLink |
| 285 | else: |
| 286 | options.tunnelType = RemoteGRENdnLink |
| 287 | |
Vince Lehman | 194be24 | 2015-10-15 18:01:42 -0500 | [diff] [blame] | 288 | return options |
ashu | ef3490b | 2015-02-17 11:01:04 -0600 | [diff] [blame] | 289 | |
| 290 | class NdnTopo(Topo): |
Ashlesh Gawande | 1b66369 | 2015-10-14 16:38:10 -0500 | [diff] [blame] | 291 | def __init__(self, conf_arq, workDir, **opts): |
ashu | ef3490b | 2015-02-17 11:01:04 -0600 | [diff] [blame] | 292 | Topo.__init__(self, **opts) |
| 293 | |
| 294 | global hosts_conf |
| 295 | global links_conf |
| 296 | hosts_conf = parse_hosts(conf_arq) |
Vince Lehman | fbd47c9 | 2015-10-14 16:00:06 -0500 | [diff] [blame] | 297 | switches_conf = parse_switches(conf_arq) |
ashu | ef3490b | 2015-02-17 11:01:04 -0600 | [diff] [blame] | 298 | links_conf = parse_links(conf_arq) |
| 299 | |
| 300 | self.isTCLink = False |
| 301 | self.isLimited = False |
| 302 | |
| 303 | for host in hosts_conf: |
| 304 | if host.cpu != None and self.isLimited != True: |
| 305 | self.isLimited = True |
dmcoomes | 74da84c | 2017-11-07 16:09:23 -0600 | [diff] [blame] | 306 | self.addHost(host.name, app=host.app, params=host.uri_tuples, cpu=host.cpu, |
| 307 | cores=host.cores,cache=host.cache, workdir=workDir) |
| 308 | if (options.routingType != 'link-state' and (host.params.get('radius') is None |
| 309 | or host.params.get('angle') is None)): |
| 310 | info('Hyperbolic coordinates in topology file are either missing or misconfigured.\n' \ |
| 311 | 'Check that each node has one radius value and one or two angle value(s).\n') |
| 312 | sys.exit(1) |
ashu | ef3490b | 2015-02-17 11:01:04 -0600 | [diff] [blame] | 313 | |
Vince Lehman | fbd47c9 | 2015-10-14 16:00:06 -0500 | [diff] [blame] | 314 | for switch in switches_conf: |
| 315 | self.addSwitch(switch.name) |
| 316 | |
ashu | ef3490b | 2015-02-17 11:01:04 -0600 | [diff] [blame] | 317 | for link in links_conf: |
| 318 | if len(link.linkDict) == 0: |
| 319 | self.addLink(link.h1, link.h2) |
| 320 | else: |
| 321 | self.addLink(link.h1, link.h2, **link.linkDict) |
| 322 | self.isTCLink = True |
| 323 | |
| 324 | info('Parse of ' + conf_arq + ' done.\n') |
| 325 | |
Vince Lehman | 194be24 | 2015-10-15 18:01:42 -0500 | [diff] [blame] | 326 | def execute(options): |
ashu | ef3490b | 2015-02-17 11:01:04 -0600 | [diff] [blame] | 327 | "Create a network based on template_file" |
| 328 | |
Vince Lehman | 194be24 | 2015-10-15 18:01:42 -0500 | [diff] [blame] | 329 | if options.testbed: |
Ashlesh Gawande | 044611d | 2016-12-21 14:24:49 -0600 | [diff] [blame] | 330 | options.templateFile = INSTALL_DIR + 'minindn.testbed.conf' |
ashu | ef3490b | 2015-02-17 11:01:04 -0600 | [diff] [blame] | 331 | |
Ashlesh Gawande | 044611d | 2016-12-21 14:24:49 -0600 | [diff] [blame] | 332 | if os.path.exists(options.templateFile) == False: |
| 333 | info('Template file cannot be found. Exiting...\n') |
| 334 | sys.exit(1) |
Ashlesh Gawande | 20f7076 | 2015-06-17 15:18:19 -0500 | [diff] [blame] | 335 | |
Ashlesh Gawande | f5f304b | 2016-06-16 16:42:41 -0500 | [diff] [blame] | 336 | if options.cluster is not None and options.placement == GuidedPlacer: |
| 337 | num_nodes = 0 |
| 338 | with open(options.templateFile, 'r') as topo: |
| 339 | for line in topo: |
| 340 | if ': _' in line: |
| 341 | num_nodes += 1 |
| 342 | |
| 343 | if sum(options.placeList) != num_nodes: |
| 344 | print("Placement list sum is not equal to number of nodes!") |
| 345 | sys.exit(1) |
| 346 | |
Ashlesh Gawande | f5f304b | 2016-06-16 16:42:41 -0500 | [diff] [blame] | 347 | # Copy nfd.conf to remote hosts - this assumes that NDN versions across |
| 348 | # the cluster are at least compatible if not the same |
| 349 | if options.cluster is not None: |
| 350 | for server in options.servers: |
| 351 | if server != "localhost": |
| 352 | login = "mininet@%s" % server |
| 353 | src = nfdConfFile |
| 354 | dst = "%s:/tmp/nfd.conf" % (login) |
| 355 | scp(src, dst) |
| 356 | ssh(login, "sudo cp /tmp/nfd.conf %s" % src) |
| 357 | |
Ashlesh Gawande | d829bfc | 2015-10-14 16:38:10 -0500 | [diff] [blame] | 358 | if options.resultDir is not None: |
dmcoomes | 7adc7f7 | 2017-10-06 12:01:28 -0500 | [diff] [blame] | 359 | options.resultDir = createResultsDir(options.resultDir, options.nFaces, options.routingType) |
Ashlesh Gawande | d829bfc | 2015-10-14 16:38:10 -0500 | [diff] [blame] | 360 | |
Ashlesh Gawande | 044611d | 2016-12-21 14:24:49 -0600 | [diff] [blame] | 361 | topo = NdnTopo(options.templateFile, options.workDir) |
ashu | ef3490b | 2015-02-17 11:01:04 -0600 | [diff] [blame] | 362 | |
| 363 | t = datetime.datetime.now() |
| 364 | |
| 365 | if topo.isTCLink == True and topo.isLimited == True: |
| 366 | net = Mininet(topo,host=CpuLimitedNdnHost,link=TCLink) |
| 367 | elif topo.isTCLink == True and topo.isLimited == False: |
Ashlesh Gawande | f5f304b | 2016-06-16 16:42:41 -0500 | [diff] [blame] | 368 | if options.cluster is not None: |
| 369 | mn = partial(MininetCluster, servers=options.servers, placement=options.placement) |
| 370 | net = mn(topo=topo, host=RemoteNdnHost, link=options.tunnelType) |
| 371 | else: |
| 372 | net = Mininet(topo, host=NdnHost, link=TCLink) |
ashu | ef3490b | 2015-02-17 11:01:04 -0600 | [diff] [blame] | 373 | elif topo.isTCLink == False and topo.isLimited == True: |
Ashlesh Gawande | f5f304b | 2016-06-16 16:42:41 -0500 | [diff] [blame] | 374 | net = Mininet(topo, host=CpuLimitedNdnHost) |
ashu | ef3490b | 2015-02-17 11:01:04 -0600 | [diff] [blame] | 375 | else: |
Ashlesh Gawande | f5f304b | 2016-06-16 16:42:41 -0500 | [diff] [blame] | 376 | net = Mininet(topo, host=NdnHost) |
ashu | ef3490b | 2015-02-17 11:01:04 -0600 | [diff] [blame] | 377 | |
| 378 | t2 = datetime.datetime.now() |
| 379 | |
| 380 | delta = t2 - t |
| 381 | |
| 382 | info('Setup time: ' + str(delta.seconds) + '\n') |
| 383 | |
| 384 | net.start() |
| 385 | |
ashu | 2ad32e2 | 2015-05-29 13:37:40 -0500 | [diff] [blame] | 386 | # Giving proper IPs to intf so neighbor nodes can communicate |
| 387 | # This is one way of giving connectivity, another way could be |
| 388 | # to insert a switch between each pair of neighbors |
| 389 | ndnNetBase = "1.0.0.0" |
| 390 | interfaces = [] |
| 391 | for host in net.hosts: |
| 392 | for intf in host.intfList(): |
| 393 | link = intf.link |
| 394 | node1, node2 = link.intf1.node, link.intf2.node |
Vince Lehman | fbd47c9 | 2015-10-14 16:00:06 -0500 | [diff] [blame] | 395 | |
| 396 | if node1 in net.switches or node2 in net.switches: |
Vince Lehman | fbd47c9 | 2015-10-14 16:00:06 -0500 | [diff] [blame] | 397 | continue |
| 398 | |
ashu | 2ad32e2 | 2015-05-29 13:37:40 -0500 | [diff] [blame] | 399 | if link.intf1 not in interfaces and link.intf2 not in interfaces: |
| 400 | interfaces.append(link.intf1) |
| 401 | interfaces.append(link.intf2) |
| 402 | node1.setIP(ipStr(ipParse(ndnNetBase) + 1) + '/30', intf=link.intf1) |
| 403 | node2.setIP(ipStr(ipParse(ndnNetBase) + 2) + '/30', intf=link.intf2) |
| 404 | ndnNetBase = ipStr(ipParse(ndnNetBase) + 4) |
| 405 | |
Ashlesh Gawande | 532302b | 2018-02-15 18:58:20 -0600 | [diff] [blame] | 406 | time.sleep(2) |
| 407 | info('Starting NFD on nodes\n') |
| 408 | for host in net.hosts: |
| 409 | host.nfd = Nfd(host, options.csSize) |
| 410 | host.nfd.start() |
| 411 | |
dmcoomes | ecf9c5a | 2017-10-11 10:17:46 -0500 | [diff] [blame] | 412 | if options.isNlsrEnabled is True: |
Vince Lehman | 5d5a566 | 2015-12-02 12:33:12 -0600 | [diff] [blame] | 413 | |
dmcoomes | ecf9c5a | 2017-10-11 10:17:46 -0500 | [diff] [blame] | 414 | # NLSR Security |
| 415 | if options.nlsrSecurity is True: |
| 416 | Nlsr.createKeysAndCertificates(net, options.workDir) |
ashu | ef3490b | 2015-02-17 11:01:04 -0600 | [diff] [blame] | 417 | |
dmcoomes | ecf9c5a | 2017-10-11 10:17:46 -0500 | [diff] [blame] | 418 | # NLSR initialization |
Ashlesh Gawande | 532302b | 2018-02-15 18:58:20 -0600 | [diff] [blame] | 419 | info('Starting NLSR on nodes\n') |
dmcoomes | ecf9c5a | 2017-10-11 10:17:46 -0500 | [diff] [blame] | 420 | for host in net.hosts: |
| 421 | conf = next(x for x in hosts_conf if x.name == host.name) |
| 422 | host.nlsrParameters = conf.nlsrParameters |
| 423 | |
| 424 | if options.nFaces is not None: |
| 425 | host.nlsrParameters["max-faces-per-prefix"] = options.nFaces |
ashu | ef3490b | 2015-02-17 11:01:04 -0600 | [diff] [blame] | 426 | |
dmcoomes | 2ef39c0 | 2017-10-20 14:06:26 -0500 | [diff] [blame] | 427 | if options.routingType == 'dry': |
| 428 | host.nlsrParameters["hyperbolic-state"] = "dry-run" |
dmcoomes | 7adc7f7 | 2017-10-06 12:01:28 -0500 | [diff] [blame] | 429 | |
dmcoomes | 2ef39c0 | 2017-10-20 14:06:26 -0500 | [diff] [blame] | 430 | elif options.routingType == 'hr': |
| 431 | host.nlsrParameters["hyperbolic-state"] = "on" |
ashu | ef3490b | 2015-02-17 11:01:04 -0600 | [diff] [blame] | 432 | |
dmcoomes | ecf9c5a | 2017-10-11 10:17:46 -0500 | [diff] [blame] | 433 | # Generate NLSR configuration file |
| 434 | configGenerator = NlsrConfigGenerator(host, options.nlsrSecurity, options.faceType) |
| 435 | configGenerator.createConfigFile() |
ashu | ef3490b | 2015-02-17 11:01:04 -0600 | [diff] [blame] | 436 | |
dmcoomes | ecf9c5a | 2017-10-11 10:17:46 -0500 | [diff] [blame] | 437 | # Start NLSR |
| 438 | host.nlsr = Nlsr(host, configGenerator.neighborIPs, options.faceType) |
| 439 | host.nlsr.start() |
ashu | ef3490b | 2015-02-17 11:01:04 -0600 | [diff] [blame] | 440 | |
ashu | ef3490b | 2015-02-17 11:01:04 -0600 | [diff] [blame] | 441 | for host in net.hosts: |
| 442 | if 'app' in host.params: |
Ashlesh Gawande | 557cb84 | 2015-07-01 15:39:44 -0500 | [diff] [blame] | 443 | if host.params['app'] != '': |
| 444 | app = host.params['app'] |
Ashlesh Gawande | 044611d | 2016-12-21 14:24:49 -0600 | [diff] [blame] | 445 | print("Starting " + app + " on node " + host.name) |
Ashlesh Gawande | 557cb84 | 2015-07-01 15:39:44 -0500 | [diff] [blame] | 446 | print(host.cmd(app)) |
ashu | ef3490b | 2015-02-17 11:01:04 -0600 | [diff] [blame] | 447 | |
Alexander Lane | 052aabb | 2018-05-14 14:48:29 -0500 | [diff] [blame] | 448 | # Determine if each host is running NFD and NLSR |
| 449 | for host in net.hosts: |
| 450 | nfdStatus = host.cmd("ps -g -U root | grep 'nfd --config {}/[n]fd.conf'".format(host.homeFolder)) |
| 451 | nlsrStatus = host.cmd("ps -g | grep 'nlsr -f {}/[n]lsr.conf'".format(host.homeFolder)) |
| 452 | if not host.nfd.isRunning or not nfdStatus: |
| 453 | print("NFD on host {} is not running. Printing log file and exiting...".format(host.name)) |
| 454 | print(host.cmd("cat {}/nfd.log".format(host.homeFolder))) |
| 455 | net.stop() |
| 456 | sys.exit(1) |
Alexander Lane | d6c3cad | 2018-06-19 15:11:04 -0500 | [diff] [blame] | 457 | if options.isNlsrEnabled and (not host.nlsr.isRunning or not nlsrStatus): |
Alexander Lane | 052aabb | 2018-05-14 14:48:29 -0500 | [diff] [blame] | 458 | print("NLSR on host {} is not running. Printing log file and exiting...".format(host.name)) |
| 459 | print(host.cmd("cat {}/log/nlsr.log".format(host.homeFolder))) |
| 460 | net.stop() |
| 461 | sys.exit(1) |
| 462 | |
Vince Lehman | 3b8bc65 | 2015-06-18 15:01:47 -0500 | [diff] [blame] | 463 | # Load experiment |
Vince Lehman | 194be24 | 2015-10-15 18:01:42 -0500 | [diff] [blame] | 464 | experimentName = options.experimentName |
| 465 | |
Vince Lehman | 3b8bc65 | 2015-06-18 15:01:47 -0500 | [diff] [blame] | 466 | if experimentName is not None: |
Ashlesh Gawande | 044611d | 2016-12-21 14:24:49 -0600 | [diff] [blame] | 467 | print("Loading experiment: %s" % experimentName) |
Vince Lehman | 3b8bc65 | 2015-06-18 15:01:47 -0500 | [diff] [blame] | 468 | |
| 469 | experimentArgs = { |
| 470 | "net": net, |
Vince Lehman | 194be24 | 2015-10-15 18:01:42 -0500 | [diff] [blame] | 471 | "ctime": options.ctime, |
| 472 | "nPings": options.nPings, |
Alexander Lane | 6f7a64f | 2018-05-17 15:01:14 -0500 | [diff] [blame^] | 473 | "strategy": Nfdc.STRATEGY_BEST_ROUTE, |
Ashlesh Gawande | 6a075c2 | 2017-08-03 15:15:49 -0500 | [diff] [blame] | 474 | "pctTraffic": options.pctTraffic, |
Ashlesh Gawande | 501d4d6 | 2017-10-25 13:12:11 -0500 | [diff] [blame] | 475 | "nlsrSecurity": options.nlsrSecurity, |
| 476 | "workDir": options.workDir, |
Alexander Lane | 1bc9b47 | 2018-05-16 15:07:16 -0500 | [diff] [blame] | 477 | "arguments" : options.arguments |
Vince Lehman | 3b8bc65 | 2015-06-18 15:01:47 -0500 | [diff] [blame] | 478 | } |
| 479 | |
| 480 | experiment = ExperimentManager.create(experimentName, experimentArgs) |
| 481 | |
| 482 | if experiment is not None: |
| 483 | experiment.start() |
| 484 | else: |
Ashlesh Gawande | 044611d | 2016-12-21 14:24:49 -0600 | [diff] [blame] | 485 | print("ERROR: Experiment '%s' does not exist" % experimentName) |
Vince Lehman | 3b8bc65 | 2015-06-18 15:01:47 -0500 | [diff] [blame] | 486 | return |
| 487 | |
Vince Lehman | 194be24 | 2015-10-15 18:01:42 -0500 | [diff] [blame] | 488 | if options.isCliEnabled is True: |
Ashlesh Gawande | 95789cc | 2017-02-27 12:38:04 -0600 | [diff] [blame] | 489 | MiniNDNCLI(net) |
ashu | ef3490b | 2015-02-17 11:01:04 -0600 | [diff] [blame] | 490 | |
| 491 | net.stop() |
| 492 | |
Ashlesh Gawande | d829bfc | 2015-10-14 16:38:10 -0500 | [diff] [blame] | 493 | if options.resultDir is not None: |
| 494 | print("Moving results to %s" % options.resultDir) |
Ashlesh Gawande | f5f304b | 2016-06-16 16:42:41 -0500 | [diff] [blame] | 495 | for file in glob.glob('%s/*' % options.workDir): |
| 496 | shutil.move(file, options.resultDir) |
| 497 | if options.cluster is not None: |
| 498 | for server in options.servers: |
| 499 | if server != "localhost": |
| 500 | login = "mininet@%s" % server |
| 501 | src = "%s:%s/*" % (login, options.workDir) |
| 502 | dst = options.resultDir |
| 503 | scp(src, dst) |
| 504 | print("Please clean work directories of other machines before running the cluster again") |
Ashlesh Gawande | d829bfc | 2015-10-14 16:38:10 -0500 | [diff] [blame] | 505 | |
Ashlesh Gawande | 3807c1b | 2016-08-05 16:27:02 -0500 | [diff] [blame] | 506 | def signal_handler(signal, frame): |
| 507 | print('Cleaning up...') |
| 508 | call(["nfd-stop"]) |
| 509 | call(["sudo", "mn", "--clean"]) |
| 510 | sys.exit(1) |
| 511 | |
Alexander Lane | 052aabb | 2018-05-14 14:48:29 -0500 | [diff] [blame] | 512 | def verify_dependencies(): |
| 513 | "Prevent MiniNDN from running without necessary dependencies" |
| 514 | dependencies = ["nfd", "nlsr", "infoedit", "ndnping", "ndnpingserver"] |
| 515 | devnull = open("/dev/null", "w") |
| 516 | # Checks that each program is in the system path |
| 517 | for program in dependencies: |
| 518 | if call(["which", program], stdout=devnull): |
| 519 | print("{} is missing from the system path! Exiting...".format(program)) |
| 520 | sys.exit(1) |
| 521 | devnull.close() |
| 522 | |
ashu | ef3490b | 2015-02-17 11:01:04 -0600 | [diff] [blame] | 523 | if __name__ == '__main__': |
Vince Lehman | 3b8bc65 | 2015-06-18 15:01:47 -0500 | [diff] [blame] | 524 | |
ashu | ef3490b | 2015-02-17 11:01:04 -0600 | [diff] [blame] | 525 | hosts_conf = [] |
| 526 | links_conf = [] |
Vince Lehman | 194be24 | 2015-10-15 18:01:42 -0500 | [diff] [blame] | 527 | |
Ashlesh Gawande | 2763f19 | 2017-10-25 15:48:39 -0500 | [diff] [blame] | 528 | signal.signal(signal.SIGQUIT, signal_handler) |
Ashlesh Gawande | 3807c1b | 2016-08-05 16:27:02 -0500 | [diff] [blame] | 529 | |
Vince Lehman | 194be24 | 2015-10-15 18:01:42 -0500 | [diff] [blame] | 530 | options = parse_args() |
ashu | ef3490b | 2015-02-17 11:01:04 -0600 | [diff] [blame] | 531 | |
| 532 | setLogLevel('info') |
Alexander Lane | 052aabb | 2018-05-14 14:48:29 -0500 | [diff] [blame] | 533 | verify_dependencies() |
Alexander Lane | e842cc2 | 2018-05-14 11:37:43 -0500 | [diff] [blame] | 534 | |
Alexander Lane | e842cc2 | 2018-05-14 11:37:43 -0500 | [diff] [blame] | 535 | try: |
| 536 | execute(options) |
| 537 | except Exception as e: |
Alexander Lane | 4fa8881 | 2018-05-23 12:56:52 -0500 | [diff] [blame] | 538 | print("Error: {}".format(e)) |
Alexander Lane | e842cc2 | 2018-05-14 11:37:43 -0500 | [diff] [blame] | 539 | call(["nfd-stop"]) |
| 540 | call(["sudo", "mn", "--clean"]) |
Ashlesh Gawande | 670ff15 | 2018-06-08 12:26:39 -0500 | [diff] [blame] | 541 | sys.exit(1) |