blob: 7f3829fd04a74fa0d2baf9d5481b99c7bb119dd7 [file] [log] [blame]
Ashlesh Gawande6c86e302019-09-17 22:27:05 -05001# -*- Mode:python; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
2#
Saurab Dulal576a4192020-08-25 00:55:22 -05003# Copyright (C) 2015-2020, The University of Memphis,
Ashlesh Gawande6c86e302019-09-17 22:27:05 -05004# Arizona Board of Regents,
5# Regents of the University of California.
6#
7# This file is part of Mini-NDN.
8# See AUTHORS.md for a complete list of Mini-NDN authors and contributors.
9#
10# Mini-NDN is free software: you can redistribute it and/or modify
11# it under the terms of the GNU General Public License as published by
12# the Free Software Foundation, either version 3 of the License, or
13# (at your option) any later version.
14#
15# Mini-NDN is distributed in the hope that it will be useful,
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18# GNU General Public License for more details.
19#
20# You should have received a copy of the GNU General Public License
21# along with Mini-NDN, e.g., in COPYING.md file.
22# If not, see <http://www.gnu.org/licenses/>.
23
24from mininet.log import setLogLevel, info
25
26from minindn.minindn import Minindn
27from minindn.apps.app_manager import AppManager
28from minindn.apps.nfd import Nfd
29from minindn.apps.nlsr import Nlsr
30from minindn.helpers.ip_routing_helper import IPRoutingHelper
31
phmoll9efd7392020-07-21 12:28:22 +020032"""
33This scenario demonstrates the functionality of the IPRoutingHelper. First, the routing helper
34calculates and configures routes between all nodes and then calls the `pingAll` command to
35demonstrate that all nodes are reachable.
36Successful experiments end with: `*** Results: 0% dropped`
37
38To demonstrate the IPRoutingHelper in more complex scenarios, consider starting the experiment with
39the Geant-Topology (topologies/geant.conf).
40"""
Ashlesh Gawande6c86e302019-09-17 22:27:05 -050041if __name__ == '__main__':
42 setLogLevel('info')
43
44 Minindn.cleanUp()
45 Minindn.verifyDependencies()
46
47 ndn = Minindn()
48
49 ndn.start()
50
51 info('Starting NFD on nodes\n')
52 nfds = AppManager(ndn, ndn.net.hosts, Nfd)
53 info('Starting NLSR on nodes\n')
54 nlsrs = AppManager(ndn, ndn.net.hosts, Nlsr)
55
56 # Calculate all routes for IP routing
57 IPRoutingHelper.calcAllRoutes(ndn.net)
58 info("IP routes configured, start ping\n")
59
60 ndn.net.pingAll()
61
phmollad8d37e2020-03-03 12:53:08 +010062 ndn.stop()