Examples: incorporate latest change of NDNPing Class
Change-Id: I01d59de621992a87c082074766dc18e9a7b549a2
diff --git a/examples/nlsr/mcn_failure.py b/examples/nlsr/mcn_failure.py
index 1bd0449..decb586 100644
--- a/examples/nlsr/mcn_failure.py
+++ b/examples/nlsr/mcn_failure.py
@@ -1,6 +1,6 @@
# -*- Mode:python; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
#
-# Copyright (C) 2015-2019, The University of Memphis,
+# Copyright (C) 2015-2021, The University of Memphis,
# Arizona Board of Regents,
# Regents of the University of California.
#
@@ -32,7 +32,7 @@
from minindn.apps.nlsr import Nlsr
from minindn.helpers.experiment import Experiment
from minindn.helpers.nfdc import Nfdc
-from minindn.helpers.ndnpingclient import NDNPingClient
+from minindn.helpers.ndnping import NDNPing
from nlsr_common import getParser
@@ -63,7 +63,7 @@
if args.nPings != 0:
Experiment.setupPing([mcn], Nfdc.STRATEGY_BEST_ROUTE)
for nodeToPing in pingedDict[mcn]:
- NDNPingClient.ping(mcn, nodeToPing, PING_COLLECTION_TIME_AFTER_RECOVERY)
+ NDNPing.ping(mcn, nodeToPing, nPings=PING_COLLECTION_TIME_AFTER_RECOVERY)
time.sleep(PING_COLLECTION_TIME_AFTER_RECOVERY)
diff --git a/examples/nlsr/multiple_failure.py b/examples/nlsr/multiple_failure.py
index 48d1afd..0833ff1 100644
--- a/examples/nlsr/multiple_failure.py
+++ b/examples/nlsr/multiple_failure.py
@@ -1,6 +1,6 @@
# -*- Mode:python; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
#
-# Copyright (C) 2015-2019, The University of Memphis,
+# Copyright (C) 2015-2021, The University of Memphis,
# Arizona Board of Regents,
# Regents of the University of California.
#
@@ -32,7 +32,7 @@
from minindn.apps.nlsr import Nlsr
from minindn.helpers.experiment import Experiment
from minindn.helpers.nfdc import Nfdc
-from minindn.helpers.ndnpingclient import NDNPingClient
+from minindn.helpers.ndnping import NDNPing
from nlsr_common import getParser
@@ -45,7 +45,7 @@
FAILURE_INTERVAL = 60
RECOVERY_INTERVAL = 60
- # This is the number of pings required to make it through the full experiment
+ # 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))
@@ -82,11 +82,11 @@
# Restart pings
for nodeToPing in pingedDict[host]:
- NDNPingClient.ping(host, nodeToPing, nPings)
+ NDNPing.ping(host, nodeToPing, nPings=nPings)
time.sleep(RECOVERY_INTERVAL - recovery_time)
- #Experiment.checkConvergence(ndn, ndn.net.hosts, args.ctime, quit=True)
+ Experiment.checkConvergence(ndn, ndn.net.hosts, args.ctime, quit=True)
if __name__ == '__main__':
setLogLevel('info')
diff --git a/examples/wifi/wifi_ping.py b/examples/wifi/wifi_ping.py
index bd48b15..a712342 100644
--- a/examples/wifi/wifi_ping.py
+++ b/examples/wifi/wifi_ping.py
@@ -27,7 +27,7 @@
from minindn.apps.app_manager import AppManager
from minindn.apps.nfd import Nfd
from minindn.helpers.nfdc import Nfdc
-from minindn.helpers.ndnpingclient import NDNPingClient
+from minindn.helpers.ndnping import NDNPing
from time import sleep
# This experiment uses the singleap topology and is intended to be a basic
# test case where we see if two nodes can send interests to each other.
@@ -64,13 +64,14 @@
nfds = AppManager(ndnwifi, ndnwifi.net.stations, Nfd)
info("Starting pingserver...")
- ping_server_proc = getPopen(b, "ndnpingserver /example")
+ NDNPing.startPingServer(b, "/example")
Nfdc.createFace(a, b.IP())
Nfdc.registerRoute(a, "/example", b.IP())
info("Starting ping...")
- NDNPingClient.ping(a, "/example", 10)
+ NDNPing.ping(a, "/example", nPings=10)
+ sleep(10)
# Start the CLI
MiniNDNWifiCLI(ndnwifi.net)
ndnwifi.net.stop()