Ashlesh Gawande | 6c86e30 | 2019-09-17 22:27:05 -0500 | [diff] [blame] | 1 | Howtos |
| 2 | ====== |
| 3 | |
| 4 | Connect Mini-NDN nodes to an outside network |
Davide Pesavento | 750d040 | 2025-02-25 16:50:50 -0500 | [diff] [blame^] | 5 | -------------------------------------------- |
Ashlesh Gawande | 6c86e30 | 2019-09-17 22:27:05 -0500 | [diff] [blame] | 6 | |
| 7 | Mini-NDN nodes can be connected to an outside network indirectly by |
| 8 | running NFD on the local machine: |
| 9 | |
Davide Pesavento | 750d040 | 2025-02-25 16:50:50 -0500 | [diff] [blame^] | 10 | .. code-block:: none |
Ashlesh Gawande | 6c86e30 | 2019-09-17 22:27:05 -0500 | [diff] [blame] | 11 | |
| 12 | (Mini-NDN node) ------ (NFD running on the host machine where Mini-NDN is running) ------- (External Network) |
| 13 | |
| 14 | Add a node in root namespace |
| 15 | ____________________________ |
| 16 | |
Davide Pesavento | 750d040 | 2025-02-25 16:50:50 -0500 | [diff] [blame^] | 17 | For this simple example, we can use a single node topology with node 'a'. |
Ashlesh Gawande | 6c86e30 | 2019-09-17 22:27:05 -0500 | [diff] [blame] | 18 | |
| 19 | If we want node 'a' to connect to the host machine, we need to add a |
| 20 | "root" node which has a link with node "a." |
| 21 | |
| 22 | Then the following code can be used: |
| 23 | |
Davide Pesavento | 750d040 | 2025-02-25 16:50:50 -0500 | [diff] [blame^] | 24 | .. code-block:: python |
Ashlesh Gawande | 6c86e30 | 2019-09-17 22:27:05 -0500 | [diff] [blame] | 25 | |
| 26 | topo = Topo() |
| 27 | root = topo.addHost('root', inNamespace=False) |
| 28 | a = topo.addHost('a') |
| 29 | topo.addLink(root, a, delay='10ms') |
| 30 | |
| 31 | ndn = Minindn(topo=topo) |
Ashlesh Gawande | 6c86e30 | 2019-09-17 22:27:05 -0500 | [diff] [blame] | 32 | ... |
| 33 | |
| 34 | Configuration |
| 35 | _____________ |
| 36 | |
Davide Pesavento | 750d040 | 2025-02-25 16:50:50 -0500 | [diff] [blame^] | 37 | Run Mini-NDN with the above code and issue ``ifconfig`` on the local |
Ashlesh Gawande | 6c86e30 | 2019-09-17 22:27:05 -0500 | [diff] [blame] | 38 | machine to confirm the addition of the interface. You should be able to |
| 39 | locate "root-eth0": |
| 40 | |
Davide Pesavento | 750d040 | 2025-02-25 16:50:50 -0500 | [diff] [blame^] | 41 | .. code-block:: none |
Ashlesh Gawande | 6c86e30 | 2019-09-17 22:27:05 -0500 | [diff] [blame] | 42 | |
| 43 | root-eth0 Link encap:Ethernet HWaddr 3e:eb:77:d2:6f:1f |
| 44 | inet addr:1.0.0.9 Bcast:1.0.0.11 Mask:255.255.255.252 |
| 45 | inet6 addr: fe80::3ceb:77ff:fed2:6f1f/64 Scope:Link |
| 46 | UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 |
| 47 | RX packets:34 errors:0 dropped:0 overruns:0 frame:0 |
| 48 | TX packets:33 errors:0 dropped:0 overruns:0 carrier:0 |
| 49 | collisions:0 txqueuelen:1000 |
| 50 | RX bytes:2667 (2.6 KB) TX bytes:2797 (2.7 KB) |
| 51 | |
| 52 | To make the IP address associated with this interface persistent, add |
Davide Pesavento | 750d040 | 2025-02-25 16:50:50 -0500 | [diff] [blame^] | 53 | the following line to ``/etc/network/interfaces`` and reboot your machine: |
Ashlesh Gawande | 6c86e30 | 2019-09-17 22:27:05 -0500 | [diff] [blame] | 54 | |
Davide Pesavento | 750d040 | 2025-02-25 16:50:50 -0500 | [diff] [blame^] | 55 | .. code-block:: none |
Ashlesh Gawande | 6c86e30 | 2019-09-17 22:27:05 -0500 | [diff] [blame] | 56 | |
| 57 | iface root-eth0 inet manual |
| 58 | |
| 59 | Check connection |
| 60 | ________________ |
| 61 | |
| 62 | After rebooting, run Mini-NDN and issue the following command: |
| 63 | |
Davide Pesavento | 750d040 | 2025-02-25 16:50:50 -0500 | [diff] [blame^] | 64 | .. code-block:: none |
Ashlesh Gawande | 6c86e30 | 2019-09-17 22:27:05 -0500 | [diff] [blame] | 65 | |
| 66 | mini-ndn>net |
| 67 | a a-eth0:b-eth0 a-eth1:c-eth0 a-eth2:root-eth0 |
| 68 | |
Davide Pesavento | 750d040 | 2025-02-25 16:50:50 -0500 | [diff] [blame^] | 69 | Node "a" is connected to "root-eth0". Now issue ``ifconfig a-eth2`` on |
Ashlesh Gawande | 6c86e30 | 2019-09-17 22:27:05 -0500 | [diff] [blame] | 70 | node "a": |
| 71 | |
Davide Pesavento | 750d040 | 2025-02-25 16:50:50 -0500 | [diff] [blame^] | 72 | .. code-block:: none |
Ashlesh Gawande | 6c86e30 | 2019-09-17 22:27:05 -0500 | [diff] [blame] | 73 | |
| 74 | mini-ndn>a ifconfig a-eth2 |
| 75 | a-eth2 Link encap:Ethernet HWaddr fa:76:d4:86:d3:ba |
| 76 | inet addr:1.0.0.10 Bcast:1.0.0.11 Mask:255.255.255.252 |
| 77 | |
| 78 | As learned from the previous step, the IP address of root-eth0 is |
| 79 | 1.0.0.9. |
| 80 | |
Davide Pesavento | 750d040 | 2025-02-25 16:50:50 -0500 | [diff] [blame^] | 81 | .. code-block:: none |
Ashlesh Gawande | 6c86e30 | 2019-09-17 22:27:05 -0500 | [diff] [blame] | 82 | |
| 83 | mini-ndn>a ping 1.0.0.9 |
| 84 | PING 1.0.0.9 (1.0.0.9) 56(84) bytes of data. |
| 85 | 64 bytes from 1.0.0.9: icmp_seq=1 ttl=64 time=0.137 ms |
| 86 | 64 bytes from 1.0.0.9: icmp_seq=2 ttl=64 time=0.123 ms |
| 87 | |
| 88 | The host machine will also be able to ping node "a": |
| 89 | |
Davide Pesavento | 750d040 | 2025-02-25 16:50:50 -0500 | [diff] [blame^] | 90 | .. code-block:: none |
Ashlesh Gawande | 6c86e30 | 2019-09-17 22:27:05 -0500 | [diff] [blame] | 91 | |
| 92 | VirtualBox:~$ ping 1.0.0.10 |
| 93 | PING 1.0.0.10 (1.0.0.10) 56(84) bytes of data. |
| 94 | 64 bytes from 1.0.0.10: icmp_seq=1 ttl=64 time=0.086 ms |
| 95 | |
| 96 | Run NFD on local machine and register route |
| 97 | ___________________________________________ |
| 98 | |
| 99 | Start NFD on the local machine by using: |
| 100 | |
Davide Pesavento | 750d040 | 2025-02-25 16:50:50 -0500 | [diff] [blame^] | 101 | .. code-block:: sh |
Ashlesh Gawande | 6c86e30 | 2019-09-17 22:27:05 -0500 | [diff] [blame] | 102 | |
| 103 | sudo nfd |
| 104 | |
Davide Pesavento | 750d040 | 2025-02-25 16:50:50 -0500 | [diff] [blame^] | 105 | The ``nfd-start`` script cannot be used, since the script allows only one |
Ashlesh Gawande | 6c86e30 | 2019-09-17 22:27:05 -0500 | [diff] [blame] | 106 | instance of NFD at a time. The NFD processes running on the Mini-NDN |
Davide Pesavento | 750d040 | 2025-02-25 16:50:50 -0500 | [diff] [blame^] | 107 | nodes will prevent the ``nfd-start`` script from working. |
Ashlesh Gawande | 6c86e30 | 2019-09-17 22:27:05 -0500 | [diff] [blame] | 108 | |
Davide Pesavento | 750d040 | 2025-02-25 16:50:50 -0500 | [diff] [blame^] | 109 | Now, using ``nfdc register``, we can register a route from node "a" in |
Ashlesh Gawande | 6c86e30 | 2019-09-17 22:27:05 -0500 | [diff] [blame] | 110 | Mini-NDN to the NFD process on the host machine and from the host |
| 111 | machine to an external machine. |
| 112 | |
| 113 | Also, if the local machine has a public IP, Mini-NDN nodes can be |
| 114 | reached via external machines. |
Alex Lane | 587b78f | 2020-08-13 18:43:14 -0500 | [diff] [blame] | 115 | |
| 116 | Generate NDN testbed topology |
Davide Pesavento | 750d040 | 2025-02-25 16:50:50 -0500 | [diff] [blame^] | 117 | _____________________________ |
Alex Lane | 587b78f | 2020-08-13 18:43:14 -0500 | [diff] [blame] | 118 | |
Davide Pesavento | 750d040 | 2025-02-25 16:50:50 -0500 | [diff] [blame^] | 119 | Visit the `NDN Play testbed <https://play.ndn.today/?testbed=1>`__ |
| 120 | page and utilize the "MiniNDN Config" button after setting loss |
awlane | 73add71 | 2024-08-12 21:49:00 -0500 | [diff] [blame] | 121 | and latency parameters. This will export an up to date topology |
| 122 | modeled on the testbed. We also provide a topology at |
Davide Pesavento | 750d040 | 2025-02-25 16:50:50 -0500 | [diff] [blame^] | 123 | ``topologies/testbed.conf``, which is based on a sample from 2020 |
| 124 | which has latencies based on measurements from that configuration. |