Use default topology when no topology file is provided
Change-Id: Icbc434a82cc147c84680c77e2f089f20d50ad803
refs: #2915
diff --git a/bin/minindn b/bin/minindn
index 952c568..97d3c74 100755
--- a/bin/minindn
+++ b/bin/minindn
@@ -23,11 +23,9 @@
def parse_args():
usage="""Usage: minindn [template_file] [ -t | --testbed ]
- If no template_file is given, will try to load template
- from file minindn.conf in the current directory.
+ If no template_file is given, ndn_utils/default-topology.conf (given sample file)
+ will be used.
If --testbed is used, minindn will run the NDN Project Testbed.
- This assumes you are in the testbed directory in the minindn installation
- directory.
"""
testbed = False
@@ -115,12 +113,18 @@
def execute(template_file='minindn.conf', testbed=False, pingall=None, ctime=None, hr=False, faces=3, failure=False, isMultipleFailure=False, isCliEnabled=True):
"Create a network based on template_file"
+ install_dir='/usr/local/etc/mini-ndn/'
+
if template_file == '':
- template_file='minindn.conf'
+ template_file = install_dir + 'default-topology.conf'
+
+ if testbed:
+ template_file = install_dir + 'minindn.testbed.conf'
if os.path.exists(template_file) == False:
- info('No template file given and default template file minindn.conf not found. Exiting...\n')
+ info('No template file given and default template file cannot be found. Exiting...\n')
quit()
+
topo = NdnTopo(template_file)
t = datetime.datetime.now()
diff --git a/install.sh b/install.sh
index ca86513..e40ac47 100755
--- a/install.sh
+++ b/install.sh
@@ -144,10 +144,14 @@
$install python-setuptools
pysetup="true"
fi
- sudo mkdir -p /usr/local/etc/mini-ndn/
- sudo cp ndn_utils/client.conf.sample /usr/local/etc/mini-ndn/
- sudo cp ndn_utils/nfd.conf /usr/local/etc/mini-ndn/
- sudo cp ndn_utils/nlsr.conf /usr/local/etc/mini-ndn/
+ install_dir="/usr/local/etc/mini-ndn/"
+
+ sudo mkdir -p "$install_dir"
+ sudo cp ndn_utils/client.conf.sample "$install_dir"
+ sudo cp ndn_utils/nfd.conf "$install_dir"
+ sudo cp ndn_utils/nlsr.conf "$install_dir"
+ sudo cp ndn_utils/topologies/default-topology.conf "$install_dir"
+ sudo cp ndn_utils/topologies/minindn.testbed.conf "$install_dir"
sudo python setup.py install
}
diff --git a/ndn_utils/hyperbolic_conf_file/minindn.tesbed.conf b/ndn_utils/hyperbolic_conf_file/minindn.tesbed.conf
deleted file mode 100644
index 9fc0bbc..0000000
--- a/ndn_utils/hyperbolic_conf_file/minindn.tesbed.conf
+++ /dev/null
@@ -1,74 +0,0 @@
-[nodes]
-unibas: _ radius=13.2717666496574 angle=2.41932700603969 cpu=10
-bupt: _ radius=11.5095245566676 angle=2.87230371009491 cpu=10
-pku: _ radius=11.1495655496376 angle=2.87014667817084 cpu=10
-tongji: _ radius=11.1495655496376 angle=2.8701500000 cpu=10
-orange: _ radius=10.9327229663161 angle=2.7739430543572 cpu=10
-arizona: _ radius=16.2305391313912 angle=2.97033285094067 cpu=10
-byu: _ radius=19.353845431776 angle=3.77334112452928 cpu=10
-csu: _ radius=14.1056931988398 angle=2.99266609145815 cpu=10
-uiuc: _ radius=29.2553552716 angle=2.98231233822261 cpu=10
-memphis: _ radius=15.2647735129845 angle=2.98360655737705 cpu=10
-neu: _ radius=19.9001283692128 angle=2.13894230769231 cpu=10
-uci: _ radius=19.2697694366069 angle=2.94186046511628 cpu=10
-ucla: _ radius=16.5866430024476 angle=2.99910767400357 cpu=10
-remap: _ radius=16.5866430024476 angle=2.9991100000 cpu=10
-umich: _ radius=17.7738038607456 angle=2.98018269081901 cpu=10
-wustl: _ radius=19.426848571939 angle=4.31067173953721 cpu=10
-urjc: _ radius=13.6888312671789 angle=1.17169974115617 cpu=10
-systemx: _ radius=19.1697680538273 angle=2.62274588691716 cpu=10
-lip6: _ radius=29.2553552716 angle=2.62295081967213 cpu=10
-waseda: _ radius=19.3583257471934 angle=2.99935233160622 cpu=10
-anyang: _ radius=14.3378634978013 angle=2.99956859361519 cpu=10
-caida: _ radius=17.6030443241278 angle=2.94302721088435 cpu=10
-[links]
-bupt:pku delay=14ms
-pku:unibas delay=127ms
-pku:tongji delay=14ms
-bupt:anyang delay=33ms
-bupt:tongji delay=18ms
-anyang:tongji delay=54ms
-bupt:waseda delay=48ms
-tongji:waseda delay=98ms
-tongji:caida delay=93ms
-caida:ucla delay=3ms
-anyang:pku delay=38ms
-anyang:waseda delay=22ms
-ucla:pku delay=85ms
-ucla:remap delay=1ms
-caida:uci delay=3ms
-uci:ucla delay=1ms
-uci:remap delay=1ms
-ucla:csu delay=16ms
-remap:csu delay=16ms
-caida:arizona delay=25ms
-waseda:arizona delay=75ms
-remap:arizona delay=25ms
-arizona:wustl delay=33ms
-wustl:uiuc delay=9ms
-csu:uiuc delay=14ms
-uiuc:umich delay=5ms
-csu:byu delay=8ms
-byu:remap delay=9ms
-byu:arizona delay=30ms
-wustl:urjc delay=86ms
-wustl:memphis delay=17ms
-arizona:memphis delay=17ms
-waseda:orange delay=144ms
-orange:systemx delay=2ms
-unibas:systemx delay=10ms
-memphis:neu delay=21ms
-pku:neu delay=112ms
-csu:umich delay=15ms
-urjc:lip6 delay=15ms
-urjc:unibas delay=9ms
-lip6:systemx delay=2ms
-unibas:lip6 delay=18ms
-memphis:umich delay=12ms
-memphis:orange delay=56ms
-urjc:orange delay=15ms
-lip6:orange delay=3ms
-lip6:umich delay=69ms
-unibas:orange delay=18ms
-umich:neu delay=14ms
-csu:arizona delay=18ms
diff --git a/ndn_utils/topologies/default-topology.conf b/ndn_utils/topologies/default-topology.conf
new file mode 100644
index 0000000..9452122
--- /dev/null
+++ b/ndn_utils/topologies/default-topology.conf
@@ -0,0 +1,9 @@
+[nodes]
+a: _
+b: _
+c: _
+d: _
+[links]
+a:b delay=10ms
+a:c delay=10ms
+b:d delay=10ms
diff --git a/ndn_utils/hyperbolic_conf_file/minindn.caida.conf b/ndn_utils/topologies/minindn.caida.conf
similarity index 100%
rename from ndn_utils/hyperbolic_conf_file/minindn.caida.conf
rename to ndn_utils/topologies/minindn.caida.conf
diff --git a/ndn_utils/topologies/minindn.testbed.conf b/ndn_utils/topologies/minindn.testbed.conf
new file mode 100644
index 0000000..0073f50
--- /dev/null
+++ b/ndn_utils/topologies/minindn.testbed.conf
@@ -0,0 +1,74 @@
+[nodes]
+unibas: _ radius=13.2717666496574 angle=2.41932700603969
+bupt: _ radius=11.5095245566676 angle=2.87230371009491
+pku: _ radius=11.1495655496376 angle=2.87014667817084
+tongji: _ radius=11.1495655496376 angle=2.8701500000
+orange: _ radius=10.9327229663161 angle=2.7739430543572
+arizona: _ radius=16.2305391313912 angle=2.97033285094067
+byu: _ radius=19.353845431776 angle=3.77334112452928
+csu: _ radius=14.1056931988398 angle=2.99266609145815
+uiuc: _ radius=29.2553552716 angle=2.98231233822261
+memphis: _ radius=15.2647735129845 angle=2.98360655737705
+neu: _ radius=19.9001283692128 angle=2.13894230769231
+uci: _ radius=19.2697694366069 angle=2.94186046511628
+ucla: _ radius=16.5866430024476 angle=2.99910767400357
+remap: _ radius=16.5866430024476 angle=2.9991100000
+umich: _ radius=17.7738038607456 angle=2.98018269081901
+wustl: _ radius=19.426848571939 angle=4.31067173953721
+urjc: _ radius=13.6888312671789 angle=1.17169974115617
+systemx: _ radius=19.1697680538273 angle=2.62274588691716
+lip6: _ radius=29.2553552716 angle=2.62295081967213
+waseda: _ radius=19.3583257471934 angle=2.99935233160622
+anyang: _ radius=14.3378634978013 angle=2.99956859361519
+caida: _ radius=17.6030443241278 angle=2.94302721088435
+[links]
+bupt:pku delay=14ms
+pku:unibas delay=127ms
+pku:tongji delay=14ms
+bupt:anyang delay=33ms
+bupt:tongji delay=18ms
+anyang:tongji delay=54ms
+bupt:waseda delay=48ms
+tongji:waseda delay=98ms
+tongji:caida delay=93ms
+caida:ucla delay=3ms
+anyang:pku delay=38ms
+anyang:waseda delay=22ms
+ucla:pku delay=85ms
+ucla:remap delay=1ms
+caida:uci delay=3ms
+uci:ucla delay=1ms
+uci:remap delay=1ms
+ucla:csu delay=16ms
+remap:csu delay=16ms
+caida:arizona delay=25ms
+waseda:arizona delay=75ms
+remap:arizona delay=25ms
+arizona:wustl delay=33ms
+wustl:uiuc delay=9ms
+csu:uiuc delay=14ms
+uiuc:umich delay=5ms
+csu:byu delay=8ms
+byu:remap delay=9ms
+byu:arizona delay=30ms
+wustl:urjc delay=86ms
+wustl:memphis delay=17ms
+arizona:memphis delay=17ms
+waseda:orange delay=144ms
+orange:systemx delay=2ms
+unibas:systemx delay=10ms
+memphis:neu delay=21ms
+pku:neu delay=112ms
+csu:umich delay=15ms
+urjc:lip6 delay=15ms
+urjc:unibas delay=9ms
+lip6:systemx delay=2ms
+unibas:lip6 delay=18ms
+memphis:umich delay=12ms
+memphis:orange delay=56ms
+urjc:orange delay=15ms
+lip6:orange delay=3ms
+lip6:umich delay=69ms
+unibas:orange delay=18ms
+umich:neu delay=14ms
+csu:arizona delay=18ms
diff --git a/ndn_utils/hyperbolic_conf_file/minindn.ucla.conf b/ndn_utils/topologies/minindn.ucla.conf
similarity index 60%
rename from ndn_utils/hyperbolic_conf_file/minindn.ucla.conf
rename to ndn_utils/topologies/minindn.ucla.conf
index 5cdbaf5..9135aeb 100644
--- a/ndn_utils/hyperbolic_conf_file/minindn.ucla.conf
+++ b/ndn_utils/topologies/minindn.ucla.conf
@@ -1,14 +1,14 @@
[nodes]
-ucla: _ radius=20.700007 angle=2.051234 cpu=5
-pku: _ radius=19.320956 angle=2.011893 cpu=5
-csu: _ radius=18.725071 angle=2.054556 cpu=5
-caida: _ radius=17.334066 angle=1.920136 cpu=5
-arizona: _ radius=21.038109 angle=5.203340 cpu=5
-uiuc: _ radius=21.247178 angle=2.038117 cpu=5
-wustl: _ radius=19.994570 angle=2.035105 cpu=5
-umich: _ radius=19.548038 angle=2.037021 cpu=5
-neu: _ radius=18.335813 angle=2.106513 cpu=5
-memphis: _ radius=17.389593 angle=1.925628 cpu=5
+ucla: _ radius=20.700007 angle=2.051234
+pku: _ radius=19.320956 angle=2.011893
+csu: _ radius=18.725071 angle=2.054556
+caida: _ radius=17.334066 angle=1.920136
+arizona: _ radius=21.038109 angle=5.203340
+uiuc: _ radius=21.247178 angle=2.038117
+wustl: _ radius=19.994570 angle=2.035105
+umich: _ radius=19.548038 angle=2.037021
+neu: _ radius=18.335813 angle=2.106513
+memphis: _ radius=17.389593 angle=1.925628
[links]
ucla:csu delay=16ms bw=1000
ucla:umich delay=33ms bw=1000