1、GR的作用
技术保证了设备再重启过程中转发层面能过继续知道数据转发,同时控制层面邻居关系的重建以及路由计算等动作不会影像转发层面的功能,从而避免了路由震荡引发的业务中断,保证了关键业务的数据转发,提高了整个网络的可靠性。
2、GR增加了Type9 Opaque LSA
关键参数(TLV类型 Type length value)
1)Grace Period TLV:type=1,长度为4字节,表示邻居设备进入GR helper处理流程的最长保持时间。如果超过这段时间GR Restarter还没有完成GR处理流程,则周边邻居不再担任GR helper角色【必须携带】
2)Graceful Restart Reason TLV:type=2,长度为1字节,告知邻居设备GR Restarter的重启原因【必须携带】
- value =0,表示原因未知
- value=1,表示软件重启
- value=2,表示软件重新加载(升级)
- value=3,表示GR Restarter进行主备倒换
3)IP Interface address TLV:Type=3,长度为4字节,用来告知发送Grace LSA的接口的ip地址,在网络上需要用该IP地址来唯一标识一台重启设备
3、GR工作工程
1)第一步:Grace-LSA包含的主要参数,Grace Period TLV(重启的周期1-1800s)、Graceful Restart Reason TLV(重启的原因)、IP Interface address TLV(谁要重启)
2)第二步:GR Helper回复GR Restarter LSACK,告诉对方我能支持你平滑重启
3)第三步:设备主备倒换完成,备板正常up后,发送Grace-LSAs(联系发5次),进入优雅模式,二者之间保持FIB(数据转发层面)
4)当优雅重启完成后,GR Helper将协商Graceful Restart,同步lsdb
5)正常退出优雅重启,Graceful Restart向GR Helper发送一条命令“flush Grace-LSAs”,设置age=3600s(LSA的死亡周期)
4、Grace Restarter实例
5、核心配置
1)同一个网络中的三层设备都需要配置grace restarter
2)ospf 进程下配置
使能LSA-9
命令:opaque-capability enable
配置grace restarter的周期
graceful-restart period 180//单位时S
6、详细配置
R1:
<r1>display current-configuration
[V200R003C00]
#
sysname r1
#
snmp-agent local-engineid 800007DB03000000000000
snmp-agent
#
clock timezone China-Standard-Time minus 08:00:00
#
portal local-server load portalpage.zip
#
drop illegal-mac alarm
#
set cpu-usage threshold 80 restore 75
#
aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user admin password cipher %$%$K8m.Nt84DZ}e#<0`8bmE3Uw}%$%$
local-user admin service-type http
#
firewall zone Local
priority 15
#
interface GigabitEthernet0/0/0
ip address 10.1.1.1 255.255.255.0
#
interface GigabitEthernet0/0/1
#
interface GigabitEthernet0/0/2
#
interface NULL0
#
interface LoopBack0
ip address 1.1.1.1 255.255.255.255
#
ospf 100 router-id 1.1.1.1
opaque-capability enable
graceful-restart period 180
area 0.0.0.0
network 10.1.1.0 0.0.0.255
#
user-interface con 0
authentication-mode password
idle-timeout 0 0
user-interface vty 0 4
user-interface vty 16 20
#
wlan ac
#
return
<r1>
R2:
<r2>display current-configuration
[V200R003C00]
#
sysname r2
#
snmp-agent local-engineid 800007DB03000000000000
snmp-agent
#
clock timezone China-Standard-Time minus 08:00:00
#
portal local-server load portalpage.zip
#
drop illegal-mac alarm
#
set cpu-usage threshold 80 restore 75
#
aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user admin password cipher %$%$K8m.Nt84DZ}e#<0`8bmE3Uw}%$%$
local-user admin service-type http
#
firewall zone Local
priority 15
#
interface GigabitEthernet0/0/0
ip address 10.1.1.2 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 20.1.1.1 255.255.255.0
#
interface GigabitEthernet0/0/2
#
interface NULL0
#
interface LoopBack0
ip address 2.2.2.2 255.255.255.255
#
ospf 100 router-id 2.2.2.2
opaque-capability enable
graceful-restart period 180
area 0.0.0.0
network 10.1.1.0 0.0.0.255
area 0.0.0.1
network 20.1.1.0 0.0.0.255
#
user-interface con 0
authentication-mode password
idle-timeout 0 0
user-interface vty 0 4
user-interface vty 16 20
#
wlan ac
#
return
<r2>
R3:
<r3>display current-configuration
[V200R003C00]
#
sysname r3
#
snmp-agent local-engineid 800007DB03000000000000
snmp-agent
#
clock timezone China-Standard-Time minus 08:00:00
#
portal local-server load portalpage.zip
#
drop illegal-mac alarm
#
set cpu-usage threshold 80 restore 75
#
aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user admin password cipher %$%$K8m.Nt84DZ}e#<0`8bmE3Uw}%$%$
local-user admin service-type http
#
firewall zone Local
priority 15
#
interface GigabitEthernet0/0/0
ip address 20.1.1.2 255.255.255.0
#
interface GigabitEthernet0/0/1
#
interface GigabitEthernet0/0/2
#
interface NULL0
#
interface LoopBack0
ip address 3.3.3.3 255.255.255.255
#
interface LoopBack1
ip address 192.168.1.1 255.255.255.0
#
ospf 100 router-id 3.3.3.3
opaque-capability enable
graceful-restart period 180
area 0.0.0.1
network 20.1.1.0 0.0.0.255
network 192.168.1.0 0.0.0.255
#
user-interface con 0
authentication-mode password
idle-timeout 0 0
user-interface vty 0 4
user-interface vty 16 20
#
wlan ac
#
return
<r3>
7、实验结果
执行了:reset opsf process grace-restarter
<r1>ping -c 100 192.168.1.1
PING 192.168.1.1: 56 data bytes, press CTRL_C to break
Reply from 192.168.1.1: bytes=56 Sequence=1 ttl=254 time=60 ms
Reply from 192.168.1.1: bytes=56 Sequence=2 ttl=254 time=30 ms
Reply from 192.168.1.1: bytes=56 Sequence=3 ttl=254 time=20 ms
Reply from 192.168.1.1: bytes=56 Sequence=4 ttl=254 time=30 ms
Reply from 192.168.1.1: bytes=56 Sequence=5 ttl=254 time=30 ms
Reply from 192.168.1.1: bytes=56 Sequence=6 ttl=254 time=20 ms
Reply from 192.168.1.1: bytes=56 Sequence=7 ttl=254 time=40 ms
Reply from 192.168.1.1: bytes=56 Sequence=8 ttl=254 time=30 ms
Reply from 192.168.1.1: bytes=56 Sequence=9 ttl=254 time=40 ms
Reply from 192.168.1.1: bytes=56 Sequence=10 ttl=254 time=30 ms
Reply from 192.168.1.1: bytes=56 Sequence=11 ttl=254 time=30 ms
Reply from 192.168.1.1: bytes=56 Sequence=12 ttl=254 time=40 ms
Reply from 192.168.1.1: bytes=56 Sequence=13 ttl=254 time=30 ms
Reply from 192.168.1.1: bytes=56 Sequence=14 ttl=254 time=20 ms
Reply from 192.168.1.1: bytes=56 Sequence=15 ttl=254 time=30 ms
Reply from 192.168.1.1: bytes=56 Sequence=16 ttl=254 time=30 ms
Reply from 192.168.1.1: bytes=56 Sequence=17 ttl=254 time=30 ms
Reply from 192.168.1.1: bytes=56 Sequence=18 ttl=254 time=40 ms
Reply from 192.168.1.1: bytes=56 Sequence=19 ttl=254 time=30 ms
Reply from 192.168.1.1: bytes=56 Sequence=20 ttl=254 time=30 ms
Reply from 192.168.1.1: bytes=56 Sequence=21 ttl=254 time=40 ms
Reply from 192.168.1.1: bytes=56 Sequence=22 ttl=254 time=10 ms
Reply from 192.168.1.1: bytes=56 Sequence=23 ttl=254 time=20 ms
Reply from 192.168.1.1: bytes=56 Sequence=24 ttl=254 time=30 ms
Reply from 192.168.1.1: bytes=56 Sequence=25 ttl=254 time=30 ms
Reply from 192.168.1.1: bytes=56 Sequence=26 ttl=254 time=20 ms
Reply from 192.168.1.1: bytes=56 Sequence=27 ttl=254 time=20 ms
Reply from 192.168.1.1: bytes=56 Sequence=28 ttl=254 time=20 ms
Reply from 192.168.1.1: bytes=56 Sequence=29 ttl=254 time=20 ms
Reply from 192.168.1.1: bytes=56 Sequence=30 ttl=254 time=20 ms
Reply from 192.168.1.1: bytes=56 Sequence=31 ttl=254 time=20 ms
Reply from 192.168.1.1: bytes=56 Sequence=32 ttl=254 time=20 ms
Reply from 192.168.1.1: bytes=56 Sequence=33 ttl=254 time=30 ms
Reply from 192.168.1.1: bytes=56 Sequence=34 ttl=254 time=30 ms
Reply from 192.168.1.1: bytes=56 Sequence=35 ttl=254 time=30 ms
Reply from 192.168.1.1: bytes=56 Sequence=36 ttl=254 time=30 ms
Reply from 192.168.1.1: bytes=56 Sequence=37 ttl=254 time=30 ms
Reply from 192.168.1.1: bytes=56 Sequence=38 ttl=254 time=30 ms
Reply from 192.168.1.1: bytes=56 Sequence=39 ttl=254 time=30 ms
Reply from 192.168.1.1: bytes=56 Sequence=40 ttl=254 time=40 ms
Reply from 192.168.1.1: bytes=56 Sequence=41 ttl=254 time=30 ms
Reply from 192.168.1.1: bytes=56 Sequence=42 ttl=254 time=30 ms
Reply from 192.168.1.1: bytes=56 Sequence=43 ttl=254 time=40 ms
Reply from 192.168.1.1: bytes=56 Sequence=44 ttl=254 time=40 ms
Reply from 192.168.1.1: bytes=56 Sequence=45 ttl=254 time=30 ms
Reply from 192.168.1.1: bytes=56 Sequence=46 ttl=254 time=40 ms
Reply from 192.168.1.1: bytes=56 Sequence=47 ttl=254 time=20 ms
Reply from 192.168.1.1: bytes=56 Sequence=48 ttl=254 time=30 ms
Reply from 192.168.1.1: bytes=56 Sequence=49 ttl=254 time=20 ms
Reply from 192.168.1.1: bytes=56 Sequence=50 ttl=254 time=20 ms
Reply from 192.168.1.1: bytes=56 Sequence=51 ttl=254 time=10 ms
Reply from 192.168.1.1: bytes=56 Sequence=52 ttl=254 time=20 ms
Reply from 192.168.1.1: bytes=56 Sequence=53 ttl=254 time=30 ms
Reply from 192.168.1.1: bytes=56 Sequence=54 ttl=254 time=30 ms
Reply from 192.168.1.1: bytes=56 Sequence=55 ttl=254 time=30 ms
Reply from 192.168.1.1: bytes=56 Sequence=56 ttl=254 time=30 ms
Reply from 192.168.1.1: bytes=56 Sequence=57 ttl=254 time=30 ms
Reply from 192.168.1.1: bytes=56 Sequence=58 ttl=254 time=40 ms
Reply from 192.168.1.1: bytes=56 Sequence=59 ttl=254 time=30 ms
Reply from 192.168.1.1: bytes=56 Sequence=60 ttl=254 time=20 ms
Reply from 192.168.1.1: bytes=56 Sequence=61 ttl=254 time=30 ms
Dec 27 2023 17:06:18-08:00 r1 %%01OSPF/4/RECV_FIRST_GLSA(l)[28]:OSPF 25600 attem
pted to enter helper mode and received first grace LSA from neighbor 2.2.2.2, on
interface 1.1.1.10.
<r1>
Dec 27 2023 17:06:18-08:00 r1 %%01OSPF/4/ENTER_HELPER_MODE(l)[29]:OSPF 25600 nei
ghbor 2.2.2.2 enters helper on interface 1.1.1.10.
<r1>
Reply from 192.168.1.1: bytes=56 Sequence=62 ttl=254 time=20 ms
Reply from 192.168.1.1: bytes=56 Sequence=63 ttl=254 time=20 ms
Reply from 192.168.1.1: bytes=56 Sequence=64 ttl=254 time=20 ms
Dec 27 2023 17:06:19-08:00 r1 %%01OSPF/3/NBR_DOWN_REASON(l)[30]:Neighbor state l
eaves full or changed to Down. (ProcessId=25600, NeighborRouterId=2.2.2.2, Neigh
borAreaId=0, NeighborInterface=GigabitEthernet0/0/0,NeighborDownImmediate reason
=Neighbor Down Due to SequenceNum Mismatch, NeighborDownPrimeReason=M,I,MS bit o
r SequenceNum Incorrect, NeighborChangeTime=2023-12-27 17:06:19-08:00)
<r1>
Dec 27 2023 17:06:19-08:00 r1 %%01OSPF/4/NBR_CHANGE_E(l)[31]:Neighbor changes ev
ent: neighbor status changed. (ProcessId=25600, NeighborAddress=2.1.1.10, Neighb
orEvent=SeqNumberMismatch, NeighborPreviousState=Full, NeighborCurrentState=ExSt
art)
<r1>
Reply from 192.168.1.1: bytes=56 Sequence=65 ttl=254 time=30 ms
Reply from 192.168.1.1: bytes=56 Sequence=66 ttl=254 time=30 ms
Reply from 192.168.1.1: bytes=56 Sequence=67 ttl=254 time=20 ms
Reply from 192.168.1.1: bytes=56 Sequence=68 ttl=254 time=30 ms
Reply from 192.168.1.1: bytes=56 Sequence=69 ttl=254 time=30 ms
Reply from 192.168.1.1: bytes=56 Sequence=70 ttl=254 time=20 ms
Reply from 192.168.1.1: bytes=56 Sequence=71 ttl=254 time=30 ms
Reply from 192.168.1.1: bytes=56 Sequence=72 ttl=254 time=20 ms
Reply from 192.168.1.1: bytes=56 Sequence=73 ttl=254 time=20 ms
Reply from 192.168.1.1: bytes=56 Sequence=74 ttl=254 time=30 ms
Dec 27 2023 17:06:24-08:00 r1 %%01OSPF/4/NBR_CHANGE_E(l)[32]:Neighbor changes ev
ent: neighbor status changed. (ProcessId=25600, NeighborAddress=2.1.1.10, Neighb
orEvent=NegotiationDone, NeighborPreviousState=ExStart, NeighborCurrentState=Exc
hange)
<r1>
Dec 27 2023 17:06:24-08:00 r1 %%01OSPF/4/NBR_CHANGE_E(l)[33]:Neighbor changes ev
ent: neighbor status changed. (ProcessId=25600, NeighborAddress=2.1.1.10, Neighb
orEvent=ExchangeDone, NeighborPreviousState=Exchange, NeighborCurrentState=Loadi
ng)
<r1>
Dec 27 2023 17:06:24-08:00 r1 %%01OSPF/4/NBR_CHANGE_E(l)[34]:Neighbor changes ev
ent: neighbor status changed. (ProcessId=25600, NeighborAddress=2.1.1.10, Neighb
orEvent=LoadingDone, NeighborPreviousState=Loading, NeighborCurrentState=Full)
<r1>
Reply from 192.168.1.1: bytes=56 Sequence=75 ttl=254 time=20 ms
Reply from 192.168.1.1: bytes=56 Sequence=76 ttl=254 time=30 ms
Reply from 192.168.1.1: bytes=56 Sequence=77 ttl=254 time=20 ms
Reply from 192.168.1.1: bytes=56 Sequence=78 ttl=254 time=20 ms
Reply from 192.168.1.1: bytes=56 Sequence=79 ttl=254 time=20 ms
Reply from 192.168.1.1: bytes=56 Sequence=80 ttl=254 time=30 ms
Reply from 192.168.1.1: bytes=56 Sequence=81 ttl=254 time=30 ms
Reply from 192.168.1.1: bytes=56 Sequence=82 ttl=254 time=30 ms
Reply from 192.168.1.1: bytes=56 Sequence=83 ttl=254 time=20 ms
Reply from 192.168.1.1: bytes=56 Sequence=84 ttl=254 time=20 ms
Dec 27 2023 17:06:30-08:00 r1 %%01OSPF/4/GR_EXIT_HLP_SU(l)[35]:OSPF 25600 neighb
or 2.2.2.2 exits helper successfully on interface 1.1.1.10.
<r1>
Reply from 192.168.1.1: bytes=56 Sequence=85 ttl=254 time=40 ms
Reply from 192.168.1.1: bytes=56 Sequence=86 ttl=254 time=20 ms
Reply from 192.168.1.1: bytes=56 Sequence=87 ttl=254 time=30 ms
Reply from 192.168.1.1: bytes=56 Sequence=88 ttl=254 time=30 ms
Reply from 192.168.1.1: bytes=56 Sequence=89 ttl=254 time=20 ms
Reply from 192.168.1.1: bytes=56 Sequence=90 ttl=254 time=30 ms
Reply from 192.168.1.1: bytes=56 Sequence=91 ttl=254 time=40 ms
Reply from 192.168.1.1: bytes=56 Sequence=92 ttl=254 time=40 ms
Reply from 192.168.1.1: bytes=56 Sequence=93 ttl=254 time=30 ms
Reply from 192.168.1.1: bytes=56 Sequence=94 ttl=254 time=30 ms
Reply from 192.168.1.1: bytes=56 Sequence=95 ttl=254 time=30 ms
Reply from 192.168.1.1: bytes=56 Sequence=96 ttl=254 time=30 ms
Reply from 192.168.1.1: bytes=56 Sequence=97 ttl=254 time=30 ms
Reply from 192.168.1.1: bytes=56 Sequence=98 ttl=254 time=40 ms
Reply from 192.168.1.1: bytes=56 Sequence=99 ttl=254 time=30 ms
Reply from 192.168.1.1: bytes=56 Sequence=100 ttl=254 time=30 ms
--- 192.168.1.1 ping statistics ---
100 packet(s) transmitted
100 packet(s) received
0.00% packet loss
round-trip min/avg/max = 10/28/60 ms
<r1>
标签:1.1,ttl,56,bytes,192.168,ms,14,OSPF,GR From: https://blog.51cto.com/u_13560030/9002310