Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 1 | Router Configuration |
| 2 | ==================== |
akmhoque | cc82753 | 2014-07-09 08:48:49 -0500 | [diff] [blame] | 3 | |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 4 | .. toctree:: |
| 5 | .. |
| 6 | |
| 7 | Example network and sample configuration |
| 8 | ---------------------------------------- |
| 9 | |
| 10 | Assume that three routers in the same network, but at three different sites |
| 11 | (``memphis.edu``, ``arizona.edu``, and ``colostate.edu``), are connected to each other to |
akmhoque | cc82753 | 2014-07-09 08:48:49 -0500 | [diff] [blame] | 12 | construct the following topology: |
| 13 | |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 14 | :: |
| 15 | |
| 16 | +-------------------------------------+ |
akmhoque | cc82753 | 2014-07-09 08:48:49 -0500 | [diff] [blame] | 17 | | /ndn/edu/memphis/%C1.Router/router1 | |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 18 | +-------------------------------------+ |
akmhoque | cc82753 | 2014-07-09 08:48:49 -0500 | [diff] [blame] | 19 | / 11 12\ |
| 20 | / \ |
| 21 | route-cost = 25 / \ route-cost = 30 |
| 22 | / \ |
| 23 | 17 / \ 13 |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 24 | +-----------------------------------+ 7 10 +-------------------------------------+ |
akmhoque | cc82753 | 2014-07-09 08:48:49 -0500 | [diff] [blame] | 25 | |/ndn/edu/arizona/%C1.Router/router3|-------------------|/ndn/edu/colostate/%C1.Router/router2| |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 26 | +-----------------------------------+ route-cost = 28 +-------------------------------------+ |
akmhoque | cc82753 | 2014-07-09 08:48:49 -0500 | [diff] [blame] | 27 | |
| 28 | Figure: Network Topology |
| 29 | |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 30 | The number represents the connecting face id. For example, |
| 31 | ``/ndn/edu/memphis/%C1.Router/router1`` is connected to |
| 32 | ``/ndn/edu/arizona/%C1.Router/router3`` via face 11 and the route cost is 25. To reach |
| 33 | ``/ndn/edu/colostate/%C1.Router/router2`` via face 12, the route cost is 30. |
akmhoque | cc82753 | 2014-07-09 08:48:49 -0500 | [diff] [blame] | 34 | |
| 35 | We will walk through setting up the faces and creating the configuration file for |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 36 | ``/ndn/edu/memphis/%C1.Router/router1``. |
akmhoque | cc82753 | 2014-07-09 08:48:49 -0500 | [diff] [blame] | 37 | |
Alexander Afanasyev | 7decbbf | 2014-08-24 21:29:01 -0700 | [diff] [blame^] | 38 | Step 1. Ensuring nfd is running |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 39 | ------------------------------- |
| 40 | |
akmhoque | cc82753 | 2014-07-09 08:48:49 -0500 | [diff] [blame] | 41 | Type the following in the terminal: |
| 42 | |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 43 | :: |
akmhoque | cc82753 | 2014-07-09 08:48:49 -0500 | [diff] [blame] | 44 | |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 45 | nfd-status -f |
akmhoque | cc82753 | 2014-07-09 08:48:49 -0500 | [diff] [blame] | 46 | |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 47 | If you see ``ERROR: error while connecting to the forwarder (No such file or directory)``, |
| 48 | ``nfd`` is not running. Follow the instructions in `Getting started with NFD |
| 49 | <http://named-data.net/doc/NFD/current/INSTALL.html>`_ to run nfd. |
akmhoque | cc82753 | 2014-07-09 08:48:49 -0500 | [diff] [blame] | 50 | |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 51 | Step 2. Determining FaceUri |
| 52 | --------------------------- |
akmhoque | cc82753 | 2014-07-09 08:48:49 -0500 | [diff] [blame] | 53 | |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 54 | Assume that ``/ndn/edu/arizona/%C1.Router/router3`` has hostname ``router3.arizona.edu``, |
Alexander Afanasyev | 7decbbf | 2014-08-24 21:29:01 -0700 | [diff] [blame^] | 55 | ``/ndn/edu/colostate/%C1.Router/router2`` has IP address ``79.123.10.145``, and that all |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 56 | routers in the network have agreed to sync data with name prefix ``/ndn/nlsr/sync``. |
Alexander Afanasyev | 7decbbf | 2014-08-24 21:29:01 -0700 | [diff] [blame^] | 57 | ``/ndn/edu/memphis/%C1.Router/router1`` will consider FaceUri |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 58 | ``udp4://router3.arizona.edu`` for router ``/ndn/edu/arizona/%C1.Router/router3`` and face |
| 59 | uri ``udp4://79.123.10.145`` for router ``/ndn/edu/colostate/%C1.Router/router2``. |
| 60 | |
| 61 | Step 3: Creating configuration file |
| 62 | ----------------------------------- |
| 63 | |
| 64 | Now, assume that ``/ndn/memphis.edu/router1`` wants to advertise three name prefixes |
| 65 | (``/ndn/memphis/sports/basketball/grizzlies``, ``/ndn/memphis/entertainment/blues``, |
Alexander Afanasyev | 7decbbf | 2014-08-24 21:29:01 -0700 | [diff] [blame^] | 66 | ``/ndn/news/memphis/politics/lutherking``). The configuration file with the necessary |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 67 | configuration commands follows: |
| 68 | |
| 69 | :: |
akmhoque | cc82753 | 2014-07-09 08:48:49 -0500 | [diff] [blame] | 70 | |
| 71 | ; nlsr.conf starts here |
| 72 | ; the general section contains all the general settings for router |
| 73 | |
| 74 | general |
| 75 | { |
| 76 | ; mandatory configuration command section network, site and router |
akmhoque | cc82753 | 2014-07-09 08:48:49 -0500 | [diff] [blame] | 77 | network /ndn/ ; name of the network the router belongs to in ndn URI format |
| 78 | site /edu/memphis/ ; name of the site the router belongs to in ndn URI format |
| 79 | router /%C1.Router/router1 ; name of the network the router belongs to in ndn URI format |
| 80 | |
| 81 | ; lsa-refresh-time is the time in seconds, after which router will refresh its LSAs |
akmhoque | cc82753 | 2014-07-09 08:48:49 -0500 | [diff] [blame] | 82 | lsa-refresh-time 1800 ; default value 1800. Valid values 240-7200 |
| 83 | |
Alexander Afanasyev | 7decbbf | 2014-08-24 21:29:01 -0700 | [diff] [blame^] | 84 | ; InterestLifetime (in seconds) for LSA fetching |
| 85 | lsa-interest-lifetime 4 ; default value 4. Valid values 1-60 |
akmhoque | cc82753 | 2014-07-09 08:48:49 -0500 | [diff] [blame] | 86 | |
Alexander Afanasyev | 7decbbf | 2014-08-24 21:29:01 -0700 | [diff] [blame^] | 87 | ; log-level is to set the levels of log for NLSR |
akmhoque | cc82753 | 2014-07-09 08:48:49 -0500 | [diff] [blame] | 88 | log-level INFO ; default value INFO, valid value DEBUG, INFO |
| 89 | log-dir /var/log/nlsr/ |
| 90 | seq-dir /var/lib/nlsr/ |
| 91 | } |
| 92 | |
| 93 | ; the neighbors section contains the configuration for router's neighbors and hello's behavior |
| 94 | |
| 95 | neighbors |
| 96 | { |
| 97 | ; in case hello interest timed out, router will try 'hello-retries' times at 'hello-time-out' |
| 98 | ; seconds interval before giving up for any neighbors (deciding link is down) |
| 99 | |
| 100 | hello-retries 3 ; interest retries number in integer. Default value 3 |
| 101 | ; valid values 1-10 |
| 102 | |
| 103 | hello-timeout 1 ; interest time out value in integer. Default value 1 |
| 104 | ; Valid values 1-15 |
| 105 | |
| 106 | hello-interval 60 ; interest sending interval in seconds. Default value 60 |
| 107 | ; valid values 30-90 |
| 108 | ; neighbor command is used to configure router's neighbor. Each neighbor will need |
| 109 | ; one block of neighbor command |
| 110 | |
| 111 | neighbor |
| 112 | { |
| 113 | name /ndn/edu/arizona/%C1.Router/router3 ; name prefix of the neighbor router consists |
| 114 | ; of network, site-name and router-name |
| 115 | |
| 116 | face-uri udp4://router3.arizona.edu ; face uri of the face connected to the neighbor |
| 117 | link-cost 25 ; cost of the connecting link to neighbor |
| 118 | } |
| 119 | |
| 120 | neighbor |
| 121 | { |
| 122 | name /ndn/edu/colostate/%C1.Router/router2 ; name prefix of the neighbor router consists |
| 123 | ; of network, site-name and router-name |
| 124 | |
| 125 | face-uri udp4://79.123.10.145 ; face uri of the face connected to the neighbor |
| 126 | link-cost 30 ; cost of the connecting link to neighbor |
| 127 | } |
| 128 | } |
| 129 | |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 130 | ; the hyperbolic section contains the configuration settings of enabling |
| 131 | a router to calculate ; routing table using `hyperbolic routing table |
| 132 | calculation`_ method |
akmhoque | cc82753 | 2014-07-09 08:48:49 -0500 | [diff] [blame] | 133 | |
| 134 | hyperbolic |
| 135 | { |
| 136 | ; commands in this section follows a strict order |
| 137 | ; the switch is used to set hyperbolic routing calculation in NLSR |
| 138 | |
| 139 | state off ; default value 'off', set value 'on' to enable hyperbolic routing table |
| 140 | ; calculation which turns link state routing 'off'. set value to 'dry-run" |
| 141 | ; to test hyperbolic routing and compare with link state routing. |
| 142 | |
| 143 | |
| 144 | radius 123.456 ; radius of the router in hyperbolic coordinate system |
| 145 | angle 1.45 ; angle of the router in hyperbolic coordinate system |
| 146 | } |
| 147 | |
| 148 | |
| 149 | ; the fib section is used to configure fib entry's type to ndn FIB updated by NLSR |
| 150 | |
| 151 | fib |
| 152 | { |
| 153 | ; the max-faces-per-prefix is used to limit the number of faces for each name prefixes |
| 154 | ; by NLSR in ndn FIB |
| 155 | |
| 156 | max-faces-per-prefix 3 ; default value 0. Valid value 0-60. By default (value 0) NLSR adds |
| 157 | ; all available faces for each reachable name prefixes in NDN FIB |
| 158 | |
| 159 | } |
| 160 | |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 161 | ; the advertising section contains the configuration settings of the |
| 162 | name prefixes ; hosted by this router |
akmhoque | cc82753 | 2014-07-09 08:48:49 -0500 | [diff] [blame] | 163 | |
| 164 | advertising |
| 165 | { |
| 166 | ; the ndnname is used to advertised name from the router. To advertise each name prefix |
| 167 | ; configure one block of ndnname configuration command for every name prefix. |
| 168 | |
| 169 | prefix /ndn/memphis/sports/basketball/grizzlies |
| 170 | prefix /ndn/memphis/entertainment/blues |
| 171 | prefix /ndn/news/memphis/politics/lutherking |
| 172 | } |
| 173 | |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 174 | .. note:: |
akmhoque | cc82753 | 2014-07-09 08:48:49 -0500 | [diff] [blame] | 175 | |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 176 | Security configuration is discussed in :doc:`SECURITY-CONFIG`, which will be also part |
| 177 | of this configuration file |
| 178 | |
| 179 | Step 4: Running NLSR on /ndn/memphis.edu/router1 |
akmhoque | cc82753 | 2014-07-09 08:48:49 -0500 | [diff] [blame] | 180 | ------------------------------------------------- |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 181 | |
| 182 | Assuming the configuration file is saved as ``nlsr.conf``, type the following to run nlsr: |
| 183 | |
| 184 | :: |
akmhoque | cc82753 | 2014-07-09 08:48:49 -0500 | [diff] [blame] | 185 | |
| 186 | $ nlsr -f nlsr.conf |
| 187 | |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 188 | NLSR will look for nlsr.conf in the current directory. If nlsr.conf is not in the current |
| 189 | directory, please provide the absolute path with the file name as the value. If |
| 190 | ``nlsr.conf`` resides in ``/home/ndnuser/configuration`` directory, type ``nlsr -f |
| 191 | /home/ndnuser/configuration/nlsr.conf`` to run nlsr. |
akmhoque | cc82753 | 2014-07-09 08:48:49 -0500 | [diff] [blame] | 192 | |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 193 | The same process needs to be followed for ``/ndn/arizona.edu/router3`` and |
| 194 | ``/ndn/colostate.edu/router2`` to run NLSR on these routers. |
akmhoque | cc82753 | 2014-07-09 08:48:49 -0500 | [diff] [blame] | 195 | |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 196 | Expected Output |
akmhoque | cc82753 | 2014-07-09 08:48:49 -0500 | [diff] [blame] | 197 | ---------------- |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 198 | |
Alexander Afanasyev | 7decbbf | 2014-08-24 21:29:01 -0700 | [diff] [blame^] | 199 | Assuming that all three routers are configured correctly and routing has converged, ``nfd-status`` in |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 200 | ``/ndn/edu/colostate/%C1.Router/router2`` will have the following entries for the name |
| 201 | advertised by ``/ndn/edu/memphis/%C1.Router/router1``: |
akmhoque | cc82753 | 2014-07-09 08:48:49 -0500 | [diff] [blame] | 202 | |
Alexander Afanasyev | 7decbbf | 2014-08-24 21:29:01 -0700 | [diff] [blame^] | 203 | RIB: |
akmhoque | cc82753 | 2014-07-09 08:48:49 -0500 | [diff] [blame] | 204 | |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 205 | :: |
| 206 | |
Alexander Afanasyev | 7decbbf | 2014-08-24 21:29:01 -0700 | [diff] [blame^] | 207 | /ndn/memphis/entertainment/blues route={faceid=17 (origin=128 cost=25 ChildInherit), faceid=7 (origin=128 cost=58 ChildInherit)} |
| 208 | /ndn/memphis/sports/basketball/grizzlies route={faceid=17 (origin=128 cost=25 ChildInherit), faceid=7 (origin=128 cost=58 ChildInherit)} |
| 209 | /ndn/news/memphis/politics/lutherking route={faceid=17 (origin=128 cost=25 ChildInherit, faceid=7 (origin=128 cost=58 ChildInherit)} |
akmhoque | cc82753 | 2014-07-09 08:48:49 -0500 | [diff] [blame] | 210 | |
Alexander Afanasyev | 7decbbf | 2014-08-24 21:29:01 -0700 | [diff] [blame^] | 211 | This output can be seen by typing ``nfd-status -r`` in the terminal. Please refer to the |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 212 | network figure for face IDs. |
| 213 | |
| 214 | .. _hyperbolic routing table calculation: http://arxiv.org/abs/0805.1266 |