JNCIP: JUNOS OSPF虚链路配置 – Part 3

提升JUNOS OSPF收敛时间: hello/dead-interval vs. bfd

通过之前的实验不难发现,R4与R5之间的链路,包括R3与R4之间的链路,两条骨干网链路是整个实验网络的关键部分。通过预先在非骨干区域内创建虚链路,是一个不错的保持骨干区域连续性的备份方案。在R3与R5之间建立虚链路,更能够同时使在R4/R3/R5之间任一骨干区域链路失效后仍然能保障骨干区域的连续性。除此以外,另一个需要考虑的便是对链路失效检测的延时性能,争取在更短的时间内完成路由收敛。其中,降低OSPF Hello包的发送周期以及邻居失效周期是最常见的方式。我们可以在R3/R4/R5的骨干网接口上进行设置,需要注意的是链路两端的路由器必须设置相同的计时器值,计时器同步是形成OSPF邻接关系的必要前提。我们将三台路由器的所有骨干网接口计时器值减少为默认的50%,注意不要忘记对R3/R5之间的虚链路接口一起设置:

[edit logical-routers]
nigel@itaalab# set r4 protocols ospf area 0 interface
 fxp2.34 hello-interval 5 dead-interval 20 

[edit logical-routers]
nigel@itaalab# set r4 protocols ospf area 0 interface
 fxp1.45 hello-interval 5 dead-interval 20 

[edit logical-routers]
nigel@itaalab# set r3 protocols ospf area 0 interface
 fxp1.34 hello-interval 5 dead-interval 20 

[edit logical-routers]
nigel@itaalab# set r5 protocols ospf area 0 interface
 fxp2.45 hello-interval 5 dead-interval 20 

[edit logical-routers r3 protocols ospf area 0.0.0.0]
nigel@itaalab# set virtual-link neighbor-id 10.0.3.5
 transit-area 3 hello-interval 5 dead-interval 20 

[edit logical-routers r5 protocols ospf area 0.0.0.0]
nigel@itaalab# set virtual-link neighbor-id 10.0.3.3
 transit-area 3 hello-interval 5 dead-interval 20

尽管默认情况下OSPF的dead-interval自动被调节为Hello-interval的4倍,然而还是建议(OK,这只是一个“建议”,如果非要问为什么提出这样的建议同时给予解释的话请无视 ── 你有权决定是否采纳建议,而我同样有权决定是否提供建议 ── 就那么简单的逻辑关系搞不懂怎么就有人偏搞不懂?)同时手动定义两个参数,查看R3的OSPF接口状态,可以看到全部区域0.0.0.0内全部接口的计时器值全部被修改为5/20sec,值得注意的是R3与R5之间的链路只有属于区域0.0.0.0的虚链路被修改为新的计时值,而物理接口仍然属于区域3,因此被保留为默认10/40sec不变:

nigel@itaalab# run show ospf interface
 logical-router r3 detail
Interface   State   Area    DR ID    BDR ID   Nbrs
fxp1.34      BDR    0.0.0.0 10.0.3.4 10.0.3.3    1
  Type: LAN, Address: 10.0.2.5, Mask: 255.255.255.252,
  MTU: 1496, Cost: 1
  DR addr: 10.0.2.6, BDR addr: 10.0.2.5, Adj count: 1,
  Priority: 128
  Hello: 5, Dead: 20, ReXmit: 5, Not Stub
  Auth type: None
lo0.3       DRother 0.0.0.0 0.0.0.0  0.0.0.0     0
  Type: LAN, Address: 10.0.3.3, Mask: 255.255.255.255,
  MTU: 65535, Cost: 0
  Adj count: 0, Priority: 128, , Passive
  Hello: 10, Dead: 40, ReXmit: 5, Not Stub
  Auth type: None
vl-10.0.3.5 PtToPt  0.0.0.0 0.0.0.0  0.0.0.0     1
  Type: Virtual, Address: 10.0.2.2, Mask: 0.0.0.0,
  MTU: 0, Cost: 1
  Adj count: 1
  Hello: 5, Dead: 20, ReXmit: 5, Not Stub
  Auth type: MD5, Active key ID: 10, Start time:
 2008 Jan  1 07:00:00 LONT
fxp1.35      BDR    0.0.0.3 10.0.3.5 10.0.3.3    1
  Type: LAN, Address: 10.0.2.2, Mask: 255.255.255.252,
  MTU: 1496, Cost: 1
  DR addr: 10.0.2.1, BDR addr: 10.0.2.2, Adj count: 1,
  Priority: 128
  Hello: 10, Dead: 40, ReXmit: 5, Not Stub
  Auth type: None
fxp2.13      BDR    0.0.0.10 10.0.6.1 10.0.3.3   1
  Type: LAN, Address: 10.0.4.13, Mask: 255.255.255.252,
  MTU: 1496, Cost: 2
  DR addr: 10.0.4.14, BDR addr: 10.0.4.13, Adj count: 1,
  Priority: 128
  Hello: 10, Dead: 40, ReXmit: 5, Stub NSSA
  Auth type: None

尽管缩短Hello周期能在一定程度上提升OSPF的收敛速度,然而,OSPF Hello数据包可设置的最短周期为1秒,那么邻居失效周期最短也只能为4秒钟,对于那些承载着对延时极为敏感的业务的网络而言,这样的失效检测周期依然需要提升效率。JUNOS从6.1版本开始便支持能够更快的,达到微妙级别的双向转发检测,BFD(Bidirectional Forwarding Detection),BFD是一种简单的Hello协议,然而BFD通过基于转发层面对下一跳邻居的监测 ─ 传统的IGP Hello机制是基于控制层面邻居维护,却能够有效的提升那些在传统上不存在硬件失效监测的链路,而只能依赖于IGP的Hello机制作为检测手段,如以太网络,它们对于链路失效检测的性能。同时BFD独立于各种IGP协议,不单纯能够为OSPF,并且能够为ISIS,BGP甚至MPLS提供在二层链路上的保障服务。目前,在JUNOS 8.5版本上面,我们可以测试在逻辑路由器上建立BFD会话。

[edit logical-routers]
nigel@itaalab# show r3 protocols ospf area 0
virtual-link neighbor-id 10.0.3.5 transit-area 0.0.0.3 {
    hello-interval 5;
    dead-interval 20;
    authentication {
        md5 10 key "$9$vMg8xd24Zk.54a39";
 ## SECRET-DATA
    }
}
interface fxp1.34 {
    hello-interval 5;
    dead-interval 20;
    bfd-liveness-detection {
        minimum-interval 500;
    }
}

[edit logical-routers]
nigel@itaalab# show r4 protocols ospf area 0
interface fxp2.34 {
    hello-interval 5;
    dead-interval 20;
    bfd-liveness-detection {
        minimum-interval 500;
    }
}
interface fxp1.45 {
    hello-interval 5;
    dead-interval 20;
    bfd-liveness-detection {
        minimum-interval 500;
    }
}

[edit logical-routers]
nigel@itaalab# show r5 protocols ospf area 0
virtual-link neighbor-id 10.0.3.3 transit-area 0.0.0.3 {
    hello-interval 5;
    dead-interval 20;
    authentication {
        md5 10 key "$9$ck.rK8-VYZUHVwPQ";
 ## SECRET-DATA
    }
}
interface fxp2.45 {
    hello-interval 5;
    dead-interval 20;
    bfd-liveness-detection {
        minimum-interval 500;
    }
}

BFD默认的失效时间是传输周期的3倍,在上面的配置中,我们将传输周期设置为500毫秒(ms),链路失效时间将被自动设置为1.5秒,当然,你还可以使用multiplier来定义失效时间相对于传输周期的倍数来进一步缩短或者延长链路失效时间。BFD能够为OSPF服务,但却不像OSPF计时器需要在所有接口下面打开,我们可以按照需求在某几条特定链路的两端路由器接口上设置BFD,以下的输入确认R4上BFD的两个连接,并且确认BDF目前的为OSPF协议服务:

nigel@itaalab# run show bfd session detail logical-router
 r4
                                     Transmit
Address  State Interface Detect Time Interval Multiplier
10.0.2.9 Up    fxp1.45       1.500    0.500       3
 Client OSPF, TX interval 0.500, RX interval 0.500
 Session up time 00:13:15
 Local diagnostic None, remote diagnostic None
 Remote state Up, version 1
 Logical router 1, routing table index 5
                                     Transmit
Address  State Interface Detect Time Interval Multiplier
10.0.2.5 Up    fxp2.34       1.500    0.500       3
 Client OSPF, TX interval 0.500, RX interval 0.500
 Session up time 00:13:15
 Local diagnostic None, remote diagnostic None
 Remote state Up, version 1
 Logical router 1, routing table index 5

2 sessions, 2 clients
Cumulative transmit rate 4.0 pps, cumulative receive
 rate 4.0 pps
Advertisements

发表评论

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 更改 )

Twitter picture

You are commenting using your Twitter account. Log Out / 更改 )

Facebook photo

You are commenting using your Facebook account. Log Out / 更改 )

Google+ photo

You are commenting using your Google+ account. Log Out / 更改 )

Connecting to %s