# Patent

## Title
Method and device for bidirectional forwarding detection under condition of parameter update

## Abstract

A method and device for Bidirectional Forwarding Detection under a condition of parameter update, wherein a first router establishes a link with a second router; the first router modifies packet sending parameters and/or packet receiving parameters, and sends to the second router a message with an identifier of the modification of this time; the second router returns to the first router a feedback message with an identifier of the modification of this time after receiving the message with the identifier of the modification of this time sent by the first router; the packet sending parameters and/or packet receiving parameters which are modified this time take effect after the first router receives the feedback message with the identifier sent by the second router.

## Background
TECHNICAL FIELD
The present application relates to a field of communication, and especially, to a method and device for Bidirectional Forwarding Detection under a condition of parameter update.
BACKGROUND OF THE RELATED ART
Bidirectional Forwarding Detection (BFD), as a common three-layer IP detection protocol, is very extensively applied, and plays a great role in link and device monitoring and fast switching after a link failure. In the detection process, the purpose of fast detection and switching is often achieved by modifying the sending parameters and detection parameters of the packet to adapt to deployment changes of monitoring and switching applications.
However, under the condition of UP status of BFD session in current system, if one end frequently modifies the sending parameters and detection parameters of the packet simultaneously, just at this time, a system at the opposite end is busy and cannot instantly respond to a feedback message, thus, once the end which modifies parameters receives a first feedback message, it will distribute the recently modified message parameters for the Forward Plane to take effect, which may cause inconsistent negotiation of the two ends.
SUMMARY
With above remarks, embodiments of the present document provides a method and device for Bidirectional Forwarding Detection under a condition of parameter update, so as to resolve a problem of inconsistent negotiation of the two ends due to that one end frequently modifies packet sending parameters and packet receiving parameters simultaneously, but a system at the opposite end fails to instantly respond to a feedback message, and the end which modifies parameters will distribute the recently modified message parameters to the Forward Plane to take effect once receiving a first feedback message of the opposite end.
A method for Bidirectional Forwarding Detection under a condition of parameter update provided by the embodiment of the present document, comprises:
a first router establishing a link with a second router;
the first router modifying packet sending parameters and/or packet receiving parameters, and sending to the second router a message with an identifier of the modification of this time;
the second router returning to the first router a feedback message with an identifier of the modification of this time after receiving the message with the identifier of the modification of this time sent by the first router;
the packet sending parameters and/or packet receiving parameters which are modified this time taking effect after the first router receiving the feedback message with the identifier sent by the second router.
Preferably, when the first router remodifies the packet sending parameters and/or packet receiving parameters, it is determined whether a feedback message with an identifier that is corresponding to a last modification is received, if yes, a message with an identifier of a remodification is sent to the second router, if not, it is to wait for the feedback message with the identifier of the last modification.
Preferably, the identifier is a serial number.
Preferably, the serial number is configured in the message or a field of an extended authentication section of the message.
Preferably, every time the first router modifies the packet sending parameters and/or packet receiving parameters, the first router increases the corresponding serial number by one.
An embodiment of the present document further provides a device for Bidirectional Forwarding Detection under a condition of parameter update, comprising a first router and a second router which establish a link;
the first router is configured to: modify packet sending parameters and/or packet receiving parameters; and send to the second router a message with an identifier of the modification of this time; wherein packet sending parameters and/or packet receiving parameters which are modified this time take effect after the first router receives the feedback message with the identifier of the modification of this time sent by the second router;
the second router is configured to: return to the first router the feedback message with the identifier of the modification of this time after receiving the message with the identifier of the modification of this time sent by the first router.
Preferably, the first router is further configured to: determine whether a feedback message with an identifier of a last modification is received when remodifying the packet sending parameters and/or packet receiving parameters, if yes, send to the second router a message with an identifier of a remodification, if not, wait for the feedback message with the identifier of the last modification.
Preferably, the identifier is a serial number.
Preferably, the serial number is set in the message or a field of an extended authentication section of the message.
Preferably, the first router is further configured to: increase the corresponding serial number by one every time the first router modifies the packet sending parameters and/or packet receiving parameters.
Embodiments of the present document provide a method and device for Bidirectional Forwarding Detection under a condition of parameter update, when the router at one end which establishes a link modifies packet sending parameters and/or packet receiving parameters, it sends a message with an identifier of the modification of this time to its linked router; the router at the end which modifies packet sending parameters and/or packet receiving parameters cannot make the modified packet sending parameters and/or packet receiving parameters of this time take effect, until receiving a feedback message with an identifier of the modification of this time which are sent by its connected router. Through this method, a problem of inconsistent negotiation of the two ends in the related art due to that a router at one end frequently modifies packet sending parameters and packet receiving parameters simultaneously, but a system at the opposite end fails to instantly respond to a feedback message, and the end which modifies parameters will distribute the recently modified message parameters to the Forward Plane to take effect once receiving a first feedback message of the opposite end, can be effectively resolved.



BRIEF DESCRIPTION OF DRAWINGS
FIG. 1 is a flow diagram of a method for Bidirectional Forwarding Detection under a condition of parameter update in the embodiment 1 of the present document;
FIG. 2 is a schematic diagram of a device for Bidirectional Forwarding Detection under a condition of parameter update in the embodiment 2 of the present document



PREFERRED EMBODIMENTS OF THE INVENTION
Embodiments of the present document are specific described below in combination with figures. It should be noted that, without conflicts, the embodiments in the present application and features in the embodiments may be randomly combined with each other.
In the Bidirectional Forwarding Detection (BFD), in order to reduce the impact of equipment failures on the traffics and improve usability, a device needs to detect communication failures between it and its adjacent device as soon as possible, so as to be able to take timely measures to ensure the traffics to proceed.
Embodiment 1
The embodiment of the present document provides a method for Bidirectional Forwarding Detection under a condition of parameter update, as seen from FIG. 1, the method comprises:
In S101, a first router establishes a link with a second router.
In S102, the first router modifies packet sending parameters and/or packet receiving parameters, and sends to the second router a message with an identifier of the modification of this time;
wherein, the identifier may be a serial number; and the serial number is set in the message or in a field of an extended authentication section of the message; every time the first router modifies the packet sending parameters and/or packet receiving parameters, the first router increases the corresponding serial number by one. If this modification is the first modification, the identifier is one.
In S103, the second router returns to the first router a feedback message with an identifier of the modification of this time after receiving the message with the identifier of the modification of this time sent by the first router.
In S104, the packet sending parameters and/or packet receiving parameters which are modified this time take effect after the first router receives the feedback message with the identifier sent by the second router.
In S105, the first router remodifies the packet sending parameters and/or packet receiving parameters, provided that this modification is the second modification, the first router determines whether a feedback message with an identifier of the last modification, i.e. the first modification, is received, if yes, it is to jump to S106; if not, it is to jump to S107.
In S106, the corresponding serial number is increased by one, and a message with an identifier (that is 2) of the modification of this time is sent to the second router.
In S107, it is to wait for the feedback message with the identifier of the last modification, i.e. the first modification.
The process of modifying packet sending parameters and/or packet receiving parameters by the second router is the same as the process of modifying packet sending parameters and/or packet receiving parameters by the first router in the embodiment of the present document. Every time the packet sending parameters and/or packet receiving parameters have been modified, the corresponding serial number is increased by one.
Embodiments of the present document provide a method for Bidirectional Forwarding Detection under a condition of parameter update, when a router at one end which establishes a link modifies packet sending parameters and/or packet receiving parameters, it sends a message with an identifier of the modification of this time to its linked router; a router at the end which modifies packet sending parameters and/or packet receiving parameters cannot make the modified packet sending parameters and/or packet receiving parameters of this time take effect, until receiving a feedback message with an identifier of the modification of this time which are sent by its connected router. Through the method, a problem of inconsistent negotiation of the two ends in the related art due to that a router at one end frequently modifies packet sending parameters and packet receiving parameters simultaneously, but a system at the opposite end fails to instantly respond to a feedback message, and the end which modifies parameters will distribute the recently modified message parameters to the Forward Plane to take effect once receiving a first feedback message of the opposite end, can be effectively resolved.
Embodiment 2
An embodiment of the present document provides a device for Bidirectional Forwarding Detection under a condition of parameter update, as seen in FIG. 2, the device comprises:
a first router 21 and a second router 22 which establish a link;
the first router 21 is configured to: modify packet sending parameters and/or packet receiving parameters; and send to the second router a message with an identifier of the modification of this time, wherein packet sending parameters and/or packet receiving parameters which are modified this time take effect after the first router receives a feedback message with the identifier of the modification of this time sent by the second router; determine whether a feedback message with an identifier of the last modification is received when remodifying the packet sending parameters and/or packet receiving parameters; if yes, send to the second router a message with an identifier of the modification of this time, if not, wait for the feedback message with the identifier of the last modification, wherein every time the packet sending parameters and/or packet receiving parameters have been modified, the corresponding serial number is increased by one.
The identifier may be a serial number; and the serial number is set in the message or a field of an extended authentication section of the message.
The second router 22 is configured to: return to the first router a feedback message with an identifier of the modification of this time after receiving the message with the identifier of the modification of this time sent by the first route.
An ordinary person skilled in the field should understand that the whole or part of steps of the above-mentioned method may be implemented by a program instructing relevant hardware; the program may be stored in a computer readable storage medium such as a read-only memory, a disk or a compact disk. Alternatively, the whole or part of steps of the above-mentioned embodiments may also be implemented by using one or more integrated circuits. Correspondingly, each module/unit in the above-mentioned embodiments may be implemented in a form of hardware, or may be implemented in a form of software function module. The present document is not limited to any specific form of the combination of hardware and software.
The above descriptions only shows preferred embodiments of the present document, while the protection scope of the present document is not limited to this, there may be various changes or replacements which can be easily conceived by any skilled in the field within the technique scope disclosed by the present document, and all these various changes or replacements should be included in the protection scope of the present document. Thus, the protection scope of the present document should be based on the protection scope in claims.
INDUSTRIAL APPLICABILITY
Through embodiments of the present document, a problem of inconsistent negotiation of the two ends in the related art due to that a router at one end frequently modifies packet sending parameters and packet receiving parameters simultaneously, but a system at the opposite end fails to instantly respond to a feedback message, and the end which modifies parameters will distribute the recently modified message parameters to the Forward Plane to take effect once receiving a first feedback message of the opposite end, can be effectively resolved.

## Claims

1. A method for Bidirectional Forwarding Detection under a condition of parameter update, comprising:
a first router establishing a link with a second router;
the first router making a first modification to packet sending parameters and/or packet receiving parameters, and sending to the second router a first message with an identifier of the first modification;
the second router returning to the first router a feedback message with an identifier of the first modification after receiving the first message with the identifier of the first modification sent by the first router;
the packet sending parameters and/or packet receiving parameters which are modified in the first modification taking effect after the first router receives the feedback message with the identifier of the first modification sent by the second router;
when the first router makes a second modification to the packet sending parameters and/or packet receiving parameters, the first router sending to the second router a second message with an identifier of the second modification, the identifier of the second modification being different from the identifier of the first modification;
wherein the identifiers of the first and second modification are serial numbers, and every time the first router modifies the packet sending parameters and/or packet receiving parameters, the first router increases the serial number by one, the first router does not make the modified packet sending parameters and/or packet receiving parameters take effect unless the feedback message with the serial number corresponding to the first modification is received by the first router.

2. The method according to claim 1, further comprising: after the first router makes the second modification to the packet sending parameters and/or packet receiving parameters, determining whether the feedback message with the identifier of the first modification is received, if yes, sending to the second router the second message with the identifier of the second modification, if not, waiting for the feedback message with the identifier of the first modification.

3. The method according to claim 1, wherein the serial number is set in the first and second messages or in a field of an extended authentication section of the first and second messages.

4. A device for Bidirectional Forwarding Detection under a condition of parameter update, comprising a first router and a second router which establish a link, wherein
the first router is configured to: make a first modification to packet sending parameters and/or packet receiving parameters; and send to the second router a first message with an identifier of the first modification; wherein the packet sending parameters and/or packet receiving parameters which are modified in the first modification take effect after the first router receives a feedback message with the identifier of the first modification sent by the second router;
the second router is configured to: return to the first router the feedback message with the identifier of the first modification after receiving the message with the identifier of the first modification sent by the first router;
wherein the first router is further configured to: make a second modification to the packet sending parameters and/or packet receiving parameters, and send to the second router a second message with an identifier of the second modification, the identifier of the second modification being different from the identifier of the first modification;
wherein the identifiers of the first and second modification are serial numbers, and the first router is configured to increase the serial number by one every time the first router modifies the packet sending parameters and/or packet receiving parameters, and the first router is configured to not make the modified packet sending parameters and/or packet receiving parameters take effect unless the feedback message with the serial number corresponding to the first modification is received by the first router.

5. The device according to claim 4, wherein the first router is further configured to:
after making the second modification to the packet sending parameters and/or packet receiving parameters, determine whether the feedback message with the identifier of the first modification is received, if yes, send to the second router the second message with the identifier of the second modification, if not, wait for the feedback message with the identifier of the first modification.

6. The device according to claim 4, wherein the serial number is set in the first and second messages or in a field of an extended authentication section of the first and second messages.