Message processing method and device

文档序号:1941439 发布日期:2021-12-07 浏览:12次 中文

阅读说明:本技术 一种消息处理方法及装置 (Message processing method and device ) 是由 贺旦 于 2021-09-24 设计创作,主要内容包括:本申请提供一种消息处理方法及装置,该方法应用于路由设备中的任一线卡板中的CPU,且包括:接收路由设备中的主控板发送的会话通知消息;若相关出接口信息对应的第一转发芯片所属的线卡板为该线卡板且最近一次更新的发送BFD报文的第二转发芯片不为该线卡板中的转发芯片,将第二转发芯片更新为第一转发芯片,生成转发表项,将其和BFD报文下发给第一转发芯片,将第一转发芯片的BFD报文发送状态更改为预设状态,向更新前的第二转发芯片所属的线卡板中的CPU发送相关通知消息,由相应CPU通知相关转发芯片停止发送BFD报文并删除相关转发表项,将BFD报文发送状态由预设状态更改为初始状态。本申请避免了BFD会话的误震荡。(The application provides a message processing method and a device, the method is applied to a CPU in any cable card board in routing equipment, and comprises the following steps: receiving a session notification message sent by a main control board in the routing equipment; if the line card board to which the first forwarding chip corresponding to the relevant output interface information belongs is the line card board and the second forwarding chip which is updated recently and used for sending the BFD message is not the forwarding chip in the line card board, the second forwarding chip is updated to be the first forwarding chip, a forwarding table entry is generated, the forwarding table entry and the BFD message are issued to the first forwarding chip, the sending state of the BFD message of the first forwarding chip is changed into a preset state, a relevant notification message is sent to a CPU in the line card board to which the second forwarding chip belongs before updating, the relevant forwarding chip is notified by the corresponding CPU to stop sending the BFD message and delete the relevant forwarding table entry, and the sending state of the BFD message is changed from the preset state to an initial state. The method and the device avoid the false oscillation of the BFD session.)

1. A message processing method is applied to a Central Processing Unit (CPU) in any cable card board in a routing device, and comprises the following steps:

receiving a session notification message which is sent by a main control board in the routing equipment and carries session information of a target Bidirectional Forwarding Detection (BFD) session, wherein the session information at least comprises a BFD message and corresponding output interface information;

if the line card board to which the first forwarding chip corresponding to the output interface information belongs is determined to be the line card board, and the second forwarding chip which is updated recently and used for sending the BFD message is not the forwarding chip in the line card board, updating the second forwarding chip used for sending the BFD message to be the first forwarding chip, generating a forwarding table item used for forwarding the BFD message, and sending the forwarding table item and the BFD message to the first forwarding chip so that the first forwarding chip sends the BFD message based on the forwarding table item;

changing the BFD message sending state of the first forwarding chip from an initial state to a preset state, sending a stop message carrying the session identifier of the target BFD session to a CPU in a line card board to which the second forwarding chip before updating belongs, so that after receiving the stop message, the corresponding CPU searches for the second forwarding chip of which the BFD message sending state is the preset state and is not updated for the last time, informs the searched forwarding chip to stop sending the BFD message and delete the stored forwarding table item thereof, and changes the BFD message sending state of the searched forwarding chip from the preset state to the initial state.

2. The method of claim 1, further comprising:

after receiving the session notification message, if it is determined that the line card board to which the first forwarding chip belongs is not the line card board, updating a second forwarding chip sending a BFD message to the first forwarding chip;

if the stop message sent by the CPU in the line card board to which the first forwarding chip belongs is received, searching a forwarding chip, which has the BFD message sending state as the preset state and is not the second forwarding chip updated recently, in the forwarding chips managed by the forwarding chip;

and informing the searched forwarding chip to stop sending the BFD message and deleting the stored forwarding table item of the forwarding chip, and changing the sending state of the BFD message of the searched forwarding chip from the preset state to the initial state.

3. The method of claim 1, further comprising:

after receiving the session notification message, if it is determined that the line card board to which the first forwarding chip belongs is the line card board and the second forwarding chip, which is updated recently and used for sending the BFD message, is another forwarding chip, except the first forwarding chip, in the line card board, updating the second forwarding chip, which is used for sending the BFD message, to the first forwarding chip, generating a forwarding table entry for forwarding the BFD message, and sending the generated forwarding table entry and the BFD message to the first forwarding chip, so that the first forwarding chip sends the BFD message based on the generated forwarding table entry;

changing the BFD message sending state of the first forwarding chip from an initial state to a preset state;

and informing the other forwarding chips to stop sending the BFD message and delete the stored forwarding table entry thereof, and changing the sending state of the BFD message of the found forwarding chip from the preset state to the initial state.

4. The method according to any one of claims 1 to 3, wherein it is determined whether the line card board to which the first forwarding chip corresponding to the outgoing interface information belongs is the line card board by:

searching a first forwarding chip and a line card board corresponding to the output interface information in the corresponding relation between the locally stored output interface information and the forwarding chip and the line card board;

judging whether the searched cable clamping board is the cable clamping board;

if so, determining the wire clamping board to which the first forwarding chip corresponding to the output interface information belongs as the wire clamping board;

and if not, determining that the line card board to which the first forwarding chip corresponding to the output interface information belongs is not the line card board.

5. The method of claim 1, wherein the first forwarding chip is a Network Processor (NP) chip.

6. A message processing apparatus, which is applied to a central processing unit CPU in any line card board in a routing device, the apparatus comprising:

a receiving module, configured to receive a session notification message that is sent by a main control board in the routing device and carries session information of a target Bidirectional Forwarding Detection (BFD) session, where the session information at least includes a BFD packet and corresponding egress interface information thereof;

a first processing module, configured to update a second forwarding chip that sends a BFD message to a first forwarding chip if it is determined that a line card board to which a first forwarding chip corresponding to the output interface information belongs is the line card board and a second forwarding chip that sends the BFD message that is updated most recently is not a forwarding chip in the line card board, generate a forwarding table entry for forwarding the BFD message, and send the forwarding table entry and the BFD message to the first forwarding chip, so that the first forwarding chip sends the BFD message based on the forwarding table entry;

and the second processing module is used for changing the BFD message sending state of the first forwarding chip from the initial state to a preset state, sending a stop message carrying the session identifier of the target BFD session to a CPU in a line card board to which the second forwarding chip before updating belongs, so that after the corresponding CPU receives the stop message, searching the second forwarding chip of which the BFD message sending state is the preset state and is not updated for the last time, informing the searched forwarding chip of stopping sending the BFD message and deleting the stored forwarding table item thereof, and changing the BFD message sending state of the searched forwarding chip from the preset state to the initial state.

7. The apparatus of claim 6, further comprising:

a third processing module, configured to update a second forwarding chip that sends a BFD packet to the first forwarding chip if it is determined that the line card board to which the first forwarding chip belongs is not the line card board after the receiving module receives the session notification message;

if the stop message sent by the CPU in the line card board to which the first forwarding chip belongs is received, searching a second forwarding chip which sends the BFD message and has the BFD message sending state which is the preset state and is not updated for the last time in the forwarding chips managed by the forwarding chip;

and informing the searched forwarding chip to stop sending the BFD message and deleting the stored forwarding table item of the forwarding chip, and changing the sending state of the BFD message of the searched forwarding chip from the preset state to the initial state.

8. The apparatus of claim 6, further comprising:

a fourth processing module, configured to, after the receiving module receives the session notification message, if it is determined that the line card board to which the first forwarding chip belongs is the line card board and the second forwarding chip that is updated recently and transmits the BFD packet is another forwarding chip of the line card board except the first forwarding chip, update the second forwarding chip that transmits the BFD packet to the first forwarding chip, generate a forwarding table entry for forwarding the BFD packet, and send the generated forwarding table entry and the BFD packet to the first forwarding chip, so that the first forwarding chip transmits the BFD packet based on the generated forwarding table entry;

changing the BFD message sending state of the first forwarding chip from an initial state to a preset state;

and informing the other forwarding chips to stop sending the BFD message and delete the stored forwarding table entry thereof, and changing the sending state of the BFD message of the found forwarding chip from the preset state to the initial state.

9. The apparatus of any one of claims 6 to 8, further comprising:

a determining module, configured to determine whether the line card board to which the first forwarding chip belongs corresponding to the outgoing interface information is the line card board by:

searching a first forwarding chip and a line card board corresponding to the output interface information in the corresponding relation between the locally stored output interface information and the forwarding chip and the line card board;

judging whether the searched cable clamping board is the cable clamping board;

if so, determining the wire clamping board to which the first forwarding chip corresponding to the output interface information belongs as the wire clamping board;

and if not, determining that the line card board to which the first forwarding chip corresponding to the output interface information belongs is not the line card board.

10. The apparatus of claim 6, wherein the first forwarding chip is a Network Processor (NP) chip.

Technical Field

The present application relates to the field of communications technologies, and in particular, to a method and an apparatus for processing a message.

Background

Bidirectional Forwarding Detection (BFD) is a general, standardized, media-independent and protocol-independent fast failure Detection mechanism, which is used to detect the connectivity status of a Forwarding path, and can provide millisecond Detection to quickly detect a communication failure, so that a network device (e.g., a routing device) switches to a standby link, thereby ensuring that a service operates continuously.

At present, with the development of high-performance routing devices, the number of boards and the number of links supported are increasing, multiple links and a large number of BFD sessions exist between two routing devices, so that when links are unstable, for example, when a master/slave link switch needs to refresh a route, or when a configuration information is started, or when operations such as configuration rollback and the like are configured, a master control board in a routing device may refresh interface information in session information of related BFD sessions for multiple times, and a session notification message carrying session information of the related BFD sessions needs to be sent to all board in the routing device in a multicast manner every time when the interface information is refreshed. Here, the session information includes at least a BFD packet and outgoing interface information.

For any line card board, once a Central Processing Unit (CPU) in the line card board receives the session notification message, a forwarding chip (e.g., Network Processors (NP chips), etc.) and the line card board corresponding to the outgoing interface information are searched in the locally stored outgoing interface information and the corresponding relationship between the forwarding chip and the line card board; and if the found line card board is the line card board and the latest updated forwarding chip sending the BFD message is not the forwarding chip in the line card board, updating the forwarding chip sending the BFD message to the found forwarding chip, generating a forwarding table item for forwarding the BFD message, sending the forwarding table item and the BFD message to the found forwarding chip, and sending the BFD message by the found forwarding chip base on the basis of the forwarding table item.

And if the found line card board is not the line card board and not the line card board which belongs to the forwarding chip which is updated recently and sends the BFD message, updating the forwarding chip which sends the BFD message into the found forwarding chip.

If the found line card board is the line card board and the latest updated forwarding chip sending the BFD message is other forwarding chips in the line card board except the found forwarding chip, updating the forwarding chip sending the BFD message to the found forwarding chip, generating a forwarding table item for forwarding the BFD message, sending the generated forwarding table item and the BFD message to the found forwarding chip, and sending the BFD message by the found forwarding chip based on the generated forwarding table item; and then, informing the other forwarding chips to stop sending the BFD message and deleting the forwarding table entry stored by the forwarding chips.

It can be seen that, in the whole process of processing the session notification message by the line card boards, each line card board processes the session notification message independently, so that the problem that the forwarding chip in a certain line card board stops sending BFD messages but other line card boards do not send BFD messages synchronously is easily caused because the busy degree and the processing speed of the CPUs in different line card boards are different, and further the problem of false oscillation of the related BFD sessions caused by detection timeout is caused.

Disclosure of Invention

In order to overcome the problems in the related art, the application provides a message processing method and a message processing device.

According to a first aspect of the embodiments of the present application, there is provided a message processing method, which is applied to a CPU in any cable card board in a routing device, the method including:

receiving a session notification message carrying session information of a BFD session, which is sent by a main control board in the routing device, wherein the session information at least comprises a BFD message and corresponding output interface information;

if the line card board to which the first forwarding chip corresponding to the output interface information belongs is determined to be the line card board, and the second forwarding chip which is updated recently and used for sending the BFD message is not the forwarding chip in the line card board, updating the second forwarding chip used for sending the BFD message to be the first forwarding chip, generating a forwarding table item used for forwarding the BFD message, and sending the forwarding table item and the BFD message to the first forwarding chip so that the first forwarding chip sends the BFD message based on the forwarding table item;

changing the BFD message sending state of the first forwarding chip from an initial state to a preset state, sending a stop message carrying the session identifier of the target BFD session to a CPU in a line card board to which the second forwarding chip before updating belongs, so that after receiving the stop message, the corresponding CPU searches for the second forwarding chip of which the BFD message sending state is the preset state and is not updated for the last time, informs the searched forwarding chip to stop sending the BFD message and delete the stored forwarding table item thereof, and changes the BFD message sending state of the searched forwarding chip from the preset state to the initial state.

According to a second aspect of the embodiments of the present application, there is provided a message processing apparatus applied to a CPU in any cable card board in a routing device, the apparatus including:

a receiving module, configured to receive a session notification message carrying session information of a BFD session, where the session notification message is sent by a main control board in the routing device, and the session information at least includes a BFD packet and corresponding egress interface information thereof;

a first processing module, configured to update a second forwarding chip that sends a BFD message to a first forwarding chip if it is determined that a line card board to which a first forwarding chip corresponding to the output interface information belongs is the line card board and a second forwarding chip that sends the BFD message that is updated most recently is not a forwarding chip in the line card board, generate a forwarding table entry for forwarding the BFD message, and send the forwarding table entry and the BFD message to the first forwarding chip, so that the first forwarding chip sends the BFD message based on the forwarding table entry;

and the second processing module is used for changing the BFD message sending state of the first forwarding chip from the initial state to a preset state, sending a stop message carrying the session identifier of the target BFD session to a CPU in a line card board to which the second forwarding chip before updating belongs, so that after the corresponding CPU receives the stop message, searching the second forwarding chip of which the BFD message sending state is the preset state and is not updated for the last time, informing the searched forwarding chip of stopping sending the BFD message and deleting the stored forwarding table item thereof, and changing the BFD message sending state of the searched forwarding chip from the preset state to the initial state.

The technical scheme provided by the embodiment of the application can have the following beneficial effects:

in this embodiment of the present application, for any line card board in a routing device, when a CPU in the line card board receives a session notification message carrying session information of a BFD session (including at least a BFD packet and outgoing interface information corresponding thereto) sent by a main control board in the routing device, once it is determined that the line card board to which a first forwarding chip corresponding to the outgoing interface information belongs is the line card board and a second forwarding chip that has been updated last and sends the BFD packet is not a forwarding chip in the line card board, the second forwarding chip that sends the BFD packet is updated to the first forwarding chip, a forwarding table entry for forwarding the BFD packet is generated, and the forwarding table entry and the BFD packet are sent to the first forwarding chip, so that the first forwarding chip sends the BFD packet based on the forwarding table entry; changing the BFD message sending state of the first forwarding chip from an initial state to a preset state, sending a stop message carrying the session identifier of the target session to a CPU in a line card board to which the second forwarding chip belongs, so that after receiving the stop message, the corresponding CPU searches for the forwarding chip of which the BFD message sending state is the preset state and is not updated for the last time, informs the searched forwarding chip to stop sending the BFD message and delete the stored forwarding table entry thereof, and changes the BFD message sending state of the searched forwarding chip from the preset state to the initial state.

Therefore, in the whole process of processing the session notification message by the line card board, by adding the BFD message sending state and the stop message of interaction between the line card board which needs to send the BFD message when receiving the session notification message and the line card board which needs to stop sending the BFD message when receiving the session notification message, the synchronous sending of the BFD message between the line card boards is realized, and the problem of false oscillation caused by overtime detection of the related BFD session is avoided.

It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.

Drawings

The accompanying drawings, which are incorporated in and constitute a part of this application, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application.

Fig. 1 is a schematic flowchart of a message processing method according to an embodiment of the present application;

fig. 2 is a schematic networking diagram to which a message processing method according to an embodiment of the present application is applied;

fig. 3 is a schematic structural diagram of a message processing apparatus according to an embodiment of the present application.

Detailed Description

Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.

The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.

It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present application. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.

Next, examples of the present application will be described in detail.

An embodiment of the present application provides a message processing method, which is applied to a CPU in any cable card board in a routing device, and as shown in fig. 1, the method may include the following steps:

and S11, receiving a session notification message carrying session information of the BFD session, which is sent by a main control board in the routing device.

In this step, the session information at least includes the BFD packet and its corresponding egress interface information.

S12, if it is determined that the line card board to which the first forwarding chip corresponding to the interface information belongs is the line card board and the second forwarding chip which is updated recently and used for sending the BFD message is not the forwarding chip in the line card board, updating the second forwarding chip used for sending the BFD message to be the first forwarding chip, generating a forwarding table item used for forwarding the BFD message, and sending the forwarding table item and the BFD message to the first forwarding chip so that the first forwarding chip sends the BFD message based on the forwarding table item.

In this step, the first forwarding chip may be an NP chip or the like.

In addition, in this step, the CPU may specifically determine whether the line card board to which the first forwarding chip corresponding to the interface information belongs is the line card board by:

finding out a first forwarding chip and a wire clamping plate corresponding to the interface information from the corresponding relationship between the locally stored interface information and the forwarding chip and the wire clamping plate;

judging whether the searched cable clamping board is the cable clamping board;

if so, determining the wire clamping board to which the first forwarding chip corresponding to the interface information belongs as the wire clamping board;

and when the judgment result is negative, determining that the wire clamping board to which the first forwarding chip corresponding to the interface information belongs is not the wire clamping board.

S13, changing the BFD message sending status of the first forwarding chip from the initial status to a preset status, sending a stop message carrying the session identifier of the target session to the CPU in the line card board to which the second forwarding chip before updating belongs, so that after receiving the stop message, the corresponding CPU searches for the second forwarding chip whose BFD message sending status is the preset status and is not the latest update, notifies the found forwarding chip to stop sending BFD messages and delete the stored forwarding table entries, and changes the BFD message sending status of the found forwarding chip from the preset status to the initial status.

In this step, the initial state may be represented by "0", and the preset state may be represented by "1".

Of course, the initial state and the preset state may be set in other manners, which are not listed here.

Further, in the embodiment of the present application, the CPU may further perform the following operations:

after receiving the session notification message, if the fact that the line card board to which the first forwarding chip belongs is not the line card board is determined, updating a second forwarding chip which sends the BFD message into the first forwarding chip;

if a stop message sent by a CPU in a line card board to which the first forwarding chip belongs is received, searching a second forwarding chip which is managed by the forwarding chip and has the BFD message sending state as a preset state and is not the latest updated sending BFD message;

and informing the searched forwarding chip to stop sending the BFD message and deleting the stored forwarding table item of the forwarding chip, and changing the sending state of the BFD message of the searched forwarding chip from a preset state to an initial state.

Further, in the embodiment of the present application, the CPU may further perform the following operations:

after receiving the session notification message, if it is determined that the line card board to which the first forwarding chip belongs is the line card board and the second forwarding chip, which is updated recently and used for sending the BFD message, is other forwarding chips in the line card board except the first forwarding chip, the forwarding chip used for sending the BFD message is updated to the first forwarding chip, a forwarding table item used for forwarding the BFD message is generated, and the generated forwarding table item and the BFD message are issued to the first forwarding chip, so that the first forwarding chip sends the BFD message based on the generated forwarding table item;

changing the BFD message sending state of the first forwarding chip from an initial state to a preset state;

and informing other forwarding chips to stop sending the BFD message and deleting the stored forwarding table items of the forwarding chips, and changing the sending state of the BFD message of the searched forwarding chip from a preset state to an initial state.

It should be noted that, in this embodiment of the present application, a specific generation process of the CPU generating the relevant forwarding table entry is the prior art, for example, the CPU may generate the relevant forwarding table entry based on the outgoing interface information, the packet encapsulation information, the sending interval and the detection interval of the BFD packet, which are included in the session information, and details are not described here.

The message processing method is described in detail below with reference to specific embodiments.

As shown in fig. 2, it is assumed that, within a certain period of time, a BFD packet 1 corresponding to a BFD session 1 between the routing device 1 and the routing device 2 is sent to the routing device 2 by the interface 2 of NP0 in the line card board 1 in the routing device 1, in this case, the forwarding chip that sends the BFD packet and is updated last by the CPU1 in the line card board 1 and the CPU2 in the line card board 2 is NP0, the line card board to which the NP0 belongs is the line card board 1, the BFD packet sending state of NP0 is a preset state, for example, represented by "1", and the BFD packet sending state of NP1 is an initial state, for example, represented by "0".

It is assumed that at a certain time, the main control board 1 in the routing device 1 sends the session notification message 1 carrying the session information 1 of the BFD session 1 in a multicast manner. The session information 1 includes a BFD packet 2 and its corresponding egress interface information 1.

Assume that the egress interface corresponding to the egress interface information 1 is interface 5, and the corresponding forwarding chip is NP2 in the cable card board 2.

After receiving the session notification message 1, the CPU1 in the subsequent line card board 1 determines that the line card board (i.e., the line card board 2) to which the forwarding chip corresponding to the interface information 1 belongs is not the line card board 1, at this time, the CPU1 updates the forwarding chip (i.e., NP0) that sends the BFD message to NP2, and continues to send the BFD message 1 using NP 0.

After receiving the session notification message 1, the CPU2 in the line card board 2 determines that the line card board (i.e., the line card board 2) to which the forwarding chip corresponding to the interface information 1 belongs is itself, and determines that the forwarding chip (i.e., the NP0) that sends the BFD packet that is updated last time is not the forwarding chip in the line card board 2, at this time, the CPU2 updates the forwarding chip (i.e., the NP0) that sends the BFD packet to the NP2, generates a forwarding entry 1 for forwarding the BFD packet 2, issues the forwarding entry 1 and the BFD packet 2 to the NP2, and the NP2 sends the BFD packet 2 based on the forwarding entry 1. Here, the generation process of forwarding table entry 1 is prior art and will not be described in detail here.

It should be noted that, in this case, before updating the forwarding chip that sends the BFD packet, the CPU2 may separately record the forwarding chip to be updated, and use the forwarding chip as the forwarding chip that sent the BFD packet last time, so as to facilitate subsequent interaction with the CPU in the line card board to which the forwarding chip that sent the BFD packet last time belongs.

Thereafter, the CPU2 changes the BFD packet transmission status of NP2 from 0 to 1, and sends a stop message 1 carrying the session identifier 1 of the BFD session 1 to the CPU (i.e., CPU1) in the line card board (i.e., line card board 1) to which the forwarding chip before update (i.e., NP0) belongs.

Next, after receiving the stop message 1, the CPU1 searches for a forwarding chip whose BFD message transmission state is 1 and is not the forwarding chip that was updated last time, that is, finds the NP 0; the CPU1 notifies the NP0 to stop sending BFD messages 1 and to delete forwarding entries stored by the NP0, and the CPU1 also changes the BFD message sending status of the NP0 from 1 to 0.

Further, it is assumed that the CPU1 receives the session notification message 2 carrying the session information 2 of the BFD session 1, which is transmitted from the main control board 1, before receiving the stop message 1. The session information 2 includes a BFD packet 3 and its corresponding egress interface information 2.

Assume that the egress interface corresponding to the egress interface information 2 is interface 3, and the corresponding forwarding chip is NP1 in the cable card board 1.

Then, after receiving the session notification message 2, the CPU1 in the line card 1 determines that the line card (i.e., the line card 1) to which the forwarding chip corresponding to the interface information 2 belongs is itself, and determines that the forwarding chip (i.e., the NP2) that sends the BFD packet that is updated last time is not the forwarding chip in the line card 1, at this time, the CPU1 updates the forwarding chip that sends the BFD packet to the NP1, generates a forwarding entry 2 for forwarding the BFD packet 3, issues the forwarding entry 2 and the BFD packet 3 to the NP1, and the NP1 sends the BFD packet 3 based on the forwarding entry 2.

Thereafter, the CPU1 changes the BFD packet transmission status of NP1 from 0 to 1, and sends a stop message 2 carrying the session identifier 1 of the BFD session 1 to the CPU (i.e., CPU2) in the line card board (i.e., line card board 2) to which the forwarding chip before update (i.e., NP2) belongs. The processing flow of the subsequent CPU2 is similar to the processing flow of the CPU1 receiving the stop message 1, and will not be described in detail here.

Assuming that the CPU1 receives the stop message 1 only after the NP1 sends the BFD message 3, at this time, the CPU1 searches for a forwarding chip whose BFD message sending status is 1 and which is not the forwarding chip that was updated last time, that is, finds the NP 0; the CPU1 notifies the NP0 to stop sending BFD messages 1 and to delete forwarding entries stored by the NP0, and the CPU1 also changes the BFD message sending status of the NP0 from 1 to 0.

As can be seen from the above technical solutions, in the embodiment of the present application, for any line card board in a routing device, when a CPU in the line card board receives a session notification message carrying session information (at least including a BFD packet and corresponding outgoing interface information) of a BFD session sent by a main control board in the routing device, once it is determined that the line card board to which a first forwarding chip corresponding to the outgoing interface information belongs is the line card board and a second forwarding chip, which has been updated last and sends the BFD packet, is not a forwarding chip in the line card board, a forwarding chip that sends the BFD packet is updated to the first forwarding chip and generates a forwarding entry for forwarding the BFD packet, and the forwarding entry and the BFD packet are issued to the first forwarding chip, so that the first forwarding chip sends the BFD packet based on the forwarding entry; changing the BFD message sending state of the first forwarding chip from an initial state to a preset state, sending a stop message carrying the session identifier of the target session to a CPU in a line card board to which the second forwarding chip before updating belongs, so that after receiving the stop message, the corresponding CPU searches for the forwarding chip of which the BFD message sending state is the preset state and is not the latest updated forwarding chip, informs the searched forwarding chip to stop sending the BFD message and delete the stored forwarding table entry thereof, and changes the BFD message sending state of the searched forwarding chip from the preset state to the initial state.

Therefore, in the whole process of processing the session notification message by the line card board, by adding the BFD message sending state and the stop message of interaction between the line card board which needs to send the BFD message when receiving the session notification message and the line card board which needs to stop sending the BFD message when receiving the session notification message, the synchronous sending of the BFD message between the line card boards is realized, and the problem of false oscillation caused by overtime detection of the related BFD session is avoided.

Based on the same inventive concept, the present application further provides a message processing apparatus, where the apparatus is applied to a CPU in any cable card board in a routing device, and a schematic structural diagram of the apparatus is shown in fig. 3, and specifically includes:

a receiving module 31, configured to receive a session notification message that is sent by a main control board in the routing device and carries session information of a target Bidirectional Forwarding Detection (BFD) session, where the session information at least includes a BFD packet and corresponding egress interface information thereof;

a first processing module 32, configured to update a second forwarding chip that sends a BFD message to a first forwarding chip if it is determined that a line card board to which a first forwarding chip corresponding to the output interface information belongs is the line card board and a second forwarding chip that sends the BFD message and is updated last time is not a forwarding chip in the line card board, generate a forwarding table entry for forwarding the BFD message, and send the forwarding table entry and the BFD message to the first forwarding chip, so that the first forwarding chip sends the BFD message based on the forwarding table entry;

the second processing module 33 is configured to change the BFD packet sending state of the first forwarding chip from the initial state to a preset state, send a stop message carrying the session identifier of the target BFD session to a CPU in a line card board to which the second forwarding chip before update belongs, so that after receiving the stop message, the corresponding CPU searches for a second forwarding chip whose BFD packet sending state is the preset state and is not updated last time, notifies the found forwarding chip to stop sending the BFD packet and delete the stored forwarding table entry of the BFD packet, and changes the BFD packet sending state of the found forwarding chip from the preset state to the initial state.

Preferably, the apparatus further comprises:

a third processing module (not shown in figure 3),

the second forwarding chip for sending the BFD message is updated to the first forwarding chip if it is determined that the line card board to which the first forwarding chip belongs is not the line card board after the receiving module receives the session notification message;

if the stop message sent by the CPU in the line card board to which the first forwarding chip belongs is received, searching a second forwarding chip which sends the BFD message and has the BFD message sending state which is the preset state and is not updated for the last time in the forwarding chips managed by the forwarding chip;

and informing the searched forwarding chip to stop sending the BFD message and deleting the stored forwarding table item of the forwarding chip, and changing the sending state of the BFD message of the searched forwarding chip from the preset state to the initial state.

Preferably, the apparatus further comprises:

a fourth processing module (not shown in fig. 3), configured to, after the receiving module receives the session notification message, if it is determined that the line card board to which the first forwarding chip belongs is the line card board and the second forwarding chip that is updated recently and sends the BFD packet is another forwarding chip in the line card board except the first forwarding chip, update the second forwarding chip that sends the BFD packet to the first forwarding chip, generate a forwarding entry for forwarding the BFD packet, and send the generated forwarding entry and the BFD packet to the first forwarding chip, so that the first forwarding chip sends the BFD packet based on the generated forwarding entry;

changing the BFD message sending state of the first forwarding chip from an initial state to a preset state;

and informing the other forwarding chips to stop sending the BFD message and delete the stored forwarding table entry thereof, and changing the sending state of the BFD message of the found forwarding chip from the preset state to the initial state.

Preferably, the apparatus further comprises:

a determining module (not shown in fig. 3) configured to determine whether the line card board to which the first forwarding chip corresponding to the outgoing interface information belongs is the line card board by:

searching a first forwarding chip and a line card board corresponding to the output interface information in the corresponding relation between the locally stored output interface information and the forwarding chip and the line card board;

judging whether the searched cable clamping board is the cable clamping board;

if so, determining the wire clamping board to which the first forwarding chip corresponding to the output interface information belongs as the wire clamping board;

and if not, determining that the line card board to which the first forwarding chip corresponding to the output interface information belongs is not the line card board.

Preferably, the first forwarding chip is an NP chip.

As can be seen from the above technical solutions, in the embodiment of the present application, for any line card board in a routing device, when a CPU in the line card board receives a session notification message carrying session information (at least including a BFD packet and corresponding outgoing interface information) of a BFD session sent by a main control board in the routing device, once it is determined that the line card board to which a first forwarding chip corresponding to the outgoing interface information belongs is the line card board and a second forwarding chip, which has been updated last and sends the BFD packet, is not a forwarding chip in the line card board, a forwarding chip that sends the BFD packet is updated to the first forwarding chip and generates a forwarding entry for forwarding the BFD packet, and the forwarding entry and the BFD packet are issued to the first forwarding chip, so that the first forwarding chip sends the BFD packet based on the forwarding entry; changing the BFD message sending state of the first forwarding chip from an initial state to a preset state, sending a stop message carrying the session identifier of the target session to a CPU in a line card board to which the second forwarding chip before updating belongs, so that after receiving the stop message, the corresponding CPU searches for the forwarding chip of which the BFD message sending state is the preset state and is not the latest updated forwarding chip, informs the searched forwarding chip to stop sending the BFD message and delete the stored forwarding table entry thereof, and changes the BFD message sending state of the searched forwarding chip from the preset state to the initial state.

Therefore, in the whole process of processing the session notification message by the line card board, by adding the BFD message sending state and the stop message of interaction between the line card board which needs to send the BFD message when receiving the session notification message and the line card board which needs to stop sending the BFD message when receiving the session notification message, the synchronous sending of the BFD message between the line card boards is realized, and the problem of false oscillation caused by overtime detection of the related BFD session is avoided.

The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the scope of protection of the present application.

14页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:使用外置过滤器的QoS方法、装置、计算机设备及介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!