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