docs: Adding README and details NLSR instructions

Change-Id: I038c7a07858a26ed97e64e98c259ad1fcc41c4b8
diff --git a/AUTHORS.md b/AUTHORS.md
index 53b23a9..79e500d 100644
--- a/AUTHORS.md
+++ b/AUTHORS.md
@@ -1,7 +1,7 @@
 NLSR Authors
 ===========
 
-NLSR is an open source project includes contributions from the members of
+NLSR is an open source project includes contributions from the members of the
 [NDN project team](http://named-data.net/project/participants/).
 
 ## Project lead:
@@ -22,7 +22,7 @@
     * A K M Mahmudul Hoque <https://sites.google.com/site/akmhoque/home>
     * Ashlesh Gawande
     * Minsheng Zhang
-    * Syed Obaid Amin      <http://obaidamin.weebly.com/>
+    * Syed Obaid Amin     <http://obaidamin.weebly.com/>
 
 * University of California, Los Angeles
 
@@ -33,5 +33,5 @@
 ## Queries about NLSR
 
 Any general question related to NLSR should be directed to A K M Mahmudul Hoque
-(ahoque1@memphis.edu) and security related question should be directed to
-Yingdi Yu (yingdi@cs.ucla.edu).
+(ahoque1@memphis.edu) and security related question should be directed to Yingdi
+Yu (yingdi@cs.ucla.edu)
diff --git a/README.md b/README.md
index 54072c0..8bbb5f8 100644
--- a/README.md
+++ b/README.md
@@ -1,145 +1,40 @@
-NLSR0.0
-=======
+NLSR - Named Data Link State Routing Protocol
+=============================================
 
-Named Data Link State Routing
+## Overview
 
-Installation:
+NLSR is a routing protocol in NDN that populates NDN's Forwarding Information Base. NLSR
+will continue to evolve alongside the Named Data Networking [protocol](http://named-data.net/doc/ndn-tlv/).
 
-1: Getting NLSR: 
+NLSR is an open and free software package licensed under the GPL 3.0 license and free to all
+Internet users and developers.  For more information about the licensing details and
+limitations, refer to [COPYING.md](https://github.com/named-data/NLSR/blob/master/COPYING.md).
 
-git clone https://github.com/NDN-Routing/NLSR0.0
-git checkout nlsr-cpp
+NLSR is developed by the members of the [NSF-sponsored NDN project team](http://named-data.net/project/participants/).
+For more details, please refer to [AUTHORS.md](https://github.com/named-data/NLSR/blob/master/AUTHORS.md).
+Bug reports and feedback are highly appreciated and can be made through the
+[Redmine site](http://redmine.named-data.net/projects/nlsr).
 
-2: Compiling NLSR
-	a. Run ./configure
-	b. Run make
-	c. For installing run sudo make install
-	
- Prerequisites:
-   i. You must have ndnx install in your machine
-   
-   ii. For smooth compilation you will need need autoconf-2.69 which can 
-   be fethced from http://ftpmirror.gnu.org/autoconf/autoconf-2.69.tar.gz
-   and automake-1.14 which can be fethed from 
-   http://gnu.mirrorcatalogs.com/automake/automake-1.14.tar.gz
-
-Running NLSR:
-
-1: Run ndnx daemon
-
-2: Add '/ndn/keys' route to your neighboring testbed nodes. 
-This can be done by adding routes in your ccnd.conf to all neigbors,
-e.g.
-	add /ndn/keys udp 10.0.XX.XX 
-	add /ndn/keys udp 10.0.YY.YY ...  
-	add	/ndn/keys udp 10.0.ZZ.ZZ
-
-3: Create your keys and publish them through repo. Please have
-	a look at https://github.com/named-data/ndn-testbed-key-suite for details. 
-
-4: create a nlsr configuration file, have a look at
-	macbook.conf and 'Configuration Parameters' section  for details 
-
-7: start nlsr. You can find help for running nlsr with "-h"
+The main design goal of NLSR is to provide a routing protocol to populate NDN's FIB.
+NLSR calculates the routing table using link-state or hyperbolic routing and produces
+multiple faces for each reachable name prefix in a single authoritative domain. NLSR
+will continue to evolve over time to include neighbor discovery and to become a full
+fledged inter-domain routing protocol for NDN.
 
 
-Configuration Parameter: 
+Source releases
+---------------
 
-1. router-name </name/prefix/of/the/router> 
-It is a required configuration parameter that is used to set the router name.
-Name prefix of the router must start with `/ndn' and followed by a strict
-hierarchical order of name components up to the hostname of the router. For
-e.g. if router has a hostname host.dept.org.edu pollux.cs.memphis.edu then the
-router name can be `/ndn/org.edu/dept/host..
+The source code and source-code installation instructions are always available at
+the following links:
 
-2. ccnneighbor </name/prefix/of/neighbor> [neighbor_ip_addrr] 
-This parameter is used to configure the neighboring router. Name prefix of a
-neighbor must start with `/ndn. and followed by a strict hierarchical order of
-name component as mentioned for router-name. If a router has a neighbor having
-hostname `neighbor.dept.org.edu' then configuration command would be
-`ccnneighbor /ndn/org.edu/dept/neighbor. The optional parameter,
-[neighbor_ip_addrr], can be provided for explicitly connecting to a given 
-IP. This is useful if there is no entry of the hostname in the DNS. 
+- [Installation](https://github.com/named-data/NLSR/blob/master/docs/INSTALL.md)
+- [Getting Started with NLSR](https://github.com/named-data/NLSR/blob/master/docs/GETTING-STARTED.md)
+- [Github NLSR repository](https://github.com/named-data/NLSR)
 
-3. ccnname </name/prefix/to/be/advertised> 
-ccnname is used to advertise the name prefix of the services hosted by the
-router. Name prefix must follow the ccnx naming convention.
+Additional information
+----------------------
 
-4. topo-prefix <name/prefix/of/repo/topo> 
-It is used to configure the topological prefix of the `sync. slice created for
-nlsr in a repo. Prefix must follow the ccnx naming convention. Default value
-for topo prefix is `/ndn/routing/nlsr'
-
-5. slice-prefix <name/prefix/of/repo/slice>
-This parameter is used to set the sync's slice prefix. All nlsr nodes `must'
-have the same slice prefix and must follow the ccnx naming convention. Default
-value for slice prefix is `/ndn/routing/nlsr/LSA'
-
-6. lsa-refresh-time <sec> 
-It is the time in seconds, after which router will refresh its LSAs. Default
-value = 1800 sec, Min = 240 sec
-
-7. router-dead-interval <sec> 
-It is the time after which router will consider its neighbor dead if it does
-not hear anything for that amount of time. If an LSA generated by neighbor has
-a lifetime greater than router-dead-interval then router will simply discard
-the LSA and update name prefix table, routing table and ccnd FIB accordingly.
-Default value = 3600 sec, Min = 360 sec.
-
-8. interest-retry <number> 
-interest-retry is maximum number of times a router will send same interest if
-the interest is timed out. Default = 3, Min =1 and Max = 10
-
-9. interest-resend-time <sec>
-When an interest is timed out, NLSR waits for `interest-resend-time. before
-sending another interest. The interest is retransmitted up to the value of
-`interest-retry.. If the interest doesn.t get satisfied during this time the
-neighbor will be considered as dead. Default value = 15 sec, Min = 1 sec, Max =
-60 sec 
-
-10. max-faces-per-prefix <number>
-By default NLSR calculates and add faces for all available faces to a prefix.
-Number of faces can be restricted with this parameter, if this is configured
-NLSR will add <number> or faces per prefixes in ccnd FIB.
-
-11. debug <on/off> 
-Enable nlsr debugging by printing out detail messages on the standard output.
-By default it is off. 
-
-12. logdir </directory/for/logging/> 
-NLSR will start writing log in logdir folder. If logdir is not configured NLSR
-will create a log directory name nlsrLog in user home directory and write log
-into that folder.
-
-13. tunnel-type <udp | tcp> 
-This is used to specify the tunnel type that NLSR should create for building an
-overlay network. By default NLSR creates udp tunnels.
-
-**Following Commands are only required for hyperbolic routing**
-
-14. hyperbolic-routing <on|dry_run> 
-This option enables hyperbolic routing. With option on, link state routing
-doesn't work while with dry_run option route is calculated by Link State 
-routing and hyperbolic routes are just recorded only in log file.Following 
-field is required if hyperbolic routing is on. 
-
-15. hyperbolic-cordinate <radius> <theta> 
-Polar coordinates of a node in a form of radius and theta. Currently, calculation 
-of the polar coordinates is an offline process and done by 
-the operator of a site. 
-
-** Hyperbolic Commands End here **
-
-16. keystore-path </path/to/keystore/file name(.ccnx_keystore)>
-Path to the keystore. The keystore folder is usually created  by
-ccninitkeystore. Keys in this folder will be used by NLSR to sign the packets. 
-
-17. root-key-prefix </key/prefix>   
-Name prefix of the root key; the site key should be signed by this key.  
-e.g. root-key-prefix /ndn/keys
-
-18. site-name </name/prefix/of/site> 
-Name of the site of which this router is a part. 
-
-19. network </name/of/network>
-Name of the networks router belongs to 
+- [NLSR Wiki](http://redmine.named-data.net/projects/nlsr/wiki/)
+- Feature requests and bug reports are welcome on our
+  [NLSR on NDN Redmine](http://redmine.named-data.net/projects/nlsr)
diff --git a/docs/GETTING-STARTED.md b/docs/GETTING-STARTED.md
new file mode 100644
index 0000000..e8315e1
--- /dev/null
+++ b/docs/GETTING-STARTED.md
@@ -0,0 +1,44 @@
+Getting Started with NLSR
+=============================================
+
+Getting Source
+--------------
+
+- [Github NLSR repository](https://github.com/named-data/NLSR)
+
+Installation instruction
+------------------------
+
+- [Installation](https://github.com/named-data/NLSR/blob/master/docs/INSTALL.md)
+
+Installing
+----------
+
+To install NLSR from source:
+
+- Install ndn-cxx according to [ndn-cxx installation instructions](http://named-data.net/doc/ndn-cxx/0.1.0/INSTALL.html)
+- Install nfd according to [nfd installation instructions](http://named-data.net/doc/NFD/current/INSTALL.html)
+- Install NLSR following [these instructions](https://github.com/named-data/NLSR/blob/master/docs/INSTALL.md)
+
+Configuration
+-------------
+
+After installing NLSR from source, you need to create a configuration file for
+NLSR. Please take a look at [nlsr.conf](https://github.com/named-data/NLSR/blob/master/nlsr.conf)
+for a sample configuration. For details on configuring a router, please refer to
+[build network topology](https://github.com/named-data/NLSR/blob/master/docs/TOPOLOGY.md)
+and for security configuration please refer to
+[NLSR's security configuration](https://github.com/named-data/NLSR/blob/master/docs/SECURITY.md)
+
+Running
+-------
+
+Run nlsr with the following command:
+
+    nlsr
+
+NLSR will look for the default configuration file, nlsr.conf, in the current directory.
+
+You can also run nlsr -f options as follows with the absolute path of the configuration file:
+
+    nlsr -f /nlsr/nlsr.conf
diff --git a/docs/INSTALL.md b/docs/INSTALL.md
new file mode 100644
index 0000000..1235e89
--- /dev/null
+++ b/docs/INSTALL.md
@@ -0,0 +1,61 @@
+NLSR Installation Instructions
+=============================
+
+Prerequisites
+-------------
+
+- [ndn-cxx library](https://github.com/named-data/ndn-cxx) and its requirements:
+
+         libcrypto
+         libsqlite3
+         libcrypto++
+         pkg-config
+         Boost libraries (>= 1.48)
+         OSX Security framework (on OSX platform only)
+
+   Refer to [Getting started with ndn-cxx](http://named-data.net/doc/ndn-cxx/current/INSTALL.html) -for detailed installation instructions of the library.
+
+
+- [NFD](https://github.com/named-data/nfd) and its requirements:
+
+   Refer to [Getting started with NFD ](http://named-data.net/doc/NFD/current/getting-started.html)-for detailed installation and running instruction.
+
+
+- log4cxx library
+
+       On linux variants
+
+           sudo apt-get install liblog4cxx10-dev
+
+       On Mac OSx
+
+           sudo port install log4cxx
+
+- protobuf
+
+      On Mac OSx
+
+           sudo port install protobuf-cpp
+
+      On linux variants
+
+           sudo apt-get install libprotobuf-dev
+
+
+Build
+-----
+
+The following commands should be used to build NLSR:
+
+    ./waf configure
+    ./waf
+    sudo ./waf install
+
+Refer to ./waf --help for more options that can be used during configure stage and
+how to properly configure and run NLSR.
+
+If your pkgconfig path is not set properly you can do following before running `./waf configure`
+
+    export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/
+    or
+    export PKG_CONFIG_PATH=/path/to/pkgconfig/in/your/machine
diff --git a/docs/SECURITY.md b/docs/SECURITY.md
new file mode 100644
index 0000000..c15dd60
--- /dev/null
+++ b/docs/SECURITY.md
@@ -0,0 +1,283 @@
+##Trust Model For NLSR
+
+The trust model of NLSR is semi-hierarchical.
+An example certificate signing hierarchy is:
+
+                                            root
+                                             |
+                              +--------------+---------------+
+                            site1                          site2
+                              |                              |
+                    +---------+---------+                    +
+                 operator1           operator2            operator3
+                    |                   |                    |
+              +-----+-----+        +----+-----+        +-----+-----+--------+
+           router1     router2  router3    router4  router5     router6  router7
+              |           |        |          |        |           |        |
+              +           +        +          +        +           +        +
+            NLSR        NSLR     NSLR       NSLR     NSLR        NSLR     NSLR
+
+Each entity's name and corresponding certificate name follow the convention below:
+
+    Entity   | Identity Name                                     | Example                         | Certificate Name Example
+    -------- | ------------------------------------------------- | ------------------------------- | -----------------------------------------------
+    root     | /\<network\>                                        | /ndn                            | /ndn/KEY/ksk-1/ID-CERT/%01
+    site     | /\<network\>/\<site\>                                 | /ndn/edu/ucla                   | /ndn/edu/ucla/KEY/ksk-2/ID-CERT/%01
+    operator | /\<network\>/\<site\>/%C1.Operator/\<operator-name\>          | /ndn/edu/ucla/%C1.Operator/op1      | /ndn/edu/ucla/%C1.Operator/op1/KEY/ksk-3/ID-CERT/%01
+    router   | /\<network\>/\<site\>/%C1.Router/\<router-name\>            | /ndn/edu/ucla/%C1.Router/rt1      | /ndn/edu/ucla/%C1.Router/rt1/KEY/ksk-4/ID-CERT/%01
+    NLSR     | /\<network\>/\<site\>/%C1.Router/\<router-name\>/NLSR       | /ndn/edu/ucla/%C1.Router/rt1/NLSR | /ndn/edu/ucla/%C1.Router/rt1/NLSR/KEY/ksk-5/ID-CERT/%01
+
+Users should create keys according to the naming and signing hierarchies above.
+
+## Certificate Publishing
+
+In a network, every router should have the root certificate configured as a trust anchor.
+For each site, at least one router should publish the site certificate, at least one router should publish the certificate of the site operator.
+Each router should publish its own certificate.
+All this information should be explicitly specified in nlsr.conf file.
+For example, the following configuration file indicates that NLSR should publish the site certificate and the router certificate:
+
+    ...
+    security
+    {
+      validator
+      {
+      ...
+      }
+      cert-to-publish "site.cert"   ; name of the file which contains the site certificate (optional).
+      cert-to-publish "router.cert" ; name of the file which contains the router certificate (required).
+    }
+
+Note that when a new NLSR instance is created, it will create a new key for the instance; generating the certificate for the new NLSR key is handled internally in NLSR.
+Therefore, user does not have to explcitly create keys and certificate for each NLSR instance.
+
+For key and certificate generation, please refer to the [ndnsec tool kit](http://named-data.net/doc/ndn-cxx/0.1.0/manpages/ndnsec.html).
+
+## Example
+
+Security Configuration: Every machine in network will have the same set of security rules to configure.
+However, different machine will have different configuration commands "cert-to-publish"
+depending on responsibility. Let us use the same topology used for example(https://github.com/named-data/NLSR/blob/master/docs/TOPOLOGY.md).
+
+ndnsec-key-gen generates a key
+
+Lets assume that `/ndn/memphis.edu/router1` is the router who is responsible as the memphis
+site router and also responsible as root which is the trust anchor of the network. So
+router in memphis will do the following key creation and signing.
+
+NOTE: The first two steps may not apply to everyone as the root certificate and the site certificate are usually present at a testbed outside the scope of NLSR. These steps will help if you are testing an isolated testbed.
+
+   1. Create root key and self signed certificate with prefis `/ndn`
+      $ndnsec-key-gen -n /ndn
+      $ndnsec-sign-req /ndn > root.cert
+      This root.cert will be configured by "cert-to-publish" commands in nlsr.conf
+
+   2. Generate key for site prefix `/ndn/edu/memphis` and sign it by root key
+      $ndnsec-key-gen -n /ndn/edu/memphis > unsigned_site.cert
+      $ndnsec-cert-gen -S 20140701000000 -E 20150701000000 -N "University of Memphis"
+      -s /ndn -p /ndn/edu/memphis -r unsigned_site.cert > site.cert
+
+   3. Generate key for operator and sign it by memphis site key. Lets assume that
+      operator name in Memphis site is ndnuser, so the prefix is `/ndn/edu/memphis/%C1.O.N./ndnuser`
+      $ndnsec-key-gen -n /ndn/edu/memphis/%C1.Operator/ndnuser > unsigned_operator.cert
+      $ndnsec-cert-gen -S 20140701000000 -E 20150701000000 -N "University of Memphis Operator"
+      -s /ndn/edu/memphis -p /ndn/edu/memphis/%C1.Operator/ndnuser
+      -r unsigned_operator.cert > operator.cert
+
+   4. Generate key for router and sign it with operator's key
+      $ndnsec-key-gen /ndn/edu/memphis/%C1.Router/router1 > unsigned_router.cert
+      $ndnsec-cert-gen -S 20140701000000 -E 20150701000000 -N "University of Memphis Router"
+     -s /ndn/edu/memphis/%C1.Operator/ndnuser -p /ndn/edu/memphis/%C1.Router/router1
+     -r unsigned_router.cert > router.cert
+
+
+Key creation and signing is done for `/ndn/memphis.edu/router1`. In nlsr.conf
+this router will have this lines
+
+    cert-to-publish "root.cert"
+    cert-to-publish "site.cert"
+    cert-to-publish "operator.cert"
+    cert-to-publish "router.cert"
+
+Here is the entire security configuraion of the router1 (As seen in nlsr.conf. Note that only the semi-colons before the certs have been removed, rest is same)
+
+    security
+    {
+      validator
+      {
+        rule
+        {
+          id "NSLR Hello Rule"
+          for data
+          filter
+          {
+            type name
+            regex ^[^<NLSR><INFO>]*<NLSR><INFO><><>$
+          }
+          checker
+          {
+            type customized
+            sig-type rsa-sha256
+            key-locator
+            {
+              type name
+              hyper-relation
+              {
+                k-regex ^([^<KEY><NLSR>]*)<NLSR><KEY><ksk-.*><ID-CERT>$
+                k-expand \\1
+                h-relation equal
+                p-regex ^([^<NLSR><INFO>]*)<NLSR><INFO><><>$
+                p-expand \\1
+              }
+            }
+          }
+        }
+
+        rule
+        {
+          id "NSLR LSA Rule"
+          for data
+          filter
+          {
+            type name
+            regex ^[^<NLSR><LSA>]*<NLSR><LSA>
+          }
+          checker
+          {
+            type customized
+            sig-type rsa-sha256
+            key-locator
+            {
+              type name
+              hyper-relation
+              {
+                k-regex ^([^<KEY><NLSR>]*)<NLSR><KEY><ksk-.*><ID-CERT>$
+                k-expand \\1
+                h-relation equal
+                p-regex ^([^<NLSR><LSA>]*)<NLSR><LSA>(<>*)<><><>$
+                p-expand \\1\\2
+              }
+            }
+          }
+        }
+
+        rule
+        {
+          id "NSLR Hierarchy Exception Rule"
+          for data
+          filter
+          {
+            type name
+            regex ^[^<KEY><%C1.Router>]*<%C1.Router>[^<KEY><NLSR>]*<KEY><ksk-.*><ID-CERT><>$
+          }
+          checker
+          {
+            type customized
+            sig-type rsa-sha256
+            key-locator
+            {
+              type name
+              hyper-relation
+              {
+	              k-regex ^([^<KEY><%C1.Operator>]*)<%C1.Operator>[^<KEY>]*<KEY><ksk-.*><ID-CERT>$
+                k-expand \\1
+                h-relation equal
+                p-regex ^([^<KEY><%C1.Router>]*)<%C1.Router>[^<KEY>]*<KEY><ksk-.*><ID-CERT><>$
+                p-expand \\1
+              }
+            }
+          }
+        }
+
+        rule
+        {
+          id "NSLR Hierarchical Rule"
+          for data
+          filter
+          {
+            type name
+            regex ^[^<KEY>]*<KEY><ksk-.*><ID-CERT><>$
+          }
+          checker
+          {
+            type hierarchical
+            sig-type rsa-sha256
+          }
+        }
+
+        trust-anchor
+        {
+          type file
+          file-name "root.cert"
+        }
+      }
+      cert-to-publish "root.cert" //optional, a file containing the root certificate. only the router
+                                  //that is designated to publish root cert needs to specify this
+      cert-to-publish "site.cert" //optional, a file containing the root certificate. only the router
+                                  //that is designated to publish site cert need to specify this
+      cert-to-publish "operator.cert" //optional, a file containing the root certificate. only the
+                                      //router that is designated to publish operator cert need to
+                                      //specify this
+      cert-to-publish "router.cert" //required, a file containing the router certificate.
+    }
+
+Now lets see how `/ndn/colostate.edu/router2` will create and sign keys. Let assume
+that this router is responsible for hosting site keys and operator keys of colorado
+site.
+
+   2. Generate key for site prefix `/ndn/edu/colorado`
+      $ndnsec-key-gen -n /ndn/edu/memphis > unsigned_site.cert
+
+      Send this cert to Memphis site ( as in example Memphis is the root) and get
+      it signed by root. After you get back the site please put it in your convenient
+      certificate directory.
+
+   3. Generate key for operator and sign it by colorado site key. Lets assume that
+      operator name in Colorado site is testop, so the prefix is `/ndn/edu/colorado/%C1.O.N./testop`
+      $ndnsec-key-gen -n /ndn/edu/colorado/%C1.Operator/testop > unsigned_operator.cert
+      $ndnsec-cert-gen -S 20140701000000 -E 20150701000000 -N "Colorado State University Operator"
+      -s /ndn/edu/colorado -p /ndn/edu/colorado/%C1.Operator/testop
+      -r unsigned_operator.cert > operator.cert
+
+   4. Generate key for router and sign it with operator's key
+      $ndnsec-key-gen /ndn/edu/colorado/%C1.Router/router2 > unsigned_router.cert
+      $ndnsec-cert-gen -S 20140701000000 -E 20150701000000 -N "Colorado State University Router"
+      -s /ndn/edu/colorado/%C1.Operator/testop -p /ndn/edu/colorado/%C1.Router/router2
+      -r unsigned_router.cert > router.cert
+
+
+Key creation and signing is done for `/ndn/edu/colorado/router2`. In nlsr.conf
+this router will have these lines
+
+    cert-to-publish "site.cert"
+    cert-to-publish "operator.cert"
+    cert-to-publish "router.cert"
+
+(The rest of the security configuration is same as the other router.)
+
+Colorado also need to bring the root.cert from Memphis and put it in the certificate
+directory as it is configured as trust anchor.
+
+Now both Memphis and Colorado router is ready to run with security configuration.
+Arizona router will follow the same step as Colorado to configure security for NLSR.
+
+
+# Disabling Security in NLSR
+
+To disable packet validation in NLSR, you need to change the configuration file
+in section: security.validator.trust-anchor
+
+    trust-anchor
+    {
+      type file
+      file-name "root.cert"
+    }
+
+change the previous section in security configuration to below
+
+    trust-anchor
+    {
+      type any
+    }
+
+With this change, packets are still signed, but validation will be skipped.
diff --git a/docs/TOPOLOGY.md b/docs/TOPOLOGY.md
new file mode 100644
index 0000000..c542de2
--- /dev/null
+++ b/docs/TOPOLOGY.md
@@ -0,0 +1,193 @@
+Example network and sample configuration:
+=========================================
+
+Lets assume that three routers in the same network but at three different sites (
+memphis.edu, arizona.edu, and colostate.edu) are connected to each other to
+construct the following topology:
+
+                        -------------------------------------
+                        | /ndn/edu/memphis/%C1.Router/router1 |
+                        -------------------------------------
+                            / 11                      12\
+                           /                             \
+          route-cost = 25 /                               \ route-cost = 30
+                         /                                 \
+                     17 /                                   \ 13
+    ------------------------------------- 7              10 --------------------------------------
+    |/ndn/edu/arizona/%C1.Router/router3|-------------------|/ndn/edu/colostate/%C1.Router/router2|
+    -------------------------------------   route-cost = 28 --------------------------------------
+
+                          Figure: Network Topology
+
+The number represents the connecting face id. For example, `/ndn/edu/memphis/%C1.Router/router1`
+is connected to `/ndn/edu/arizona/%C1.Router/router3` via face 11 and the route cost is 25.
+To reach `/ndn/edu/colostate/%C1.Router/router2` via face 12, the route cost is 30.
+
+We will walk through setting up the faces and creating the configuration file for
+`/ndn/edu/memphis/%C1.Router/router1`.
+
+Step 1. Ensure nfd is running :
+----------------
+Type the following in the terminal:
+
+    "nfd-status -f"
+
+
+if you see `ERROR: error while connecting to the forwarder (No such file or directory)`
+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.
+
+Step 2. Determining FaceUri:
+--------------------
+Lets assume that `/ndn/edu/arizona/%C1.Router/router3` has hostname `router3.arizona.edu`
+and `/ndn/edu/colostate/%C1.Router/router2` has ip address `79.123.10.145`, and that all
+routers in the network had agreed to sync data in name prefix `/ndn/nlsr/sync`.
+`/ndn/edu/memphis/%C1.Router/router1` will consider face uri `udp4://router3.arizona.edu` for
+router `/ndn/edu/arizona/%C1.Router/router3` and face uri `udp4://79.123.10.145` for router
+`/ndn/edu/colostate/%C1.Router/router2`.
+
+Step 3: Creating configuration file:
+------------------------------------
+Now, lets assume that /ndn/memphis.edu/router1 wants to advertise three name
+prefixes that can be reached through it ( `/ndn/memphis/sports/basketball/grizzlies`,
+`/ndn/memphis/entertainment/blues`, `/ndn/news/memphis/politics/lutherking`). Now,
+the configuration file with minimum configuration commands will have the following
+commands
+
+    ; nlsr.conf starts here
+    ; the general section contains all the general settings for router
+
+    general
+    {
+        ; mandatory configuration command section network, site and router
+
+        network /ndn/         ; name of the network the router belongs to in ndn URI format
+        site /edu/memphis/    ; name of the site the router belongs to in ndn URI format
+        router /%C1.Router/router1    ; name of the network the router belongs to in ndn URI format
+
+        ; lsa-refresh-time is the time in seconds, after which router will refresh its LSAs
+
+        lsa-refresh-time 1800      ; default value 1800. Valid values 240-7200
+
+        ; log-level is to set the levels of log for NLSR
+
+        log-level  INFO       ; default value INFO, valid value DEBUG, INFO
+        log-dir /var/log/nlsr/
+        seq-dir /var/lib/nlsr/
+    }
+
+    ; the neighbors section contains the configuration for router's neighbors and hello's behavior
+
+    neighbors
+    {
+       ; in case hello interest timed out, router will try 'hello-retries' times at 'hello-time-out'
+       ; seconds interval before giving up for any neighbors (deciding link is down)
+
+       hello-retries 3                     ; interest retries number in integer. Default value 3
+                                           ; valid values 1-10
+
+       hello-timeout 1                    ; interest time out value in integer. Default value 1
+                                          ; Valid values 1-15
+
+       hello-interval  60                  ; interest sending interval in seconds. Default value 60
+                                           ; valid values 30-90
+       ; neighbor command is used to configure router's neighbor. Each neighbor will need
+       ; one block of neighbor command
+
+      neighbor
+      {
+          name /ndn/edu/arizona/%C1.Router/router3        ; name prefix of the neighbor router consists
+                                                          ; of network, site-name and router-name
+
+          face-uri  udp4://router3.arizona.edu  ; face uri of the face connected to the neighbor
+          link-cost 25                         ; cost of the connecting link to neighbor
+      }
+
+      neighbor
+      {
+          name /ndn/edu/colostate/%C1.Router/router2          ; name prefix of the neighbor router consists
+                                                   ; of network, site-name and router-name
+
+          face-uri  udp4://79.123.10.145     ; face uri of the face connected to the neighbor
+          link-cost 30                        ; cost of the connecting link to neighbor
+      }
+    }
+
+    ; the hyperbolic section contains the configuration settings of enabling a router to calculate
+    ; routing table using [hyperbolic routing table calculation](http://arxiv.org/abs/0805.1266) method
+
+    hyperbolic
+    {
+        ; commands in this section follows a strict order
+        ; the switch is used to set hyperbolic routing calculation in NLSR
+
+        state off             ; default value 'off', set value 'on' to enable hyperbolic routing table
+                              ; calculation which turns link state routing 'off'. set value to 'dry-run"
+                              ; to test hyperbolic routing and compare with link state routing.
+
+
+        radius   123.456       ; radius of the router in hyperbolic coordinate system
+        angle    1.45          ; angle of the router in hyperbolic coordinate system
+    }
+
+
+    ; the fib section is used to configure fib entry's type to ndn FIB updated by NLSR
+
+    fib
+    {
+        ; the max-faces-per-prefix is used to limit the number of faces for each name prefixes
+        ; by NLSR in ndn FIB
+
+        max-faces-per-prefix 3   ; default value 0. Valid value 0-60. By default (value 0) NLSR adds
+                                 ; all available faces for each reachable name prefixes in NDN FIB
+
+    }
+
+    ; the advertising section contains the configuration settings of the name prefixes
+    ; hosted by this router
+
+    advertising
+    {
+        ; the ndnname is used to advertised name from the router. To advertise each name prefix
+        ; configure one block of ndnname configuration command for every name prefix.
+
+        prefix /ndn/memphis/sports/basketball/grizzlies
+        prefix /ndn/memphis/entertainment/blues
+        prefix /ndn/news/memphis/politics/lutherking
+    }
+
+    ; security configuration is discussed
+    ;[NLSR's security configuration](https://github.com/named-data/NLSR/blob/master/docs/SECURITY.md)
+    ; which will be also part of this configuration file here
+    ;
+    ; nlsr.conf end here
+
+Step 4: Running NLSR in /ndn/memphis.edu/router1:
+-------------------------------------------------
+Assuming the configuration file is saved as nlsr.conf. Type the following to run
+nlsr
+
+    $ nlsr -f nlsr.conf
+
+NLSR will look for nlsr.conf in the current directory. If nlsr.conf is not in
+the corrent directory, please provide the absolute path with the file name as the
+value. If nlsr.conf resides in /home/ndnuser/configuration directory, type "nlsr
+-f /home/ndnuser/configuration/nlsr.conf" to run nlsr.
+
+The same process needs to be followed for router /ndn/arizona.edu/router3 and
+/ndn/colostate.edu/router2 to run NLSR on these routers.
+
+Expected Output:
+----------------
+Assuming that all three routers are configured correctly and converged, nfd-status
+in `/ndn/edu/colostate/%C1.Router/router2` will have the following entries for the
+name advertised by `/ndn/edu/memphis/%C1.Router/router1`. This output can be 
+seen by typing `nfd-status -f` in terminal
+
+FIB:
+
+    /ndn/memphis/sports/basketball/grizzlies nexthops={faceid=17 (cost=25), faceid=7 (cost=58)}
+    /ndn/memphis/entertainment/blues nexthops={faceid=17 (cost=25), faceid=7 (cost=58)}
+    /ndn/news/memphis/politics/lutherking nexthops={faceid=17 (cost=25), faceid=7 (cost=58)}
+
+Please refer to the network figure for face id. Numbers at the end of each link
+correspond to face ids.
diff --git a/nlsr.conf b/nlsr.conf
index d6f31bc..13d7b5b 100644
--- a/nlsr.conf
+++ b/nlsr.conf
@@ -6,7 +6,7 @@
 
     network /ndn/         ; name of the network the router belongs to in ndn URI format
     site /edu/memphis    ; name of the site the router belongs to in ndn URI format
-    router /%C1.O.R./cs/pollux    ; name of the router in ndn URI format
+    router /%C1.Router/cs/pollux    ; name of the router in ndn URI format
 
 ; lsa-refresh-time is the time in seconds, after which router will refresh its LSAs
 
@@ -39,19 +39,19 @@
 
    neighbor
    {
-       name /ndn/edu/memphis/%C1.O.R./cs/castor        ; name prefix of the neighbor router consists
+       name /ndn/edu/memphis/%C1.Router/cs/castor        ; name prefix of the neighbor router consists
                                               ; of network, site-name and router-name
 
-       face-uri  udp://castor.cs.memphis.edu  ; face id of the face connected to the neighbor
+       face-uri  udp://castor.cs.memphis.edu  ; face uri of the face connected to the neighbor
        link-cost 25                         ; cost of the connecting link to neighbor
    }
 
    neighbor
    {
-       name /ndn/edu/memphis/%C1.O.R./cs/mira          ; name prefix of the neighbor router consists
+       name /ndn/edu/memphis/%C1.Router/cs/mira          ; name prefix of the neighbor router consists
                                               ; of network, site-name and router-name
 
-       face-uri  udp://mira.cs.memphis.edu    ; face id of the face connected to the neighbor
+       face-uri  udp://mira.cs.memphis.edu    ; face uri of the face connected to the neighbor
        link-cost 30                        ; cost of the connecting link to neighbor
    }
 }
@@ -165,7 +165,7 @@
       filter
       {
         type name
-        regex ^[^<KEY><%C1.O.R.>]*<%C1.O.R.>[^<KEY><NLSR>]*<KEY><ksk-.*><ID-CERT><>$
+        regex ^[^<KEY><%C1.Router>]*<%C1.Router>[^<KEY><NLSR>]*<KEY><ksk-.*><ID-CERT><>$
       }
       checker
       {
@@ -176,10 +176,10 @@
           type name
           hyper-relation
           {
-	    k-regex ^([^<KEY><%C1.O.N.>]*)<%C1.O.N.>[^<KEY>]*<KEY><ksk-.*><ID-CERT>$
+	    k-regex ^([^<KEY><%C1.Operator>]*)<%C1.Operator>[^<KEY>]*<KEY><ksk-.*><ID-CERT>$
             k-expand \\1
             h-relation equal
-            p-regex ^([^<KEY><%C1.O.R.>]*)<%C1.O.R.>[^<KEY>]*<KEY><ksk-.*><ID-CERT><>$
+            p-regex ^([^<KEY><%C1.Router>]*)<%C1.Router>[^<KEY>]*<KEY><ksk-.*><ID-CERT><>$
             p-expand \\1
           }
         }