A service board detection method and device
By sending test messages to the search engine of the service board card in a frame device and reading hit counts, abnormalities in TCAM memory are detected, and packet matching abnormalities caused by TCAM errors in the prior art are solved, and early detection and minor impact abnormal recovery are achieved.
Patent Information
- Application Number
- CN202111628861.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-28
- Publication Date
- 2025-04-22
- Estimated Expiration
- 2041-12-28
AI Technical Summary
In the prior art, irreversible errors are easily caused during the use of the TCAM memory of the service board in the framed device, resulting in packet matching exceptions. The existing solutions require manual or command line plugging of the service board to recover, but this method will cause other services to be interrupted and problems cannot be detected in advance.
By implementing a service board detection method on the CPU of the main control board of the frame device, a preset number of test packets that meet the mask rules are sent to the search engine in each service board to be detected, and the hit count of the search engine is read. If the hit count is not equal to the preset number, it is judged that there is an exception in the search engine.
This method can expose the problems of search engines in the business board in advance, find specific exception search engines, so as to perform operations with little impact when abnormal recovery is restored, and avoid other business interruptions.
Smart Images

Figure CN114297010B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of network communication technology, and in particular to a service board detection method and device. Background Art
[0002] A frame device is a network device that integrates routing switching, network security, application delivery and other functions. A main control board can be inserted into each frame device as a management board, and multiple service boards can be inserted as service processing boards. With the continuous development of information data, the processing performance of frame devices per unit time is also constantly improving, and it is necessary to insert service boards that can process data quickly, such as a FPGA (Field Programmable Gate Array) chip that combines high-performance processing, and is also equipped with a TCAM (ternary content addressable memory) chip, as well as a service board with a switching chip that has basic forwarding functions.
[0003] In actual application scenarios, service boards will use mask rules to match messages, and perform corresponding service processing for messages that match the mask rules. Each bit (binary digit) in TCAM has three states. In addition to "0" and "1", there is also a "don't care" state, which can perform both exact matching and fuzzy matching. For service boards containing TCAM chips, TCAM can be used as a search engine to implement mask rules by using the fuzzy matching search function of TCAM. However, during the use of TCAM memory, some irreversible errors may occur with a low probability. For example, abnormal access to the TCAM memory causes the message to be falsely hit or miss when matching the mask rule, thereby causing abnormal service processing of the frame device.
[0004] The existing solution is to manually or through the command line to unplug the business card when an exception occurs in business processing, and trigger the restart of the business card to power on and off the hardware modules in the business card, and reinitialize the software and hardware resources of each part, so as to achieve the effect of abnormal recovery. However, since it is unclear which business card has failed, all business cards need to be plugged in and out. Unplugging and plugging business cards during business processing will interrupt other normal business operations, resulting in the inability to process other normal business cards during this period, which has a great impact. Moreover, this solution cannot detect problems with business cards in advance, and can only be operated after the problem occurs. Summary of the invention
[0005] In view of this, an embodiment of the present disclosure provides at least one service board detection method and device.
[0006] Specifically, the embodiments of the present disclosure are implemented through the following technical solutions:
[0007] In a first aspect, a service board detection method is provided, which is applied to a CPU on a main control board in a frame device, wherein the frame device includes a main control board and at least one service board, and each of the service boards includes a search engine for performing message matching according to a mask rule, and the method includes:
[0008] For each of the service boards to be detected, a preset number of test messages are forwarded to the switch chip of the service board through the switch chip of the main control board, so that the switch chip of the service board sends the test message to the search engine in the service board for matching, wherein the test message is a message that meets the mask rule;
[0009] Reading the hit count of the search engine in each of the service boards respectively, wherein the hit count is the number of test messages that hit the mask rule counted when the search engine in each of the service boards matches the test messages;
[0010] In response to the hit count of any of the search engines not being equal to the preset number, it is determined that an abnormality exists in the search engine in the service board.
[0011] In a second aspect, a service board detection device is provided, which is applied to a CPU on a main control board in a frame device, wherein the frame device includes a main control board and at least one service board, and each of the service boards includes a search engine for matching messages according to a mask rule, and the device includes:
[0012] A sending module, for each of the service boards to be detected, forwarding a preset number of test messages to the switch chip of the service board through the switch chip of the main control board, so that the switch chip of the service board sends the test message to the search engine in the service board for matching, wherein the test message is a message that meets the mask rule;
[0013] A reading module, used to read the hit count of the search engine in each of the service boards respectively, wherein the hit count is the number of test messages that hit the mask rule counted when the search engine in each of the service boards matches the test messages;
[0014] The determination module is used to determine that an abnormality exists in the search engine in the service board in response to the hit count of any of the search engines not being equal to the preset number.
[0015] According to a third aspect, an electronic device is provided, comprising a memory and a processor, wherein the memory is used to store computer instructions executable on the processor, and the processor is used to implement the service board detection method described in any embodiment of the present disclosure when executing the computer instructions.
[0016] In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the service board detection method described in any embodiment of the present disclosure is implemented.
[0017] The service board detection method provided by the embodiment of the present disclosure sends a preset number of test messages that comply with the mask rules to the search engine in each service board to be detected, so that each search engine matches the test messages according to the mask rules, and determines whether the search engine in the service board is abnormal by the number of test messages that hit the mask rules. This method can expose problems with the search engine in the service board of the frame device in advance, and can find the specific search engine where the abnormality occurs, so that when the abnormality is recovered, it can be restored using operations with little impact. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in one or more embodiments of the present disclosure or related technologies, the drawings required for use in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in one or more embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0019] Figure 1 is a flow chart of a service board detection method shown in at least one embodiment of the present disclosure;
[0020] Figure 2 is a schematic diagram of a frame-type device shown in at least one embodiment of the present disclosure;
[0021] Figure 3 is a block diagram of another service board detection method shown in at least one embodiment of the present disclosure;
[0022] Figure 4 is a block diagram of another service board detection device shown in at least one embodiment of the present disclosure;
[0023] Figure 5 It is a schematic diagram of the hardware structure of an electronic device shown in at least one embodiment of the present disclosure. DETAILED DESCRIPTION
[0024] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with this specification. Instead, they are merely examples of devices and methods consistent with some aspects of this specification as detailed in the appended claims.
[0025] The terms used in this specification are for the purpose of describing specific embodiments only and are not intended to limit this specification. The singular forms "a", "the" and "the" used in this specification and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0026] It should be understood that although the terms first, second, third, etc. may be used in this specification to describe various information, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of this specification, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0027] In order to solve the above problems, the embodiments of the present disclosure provide a service board detection method to ensure that the search engine problem in the service board of the frame device can be detected in advance. Figure 1 , Figure 1 It is a flowchart of a service board detection method shown in at least one embodiment of the present disclosure. The method can be used in a CPU (Central Processing Unit) on a main control board in a frame device. The frame device includes a main control board and at least one service board. Each service board includes a search engine for matching messages according to mask rules.
[0028] The search engine is a device on the service board with a matching search function, which can match messages according to mask rules. In this embodiment, the search engine can be TCAM. In other embodiments, a memory that can implement matching search, such as CAM (Content Addressable Memory) or SRAM (Static Random-Access Memory), can also be used.
[0029] In this embodiment, the mask rule can be implemented by using the fuzzy matching search function of TCAM. The mask rule can be configured according to the information of the message header to match the message of a specified type. This embodiment does not limit the specific form of the mask rule.
[0030] For example, for the five-tuple information of the message: source IP (Internet Protocol, Internet Protocol) address (source IP, referred to as sip), destination IP address (destination IP, referred to as sip), source port (source port, referred to as sport), destination port (destination port, referred to as dport) and transport layer protocol (protocl), configure a mask rule, which is divided into two parts:
[0031] a) Content part: sip+dip+sport+dport+protocl;
[0032] b) Mask part: sip-mask+dip-mask+sport-mask+dport-mask+protocol-mask;
[0033] For example, the content of a mask rule is: 1.1.1.1+2.2.2.2+1023+4000+17;
[0034] If the mask part is 255.255.255.255+255.255.255.255+0xffff+0xffff+0xff, it means that all five-tuple information is concerned. When matching the message, the five-tuple of the message must be completely consistent with the content part to match this rule.
[0035] If the mask part is 255.255.255.0+255.255.255.255+0xffff+0xffff+0xff, it means that the information of the four tuples of destination IP address, source port, destination port and transport layer protocol are all concerned, and the information before the last byte of the source IP address is all concerned. When matching the message, except for the last byte of the source IP address, the other five-tuple information of the message must be completely consistent with the content part to hit this rule.
[0036] For another example, for the destination port of the message, configure another mask rule, which is divided into two parts:
[0037] a) Content part: dport;
[0038] b) Mask part: dport-mask;
[0039] For example: the content part of a mask rule is: 80;
[0040] If the mask part is 0xff, it means that only the packets with the destination port number of 80 are matched.
[0041] This embodiment does not limit the number of service boards inserted into the frame-type device.
[0042] See also Figure 2 , which is an example of a frame-type device. Figure 2 The frame device in the figure is a DPX device, which is a distributed network device. The frame device includes a main control board and two business boards. The main control board is mainly used for basic configuration, while the business board focuses on business processing. Among them, the main control board includes a SW (Switch, switching chip) and a CPU with basic forwarding functions. The two business boards have the same configuration, both of which include a SW with basic forwarding functions, a business processing module for processing business messages, and an instruction control module for receiving instructions issued by the main control board CPU. The business processing module includes a high-performance processing FPGA chip, and is equipped with a TCAM chip that serves as a search engine for message matching. The instruction control module can be a small processor.
[0043] Combine the following Figure 2 The frame-type device of the structure shown in the figure illustrates the service board detection method of this embodiment, which includes the following steps:
[0044] In step 102, for each of the business boards to be tested, a preset number of test messages are forwarded to the switching chip of the business board through the switching chip of the main control board, so that the switching chip of the business board sends the test message to the search engine in the business board for matching, wherein the test message is a message that complies with the mask rule.
[0045] like Figure 2 As shown, a preset number of test messages are sent from the CPU of the main control board, and are forwarded to the switch chip SW of the business board 1 through the switch chip SW of the main control board. After the switch chip SW of the business board 1 receives the test message, it is distributed to the TCAM inside the business processing module 1; similarly, a preset number of test messages are also forwarded to the switch chip SW of the business board 2 through the switch chip SW of the main control board. After the switch chip SW of the business board 2 receives the test message, it is distributed to the TCAM inside the business processing module 2.
[0046] After receiving the test message, the TCAM matches the test message according to the mask rule.
[0047] In this embodiment, the number of mask rules in the search engine and the preset number of test messages can be the same or different. For example, the preset number of test messages can be less than the number of mask rules, and some mask rules are tested; the preset number of test messages can be more than the number of mask rules, and some mask rules are tested repeatedly; the number of test messages can be the same as the number of mask rules, and each test message corresponds to each mask rule one by one to maximize the detection efficiency.
[0048] In step 104, the hit counts of the search engines in the service boards are read respectively, wherein the hit counts are the number of test messages that hit the mask rule and are counted when the search engines in the service boards match the test messages.
[0049] As shown in Figure 2, the CPU of the main control board can read the hit count of the search engine in each business board through the instruction control board of the business board. The read hit count can carry the identification of the business board to identify whether the hit count belongs to business board 1 or business board 2.
[0050] In step 106, in response to the hit count of any of the search engines not being equal to the preset number, it is determined that an abnormality exists in the search engine in the service board.
[0051] Since all test messages are messages that comply with the mask rules, in theory, when the search engine matches the test messages, each test message should hit the mask rules, and the hit count of the search engine should be equal to the preset number. When the hit count of a search engine is less than the preset number, it is determined that the search engine in the service board is abnormal.
[0052] The service board detection method provided by the embodiment of the present disclosure sends a preset number of test messages that comply with the mask rules to the search engine in each service board to be detected, so that each search engine matches the test messages according to the mask rules, and determines whether the search engine in the service board is abnormal by the number of test messages that hit the mask rules. This method can expose problems with the search engine in the service board of the frame device in advance, and can find the specific search engine where the abnormality occurs, so that when the abnormality is recovered, it can be restored using operations with little impact.
[0053] The above embodiment can be applied to the following detection scenarios:
[0054] 1) Normal equipment restart stage: After the DPX equipment starts normally and all boards are restored normally, before all functional service configurations are restored, the TCAM of each service board is tested. The objects to be tested are all service boards in the frame-type equipment;
[0055] 2) Manual insertion of service card: After a new service card is inserted and the service card is restored to normal, the TCAM in the designated newly inserted service card is tested. The object to be tested is the designated service card in the chassis device.
[0056] 3) Scheduled polling: You can select the scheduled maintenance time of the chassis device, for example, when the device runs until 0:00 in the morning, start the detection mechanism. The objects to be detected are all the service boards in the chassis device.
[0057] like Figure 3 As shown, Figure 3 A flowchart of another service board detection method is shown, which describes the service board detection process in more detail and is applied to the CPU on the main control board in a frame device. The frame device can be as follows: Figure 2 The device of the structure shown in the figure comprises the following processing steps:
[0058] In step 202, a service board set to be detected is determined.
[0059] The service board set to be detected may include all service boards in the chassis device, or may include a specified part of the service boards.
[0060] In step 204, for each service board to be detected, a mask rule set is sent to a search engine in the service board.
[0061] The mask rule is any rule in the mask rule set, and the mask rule set includes a preset number of mask rules.
[0062] In this embodiment, the number of mask rules and test messages is the same, which is a preset number, and each test message corresponds to each mask rule one by one.
[0063] The setting of the preset number may refer to the upper limit of the number of mask rules that can be used in the search engine, so as to detect the search engine in the service board to the maximum extent.
[0064] For example, the detection of TCAM mask rule hit function needs to cover all mask rule areas in TCAM. If all mask rules are the same, the mask functions in the range cannot be fully detected. The number of mask rules supported by TCAM is about 300,000. Assuming that the upper limit of TCAM mask rules is 300,000, 300,000 different mask rules can be configured.
[0065] In this embodiment, the mask rule is a rule for searching and matching based on the five-tuple information of the message. The mask rule is divided into a mask part and a content part. The content part is the standard five-tuple information, and the mask part is used to identify the information to be searched and matched in the standard five-tuple information, as shown below:
[0066] a) Content part: sip+dip+sport+dport+protocl;
[0067] b) Mask part: sip-mask+dip-mask+sport-mask+dport-mask+protocol-mask.
[0068] For such a large number of test messages, when assembling the test messages for testing the mask function, it is necessary to ensure that the required test messages are quickly assembled to match each mask rule. To this end, in one example, the mask rule set can use a mask increment rule so that the CPU can quickly assemble the required test messages. Among them, the mask parts of each mask rule in the mask rule set are the same, and the content parts are different. For the content parts of every two mask rules, the standard five-tuple information of one mask rule differs from the standard five-tuple information of the other mask rule by a fixed bit.
[0069] Specifically, the inconsistency of the content parts of every two mask rules means that the difference between each tuple (one or more) of the content part increases or decreases at a fixed interval, but the mask part is the same.
[0070] For example:
[0071] The content of the first mask rule is: 1.1.1.1+2.2.2.2+1024+2002+17;
[0072] The content of the second mask rule is: 1.1.1.2+2.2.2.3+1025+2003+18;
[0073] The content of the third mask rule is: 1.1.1.3+2.2.2.4+1026+2004+19.
[0074] Among them, the information of each tuple of the five-tuple is incremented by 1. The content of each tuple of each mask rule only differs by 1 bit field, and the total difference is 5 bit fields.
[0075] Another example:
[0076] The content of the first mask rule is: 1.1.1.1+2.2.2.2+1024+2002+17;
[0077] The content of the second mask rule is: 1.1.1.1+2.2.2.2+1024+2004+18;
[0078] The content of the third mask rule is: 1.1.1.1+2.2.2.2+1024+2006+19.
[0079] The destination port number in the five-tuple increases by 2, and the protocol number increases by 1. The destination port tuple of each mask rule has a difference of 2 bit fields, and the protocol tuple has a difference of 1 bit field, for a total of 3 bit fields.
[0080] When the CPU is assembling test messages that are partially consistent with the content of the mask rule, at the code level, each test message can be generated by a simple instruction (for example, if the content of each tuple is only different by 1 bit field, a simple +1 operation is required), and the next test message can be quickly assembled based on the previous test message, greatly reducing the time spent by the CPU to assemble messages. For mask rules that only differ by fixed bits, the CPU can quickly assemble test messages corresponding to the mask rule, thereby improving detection efficiency.
[0081] In this step, if Figure 2 As shown, the CPU sends 300,000 mask rules to each TCAM through the instruction control module of each service board to be detected, until the mask rule set is sent and each TCAM receives 300,000 mask rules.
[0082] In step 206, the multicast table entry is sent to the main control board and the switch chip of each of the service boards to be detected.
[0083] In this embodiment, the multicast function can be used to transfer a preset number of test messages to each TCAM in the service board set at one time. Prior to this, it is necessary to pre-configure a multicast table entry for each switch chip in this step.
[0084] Generally, a multicast entry consists of two parts: the multicast destination MAC address (Media Access Control Address), which has fixed characteristics and is a table entry match; and the physical exit of the corresponding message after the table entry is matched. The switching chip can forward the message that has matched the multicast destination MAC address to the specified physical exit according to the multicast entry.
[0085] like Figure 2 As shown, the CPU sends the corresponding multicast table entry to the switch chip of the main control board to configure the multicast address of the switch chip of the main control board as the multicast destination MAC address, and configures the physical exit of the switch chip of the main control board as the port connected to the switch chip of each service board. The switch chip of each service board in the service board set is traversed and the corresponding multicast table entry is sent to configure the multicast address of the switch chip of each service board as the multicast destination MAC address, and configures the physical exit of the switch chip of each service board as the port connected to the search engine in the service board.
[0086] Exemplarily, in this embodiment, the multicast destination MAC address is 01:c0:e0:22:33:44.
[0087] In step 208, a preset number of test messages are assembled.
[0088] Among them, the preset number of test messages is consistent with the mask rule, and the five-tuple information of each test message corresponds to each mask rule one by one. At the same time, in order to ensure that the test message can go to multiple specified service boards at the same time, the multicast function needs to be used, so the destination MAC address of the test message needs to be set to the multicast destination MAC address, that is, 01:c0:e0:22:33:44.
[0089] When the mask increment rule is adopted, the CPU can quickly assemble the corresponding test message.
[0090] In step 210, a preset number of test messages carrying the multicast destination MAC address are sent to the switching chip of the main control board, so that after the test message matches the multicast table entry, the switching chip of the main control board is multicasted and sent by the port connected to the switching chip of each of the service boards to be tested.
[0091] After assembling the test message, the test message is transferred out from the CPU, and the test message is matched to the multicast table entry in the switching chip of the main control board, and forwarded to the switching chip of each business board according to the physical exit specified by the multicast table entry. After receiving the test message, the switching chip of each business board matches the multicast table entry again, and redistributes the test message to the TCAM inside the business board according to the physical exit specified by the multicast table entry, so that each TCAM to be detected can receive a preset number of test messages and perform matching.
[0092] In step 212, the hit counts of the search engines in the service boards are read respectively.
[0093] After sending the test message, the CPU reads the hit counts of all TCAMs of each service board.
[0094] In step 214, in response to the hit count of any of the search engines not being equal to the preset number, it is determined that an abnormality exists in the search engine in the service board.
[0095] Theoretically, the hit count of each TCAM should be 300,000. If the hit count of a TCAM is found to be less than 300,000, it means that the TCAM is abnormal.
[0096] In step 216, in response to an abnormality in the search engine in any of the service boards, a reset instruction is sent to the search engine in the service board, so that the search engine is reset after receiving the reset instruction.
[0097] For a service board with an abnormal TCAM, the CPU sends a reset instruction to the abnormal TCAM through the instruction control board of the service board to reset it without plugging in or out the service board where the TCAM is located. Even if the TCAM of the service board is abnormal, other services of the service board can still operate normally, such as the services on the FPGA chip. There is no need to plug in or out all the service boards in the frame device because the service board where the abnormal TCAM is located cannot be found.
[0098] In step 218, the service board where the search engine to be reset is located is added to the service board set to be re-tested, and each service board in the service board set is re-tested.
[0099] For a service card without TCAM abnormality, the detection process ends, the multicast table entry of the service card switching chip and the mask rule of the search engine are deleted, and the record of the port of the service card on the switching chip of the main control card is deleted.
[0100] The service board where the abnormal TCAM is located is recorded and added to the service board set to be re-tested for re-testing. The re-testing steps may be to first delete the multicast table entries of each switching chip and the mask rules of the search engine, and then re-test from step 204; or re-testing may be to start from step 210.
[0101] In response to a finding that a search engine in any of the service boards has an abnormality in the result of the re-detection, a reset instruction is sent to the search engine in the service board.
[0102] In step 220, in response to the number of re-detections reaching a preset value, the detection is terminated and the mask rule in the search engine is deleted.
[0103] For example, the preset value may be set to 5 times. When the number of re-detection exceeds 5 times and there is still an abnormal search engine, the detection is terminated and the mask rule in the search engine and the multicast record of the switching chip are deleted. The service board where the abnormal search engine is located is recorded and an alarm is issued.
[0104] The service board detection method provided by the embodiment of the present disclosure sends a preset number of test messages that comply with the mask rules to the search engines in each service board to be detected in a multicast manner, so that each search engine can quickly receive the test messages and match the test messages according to the mask rules, and judge whether the search engine in the service board is abnormal by the number of test messages that hit the mask rules, and reset the abnormal search engine separately, so as to expose the problem of the search engine in the service board of the frame device in advance, find the specific search engine where the abnormality occurs, and use small-impact operations to recover it, so as to timely discover the search engine problem of the service board of the frame device, and use small-impact operations to recover the abnormality as soon as possible.
[0105] like Figure 4 As shown, Figure 4 The present invention is a block diagram of a service board detection device shown in at least one embodiment of the present invention, which is applied to a CPU on a main control board in a frame device, wherein the frame device includes a main control board and at least one service board, and each of the service boards includes a search engine for performing message matching according to a mask rule. The device includes:
[0106] The sending module 41 is used to forward a preset number of test messages to the switching chip of the business board through the switching chip of the main control board for each business board to be detected, so that the switching chip of the business board sends the test message to the search engine in the business board for matching, wherein the test message is a message that complies with the mask rule.
[0107] The reading module 42 is used to read the hit count of the search engine in each of the service boards respectively, wherein the hit count is the number of test messages that hit the mask rule counted when the search engine in each of the service boards matches the test messages.
[0108] The determination module 43 is configured to determine that an abnormality exists in the search engine in the service board in response to a hit count of any of the search engines not being equal to the preset number.
[0109] In one example, the mask rule is any rule in a mask rule set, and the mask rule set includes a preset number of mask rules; before the sending module 41 is used to forward the preset number of test messages to the switching chip of the business board through the switching chip of the main control board, it is also used to: for each of the business boards to be tested, send the mask rule set to the search engine in the business board.
[0110] In one example, the mask rule is a rule for searching and matching based on the five-tuple information of the message. The mask rule is divided into a mask part and a content part. The content part is the standard five-tuple information, and the mask part is used to identify the information to be searched and matched in the standard five-tuple information.
[0111] The mask parts of the mask rules in the mask rule set are the same, and the content parts are different. For the content parts of every two mask rules, the standard five-tuple information of one mask rule differs from the standard five-tuple information of another mask rule by a fixed bit.
[0112] Before forwarding the preset number of test messages to the switching chip of the service board through the switching chip of the main control board, the sending module 41 is also used to: assemble a preset number of test messages, wherein the five-tuple information of each test message corresponds to each mask rule.
[0113] In one example, before the sending module 41 is used to forward a preset number of test messages to the switching chip of the business board through the switching chip of the main control board, it is also used to: send multicast table entries to the main control board and the switching chips of each of the business boards to be detected, and the multicast table entries include the media access control address MAC address of the multicast destination; when it is used to forward a preset number of test messages to the switching chip of the business board through the switching chip of the main control board for each of the business boards to be detected, it is specifically used to: send a preset number of test messages carrying the multicast destination MAC address to the switching chip of the main control board, so that the test messages are multicasted by the switching chip of the main control board from the port connected to the switching chip of each of the business boards to be detected after matching the multicast table entries.
[0114] In one example, the determination module 43 is further used to send a reset instruction to the search engine in any of the business boards in response to an abnormality in the search engine in the business board, so that the search engine is reset after receiving the reset instruction.
[0115] In one example, the determination module 43 is also used to add the business board where the search engine to be reset is located to a business board set to be retested; retest each business board in the business board set; and in response to an abnormality in the search engine in any of the business boards in the retest results, send a reset instruction to the search engine in the business board.
[0116] In one example, the determination module 43 is further configured to terminate the detection and delete the mask rule in the search engine in response to the number of re-detections reaching a preset value.
[0117] The implementation process of the functions and effects of each module in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, which will not be repeated here.
[0118] The present disclosure also provides an electronic device, such as Figure 5 As shown, the electronic device includes a memory 51 and a processor 52, wherein the memory 51 is used to store computer instructions that can be executed on the processor, and the processor 52 is used to implement the method described in any embodiment of the present disclosure when executing the computer instructions.
[0119] The embodiments of the present disclosure further provide a computer program product, which includes a computer program / instruction. When the computer program / instruction is executed by a processor, the service board detection method described in any embodiment of the present disclosure is implemented.
[0120] The embodiments of the present disclosure further provide a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the service board detection method described in any embodiment of the present disclosure is implemented.
[0121] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this specification. A person of ordinary skill in the art can understand and implement it without paying creative labor.
[0122] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0123] Those skilled in the art will readily appreciate other embodiments of the specification after considering the specification and practicing the invention claimed herein. The specification is intended to cover any variations, uses or adaptations of the specification that follow the general principles of the specification and include common knowledge or customary techniques in the art that are not claimed in the specification. The specification and examples are to be considered exemplary only, and the true scope and spirit of the specification are indicated by the following claims.
[0124] It should be understood that the present description is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present description is limited only by the appended claims.
[0125] The above description is only a preferred embodiment of this specification and is not intended to limit this specification. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of this specification should be included in the scope of protection of this specification.
Claims
1. A service board detection method, applied to a central processing unit CPU on a main control board in a frame device, wherein the frame device includes a main control board and at least one service board, each of the service boards includes a search engine for message matching according to a mask rule, wherein the mask rule is a rule for searching and matching according to five-tuple information of the message, wherein the mask rule is divided into a mask part and a content part, wherein the content part is standard five-tuple information, and the mask part is used to identify information to be searched and matched in the standard five-tuple information; characterized in that The method comprises: For each of the service boards to be detected, a preset number of test messages are forwarded to the switch chip of the service board through the switch chip of the main control board, so that the switch chip of the service board sends the test message to the search engine in the service board for matching, wherein the test message is a message that meets the mask rule; Reading the hit count of the search engine in each of the service boards respectively, wherein the hit count is the number of test messages that hit the mask rule counted when the search engine in each of the service boards matches the test messages; In response to the hit count of any of the search engines not being equal to the preset number, it is determined that an abnormality exists in the search engine in the service board.
2. The method according to claim 1, characterized in that The mask rule is any one rule in a mask rule set, and the mask rule set includes a preset number of mask rules; Before forwarding the preset number of test messages to the switching chip of the service board through the switching chip of the main control board, the method further includes: For each of the service boards to be detected, the mask rule set is sent to a search engine in the service board.
3. The method according to claim 2, characterized in that The mask parts of the mask rules in the mask rule set are the same, and the content parts are different. For the content parts of every two mask rules, the standard five-tuple information of one mask rule differs from the standard five-tuple information of the other mask rule by a fixed bit. Before forwarding the preset number of test messages to the switching chip of the service board through the switching chip of the main control board, the method further includes: A preset number of test messages are assembled, wherein the five-tuple information of each of the test messages corresponds to each mask rule.
4. The method according to claim 1, characterized in that: Before forwarding a preset number of test messages to the switching chip of the service board through the switching chip of the main control board for each service board to be detected, the method further includes: Sending a multicast table entry to the main control board and the switch chip of each of the service boards to be detected, wherein the multicast table entry includes a media access control address MAC address of the multicast destination; For each of the service boards to be detected, forwarding a preset number of test messages to the switch chip of the service board through the switch chip of the main control board includes: A preset number of test messages carrying the multicast destination MAC address are sent to the switch chip of the main control board, so that after the test message matches the multicast table entry, the switch chip of the main control board is multicasted and sent from the port connected to the switch chip of each of the service boards to be tested.
5. The method according to claim 1, characterized in that The method further comprises: In response to an abnormality in the search engine in any of the service boards, a reset instruction is sent to the search engine in the service board, so that the search engine is reset after receiving the reset instruction.
6. The method according to claim 5, characterized in that The method further comprises: Adding the service board where the search engine to be reset is located to the service board set to be re-tested; Re-testing each service board in the service board set; In response to a finding that a search engine in any of the service boards has an abnormality in the result of the re-detection, a reset instruction is sent to the search engine in the service board.
7. The method according to claim 6, characterized in that The method further comprises: In response to the number of re-detections reaching a preset value, the detection is terminated and the mask rule in the search engine is deleted.
8. A service board detection device, applied to a CPU on a main control board in a frame device, wherein the frame device includes a main control board and at least one service board, each of the service boards includes a search engine for message matching according to a mask rule, wherein the mask rule is a rule for searching and matching according to five-tuple information of the message, and the mask rule is divided into a mask part and a content part, wherein the content part is standard five-tuple information, and the mask part is used to identify information to be searched and matched in the standard five-tuple information; characterized in that The device comprises: A sending module, for each of the service boards to be detected, forwarding a preset number of test messages to the switch chip of the service board through the switch chip of the main control board, so that the switch chip of the service board sends the test message to the search engine in the service board for matching, wherein the test message is a message that meets the mask rule; A reading module, used to read the hit count of the search engine in each of the service boards respectively, wherein the hit count is the number of test messages that hit the mask rule counted when the search engine in each of the service boards matches the test messages; The determination module is used to determine that an abnormality exists in the search engine in the service board in response to the hit count of any of the search engines not being equal to the preset number.
9. An electronic device, characterized in that: The device comprises a memory and a processor, wherein the memory is used to store computer instructions executable on the processor, and the processor is used to implement any one of the methods of claims 1 to 7 when executing the computer instructions.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Message control strategy matching method and device
CN105939284A
IPv4 mask quintuple rule storage and compression method and device
CN111984835A