blob: b7a9269e76aeacf372dd00fde8b9ea8c903e5a94 [file] [log] [blame]
awlaned8e6b8e2022-05-16 23:49:56 -05001import time
2
3from mininet.log import setLogLevel, info
4
5from minindn.wifi.minindnwifi import MinindnWifi
6from minindn.apps.app_manager import AppManager
7from minindn.apps.nfd import Nfd
8from minindn.apps.nlsr import Nlsr
9from minindn.helpers.experiment import Experiment
10
11setLogLevel('info')
12
13# Setup code
14sync = Nlsr.SYNC_PSYNC
15
16ndn = MinindnWifi()
17args = ndn.args
18
19ndn.start()
20
21info('Starting NFD on nodes\n')
22nfds = AppManager(ndn, ndn.net.stations, Nfd, logLevel='INFO')
23face_dict = ndn.setupFaces()
24
25if not face_dict:
26 print("Hint: Are you sure you're running with a topology with a faces section? \
27 Try topologies/wifi/nlsr_wifi_example.conf")
28
29info('Starting NLSR on nodes\n')
30nlsrs = AppManager(ndn, [], Nlsr)
31
32print(face_dict)
33
34for host in ndn.net.stations:
35 nlsrs.startOnNode(host, sync=sync, logLevel='INFO', faceDict=face_dict)
36 time.sleep(0.1)
37
38Experiment.checkConvergence(ndn, ndn.net.stations, 60, False)
39
40# Uncomment for CLI access
41from minindn.util import MiniNDNWifiCLI
42MiniNDNWifiCLI(ndn.net)
43
44ndn.stop()