BFD技术的全面解析(fd技术是什么)

网友投稿 610 2022-09-23


BFD技术的全面解析(fd技术是什么)

BFD出现的技术背景

BFD的实现原理

BFD会话的检测机制

BFD的检测机制是两个系统建立BFD会话,并沿它们之间的路径周期性发送BFD控制报文,如果一方在既定的时间内没有收到BFD控制报文,则认为路径上发生了故障,BFD控制报文是UDP报文,端口号3784。BFD提供异步检测模式。在这种模式下,系统之间相互周期性地发送BFD控制报文,如果某个系统连续3个报文都没有接收到,就认为此BFD会话的状态是Down

BFD的状态机

BFD的配置

OSPF协议联动BFD协议

RA的配置文件

# sysname RA # bfd # interface GigabitEthernet0/0/1 ip address 10.0.12.1 255.255.255.0 # ospf 1 bfd all-interfaces enable area 0.0.0.0 network 10.0.12.0 0.0.0.255 #

RD的配置文件

# sysname RD # interface GigabitEthernet0/0/1 ip address 10.0.12.2 255.255.255.0 # Bfd # ospf 1 bfd all-interfaces enable area 0.0.0.0 network 10.0.12.0 0.0.0.255 #

检查RTA的OSPF邻居关系

[RA]display ospf peer brief OSPF Process 1 with Router ID 10.0.12.1 Peer Statistic Information ---------------------------------------------------------------------------- Area Id Interface Neighbor id State 0.0.0.0 GigabitEthernet0/0/1 10.0.12.2 Full ----------------------------------------------------------------------------

检查RTA的BFD状态

[RA]display bfd session all -------------------------------------------------------------------------------- Local Remote PeerIpAddr State Type InterfaceName -------------------------------------------------------------------------------- 8192 8192 10.0.12.2 Up D_IP_IF GigabitEthernet0/0/1 -------------------------------------------------------------------------------- Total UP/DOWN Session Number : 1/0 [RA]

把SWB和SWC之间的链路shutdown一下

[SW1-GigabitEthernet0/0/2]shutdown

在RA上面进行查看

弹出的一些日志信息

Sep 28 2019 17:04:18-08:00 RA %%01BFD/4/STACHG_TODWN(l)[8]:BFD session changed t o Down. (SlotNumber=0, Discriminator=2097152, Diagnostic=DetectDown, Application s=OSPF, ProcessPST=False, BindInterfaceName=GigabitEthernet0/0/1, InterfacePhysi calState=Up, InterfaceProtocolState=Up) Sep 28 2019 17:04:18-08:00 RA %%01OSPF/3/NBR_CHG_DOWN(l)[9]:Neighbor event:neigh bor state changed to Down. (ProcessId=256, NeighborAddress=2.12.0.10, NeighborEv ent=KillNbr, NeighborPreviousState=Full, NeighborCurrentState=Down) Sep 28 2019 17:04:18-08:00 RA %%01OSPF/3/NBR_DOWN_REASON(l)[10]:Neighbor state l eaves full or changed to Down. (ProcessId=256, NeighborRouterId=2.12.0.10, Neigh borAreaId=0, NeighborInterface=GigabitEthernet0/0/1,NeighborDownImmediate reason =Neighbor Down Due to Kill Neighbor, NeighborDownPrimeReason=BFD Session Down, N eighborChangeTime=2019-09-28 17:04:18-08:00)

查看BFD的会话信息

[RA]display bfd session all -------------------------------------------------------------------------------- Local Remote PeerIpAddr State Type InterfaceName -------------------------------------------------------------------------------- 8192 0 10.0.12.2 Down D_IP_IF GigabitEthernet0/0/1 -------------------------------------------------------------------------------- Total UP/DOWN Session Number : 0/1

查看OSPF的邻居状态信息

[RA]display ospf peer brief OSPF Process 1 with Router ID 10.0.12.1 Peer Statistic Information ---------------------------------------------------------------------------- Area Id Interface Neighbor id State ----------------------------------------------------------------------------

总结:

中间的链路故障,BFD通过监测模块进行检测,然后交给track模块,由追踪模块交给应用模块,也就是OSPF进程进行处理

VRRP联动BFD协议

# Bfd //全局启动BFD协议 # bfd 1 bind peer-ip 10.0.24.2 source-ip 10.0.45.5 auto //因为当中没有任何动态路由协议 所以需要手动指定邻居的IP地址和自己的IP地址 后面的auto就是让其动态产生本地标识符 commit //有一些交换机里面需要commit一下bfd的配置

进行查看BFD的会话

display bfd session all -------------------------------------------------------------------------------- Local Remote PeerIpAddr State Type InterfaceName -------------------------------------------------------------------------------- 8195 8194 10.0.12.2 Up D_IP_IF GigabitEthernet0/0/1 -------------------------------------------------------------------------------- Total UP/DOWN Session Number : 1/0

RA的配置文件

# sysname RA # interface GigabitEthernet0/0/0 ip address 13.1.1.1 255.255.255.0 # interface GigabitEthernet0/0/1 ip address 10.0.0.1 255.255.255.0 vrrp vrid 1 virtual-ip 10.0.0.10 vrrp vrid 1 priority 120 vrrp vrid 1 preempt-mode timer delay 20 vrrp vrid 1 track interface GigabitEthernet0/0/0 reduced 30 vrrp vrid 1 track bfd-session session-name 1 reduced 30 # bfd 1 bind peer-ip 13.1.1.3 source-ip 13.1.1.1 auto commit # ip route-static 3.3.3.3 255.255.255.255 13.1.1.3 #

RB的配置文件

# sysname RB # interface GigabitEthernet0/0/0 ip address 23.1.1.2 255.255.255.0 # interface GigabitEthernet0/0/1 ip address 10.0.0.2 255.255.255.0 vrrp vrid 1 virtual-ip 10.0.0.10 # ip route-static 3.3.3.3 255.255.255.255 23.1.1.3 #

RC的配置文件

# sysname RC # interface GigabitEthernet0/0/0 ip address 13.1.1.3 255.255.255.0 # interface GigabitEthernet0/0/1 ip address 23.1.1.3 255.255.255.0 # interface LoopBack0 ip address 3.3.3.3 255.255.255.255 # bfd 1 bind peer-ip 13.1.1.1 source-ip 13.1.1.3 auto commit # ip route-static 10.0.0.0 255.255.255.0 13.1.1.1 ip route-static 10.0.0.0 255.255.255.0 23.1.1.2 #

检查bfd的状态

[RA]display bfd session all -------------------------------------------------------------------------------- Local Remote PeerIpAddr State Type InterfaceName -------------------------------------------------------------------------------- 8192 8192 13.1.1.3 Up S_AUTO_PEER - -------------------------------------------------------------------------------- Total UP/DOWN Session Number : 1/0

检查VRRP的状态

[RA]display vrrp GigabitEthernet0/0/1 | Virtual Router 1 State : Master Virtual IP : 10.0.0.10 Master IP : 10.0.0.1 PriorityRun : 120 PriorityConfig : 120 MasterPriority : 120 Preempt : YES Delay Time : 20 s TimerRun : 1 s TimerConfig : 1 s Auth type : NONE Virtual MAC : 0000-5e00-0101 Check TTL : YES Config type : normal-vrrp Backup-forward : disabled Track IF : GigabitEthernet0/0/0 Priority reduced : 30 IF state : UP Track BFD : 1 Priority reduced : 30 BFD-session state : UP Create time : 2019-09-28 17:15:24 UTC-08:00 Last change time : 2019-09-28 17:26:50 UTC-08:00

在PC上面路由追踪一下

PC>tracert 3.3.3.3 traceroute to 3.3.3.3, 8 hops max (ICMP), press Ctrl+C to stop 1 10.0.0.1 63 ms 46 ms 47 ms 2 3.3.3.3 63 ms 62 ms 47 ms

在交换机上面关闭一下接口

[SW3-GigabitEthernet0/0/1]shutdown

在RA上查看如下信息

[RA] Sep 28 2019 17:34:22-08:00 RA %%01BFD/4/STACHG_TODWN(l)[16]:BFD session changed to Down. (SlotNumber=0, Discriminator=2097152, Diagnostic=DetectDown, Applicatio ns=VRRP | AUTO, ProcessPST=False, BindInterfaceName=None, InterfacePhysicalState =None, InterfaceProtocolState=None) [RA] Sep 28 2019 17:34:22-08:00 RA VRRP/2/VRRPMASTERDOWN:OID 16777216.50331648.100663 296.16777216.67108864.16777216.3674669056.83886080.419430400.2130706432.33554432 .503316480.16777216 The state of VRRP changed from master to other state. (VrrpI fIndex=67108864, VrId=16777216, IfIndex=67108864, IPAddress=1.1.1.13, NodeName=R A, IfName=GigabitEthernet0/0/1, CurrentState=Backup, ChangeReason=priority calcu lation) [RA] Sep 28 2019 17:34:22-08:00 RA %%01VRRP/4/STATEWARNINGEXTEND(l)[17]:Virtual Route r state MASTER changed to BACKUP, because of priority calculation. (Interface=Gi gabitEthernet0/0/1, VrId=16777216, InetType=IPv4) [RA]

查看BFD的状态

[RA]display bfd session all -------------------------------------------------------------------------------- Local Remote PeerIpAddr State Type InterfaceName -------------------------------------------------------------------------------- 8192 0 13.1.1.3 Down S_AUTO_PEER - -------------------------------------------------------------------------------- Total UP/DOWN Session Number : 0/1

查看VRRP的状态

[RA]display vrrp GigabitEthernet0/0/1 | Virtual Router 1 State : Backup Virtual IP : 10.0.0.10 Master IP : 10.0.0.2 PriorityRun : 90 PriorityConfig : 120 MasterPriority : 100 Preempt : YES Delay Time : 20 s TimerRun : 1 s TimerConfig : 1 s Auth type : NONE Virtual MAC : 0000-5e00-0101 Check TTL : YES Config type : normal-vrrp Backup-forward : disabled Track IF : GigabitEthernet0/0/0 Priority reduced : 30 IF state : UP Track BFD : 1 Priority reduced : 30 BFD-session state : DOWN Create time : 2019-09-28 17:15:24 UTC-08:00 Last change time : 2019-09-28 17:34:22 UTC-08:00

在PC上面路由追踪一下

PC>tracert 3.3.3.3 traceroute to 3.3.3.3, 8 hops max (ICMP), press Ctrl+C to stop 1 10.0.0.2 47 ms 47 ms 47 ms 2 3.3.3.3 46 ms 47 ms 47 ms PC>

单臂回声

SWA的配置文件

system-view [HUAWEI] sysname SwitchA [SwitchA] vlan 13 [SwitchA-vlan13] quit [SwitchA] interface gigabitethernet 0/0/1 [SwitchA-GigabitEthernet0/0/1] port link-type hybrid [SwitchA-GigabitEthernet0/0/1] port hybrid pvid vlan 13 [SwitchA-GigabitEthernet0/0/1] port hybrid untagged vlan 13 [SwitchA-GigabitEthernet0/0/1] quit [SwitchA] interface vlanif13 [SwitchA-Vlanif13] ip address 10.1.1.5 24 [SwitchA-Vlanif13] quit [SwitchA] bfd [SwitchA-bfd] quit [SwitchA] bfd atob bind peer-ip 10.1.1.6 interface vlanif13 source-ip 10.1.1.5 one-arm-echo [SwitchA-bfd-session-atob] discriminator local 1 [SwitchA-bfd-session-atob] min-echo-rx-interval 100 [SwitchA-bfd-session-atob] commit [SwitchA-bfd-session-atob] quit

SWB的配置文件

system-view [HUAWEI] sysname SwitchB [SwitchB] vlan 13 [SwitchB-vlan13] quit [SwitchB] interface gigabitethernet 0/0/1 [SwitchB-GigabitEthernet0/0/1] port link-type hybrid [SwitchB-GigabitEthernet0/0/1] port hybrid pvid vlan 13 [SwitchB-GigabitEthernet0/0/1] port hybrid untagged vlan 13 [SwitchB-GigabitEthernet0/0/1] quit [SwitchB] interface vlanif13 [SwitchB-Vlanif13] ip address 10.1.1.6 24 [SwitchB-Vlanif13] quit

检查

[SwitchA] display bfd session all verbose -------------------------------------------------------------------------------- Session MIndex : 256 (One Hop) State : Up Name : atob -------------------------------------------------------------------------------- Local Discriminator : 1 Remote Discriminator : - Session Detect Mode : Asynchronous One-arm-echo Mode BFD Bind Type : Interface(Vlanif13) Bind Session Type : Static Bind Peer IP Address : 10.1.1.6 NextHop Ip Address : 10.1.1.6 Bind Interface : Vlanif13 Bind Source IP Address : 10.1.1.5 FSM Board Id : 0 TOS-EXP : 7 Echo Rx Interval (ms) : 100 Actual Tx Interval (ms): 100 Actual Rx Interval (ms): 100 Local Detect Multi : 3 Detect Interval (ms) : 300 Echo Passive : Disable Acl Number : - Destination Port : 3784 TTL : 255 Proc Interface Status : Disable Process PST : Disable WTR Interval (ms) : - Active Multi : 3 DSCP : - Last Local Diagnostic : No Diagnostic Bind Application : No Application Bind Session TX TmrID : - Session Detect TmrID : - Session Init TmrID : - Session WTR TmrID : - Session Echo Tx TmrID : - PDT Index : FSM-0 | RCV-0 | IF-0 | TOKEN-0 Session Description : - -------------------------------------------------------------------------------- Total UP/DOWN Session Number : 1/0

BFD默认参数及调整方法


版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:Java编程 多态
下一篇:单域MPLS 虚拟私有网络的整个详解配置过程(可跟做)(单域名和多域名的区别)
相关文章

 发表评论

暂时没有评论,来抢沙发吧~