Add wireless simulation to redesigned Mini-NDN using Mininet-wifi.
refs: #4858
Change-Id: If9f7dd069203309c998ab2ff570a6cc8ee362434
diff --git a/minindn/helpers/ndnpingclient.py b/minindn/helpers/ndnpingclient.py
index 37b63db..a252a58 100644
--- a/minindn/helpers/ndnpingclient.py
+++ b/minindn/helpers/ndnpingclient.py
@@ -27,19 +27,21 @@
class NDNPingClient(object):
@staticmethod
- def ping(source, dest, nPings=1, interval=None, timeout=None, starting_seq_num=None,
+ def ping(source, prefix, nPings=1, interval=None, timeout=None, starting_seq_num=None,
identifier=None, allow_stale_data=False, print_timestamp=True, sleepTime=0.2):
- print('Scheduling ping(s) from {} to {}'.format(source.name, dest.name))
+ print('Scheduling ping(s) from {} for {}'.format(source.name, prefix))
# Use '&' to run in background and perform parallel pings
- source.cmd('ndnping{1}{2}{3}{4}{5}{6}{7} /ndn/{0}-site/{0} >> ping-data/{0}.txt &'
+ source.cmd("mkdir ping-data")
+ source.cmd('ndnping{1}{2}{3}{4}{5}{6}{7} {0} >> ping-data/{8}.txt &'
.format(
- dest,
+ prefix,
' -c {}'.format(nPings),
' -i {}'.format(interval) if interval else '',
' -o {}'.format(timeout) if timeout else '',
' -n {}'.format(starting_seq_num) if starting_seq_num else '',
' -p {}'.format(identifier) if identifier else '',
' -a' if allow_stale_data else '',
- ' -t' if print_timestamp else ''
+ ' -t' if print_timestamp else '',
+ str.replace(prefix[1:], "/", "-")
))
time.sleep(sleepTime)
diff --git a/minindn/helpers/nfdc.py b/minindn/helpers/nfdc.py
index 16dabb8..4fc9240 100644
--- a/minindn/helpers/nfdc.py
+++ b/minindn/helpers/nfdc.py
@@ -38,7 +38,7 @@
@staticmethod
def registerRoute(node, namePrefix, remoteNodeAddress, protocol=PROTOCOL_UDP, origin=255,
cost=0, inheritFlag=True, captureFlag=False, expirationInMillis=None):
- cmd = ('nfdc route add {} {}://{} origin {} cost {} {}{}').format(
+ cmd = ('nfdc route add {} {}://{} origin {} cost {} {}{}{}').format(
namePrefix,
protocol,
remoteNodeAddress,