NLSR: Named-data Link State Routing Protocol

文档

overview

NLSR是NDN中的一个路由协议,它填充NDN的路由信息库。NLSR将继续与命名的数据网络协议一起发展.
NLSR是一个开放和自由的软件包,在GPL 3.0许可下获得许可,对所有互联网用户和开发人员免费。有关授权细节和限制的更多信息,请参阅COPYING.md。
NLSR是由nsf资助的NDN项目团队的成员开发的。详情请参阅AUTHORS.md。Bug报告和反馈非常受欢迎,可以通过Redmine.site进行。
NLSR的主要设计目标是提供一个路由协议来填充NDN的FIB。NLSR使用链路状态或双曲线路由来计算路由表,并在单个权威域中为每个可到达的名称前缀生成多个faces。NLSR将随着时间的推移不断发展,包括邻居发现,并成为NDN的一个成熟的域间路由协议

源代码和代码说明

补充信息

1 NLSR Installation Instructions

前向准备

  • NFD及其要求:有关详细的安装和运行说明,请参阅 Getting started with NFD。
  • ChronoSync(计时同步)库:下载ChronoSync库,并按照以下地址的说明建立:https://github.com/named-data/ChronoSync#build
  • PSync库:下载PSync库,并按照以下地址的说明建立:https://github.com/named-data/PSync#build
    build
    执行一下命令去build NLSR
./waf configure
./waf
sudo ./waf install

有关在配置阶段可以使用的更多选项以及如何正确配置NLSR,请参阅./waf -help。
如果你的pkgconfig路径没有正确设置,可以在运行之前执行以下操作:

export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/
or
export PKG_CONFIG_PATH=/path/to/pkgconfig/on/your/machine

2 GET START WITH NLSR

Important Notes About Configuration
从v0.4.0开始,NLSR不再为NLSR .conf中指定的邻居创建faces。相反,它依赖于NFD中faces的预先存在。NLSR将从NFD获取此信息,并使用此信息配置它的邻居。对于依赖NLSR自动配置其网络的人来说,现在必须使用nfdc来完成这一任务。
Configuration
从源代码安装NLSR之后,需要为NLSR创建一个配置文件。请查看nlsr.conf以获得示例配置。有关配置路由器的详细信息,请参阅 Router Configuration。有关安全配置的详细信息,请参阅Security Configuration。
Running

nslr

NLSR将在当前目录中查找默认配置文件NLSR.conf,你也可以用配置文件的绝对路径运行nlsr -f:

nlsr -f /usr/local/etc/ndn/nlsr.conf

Logging
NLSR使用ndn-cxx日志记录功能。在所选日志级别值下面列出的所有级别都已启用。

Valid values:

  TRACE    trace messages (most verbose)
  DEBUG    debugging messages
  INFO     informational messages
  WARN     warning messages
  ERROR    error messages
  FATAL    fatal (will be logged unconditionally)

要获取NLSR的日志,请使用正确的前缀和日志级别设置设置NDN_LOG环境变量。例如,运行以下命令将显示NLSR中具有调试级别或以下的所有日志消息。

NDN_LOG='nlsr.*=DEBUG' nlsr

如果用户看到一个错误消息,用户没有对该目录的读写权限,可以通过使用sudo运行应用程序来绕过这个问题:

sudo env NDN_LOG='nlsr.*=DEBUG' nlsr

3 Router Configure

假设三个路由器在同一个网络中,但是在三个不同的站点上:(memphis.edu, arizona.edu, and colostate.edu),相互连接,构造如下拓扑:
在这里插入图片描述
数字表示连接face id,例如/ndn/edu/memphis/% c1.Router/router1连接到/ndn/edu/arizona/% c1.Router1/router3通过face11,路由成本为25。达到/ ndn /edu/colostate/%C1.Router/router2通过face12,路由成本是30。我们将遍历设置面并创建/ndn/edu/memphis/% c1 .Router /router1的配置文件。建议在启动路由器配置之前,按照安全配置中的描述来配置安全性。
Step 1. Ensuring nfd is running
在终端机内输入以下:

ndn-status

如果您在连接到转发器时看到错误(没有这样的文件或目录),nfd没有运行。按照说明Getting start with NFD运行nfd。从v0.4.0开始,NLSR不再为nlsr .conf中指定的邻居创建face。相反,它依赖于NFD中face的预先存在。NLSR将从NFD获取此信息,并使用此信息配置它的邻居。为了创建face,现在需要使用nfdc命令。
Step 2. Determining FaceUri(确定faceuri)
假设/ndn /edu/arizona/%C1.Router/router3有主机名router3.arizona.edu
/ndn/edu/colostate/% c1.Router/router2的IP地址是79.123.10.145。
/ ndn /edu/memphis/%C1.Router/router1将考虑FaceUri udp4://router3.arizona.edu用于路由器/ndn/edu/arizona/% c1.Router/router3
FaceUri udp4://79.123.10.145用于路由器/ndn/ edu/colostate/%c1.Router/router2
Step 3: Creating configuration file
现在,假设/ndn/memphis.edu/router1想要宣传三个名字前缀(/ndn/memphis/sports/basketball/grizzlies/ndn/memphis/entertainment/blues/ndn/news/memphis/politics/lutherking)。配置文件与必要的配置命令如下:

; 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

    ; InterestLifetime (in seconds) for LSA fetching
    lsa-interest-lifetime 4    ; default value 4. Valid values 1-60

    state-dir /var/lib/nlsr/ ; state directory to store all dynamic changes to 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

   ; adj-lsa-build-interval is the time to wait in seconds after an Adjacency LSA
   ; build is scheduled before actually building the Adjacency LSA

   adj-lsa-build-interval 5   ; default value 5. Valid values 0-5. It is recommended that
                              ; adj-lsa-build-interval have a lower value than
                              ; routing-calc-interval

   ; first-hello-interval is the time to wait in seconds before sending the first Hello Interest

   first-hello-interval  10   ; Default value 10. Valid values 0-10

   ; 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`_ 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
}

默认情况下,NLSR的序列文件目录设置为/var/lib/ nlsr /。用户必须在启动NLSR之前创建此目录。由于这是一个系统目录,NLSR必须作为根目录执行,或者在配置文件系统以授予“NLSR”读写权限之后,NLSR可以作为用户“NLSR”运行。如果用户没有权限,将会出现以下错误:

User does not have read and write permission on the directory
Error in configuration file processing! Exiting from NLSR

为了避免这种情况,可以在用户拥有的目录中设置目录。例如:

general
{
  ...

  state-dir /home/username/nlsr/log  ; path for sequence directory and other dynamic changes (Absolute path)

}
...

如果没有配置安全性,用户将遇到以下错误:

Cannot read certificate from file: /home/username/NLSR/root.cert

为了消除这个错误和与安全相关的类似错误,必须按照安全配置中的描述配置安全。安全可以被禁用的测试目的如下:

...
trust-anchor
{
  type any
  ;file-name "root.cert"
}
...
trust-anchor
{
  type any
  ;file-name "site.cert"
}
; cert-to-publish "root.cert"
; cert-to-publish "router.cert"
; cert-to-publish "site.cert"
; cert-to-publish "router.cert"

或简单地将整安全部分替换为:

security
{
  validator
  {
    trust-anchor
    {
      type any
    }
  }
  prefix-update-validator
  {
    trust-anchor
    {
      type any
    }
  }
}

Step 4: Running NLSR on /ndn/memphis.edu/router
假设配置文件保存为nlsr.conf,输入以下命令来运行nlsr:

$ nlsr -f nlsr.conf

NLSR将在当前目录中查找nlsr .conf。如果nlsr.conf不在当前目录中,请提供文件名作为值的绝对路径。如果nlsr.conf位于/home/ndnuser/configuration目录中,则键入nlsr -f /home/ndnuser/configuration/nlsr.conf来运行nlsr。
要在这些路由器上运行NLSR,需要对/ndn/arizona.edu/router3/ndn/colostate.edu/router2执行相同的过程。
Expected Output
假设所有三个路由器都配置正确且路由已聚合,ndn/edu/colostate/% c1.Router/router2中的nfd-status.将通过/ndn/edu/memphis/% c1 .Router/router1将下列(或类似)条目的名称广播:
RIB:

/ndn/memphis/entertainment/blues route={faceid=17 (origin=128 cost=25 ChildInherit), faceid=7 (origin=128 cost=58 ChildInherit)}
/ndn/memphis/sports/basketball/grizzlies route={faceid=17 (origin=128 cost=25 ChildInherit), faceid=7 (origin=128 cost=58 ChildInherit)}
/ndn/news/memphis/politics/lutherking route={faceid=17 (origin=128 cost=25 ChildInherit, faceid=7 (origin=128 cost=58 ChildInherit)}

在终端中输入nfdc router list可以看到这个输出。

论文

3 设计

3.1 命名
我们设计中最重要的部分是路由系统中每个元素及其对应的公钥的正确命名方案。根据当前的网络结构和操作实践,层次命名方案似乎最适合捕获系统中各个组件之间的关系,从而很容易识别属于同一网络的路由器,以及由给定路由过程生成的消息。
在我们的设计中,每个路由器都是根据它所处的网络、它所属的特定站点以及分配的路由器名称来命名的。///.
例如,在Altanta亚特兰大的PoP(存在点)中的ATT路由器可能被命名为/ATT/AtlantaPOP1/router3.
这样,我们知道如果两个路由器共享相同的名称前缀/,他们属于同一网络,如果他们有相同的前缀:耳都//.它们属于同一个站点。这种命名方案很容易过滤掉错误的路由消息。
路由器上的NLSR进程是根据路由器名来命名的:路由器名用作前缀,后面跟着进程名NLSR,即/ / / / NLSR。
NLSR路由恶魔名称用于相邻NLSR路由器之间的定期信息info,以检测链路或路由进程本身的故障。
理想情况下,由NLSR进程发起的任何路由更新都应该将进程名作为前缀,以便容易地识别消息发送者。换句话说,LSA(链路状态通告)的名称应该以NLSR/LSA开头,以表明它是由NLSR进程生成的。
然而,因为我们实现使用CCNx Sync和Repo 传播LSA数据,CCNx repo 强加约束,所有要同步的数据必须共享一个共同的名称前缀,我们当前的实现是局限于对路由器生成的LSAa使用公共的前缀。我们使用公共前缀//NLSR/LSA(我们称其为)来命名每个LSA,并将//附加到这个前缀,以区分来自不同NLSR路由器的LSA。

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值