WO2017063365A1 - 邻居震荡的抑制方法及装置 - Google Patents
邻居震荡的抑制方法及装置 Download PDFInfo
- Publication number
- WO2017063365A1 WO2017063365A1 PCT/CN2016/083365 CN2016083365W WO2017063365A1 WO 2017063365 A1 WO2017063365 A1 WO 2017063365A1 CN 2016083365 W CN2016083365 W CN 2016083365W WO 2017063365 A1 WO2017063365 A1 WO 2017063365A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- neighbor
- state
- router
- suppression
- penalty value
- Prior art date
Links
Images
Definitions
- This application relates to, but is not limited to, the field of communication technology.
- the distance vector routing algorithm includes: Routing Information Protocol (RIP) and Border Gateway Protocol (BGP).
- the link state routing algorithm includes: Open Shortest Path (Open Shortest Path). First, referred to as: OSPF), Intermediate System-to-Intermediate System (ISIS).
- OSPF Routing Information Protocol
- ISIS Intermediate System-to-Intermediate System
- the routing protocol (except the RIP protocol) establishes the neighbor relationship through the HELLO packet mechanism.
- the HELLO packet can carry the local related attribute information.
- the two parties send the HELLO packet to discover the other party and receive the peer end.
- the HELLO packet is checked for validity of the HELLO packet. If the parameters match, the neighbor relationship of the HELLO packet sender can be recorded. In actual application, the neighbors can negotiate a certain time interval. If the HELLO packet sent by the neighbor is not received, the neighbor relationship is deleted. The neighbor relationship is deleted.
- the local router exchanges routing information with other routers through routing protocols, sends network reachability information to other routers, and receives network reachability information from other routers. After routing information exchange completes routing information, it is based on all reachable information in related technologies. The decision is made to the optimal path to the specific network. During this period, the topology changes in the network are also responded, and the change information needs to be notified to other routers in time, so that other routers update the corresponding routes.
- the routing information advertised by the neighbor and the routing information advertised by the neighbor are continually deleted to the routing table.
- the route flapping occurs locally, and the oscillating route is further triggered.
- the local router repeats the routing process of deleting and re-advertised to other routers, which greatly wastes valuable bandwidth resources and central processing unit (Central Processing Unit, referred to as: CPU) resources.
- CPU central processing Unit
- FIG. 1 is a schematic diagram of a neighbor oscillation in the related art.
- router 2 and router 1 establish a neighbor relationship through OSPF, and router 2 advertises routing information to router 1 and neighbor state arrives (UP). Due to the unstable transmission of the link medium between the router 1 and the router 2, there is a problem in the transmission of the message between the router 1 and the router 1 does not receive the HELLO message sent by the router 2 within the specified time.
- Router 2 deletes this neighbor, and correspondingly deletes the routing information advertised by Router 2, and then receives the HELLO packet sent by Router 2.
- the routing information advertised by Router 2 is added to the routing table. The relationship is repeatedly oscillated, causing Router 1 to continuously add and delete routing information advertised by Router 2, that is, route flapping.
- This document provides a method and device for suppressing neighbor oscillations to solve the problem of route flapping in the local routing table caused by unstable neighbor states in the related art.
- a method for suppressing neighbor oscillations including:
- the first router acquires a neighbor state change dynamic between the second router that has established a neighbor relationship with the first router;
- the first router adds a value to the neighbor penalty value each time the neighbor state change dynamic changes from a normal state to a fault state;
- the first router sets the neighbor state to a suppression state when the added neighbor penalty value is greater than a preset suppression threshold.
- the method further includes:
- the first router starts a first timer, where the first timer is used to indicate that When the first preset timing time is reached, the first router performs a halving operation on the neighbor penalty value.
- the method further includes:
- the first router Before the neighbor state is a suppression state, and when the first timer reaches a first preset timing time, the first router performs a halving operation on the neighbor penalty value; or, in the neighbor state After the state is suppressed, and when the first timer reaches the first preset timing time, the first router performs a halving operation on the neighbor penalty value;
- the first router keeps the neighbor state as the suppression state when the judgment result is that the neighbor penalty value after the halving is greater than the preset suppression threshold;
- the method further includes:
- the first router starts a second timer
- the first router sets the neighbor state to exit the suppression state, and reconfigures the neighbor penalty value, where the neighbor penalty value after reconfiguration Less than the preset suppression threshold.
- the second preset timing time is greater than the first preset timing time.
- the method further includes:
- the first router keeps the neighbor state as the suppression state when receiving the keep-alive HELLO packet sent by the second router to establish a connection, and the neighbor state is the suppression state.
- a device for suppressing neighbor oscillations is applied to a first router, and the suppression device for the neighbor oscillation includes:
- An acquiring module configured to: acquire a neighbor state change dynamic between a second router that has established a neighbor relationship with the first router;
- Adding a module configured to: add a value to the neighbor penalty value when the dynamic change of the neighbor state obtained by the acquiring module is changed from a normal state to a fault state;
- the setting module is configured to: set the neighbor state to a suppression state when a neighbor penalty value added by the adding module is greater than a preset suppression threshold.
- the device further includes:
- the module is opened, and is configured to: when the neighbor state change dynamic is the first neighbor state change dynamic, and the acquiring module acquires a neighbor state change between the second router that has established a neighbor relationship with the first router.
- the first timer is started, where the first timer is used to indicate that the first router halved the neighbor penalty value when the first preset timing time is reached.
- the device further includes:
- the processing module is configured to: before the neighboring state is the suppression state, and when the first timer that is enabled by the enabling module reaches the first preset timing, the halving operation is performed on the neighbor penalty value; Or, after the neighboring state is the suppression state, and when the first timer that is enabled by the enabling module reaches the first preset timing time, the neighbor penalty value is halved;
- the determining module is configured to: determine whether the neighbor penalty value after the halving of the processing module is greater than the preset suppression threshold;
- the state setting module is further configured to: when the determination result of the determining module is that the neighbor penalty value after the halving is greater than the preset suppression threshold, maintaining the neighbor state as the suppression state;
- the state setting module is further configured to: when the judgment result is that the neighbor penalty value after the halving is less than or equal to the preset suppression threshold, set the neighbor state to exit the suppression state.
- the opening module is further configured to: after the state setting module sets the neighbor state to a suppression state, start a second timer;
- the state setting module is further configured to: when the second timer that is enabled by the initiating module reaches a second preset timing, set the neighbor state to exit the suppression state, and reconfigure the neighbor penalty a value, wherein the reconfigured neighbor penalty value is less than the preset suppression threshold.
- the second preset timing time is greater than the first preset timing time.
- the state setting module is further configured to: after the acquiring module acquires a neighbor state change dynamic between a second router that has established a neighbor relationship with the first router, after receiving the second And maintaining, when the neighbor state is the suppression state, the neighbor state is the suppression state, when the router sends a keep-alive HELLO packet for establishing a connection.
- the first router acquires the neighbor state change dynamic between the second router that has established the neighbor relationship with the first router, and the first router changes in each neighbor state.
- the neighbor penalty value is increased by a value, and the first router sets the neighbor state to the suppression state when the added neighbor penalty value is greater than the preset suppression threshold.
- the penalty value is used to suppress the neighboring flapping of the route, and the problem of route flapping in the local routing table caused by the unstable neighbor state in the related art is solved, thereby achieving the effect of saving valuable bandwidth resources and CPU resources.
- FIG. 1 is a schematic diagram of a neighbor oscillation in a related art
- FIG. 2 is a flowchart of a method for suppressing neighbor oscillation according to an embodiment of the present invention
- FIG. 3 is a flowchart of another method for suppressing neighbor oscillation according to an embodiment of the present disclosure
- FIG. 4 is a flowchart of still another method for suppressing neighbor oscillation according to an embodiment of the present disclosure
- FIG. 5 is a schematic structural diagram of a device for suppressing neighbor oscillation according to an embodiment of the present disclosure
- FIG. 6 is a schematic structural diagram of another apparatus for suppressing neighbor oscillation according to an embodiment of the present disclosure.
- FIG. 7 is a flowchart of a method for processing a neighbor state after a neighbor state change is performed according to an embodiment of the present invention
- FIG. 8 is a flowchart of a method for processing a HELLO message for a neighbor that is newly sent by a neighbor in a fault state according to the method for suppressing neighbor oscillation according to an embodiment of the present invention
- FIG. 9 is a half-life timer super in a method for suppressing neighbor oscillation according to an embodiment of the present invention. Flow chart of the processing method after the time.
- FIG. 2 is a flowchart of a method for suppressing neighbor oscillation according to an embodiment of the present invention. As shown in FIG. 2, the method provided in this embodiment includes the following steps. That is, steps 110 to 130:
- Step 110 The first router acquires a neighbor state change dynamic between the second router that has established a neighbor relationship with the first router.
- Step 120 The first router adds a value to the neighbor penalty value when the dynamic change of the neighbor state changes from the normal state to the fault state.
- Step 130 When the increased neighbor penalty value of the first router is greater than the preset suppression threshold, the first router sets the neighbor state to the suppression state.
- the first router acquires the neighbor state change dynamic between the second routers that have established the neighbor relationship with the first router, and the dynamic change of the first router in each neighbor state is normal.
- the neighbor penalty value is increased by a value, and the first router sets the neighbor state to the suppression state when the added neighbor penalty value is greater than the preset suppression threshold; that is, the method is adopted in this embodiment.
- the neighbor penalty value is used to suppress the neighboring flapping of the route, which solves the problem of route flapping in the local routing table caused by the unstable neighbor state in the related art, thereby achieving the effect of saving valuable bandwidth resources and CPU resources. .
- FIG. 3 is a flowchart of another method for suppressing neighbor oscillation according to an embodiment of the present invention.
- the first router acquires the second router that has established a neighbor relationship with the first router.
- the method of the embodiment may further include: Step 111: The first router starts the first timer, where the first timer is used to indicate that the preset timing is reached. At the time, the first router halved the neighbor penalty value.
- the method in this embodiment may further include steps 140 to 152:
- Step 140 Before the neighbor state is in the state, and when the first timer reaches the first preset timing, the first router halved the neighbor penalty value; or, after the neighbor state is the suppression state, and When the first timer reaches the first preset timing time, the first router halves the neighbor penalty value.
- Step 150 The first router determines whether the neighbor penalty value after the halving is greater than the preset suppression threshold. If the neighbor penalty value after the halved determination is greater than the preset suppression threshold, step 151 is performed; When the neighbor penalty value is less than or equal to the preset suppression threshold, step 152 is performed.
- Step 151 The first router keeps the neighbor state as a suppression state.
- Step 152 The first router sets a neighbor state exit suppression state.
- the suppression state in the embodiment may be alleviated, so that the neighbor state may not remain in the suppression state at all times, that is, when the first timer is reached, it is required in the embodiment.
- the penalty value is halved, and after one or more halving operations, the penalty value that originally exceeds the predetermined threshold may be less than a predetermined threshold, thereby unblocking the suppression state.
- FIG. 4 is a flowchart of still another method for suppressing neighbor oscillation according to an embodiment of the present invention.
- the method in this embodiment may further include steps 160 to 170:
- Step 160 The first router starts a second timer.
- Step 170 The first router sets the neighbor state exit suppression state when the second timer reaches the second preset timing, and re-configures the neighbor penalty value, where the neighbor penalty after reconfiguration The value is less than the preset suppression threshold.
- the neighbor state may not be suppressed indefinitely, that is, when the neighbor penalty value is still greater than a predetermined threshold after a period of time, the reconfiguration is required.
- the penalty value is not be suppressed indefinitely, that is, when the neighbor penalty value is still greater than a predetermined threshold after a period of time, the reconfiguration is required.
- the second preset timing time is greater than the first preset timing time.
- the method in this embodiment further The method includes: when the first router receives the HELLO packet sent by the second router to establish a connection, and the neighbor state is the suppression state, maintaining the neighbor state as the suppression state.
- the first router when receiving the HELLO packet sent by the second router for establishing a connection, the first router establishes a neighbor relationship with the second router as long as the current neighbor state is not in the suppression state; After the change dynamics, the suppression state may be entered, or the suppression state may be entered after the dynamic change. In the embodiment, the suppression state may be related to the configured time parameter.
- the embodiment of the present invention further provides a device for suppressing neighbors, which is used to implement the foregoing embodiments and optional embodiments, and details are not described herein.
- the term "module” may implement a combination of software and/or hardware of a predetermined function.
- the apparatus described in the following embodiments is preferably implemented in software, hardware, or a combination of software and hardware, is also possible and contemplated.
- FIG. 5 is a schematic structural diagram of a device for suppressing neighbor oscillation according to an embodiment of the present invention.
- the apparatus for suppressing neighbor oscillation provided in this embodiment may be applied to the first router.
- the apparatus includes: an obtaining module 31, an adding module 32, and a state setting module 33.
- the obtaining module 31 is configured to: acquire a neighbor state change dynamic between the second router that has established a neighbor relationship with the first router.
- the adding module 32 is coupled to the acquiring module 31.
- the adding module 32 is configured to add a value to the neighbor penalty value when the dynamic state of the neighbor state acquired by the acquiring module 31 changes from a normal state to a fault state.
- the state setting module 33 is coupled to the adding module 32.
- the state setting module 33 is configured to set the neighbor state to the suppressed state when the added neighbor penalty value is greater than the preset suppression threshold.
- FIG. 6 is a schematic structural diagram of another neighbor oscillation suppression apparatus according to an embodiment of the present invention.
- the apparatus provided in this embodiment is further provided on the structure of the apparatus shown in FIG.
- the method may include: the initiating module 34 is coupled to the acquiring module 31, and the initiating module 34 is configured to: when the neighbor state change dynamic is the first neighbor state change dynamic, and obtain the neighbor relationship with the first router in the obtaining module 31. After the dynamic change of the neighbor state between the second routers, the first timer is started, where the first timer is used to indicate that the first router halved the neighbor penalty value when the preset timing time is reached.
- the apparatus provided in this embodiment may further include: a processing module 35 coupled to the opening module 34, the processing module 35 being configured to: before the neighbor state is the suppression state, and at the first timing when the opening module 34 is turned on.
- the neighbor penalty value is halved; or, after the neighbor state is the suppression state, and when the first timer opened by the opening module 34 reaches the first preset timing time, The neighboring penalty value is halved;
- the determining module 36 is coupled to the processing module 35, and the determining module 36 is configured to: determine whether the neighbor penalty value after the halving process is performed by the processing module 35 is greater than a preset suppression threshold; accordingly, the state setting
- the module 33 is further coupled to the determining module 36.
- the state setting module 33 is further configured to: maintain the neighbor state as a suppression state when the neighboring penalty value of the determining module 36 is halved and the neighbor penalty value is greater than the preset suppression threshold;
- the setting module 33 is further configured to: set the neighbor shape when the neighbor penalty value after the determination result is halved is less than or equal to the preset suppression threshold The state exits the suppression state.
- the opening module 34 in this embodiment is also coupled to the state setting module 33.
- the opening module 34 is further configured to: set the neighbor state in the state setting module 33 to After the state is suppressed, the second timer is turned on.
- the state setting module 33 is further configured to: when the second timer that is turned on by the module 34 reaches the second preset timing, set the neighbor state to exit the suppression state, and reconfigure the neighbor penalty. The value, where the reconfigured neighbor penalty value is less than the preset suppression threshold.
- the second preset timing time is greater than the first preset timing time.
- the state setting module in this embodiment is based on the structure of the apparatus shown in FIG. 33 is also coupled to the acquisition module 31.
- the state setting module 33 is further configured to: after the acquisition module 31 acquires the neighbor state change dynamic between the second router that has established the neighbor relationship with the first router, after receiving the fault state When the neighbor newly sent HELLO packet is established, and the neighbor state is suppressed, the neighbor state is kept in the suppressed state.
- each of the foregoing modules may be implemented by software or hardware.
- the foregoing may be implemented by, but not limited to, the foregoing modules are all located in the same processor; or, the modules are located in multiple In the processor.
- This embodiment provides a neighboring oscillating suppression method.
- the neighboring penalty value is assigned to the neighbor. The more the neighbor oscillates, the greater the neighbor penalty value is.
- the penalty value is greater than the preset suppression threshold, the neighbor state enters the suppression state and no longer establishes a neighbor relationship with the router. Each set half-life interval, the neighbor's neighbor penalty value is halved. When the neighbor penalty value is less than the set reuse value. When you can establish a neighbor relationship with the router again. In this embodiment, the unstable neighbor state is suppressed, and the route flapping problem that may occur in the local routing table is avoided, and valuable bandwidth resources and CPU resources are also saved.
- the neighbor suppression information is created, the neighbor penalty value is initialized, and the half-life timer is turned on. If the neighbor suppression information record already exists, the neighbor penalty value is added. If the neighbor penalty value is greater than the preset suppression threshold, set the neighbor state to the suppression state and simultaneously open the maximum suppression timer;
- the local router can communicate with the router. Establish a neighbor relationship; if there is a suppression information record of the neighbor and the neighbor has entered the suppression state, the local router cannot establish a neighbor relationship with the router;
- the half-life timer (corresponding to the first timer in the foregoing embodiment) is timed out, the neighbor penalty value is halved, and the neighbor penalty value is determined to be less than the reused value. If the neighbor penalty value is less than The secondary use value and the neighbor state is previously in the suppressed state, then the neighbor state exit suppression state is set, and then the local router can establish a neighbor relationship with the neighbor router again;
- the maximum suppression timer (corresponding to the second timer in the foregoing embodiment) times out processing. If the neighbor state is in the suppression state at this time, the neighbor state is set to exit the suppression state, and then the local router can establish a neighbor relationship with the neighbor router again. , reset the neighbor penalty value;
- the neighbor oscillation suppression command parameter mainly includes a half-life time parameter, a maximum suppression time parameter, a suppression threshold parameter, and a reuse value parameter.
- the neighbor penalty value is halved every half-life interval; in order not to prevent the neighbor state from being suppressed indefinitely, the neighbor state enters the suppression state, and the maximum suppression interval is passed.
- the neighbor penalty value is continuously increased due to the repeated oscillation of the neighbor, and when the neighbor penalty value is greater than the preset suppression threshold, The neighbor state enters the suppression state.
- the local router cannot establish a neighbor relationship with the neighboring router.
- the neighbor penalty value is halved every half-life interval after the neighbor state enters the suppression state. When the neighbor penalty value is less than the re-use value, the neighbor state is set to exit. To suppress the state, the local router can then establish a neighbor relationship with the neighbor router again.
- FIG. 7 is a flowchart of a method for processing a neighbor state after a neighbor state change according to an embodiment of the present invention. As shown in FIG. 7 , the method provided in this embodiment may include steps 401 to 407:
- Step 401 The neighbor status changes from Up to Down.
- Step 402 determining whether there is a suppression information record; when the result of the determination is that there is no suppression information record, step 403 is performed, and when the result of the determination is that there is suppression information record, step 404 is performed;
- Step 403 Create a suppression information record of the neighbor, initialize a neighbor penalty value, and open a half-life timer, where the half-life timer interval is a half-life configuration value;
- Step 404 Add a value to the neighbor penalty value.
- Step 405 Determine whether the neighbor penalty value is greater than the preset suppression threshold. If the neighbor penalty value is greater than the preset suppression threshold, go to step 406. If the neighbor penalty value is less than or equal to the preset suppression threshold, perform the step. 407;
- Step 406 Set the neighbor state to the suppression state, and open the maximum suppression timer, which is the maximum suppression.
- the time interval of the timer is the maximum suppression time configuration value
- Step 407 No operation is performed.
- the neighbor has started to oscillate. If it is the first one, you need to create a suppression information record for the neighbor, the initial neighbor penalty value, and the half-life timer. If it is not the first one.
- the generated oscillation increases the neighbor penalty value by a value, which can be a fixed growth mode or an exponential growth mode. If the increased neighbor penalty value is greater than the preset suppression threshold, the neighbor state is required next. If the neighbor suppression penalty is less than the preset suppression threshold, the maximum suppression timer needs to be turned on. , do nothing.
- FIG. 8 is a flowchart of a method for processing a HELLO packet sent by a neighbor in a fault state after being received by a neighbor in a fault state according to an embodiment of the present invention, as shown in FIG.
- the method provided by the embodiment may include steps 501 to 505:
- Step 501 Receive a newly sent HELLO packet for establishing a connection in a neighbor in a fault state.
- Step 502 it is determined whether there is a suppression information record; when the determination result is that there is suppression information record, step 503 is performed, and if the result of the determination is that there is no suppression information record, step 505 is performed;
- Step 503 it is determined whether the neighbor state is in the suppression state, when the judgment result is that the neighbor state is in the suppression state, step 504 is performed, and when the determination result is that the neighbor state is not in the suppression state, step 505 is performed;
- Step 504 no neighbor relationship is established
- Step 505 establishing a neighbor relationship.
- the neighbor suppression information record is displayed. If the HELLO packet exists, it indicates that the previous oscillating state has occurred. If the neighbor state is in the suppressed state, the local router cannot establish a neighbor relationship with the neighboring router. If the neighbor state is not in the suppressed state, the local router can establish a neighbor relationship with the neighboring router; if there is no suppression Information record, indicating that there has been no previous shock or a long time interval There has been no oscillating in the neighborhood and the neighbor penalty value is attenuated to 0, indicating that the local router can establish a neighbor relationship with the neighbor router.
- the neighbor flapping will cause the local router to repeatedly add and delete routes advertised by the neighbors. That is, the route flapping occurs.
- the oscillating route will also trigger the local router to repeatedly delete and re-advertise the routing process to other routers. , greatly waste valuable bandwidth resources and CPU resources.
- FIG. 9 is a flowchart of a method for processing a half-life timer after a timeout in a neighbor oscillation suppression method according to an embodiment of the present invention. As shown in FIG. 9, the method provided in this embodiment may include steps 601 to 609:
- Step 601 opening a half-life timer
- Step 602 After the half-life timer expires, the neighbor penalty value is halved;
- Step 603 it is determined whether the neighbor penalty value is less than the reuse value, when the judgment result is that the neighbor penalty value is equal to the reuse value, step 601 is performed, and when the judgment result is that the neighbor penalty value is less than the reuse value, step 604 is performed;
- Step 604 it is determined whether the neighbor state is in the suppression state; when the judgment result is that the neighbor state is not in the suppression state, step 606 is performed, and when the determination result is that the neighbor state is in the suppression state, step 605 is performed;
- Step 605 it is determined whether the neighbor penalty value is 0; when the judgment result is that the neighbor penalty value is 0, step 608 is performed, and when the judgment result is that the neighbor penalty value is not 0, step 609 is performed;
- Step 606 it is determined whether the neighbor penalty value is 0; when the judgment result is that the neighbor penalty value is 0, step 607 is performed;
- Step 607 deleting a corresponding suppression information record, where the suppression information record includes a maximum suppression timer and a half-life timer;
- Step 608 setting a neighbor state exit suppression state, and deleting a corresponding suppression information record, where the suppression information record includes a maximum suppression periodicity and a half-life timer;
- step 609 the neighbor state exit suppression state is set, and the maximum suppression scheduler is turned off.
- the neighbor suppression information record is created when the neighbor first oscillates, the initial neighbor penalty value is set, and the half-life timer is turned on. After the time interval of the half-life configuration value, the half-life timer expires, and the neighbor penalty value is halved. If the neighbor penalty value after halving is less than the reuse value and And the reassigned route is previously in a suppressed state, then setting the neighbor state exit suppression state is no longer suppressed, and then the local router can establish a neighbor relationship with the neighbor router. Because the neighbor state is no longer in the suppression state, you need to disable the maximum suppression timer.
- the suppression information record may include a closed half-life timer and a maximum suppression timer.
- the penalty value is continuously increased when the neighbor repeatedly oscillates, and when the neighbor penalty value is greater than the preset suppression threshold, the neighbor state needs to be suppressed and enters the suppression state.
- the maximum suppression configuration value interval that is, the maximum suppression timer expires, set the neighbor state to exit the suppression state, and reset the neighbor penalty.
- the value of the reconfigured neighbor penalty value needs to be less than or equal to the configured value again; the local router can establish a neighbor relationship with the neighbor.
- Embodiments of the present invention also provide a storage medium.
- the foregoing storage medium may be configured to store program code for performing the following steps:
- Step 1 The first router acquires a neighbor state change dynamic between the second router that has established a neighbor relationship with the first router.
- Step 2 The first router adds a value to the neighbor penalty value when the dynamic change of the neighbor state changes from the normal state to the fault state.
- Step 3 The first router sets the neighbor state to the suppression state when the added neighbor penalty value is greater than the preset suppression threshold.
- all or part of the steps of the above embodiments may also be implemented by using an integrated circuit. These steps may be separately fabricated into individual integrated circuit modules, or multiple modules or steps may be fabricated into a single integrated circuit module. achieve.
- the devices/function modules/functional units in the above embodiments may be implemented by a general-purpose computing device, which may be centralized on a single computing device or distributed over a network of multiple computing devices.
- the device/function module/functional unit in the above embodiment When the device/function module/functional unit in the above embodiment is implemented in the form of a software function module and sold or used as a stand-alone product, it can be stored in a computer readable storage medium.
- the above mentioned computer readable storage medium may be a read only memory, a magnetic disk or an optical disk or the like.
- the embodiment of the present invention obtains the neighbor state change dynamic between the second routers that have established the neighbor relationship with the first router by using the first router, and the first router changes the state of the neighbor state to the fault state when the dynamic state changes from the normal state to the fault state. Adding a value to the neighbor penalty value, and setting the neighbor state to the suppression state when the increased neighbor penalty value is greater than the preset suppression threshold. In the embodiment of the present invention, the neighbor penalty value is used to suppress the neighbor of the route.
- the oscillating problem solves the problem of route flapping in the local routing table caused by the unstable neighbor state in the related art, thereby achieving the effect of saving valuable bandwidth resources and CPU resources.
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
一种邻居震荡的抑制方法及装置,其中,该方法包括:第一路由器获取与第一路由器已建立邻居关系的第二路由器之间的邻居状态变化动态;第一路由器在每一次邻居状态变化动态为由正常状态变化为故障状态时,对邻居惩罚值增加一个值;第一路由器在增加后的邻居惩罚值大于预设抑制阈值时,设置邻居状态为抑制状态。
Description
本申请涉及但不限于通信技术领域。
路由协议主要分为两种,一种是距离矢量路由算法,一种是链路状态路由算法。距离矢量路由算法包括:路由信息协议(Routing Information Protocol,简称为:RIP)、边界网关协议(Border Gateway Protocol,简称为:BGP),链路状态路由算法包括:开放式最短路径优先(Open Shortest Path First,简称为:OSPF)、中间系统-中间系统(Intermediate System-to-Intermediate System,简称为:ISIS)。
路由协议(RIP协议除外)都是通过保活(HELLO)报文机制来建立邻居关系,该HELLO报文可以携带本地的相关属性信息,双方通过发送HELLO报文来发现对方,接收到对端发来的HELLO报文,对HELLO报文进行有效性检查,各个参数如果匹配的情况下可以记录下HELLO报文发送者这个邻居关系;在实际应用中,邻居双方可以通过协商约定一定时间间隔内如果没有接收到邻居对方发来的HELLO报文时,认为邻居已经不存在,需要将邻居关系删除,那么邻居通告过来的路由信息也会相应地删除。
本地路由器通过路由协议和其他路由器交换路由信息,向其他路由器发送网络可达信息,也从其他路由器那里接收网络可达信息,路由信息交换完成路由信息后,基于相关技术中的所有可达信息来决策出到达具体网络的最优路径,在此期间还要响应网络中拓扑的变化,并且需要及时将变化信息通告给其他路由器,使得其他路由器进行相应路由的更新。
当由于某种原因导致邻居状态出现震荡时,就要不断地删除邻居通告的路由信息和安装邻居通告的路由信息到路由表中,相应地,导致本地出现路由震荡,震荡的路由也会进一步触发本地路由器重复向其他路由器删除和再通告的路由过程,极大地浪费了宝贵的带宽资源和中央处理器(Central
Processing Unit,简称为:CPU)资源。
图1为相关技术中一种邻居震荡的示意图,如图1所示,路由器2和路由器1通过OSPF建立邻居关系,路由器2通告路由信息给路由器1,邻居状态到达(UP)。由于路由器1与路由器2之间链路介质传输不稳定的原因,导致之间报文传输有问题,从而引起路由器1没有在规定时间内收到路由器2发来的HELLO报文,随之会将路由器2这个邻居删除,相应地也删除路由器2通告的路由信息,紧接着又收到路由器2发来的HELLO报文,邻居关系建立好之后将路由器2通告的路由信息添加到路由表中,邻居关系如此反复震荡,导致路由器1会不断地添加和删除路由器2通告的路由信息,即路由震荡。
发明内容
以下是对本文详细描述的主题的概述。本概述并非是为了限制权利要求的保护范围。
相关技术中,由于不稳定的邻居状态而造成的本地路由表出现的路由震荡的问题,相关技术中尚未提出有效的解决方案。
本文提供了一种邻居震荡的抑制方法及装置,以解决相关技术中由于不稳定的邻居状态,而造成的本地路由表出现的路由震荡的问题。
一种邻居震荡的抑制方法,包括:
第一路由器获取与所述第一路由器已建立邻居关系的第二路由器之间的邻居状态变化动态;
所述第一路由器在每一次所述邻居状态变化动态为由正常状态变化为故障状态时,对邻居惩罚值增加一个值;
所述第一路由器在增加后的邻居惩罚值大于预设抑制阈值时,设置所述邻居状态为抑制状态。
可选地,在所述邻居状态变化动态为第一次邻居状态变化动态时,且在所述第一路由器获取与所述第一路由器已建立邻居关系的第二路由器之间的邻居状态变化动态之后,所述方法还包括:
所述第一路由器开启第一定时器,其中,所述第一定时器用于指示在到
达第一预设定时时间时,所述第一路由器对所述邻居惩罚值进行减半操作。
可选地,所述方法还包括:
在所述邻居状态为抑制状态之前,并且在所述第一定时器到达第一预设定时时间时,所述第一路由器对所述邻居惩罚值进行减半操作;或,在所述邻居状态为抑制状态之后,并且在所述第一定时器到达所述第一预设定时时间时,所述第一路由器对所述邻居惩罚值进行减半操作;
所述第一路由器判断减半后的邻居惩罚值是否大于所述预设抑制阈值;
所述第一路由器在判断结果为所述减半后的邻居惩罚值大于所述预设抑制阈值时,保持所述邻居状态为所述抑制状态;
所述第一路由器在判断结果为所述减半后的邻居惩罚值小于或等于所述预设抑制阈值时,设置所述邻居状态退出所述抑制状态。
可选地,在所述第一路由器设置所述邻居状态为抑制状态之后,所述方法还包括:
所述第一路由器开启第二定时器;
所述第一路由器在所述第二定时器达到第二预设定时时间时,设置所述邻居状态退出所述抑制状态,并重新配置所述邻居惩罚值,其中,重新配置后的邻居惩罚值小于所述预设抑制阈值。
可选地,所述第二预设定时时间大于所述第一预设定时时间。
可选地,在所述第一路由器获取与所述第一路由器已建立邻居关系的第二路由器之间的邻居状态变化动态之后,所述方法还包括:
所述第一路由器在接收到所述第二路由器发送的用于建立连接的保活HELLO报文,且所述邻居状态为所述抑制状态时,保持所述邻居状态为所述抑制状态。
一种邻居震荡的抑制装置,应用于第一路由器中,所述邻居震荡的抑制装置包括:
获取模块,设置为:获取与所述第一路由器已建立邻居关系的第二路由器之间的邻居状态变化动态;
增加模块,设置为:在每一次所述获取模块获取的所述邻居状态变化动态为由正常状态变化为故障状态时,对邻居惩罚值增加一个值;
设置模块,设置为:在所述增加模块增加后的邻居惩罚值大于预设抑制阈值时,设置所述邻居状态为抑制状态。
可选地,所述装置还包括:
开启模块,设置为:在所述邻居状态变化动态为第一次邻居状态变化动态时,且在所述获取模块获取与所述第一路由器已建立邻居关系的第二路由器之间的邻居状态变化动态之后,开启第一定时器,其中,所述第一定时器用于指示在到达第一预设定时时间时,所述第一路由器对所述邻居惩罚值进行减半操作。
可选地,所述装置还包括:
处理模块,设置为:在所述邻居状态为抑制状态之前,并且在所述开启模块开启的所述第一定时器到达第一预设定时时间时,对所述邻居惩罚值进行减半操作;或,在所述邻居状态为抑制状态之后,并且在所述开启模块开启的所述第一定时器到达所述第一预设定时时间时,对所述邻居惩罚值进行减半操作;
判断模块,设置为:判断所述处理模块进行减半后的邻居惩罚值是否大于所述预设抑制阈值;
所述状态设置模块,还设置为:在所述判断模块的判断结果为所述减半后的邻居惩罚值大于所述预设抑制阈值时,保持所述邻居状态为所述抑制状态;
所述状态设置模块,还设置为:在判断结果为所述减半后的邻居惩罚值小于或等于所述预设抑制阈值时,设置所述邻居状态退出所述抑制状态。
可选地,所述开启模块,还设置为:在所述状态设置模块设置所述邻居状态为抑制状态之后,开启第二定时器;
所述状态设置模块,还设置为:在所述开启模块开启的所述第二定时器达到第二预设定时时间时,设置所述邻居状态退出所述抑制状态,并重新配置所述邻居惩罚值,其中,重新配置后的邻居惩罚值小于所述预设抑制阈值。
可选地,所述第二预设定时时间大于所述第一预设定时时间。
可选地,所述状态设置模块,还设置为:在所述获取模块获取与所述第一路由器已建立邻居关系的第二路由器之间的邻居状态变化动态之后,在接收到所述第二路由器发送的用于建立连接的保活HELLO报文,且所述邻居状态为所述抑制状态时,保持所述邻居状态为所述抑制状态。
在本发明实施例提供的邻居震荡的抑制方法及装置中,第一路由器获取与第一路由器已建立邻居关系的第二路由器之间的邻居状态变化动态,而第一路由器在每一次邻居状态变化动态为由正常状态变化为故障状态时,对邻居惩罚值增加一个值,并且第一路由器设置在增加后的邻居惩罚值大于预设抑制阈值时,邻居状态为抑制状态;本发明实施例采用了惩罚值的方式来抑制路由的邻居震荡,解决了相关技术中由于不稳定的邻居状态而造成的本地路由表出现的路由震荡的问题,进而达到了节省宝贵的带宽资源和CPU资源的效果。
在阅读并理解了附图和详细描述后,可以明白其他方面。
附图概述
图1为相关技术中一种邻居震荡的示意图;
图2为本发明实施例提供的一种邻居震荡的抑制方法的流程图;
图3为本发明实施例提供的另一种邻居震荡的抑制方法的流程图;
图4为本发明实施例提供的又一种邻居震荡的抑制方法的流程图;
图5为本发明实施例提供的一种邻居震荡的抑制装置的结构示意图;
图6为本发明实施例提供的另一种邻居震荡的抑制装置的结构示意图;
图7为本发明实施例提供的邻居震荡的抑制方法中一种邻居状态变化后的处理方法的流程图;
图8为本发明实施例提供的邻居震荡的抑制方法中一种接收到处于故障状态的邻居新发来的用于建立的HELLO报文后的处理方法的流程图;
图9为本发明实施例提供的邻居震荡的抑制方法中一种半衰期定时器超
时后的处理方法的流程图。
下文中将结合附图对本发明的实施方式进行详细说明。需要说明的是,在不冲突的情况下,本文中的实施例及实施例中的特征可以相互任意组合。
在附图的流程图示出的步骤可以在诸如一组计算机可执行指令的计算机系统中执行。并且,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。
需要说明的是,本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。
本发明实施例提供了一种邻居震荡的抑制方法,图2为本发明实施例提供的一种邻居震荡的抑制方法的流程图,如图2所示,本实施例提供的方法包括如下步骤,即步骤110~步骤130:
步骤110:第一路由器获取与第一路由器已建立邻居关系的第二路由器之间的邻居状态变化动态。
步骤120:第一路由器在每一次邻居状态变化动态为由正常状态变化为故障状态时,对邻居惩罚值增加一个值。
步骤130:第一路由器在增加后的邻居惩罚值大于预设抑制阈值时,第一路由器设置邻居状态为抑制状态。
通过本实施例的上述步骤110到步骤130,第一路由器获取与第一路由器已建立邻居关系的第二路由器之间的邻居状态变化动态,而第一路由器在每一次邻居状态变化动态为由正常状态变化为故障状态时,对邻居惩罚值增加一个值,并且第一路由器在增加后的邻居惩罚值大于预设抑制阈值时,设置邻居状态为抑制状态;也就是说,在本实施例中采用了邻居惩罚值的方式来抑制路由的邻居震荡,解决了相关技术中由于不稳定的邻居状态而造成的本地路由表出现的路由震荡的问题,进而达到了节省宝贵的带宽资源和CPU资源的效果。
可选地,图3为本发明实施例提供的另一种邻居震荡的抑制方法的流程图。如图3所示,在上述图2所示实施例的基础上,在邻居状态变化动态为第一次邻居状态变化动态时,在第一路由器获取与第一路由器已建立邻居关系的第二路由器之间的邻居状态变化动态之后,即在步骤110之后,本实施例的方法还可以包括:步骤111,第一路由器开启第一定时器,其中,该第一定时器用于指示在到达预设定时时间时,第一路由器对邻居惩罚值进行减半操作。
可选地,在本发明的一个实施例中,基于图3所示实施例中的第一定时器,本实施例的方法还可以包括步骤140~步骤152:
步骤140:在邻居状态为制状态之前,并且在第一定时器到达第一预设定时时间时,该第一路由器对邻居惩罚值进行减半操作;或,在邻居状态为抑制状态之后,并且在第一定时器到达第一预设定时时间时,该第一路由器对邻居惩罚值进行减半操作。
步骤150:第一路由器判断减半后的邻居惩罚值是否大于预设抑制阈值;在判断结果为减半后的邻居惩罚值大于预设抑制阈值时,执行步骤151;在判断结果为减半后的邻居惩罚值小于或等于预设抑制阈值时,执行步骤152。
步骤151,第一路由器保持邻居状态为抑制状态;
步骤152,第一路由器设置邻居状态退出抑制状态。
基于上述实施例中的第一定时器,以及步骤140和步骤152,可以缓解本实施例中的抑制状态,使得邻居状态不得一直保持抑制状态,即第一定时器达到时需要对本实施例中的惩罚值进行减半,在经过一次或多次减半操作之后,使得原来超过预定阈值的惩罚值可以小于预定阈值,进而解禁抑制状态。
可选地,图4为本发明实施例提供的又一种邻居震荡的抑制方法的流程图。如图4所示,在上述图2所示实施例的基础上,在第一路由器设置邻居状态为抑制状态之后,即步骤130之后,本实施例的方法还可以包括步骤160~步骤170:
步骤160:第一路由器开启第二定时器;
步骤170:第一路由器在第二定时器达到第二预设定时时间时,设置邻居状态退出抑制状态,并重新配置邻居惩罚值,其中,重新配置后的邻居惩罚
值小于预设抑制阈值。
在图4所示实施例中第二定时器的基础上,可以不使邻居状态无期限地被抑制,也就是说,在经过一段时间后该邻居惩罚值还是大于预定阈值时,则需要重新配置该惩罚值。
可选地,在本发明的一个实施例中,第二预设定时时间大于第一预设定时时间。
可选地,在本实施例中的另一个可选实施方式中,在第一路由器获取与第一路由器已建立邻居关系的第二路由器之间的邻居状态变化动态之后,本实施例的方法还包括:第一路由器在接收到第二路由器发送的用于建立连接的HELLO报文,且邻居状态为抑制状态时,保持该邻居状态为抑制状态。在实际应用中,在接收到第二路由器发送的用于建立连接的HELLO报文,只要目前邻居状态不为抑制状态时,则第一路由器建立与第二路由器之间的邻居关系;因为有可能是一次变化动态后就可以进入抑制状态,也有可能是多次变化动态后进入抑制状态,在本实施例中该抑制状态可选的与配置的时间参数有关系。
本发明实施例中还提供了一种邻居震荡的抑制装置,该装置用于实现上述实施例及可选的实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。
图5为本发明实施例提供的一种邻居震荡的抑制装置的结构示意图。本实施例提供的邻居震荡的抑制装置可以应用于第一路由器中,如图5所示,该装置包括:获取模块31、增加模块32和状态设置模块33。
其中,获取模块31,设置为:获取与第一路由器已建立邻居关系的第二路由器之间的邻居状态变化动态。
增加模块32,与获取模块31耦合而连接,该增加模块32设置为:在每一次获取模块31获取的邻居状态变化动态为由正常状态变化为故障状态时,对邻居惩罚值增加一个值。
状态设置模块33,与增加模块32耦合连接,该状态设置模块33设置为:在增加后的邻居惩罚值大于预设抑制阈值时,设置邻居状态为抑制状态。
可选地,图6为本发明实施例提供的另一种邻居震荡的抑制装置的结构示意图,如图6所示,在上述图5所示装置的结构基础上,本实施例提供的装置还可以包括:开启模块34,与获取模块31耦合连接,该开启模块34设置为:在邻居状态变化动态为第一次邻居状态变化动态时,且在获取模块31获取与第一路由器已建立邻居关系的第二路由器之间的邻居状态变化动态之后,开启第一定时器,其中,该第一定时器用于指示在到达预设定时时间时,第一路由器对邻居惩罚值进行减半操作。
可选地,本实施例提供的装置还可以包括:处理模块35,与开启模块34耦合连接,该处理模块35设置为:在邻居状态为抑制状态之前,并且在开启模块34开启的第一定时器到达第一预设定时时间时,对邻居惩罚值进行减半操作;或,在邻居状态为抑制状态之后,并且在开启模块34开启的第一定时器到达第一预设定时时间时,对邻居惩罚值进行减半操作;判断模块36,与处理模块35耦合连接,该判断模块36设置为:判断处理模块35进行减半后的邻居惩罚值是否大于预设抑制阈值;相应地,状态设置模块33还与判断模块36耦合连接,该状态设置模块33还设置为:在判断模块36的判断结果为减半后的邻居惩罚值大于预设抑制阈值时,保持邻居状态为抑制状态;该状态设置模块33还设置为:在判断结果为减半后的邻居惩罚值小于或等于预设抑制阈值时,设置该邻居状态退出抑制状态。
可选地,在上述图6所示装置的结构基础上,本实施例中的开启模块34还与状态设置模块33耦合连接,该开启模块34还设置为:在状态设置模块33设置邻居状态为抑制状态之后,开启第二定时器;状态设置模块33,还设置为:在开启模块34开启的第二定时器达到第二预设定时时间时,设置邻居状态退出抑制状态,并重新配置邻居惩罚值,其中,重新配置后的邻居惩罚值小于预设抑制阈值。
可选地,本发明的一个实施例中,第二预设定时时间大于第一预设定时时间。
可选地,在上述图6所示装置的结构基础上,本实施例中的状态设置模块
33还与获取模块31耦合连接,状态设置模块33还设置为:在获取模块31获取与第一路由器已建立邻居关系的第二路由器之间的邻居状态变化动态之后,在接收到处于故障状态所述邻居新发来的建立连接的HELLO报文,且邻居状态为抑制状态时,保持邻居状态为抑制状态。
在实际应用中,上述各个模块是可以通过软件或硬件来实现的,对于后者,可以通过以下方式实现,但不限于此:上述模块均位于同一处理器中;或者,上述模块分别位于多个处理器中。
下面结合本发明实施例和可选实施方式对本发明进行举例说明。
本实施例提供了一种邻居震荡抑制的方法,该方法采用在邻居路由器由Up变为Down时,为邻居赋予邻居惩罚值,邻居震荡的次数越多,邻居惩罚值也就越大,当邻居惩罚值大于预设抑制阀值时,邻居状态进入抑制状态,不再与该路由器建立邻居关系,每经过设置的半衰期间隔,邻居的邻居惩罚值减半,当邻居惩罚值小于设置的再次使用值时,可以再次与该路由器建立邻居关系。本实施例通过抑制不稳定的邻居状态,避免了随之带来的本地路由表可能出现的路由震荡问题,同时也节省了宝贵的带宽资源和CPU资源。
本实施例的邻居震荡抑制的方法包括如下几个流程:
1、路由协议配置邻居震荡抑制命令,设置抑制相关参数值;
2、当邻居状态由Up变为Down时,如果没有该邻居抑制信息记录,则创建邻居的抑制信息,初始化邻居惩罚值,打开半衰期定时器;如果已经存在该邻居抑制信息记录,增加邻居惩罚值,如果邻居惩罚值大于预设抑制阀值时,将邻居状态设置为抑制状态,同时打开最大抑制定时器;
3、当接收到第二路由器发送的用于建立连接的HELLO报文时,如果没有该邻居抑制信息记录或者有该邻居抑制信息记录但该邻居状态还没进入抑制状态,本地路由器可以与该路由器建立邻居关系;如果存在该邻居的抑制信息记录并且该邻居已经进入抑制状态,本地路由器不能与该路由器建立邻居关系;
4、半衰期定时器(对应于上述实施例中的第一定时器)超时处理,邻居惩罚值减半,判断邻居惩罚值是否小于再次使用值,如果邻居惩罚值小于再
次使用值并且邻居状态先前处于抑制状态,则设置邻居状态退出抑制状态,接下来本地路由器可以再次与该邻居路由器建立邻居关系;
5、最大抑制定时器(对应上述实施例中的第二定时器)超时处理,如果此时邻居状态处于抑制状态则设置邻居状态退出抑制状态,接下来本地路由器可以再次与该邻居路由器建立邻居关系,重置邻居惩罚值;
在本实施例中,邻居震荡抑制命令参数主要包括半衰期时间参数、最大抑制时间参数、抑制阀值参数、再次使用值参数。为了使得与震荡后的邻居能够及时恢复邻居关系,每经过半衰期时间间隔,邻居惩罚值减半;为了不使邻居状态可能无期限地被抑制,从邻居状态进入抑制状态开始,经过最大抑制时间间隔后将该邻居状态退出抑制状态,也就是邻居状态被抑制的最长时间间隔为最大抑制时间参数值;邻居反复震荡引起邻居惩罚值不断增大,当邻居惩罚值大于预设抑制阀值时,邻居状态进入抑制状态,本地路由器不能与该邻居路由器建立邻居关系;邻居状态进入抑制状态后每经过半衰期时间间隔,邻居惩罚值减半,当邻居惩罚值小于再次使用值时,设置该邻居状态退出抑制状态,接下来本地路由器可以再次与邻居路由器建立邻居关系。
图7为本发明实施例提供的邻居震荡的抑制方法中一种邻居状态变化后后的处理方法的流程图,如图7所示,本实施例提供的方法的可以包括步骤401~步骤407:
步骤401:邻居状态由Up变化为Down;
步骤402:判断是否有抑制信息记录;在判断结果为没有抑制信息记录时,执行步骤403,在判断结果为有抑制信息记录时,执行步骤404;
步骤403:创建该邻居的抑制信息记录,初始化邻居惩罚值,并打开半衰期定时器,该半衰期定时器的时间间隔为半衰期配置值;
步骤404:邻居惩罚值增加一个值;
步骤405:判断邻居惩罚值是否大于预设抑制阈值;在判断结果为邻居惩罚值大于预设抑制阈值时,执行步骤406,在判断结果为邻居惩罚值小于或等于预设抑制阈值时,执行步骤407;
步骤406:设置邻居状态为抑制状态,并打开最大抑制定时器,该最大抑
制定时器的时间间隔为最大抑制时间配置值;
步骤407:不执行任何操作。
如果邻居状态从Up变为Down,说明邻居已经开始发生震荡,如果是第一次产生的震荡,则需要创建对应邻居的抑制信息记录,初始邻居化惩罚值,打开半衰期定时器,如果不是第一次产生的震荡,将邻居惩罚值增加一个值,可以是固定增长方式,也可以是指数增长方式等等,如果增加后的邻居惩罚值大于预设抑制阀值时,说明该邻居状态接下来需要被抑制,进入抑制状态,为了不使邻居无期限地被抑制,此时需要打开最大抑制定时器,时间间隔为最大抑制时间的配置值;如果增加后的邻居惩罚值小于预设抑制阀值时,不做任何操作。
图8为本发明实施例提供的邻居震荡的抑制方法中一种接收到处于故障状态的邻居新发来的用于建立的HELLO报文后的处理方法的流程图,如图8所示,本实施例提供的方法可以包括步骤501~步骤505:
步骤501,接收处于故障状态的邻居新发来的用于建立连接的HELLO报文;
步骤502,判断是否有抑制信息记录;在判断结果为有抑制信息记录时,执行步骤503,在判断结果为没有抑制信息记录时,执行步骤505;
步骤503,判断邻居状态是否处于抑制状态,在判断结果为邻居状态处于抑制状态时,执行步骤504,在判断结果为邻居状态未处于抑制状态时,执行步骤505;
步骤504,不建立邻居关系;
步骤505,建立邻居关系。
通过本实施例可知,如果接收到处于故障状态的邻居新发来的用于建立连接的HELLO报文,查看是否存在该邻居抑制信息记录,存在的话说明以前发生过震荡,继续判断该邻居状态是否处于抑制状态,若该邻居状态处于抑制状态的话,本地路由器不能与该邻居路由器建立邻居关系,若该邻居状态未处于抑制状态的话,说明本地路由器可以与该邻居路由器建立邻居关系;如果不存在抑制信息记录,说明以前没有发生过震荡或者很长一段时间间隔
内没有发生过震荡以至邻居惩罚值衰减为0,说明本地路由器可以与该邻居路由器建立邻居关系。如果没有邻居抑制机制的话,邻居震荡会导致本地路由器不断重复地添加和删除邻居通告的路由,即出现路由震荡,震荡的路由也会随之触发本地路由器重复着向其他路由器删除和再通告路由过程,极大地浪费了宝贵的带宽资源和CPU资源。
图9为本发明实施例提供的邻居震荡的抑制方法中一种半衰期定时器超时后的处理方法的流程图,如图9所示,本实施例提供的方法可以包括步骤601~步骤609:
步骤601,打开半衰期定时器;
步骤602,在半衰期定时器超时后,将邻居惩罚值减半;
步骤603,判断邻居惩罚值是否小于再次使用值,在判断结果为邻居惩罚值等于再次使用值时,执行步骤601,在判断结果为邻居惩罚值小于再次使用值时,执行步骤604;
步骤604,判断邻居状态是否处于抑制状态;在判断结果为邻居状态未处于抑制状态时,执行步骤606,在判断结果为邻居状态处于抑制状态时,执行步骤605;
步骤605,判断邻居惩罚值是否为0;在判断结果为邻居惩罚值为0时,执行步骤608,在判断结果为邻居惩罚值不为0时,执行步骤609;
步骤606,判断邻居惩罚值是否为0;在判断结果为邻居惩罚值为0时,执行步骤607;
步骤607,删除相应抑制信息记录,该抑制信息记录包括最大抑制定时器和半衰期定时器;
步骤608,设置邻居状态退出抑制状态,并且删除相应抑制信息记录,该抑制信息记录包括最大抑制定期和半衰期定时器;
步骤609,设置邻居状态退出抑制状态,并且关闭最大抑制定期器。
本实施例中邻居第一次出现震荡时创建邻居抑制信息记录,初始邻居化惩罚值,打开半衰期定时器,经过半衰期配置值的时间间隔后,即半衰期定时器超时,将邻居惩罚值减半,如果减半后的邻居惩罚值小于再次使用值并
且重分配的路由先前处于抑制状态,那么设置该邻居状态退出抑制状态不再被抑制,接下来本地路由器可以与该邻居路由器建立邻居关系。因为此时邻居状态已经不再处于抑制状态,所以需要关闭最大抑制定时器,该最大抑制定时器就是为了保证一定时间内无论邻居如何震荡导致邻居惩罚值过大,都要设置邻居状态退出抑制状态,而此时邻居状态已经不处于抑制状态,所以需要关闭最大抑制定时器。
当邻居惩罚值衰减到0时,说明邻居很长时间没再发生过震荡,将邻居对应的抑制信息记录删除,该抑制信息记录可以包括关闭半衰期定时器和最大抑制定时器等。
此外,对于本实施例中还涉及到的最大抑制定时器,在邻居反复震荡使得惩罚值不断增大,当邻居惩罚值大于预设抑制阀值时,邻居状态接下来需要被抑制,进入抑制状态,为了不使邻居状态无期限地被抑制,此时需要打开最大抑制定时器,经过最大抑制配置值时间间隔后,即最大抑制定时器超时,设置该邻居状态退出抑制状态,重置该邻居惩罚值,重新配置的邻居惩罚值需要小于等于再次使用配置值;此时本地路由器可以与该邻居建立邻居关系。
本发明的实施例还提供了一种存储介质。可选地,在本实施例中,上述存储介质可以被设置为存储用于执行以下步骤的程序代码:
步骤1:第一路由器获取与第一路由器已建立邻居关系的第二路由器之间的邻居状态变化动态;
步骤2:第一路由器在每一次邻居状态变化动态为由正常状态变化为故障状态时,对邻居惩罚值增加一个值;
步骤3:第一路由器在增加后的邻居惩罚值大于预设抑制阈值时,设置邻居状态为抑制状态。
可选地,本实施例中的示例可以参考上述实施例及可选实施方式中所描述的示例,本实施例在此不再赘述。
本领域普通技术人员可以理解上述实施例的全部或部分步骤可以使用计算机程序流程来实现,所述计算机程序可以存储于一计算机可读存储介质中,
所述计算机程序在相应的硬件平台上(如系统、设备、装置、器件等)执行,在执行时,包括方法实施例的步骤之一或其组合。
可选地,上述实施例的全部或部分步骤也可以使用集成电路来实现,这些步骤可以被分别制作成一个个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。
上述实施例中的装置/功能模块/功能单元可以采用通用的计算装置来实现,它们可以集中在单个的计算装置上,也可以分布在多个计算装置所组成的网络上。
上述实施例中的装置/功能模块/功能单元以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。上述提到的计算机可读取存储介质可以是只读存储器,磁盘或光盘等。
本发明实施例通过第一路由器获取与第一路由器已建立邻居关系的第二路由器之间的邻居状态变化动态,而第一路由器在每一次邻居状态变化动态为由正常状态变化为故障状态时,对邻居惩罚值增加一个值,并且第一路由器在增加后的邻居惩罚值大于预设抑制阈值时,设置邻居状态为抑制状态;本发明实施例中采用了邻居惩罚值的方式来抑制路由的邻居震荡,解决了相关技术中由于不稳定的邻居状态而造成的本地路由表出现的路由震荡的问题,进而达到了节省宝贵的带宽资源和CPU资源的效果。
Claims (12)
- 一种邻居震荡的抑制方法,包括:第一路由器获取与所述第一路由器已建立邻居关系的第二路由器之间的邻居状态变化动态;所述第一路由器在每一次所述邻居状态变化动态为由正常状态变化为故障状态时,对邻居惩罚值增加一个值;所述第一路由器在增加后的邻居惩罚值大于预设抑制阈值时,设置所述邻居状态为抑制状态。
- 根据权利要求1所述的方法,其中,在所述邻居状态变化动态为第一次邻居状态变化动态时,且在所述第一路由器获取与所述第一路由器已建立邻居关系的第二路由器之间的邻居状态变化动态之后,所述方法还包括:所述第一路由器开启第一定时器,其中,所述第一定时器用于指示在到达第一预设定时时间时,所述第一路由器对所述邻居惩罚值进行减半操作。
- 根据权利要求2所述的方法,所述方法还包括:在所述邻居状态为抑制状态之前,并且在所述第一定时器到达第一预设定时时间时,所述第一路由器对所述邻居惩罚值进行减半操作;或,在所述邻居状态为抑制状态之后,并且在所述第一定时器到达所述第一预设定时时间时,所述第一路由器对所述邻居惩罚值进行减半操作;所述第一路由器判断减半后的邻居惩罚值是否大于所述预设抑制阈值;所述第一路由器在判断结果为所述减半后的邻居惩罚值大于所述预设抑制阈值时,保持所述邻居状态为所述抑制状态;所述第一路由器在判断结果为所述减半后的邻居惩罚值小于或等于所述预设抑制阈值时,设置所述邻居状态退出所述抑制状态。
- 根据权利要求2所述的方法,其中,在所述第一路由器设置所述邻居状态为抑制状态之后,所述方法还包括:所述第一路由器开启第二定时器;所述第一路由器在所述第二定时器达到第二预设定时时间时,设置所述 邻居状态退出所述抑制状态,并重新配置所述邻居惩罚值,其中,重新配置后的邻居惩罚值小于所述预设抑制阈值。
- 根据权利要求4所述的方法,其中,所述第二预设定时时间大于所述第一预设定时时间。
- 根据权利要求1所述的方法,其中,在所述第一路由器获取与所述第一路由器已建立邻居关系的第二路由器之间的邻居状态变化动态之后,所述方法还包括:所述第一路由器在接收到所述第二路由器发送的用于建立连接的保活HELLO报文,且所述邻居状态为所述抑制状态时,保持所述邻居状态为所述抑制状态。
- 一种邻居震荡的抑制装置,应用于第一路由器中,所述邻居震荡的抑制装置包括:获取模块,设置为:获取与所述第一路由器已建立邻居关系的第二路由器之间的邻居状态变化动态;增加模块,设置为:在每一次所述获取模块获取的所述邻居状态变化动态为由正常状态变化为故障状态时,对邻居惩罚值增加一个值;状态设置模块,设置为:在所述增加模块增加后的邻居惩罚值大于预设抑制阈值时,设置所述邻居状态为抑制状态。
- 根据权利要求7所述的装置,还包括:开启模块,设置为:在所述邻居状态变化动态为第一次邻居状态变化动态时,且在所述获取模块获取与所述第一路由器已建立邻居关系的第二路由器之间的邻居状态变化动态之后,开启第一定时器,其中,所述第一定时器用于指示在到达第一预设定时时间时,所述第一路由器对所述邻居惩罚值进行减半操作。
- 根据权利要求8所述的装置,还包括:处理模块,设置为:在所述邻居状态为抑制状态之前,并且在所述开启模块开启的所述第一定时器到达第一预设定时时间时,对所述邻居惩罚值进行减半操作;或,在所述邻居状态为抑制状态之后,并且在所述开启模块开 启的所述第一定时器到达所述第一预设定时时间时,对所述邻居惩罚值进行减半操作;判断模块,设置为:判断所述处理模块进行减半后的邻居惩罚值是否大于所述预设抑制阈值;所述状态设置模块,还设置为:在所述判断模块的判断结果为所述减半后的邻居惩罚值大于所述预设抑制阈值时,保持所述邻居状态为所述抑制状态;所述状态设置模块,还设置为:在判断结果为所述减半后的邻居惩罚值小于或等于所述预设抑制阈值时,设置所述邻居状态退出所述抑制状态。
- 根据权利要求8所述的装置,其中,所述开启模块,还设置为:在所述状态设置模块设置所述邻居状态为抑制状态之后,开启第二定时器;所述状态设置模块,还设置为:在所述开启模块开启的所述第二定时器达到第二预设定时时间时,设置所述邻居状态退出所述抑制状态,并重新配置所述邻居惩罚值,其中,重新配置后的邻居惩罚值小于所述预设抑制阈值。
- 根据权利要求10所述的装置,其中,所述第二预设定时时间大于所述第一预设定时时间。
- 根据权利要求7所述的装置,其中,所述状态设置模块,还设置为:在所述获取模块获取与所述第一路由器已建立邻居关系的第二路由器之间的邻居状态变化动态之后,在接收到所述第二路由器发送的用于建立连接的保活HELLO报文,且所述邻居状态为所述抑制状态时,保持所述邻居状态为所述抑制状态。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510659440.2A CN106572008A (zh) | 2015-10-13 | 2015-10-13 | 邻居震荡的抑制方法及装置 |
CN201510659440.2 | 2015-10-13 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2017063365A1 true WO2017063365A1 (zh) | 2017-04-20 |
Family
ID=58508642
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2016/083365 WO2017063365A1 (zh) | 2015-10-13 | 2016-05-25 | 邻居震荡的抑制方法及装置 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN106572008A (zh) |
WO (1) | WO2017063365A1 (zh) |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109309616B (zh) * | 2017-07-27 | 2022-03-01 | 中兴通讯股份有限公司 | 基于isis协议的通告方法及装置 |
CN109729020B (zh) * | 2017-10-27 | 2022-05-20 | 中兴通讯股份有限公司 | 会话传输的方法、装置、存储介质及处理器 |
CN113726542B (zh) * | 2020-05-26 | 2023-04-07 | 中国电信股份有限公司 | 路由震荡抑制方法以及相关设备 |
CN112422442B (zh) * | 2020-10-21 | 2022-07-05 | 鹏城实验室 | 处理双向转发检测协议的会话中断消息的方法及存储介质 |
CN112965831B (zh) * | 2021-02-18 | 2023-06-13 | 新华三信息安全技术有限公司 | 抑制数据反复平滑的方法及装置 |
CN114553765B (zh) * | 2022-01-29 | 2023-06-23 | 苏州浪潮智能科技有限公司 | 一种ospf邻居震荡处理的方法、装置及介质 |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101394302A (zh) * | 2007-09-19 | 2009-03-25 | 华为技术有限公司 | 控制路由震荡的方法和设备 |
CN101471811A (zh) * | 2007-12-28 | 2009-07-01 | 华为技术有限公司 | 路由震荡的抑制方法及设备 |
-
2015
- 2015-10-13 CN CN201510659440.2A patent/CN106572008A/zh active Pending
-
2016
- 2016-05-25 WO PCT/CN2016/083365 patent/WO2017063365A1/zh active Application Filing
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101394302A (zh) * | 2007-09-19 | 2009-03-25 | 华为技术有限公司 | 控制路由震荡的方法和设备 |
CN101471811A (zh) * | 2007-12-28 | 2009-07-01 | 华为技术有限公司 | 路由震荡的抑制方法及设备 |
Also Published As
Publication number | Publication date |
---|---|
CN106572008A (zh) | 2017-04-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2017063365A1 (zh) | 邻居震荡的抑制方法及装置 | |
CN106375231B (zh) | 一种流量切换方法、设备及系统 | |
US8447849B2 (en) | Negotiated parent joining in directed acyclic graphs (DAGS) | |
US9232458B2 (en) | Proactive timer-based local repair path communication in reactive routing networks | |
JP6027629B2 (ja) | 最小限接続オブジェクト・ネットワークのための支援型インテリジェント・ルーティング | |
US8472348B2 (en) | Rapid network formation for low-power and lossy networks | |
JP3944511B2 (ja) | ルータ及びルータのタイマー設定方法 | |
US20120039186A1 (en) | Method and apparatus to reduce cumulative effect of dynamic metric advertisement in smart grid/sensor networks | |
Krishnan et al. | Performance analysis of OSPF and EIGRP routing protocols for greener internetworking | |
US10404584B2 (en) | Load sharing method and router device | |
CN112039769B (zh) | 一种处理路由的方法及网络设备 | |
US20140010093A1 (en) | Method and Apparatus for the Fast Detection of Connectivity Loss Between Devices in a Network | |
CN111598564B (zh) | 区块链节点连接建立方法、装置及设备 | |
CN105471725B (zh) | 穿越自治系统的路由方法和装置 | |
WO2017036180A1 (zh) | 报文的处理方法及装置 | |
US9081567B1 (en) | Method and apparatus to control routing convergence during node reboot by entering a freeze state that inhibits routing convergence during the reboot process | |
WO2017036163A1 (zh) | 一种报文发送方法及系统 | |
WO2022083422A1 (zh) | 交叉SR/SRv6路径下发方法和装置、存储介质及电子装置 | |
WO2016078240A1 (zh) | 一种检测路由成环的方法及装置 | |
US20200336385A1 (en) | BGP Logical Topology Generation Method, and Device | |
EP3661134B1 (en) | Intermediate system to intermediate system routing protocol based notification method and apparatus | |
WO2017000566A1 (zh) | 一种获取设备接口mru值的方法及装置 | |
JP6113157B2 (ja) | 通信ネットワークにおいてルーターをスイッチオフする方法と、この方法を実施するルーター | |
WO2019128651A1 (zh) | 一种anima网络的信息处理方法、设备及系统 | |
CN102281194A (zh) | 报文的传输方法及网络设备 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 16854751 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 16854751 Country of ref document: EP Kind code of ref document: A1 |