awlane | d8e6b8e | 2022-05-16 23:49:56 -0500 | [diff] [blame] | 1 | import time |
| 2 | |
| 3 | from mininet.log import setLogLevel, info |
| 4 | |
| 5 | from minindn.wifi.minindnwifi import MinindnWifi |
| 6 | from minindn.apps.app_manager import AppManager |
| 7 | from minindn.apps.nfd import Nfd |
| 8 | from minindn.apps.nlsr import Nlsr |
| 9 | from minindn.helpers.experiment import Experiment |
| 10 | |
| 11 | setLogLevel('info') |
| 12 | |
| 13 | # Setup code |
| 14 | sync = Nlsr.SYNC_PSYNC |
| 15 | |
| 16 | ndn = MinindnWifi() |
| 17 | args = ndn.args |
| 18 | |
| 19 | ndn.start() |
| 20 | |
| 21 | info('Starting NFD on nodes\n') |
| 22 | nfds = AppManager(ndn, ndn.net.stations, Nfd, logLevel='INFO') |
| 23 | face_dict = ndn.setupFaces() |
| 24 | |
| 25 | if 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 | |
| 29 | info('Starting NLSR on nodes\n') |
| 30 | nlsrs = AppManager(ndn, [], Nlsr) |
| 31 | |
| 32 | print(face_dict) |
| 33 | |
| 34 | for host in ndn.net.stations: |
| 35 | nlsrs.startOnNode(host, sync=sync, logLevel='INFO', faceDict=face_dict) |
| 36 | time.sleep(0.1) |
| 37 | |
| 38 | Experiment.checkConvergence(ndn, ndn.net.stations, 60, False) |
| 39 | |
| 40 | # Uncomment for CLI access |
| 41 | from minindn.util import MiniNDNWifiCLI |
| 42 | MiniNDNWifiCLI(ndn.net) |
| 43 | |
| 44 | ndn.stop() |