A CCM message counting method, device, electronic device and storage medium

By hashing the table when receiving CCM messages and transmitting the message through the target detection chip, the internal device attack problem caused by the attack flow matching through the ACL table is solved, and the effect of reducing bandwidth usage and improving device stability is achieved.

CN118784374BActive Publication Date: 2025-02-21格创通信(浙江)有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411259874.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-10
Publication Date
2025-02-21
Estimated Expiration
2044-09-10

AI Technical Summary

Technical Problem

In the prior art, when using CCM messages for connectivity status detection, the attack flow may be sent to the multicast group through the ACL table matching, thereby causing attacks on the chips of all line card boards, resulting in increased bandwidth usage within the device and may lead to session errors. Detect the fault.

Method used

When receiving the CCM message, the hash lookup operation is performed according to the CCM session identifier. If the hash entry stored by itself is hit, the message is transmitted to the target detection chip instead of sending it to the multicast group. If it is not hit, the host will report to determine the target detection board and chip and issue a hash entry.

Benefits of technology

It effectively avoids the impact of attack packets on normal services, saves bandwidth across chips within the device, and improves the anti-attack and overall stability of the device.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118784374B_ABST
    Figure CN118784374B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a CCM message counting method, device, electronic device and storage medium, including: when it is detected that a continuity detection CCM message is received, a hash table lookup operation is performed according to the CCM session identifier to obtain a table lookup result; the table lookup result includes the local identifier of the detection chip, the identifier of the target detection board and the target detection chip, and the counting index; if the local identifier of the detection chip indicates that it is not the target detection chip, the first message header is encapsulated in the CCM message and transparently transmitted to the target detection chip; instead of using the multicast replication mechanism, the message transparent transmission method is adopted to transparently transmit the CCM message to the target detection chip. It ensures that there are no large numbers of redundant duplicate messages between each line card board and each chip, and avoids the impact of attack messages from the source. It saves the bandwidth of cross-chip transmission within the device, reduces the impact of attack flows on normal services, and improves the anti-attack and overall stability of the device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a CCM message counting method, device, electronic device and storage medium. Background Art

[0002] CCM (Continuity Check Message) is mainly used to detect the connectivity status between MEPs (Maintenance association End Points) in a Layer 2 network. Connectivity failure may be caused by device or link failure, network latency, administrator misconfiguration, and so on. This function is implemented by: MEP periodically sends CCM messages, and other MEPs in the same MA (Maintenance Association) receive the messages and obtain the remote status. If the MEP does not receive the CCM message from the remote MEP within a certain period of time (for example, within 3.5 CCM message sending cycles), it is considered that there is a problem with the link, and the associated upper-layer application is notified or a log alarm is output.

[0003] In the specific implementation process, the Host CPU (host processor) sends ACL (Access Control List) to all chips of all line cards, matches the CCM message characteristics, and the corresponding action item is to send the CCM message to a specific multicast group. Among them, a chip of each line card is pre-joined to the multicast group, for example, chip0 of each line card is joined to the multicast group. Among them, chip represents chip.

[0004] Therefore, when a chip on any single board receives a CCM message and hits the ACL table, it is sent to the multicast group and copied to chip 0 of each line card. Subsequently, the target detection chip on the target line card accumulates the count corresponding to the packet receiving count index, and other line cards or other chips do not process it.

[0005] According to the current implementation, if the attack flow hits the above ACL table, the attack flow will be sent to the multicast group, so that the attack flow will attack all chips in the line card board that join the multicast group. For example, it will attack chip0 of all line card boards.

[0006] On the other hand, if bandwidth restrictions are imposed on multicast replication, CCM messages of normal multicast replication may be congested in the context of attack flows, resulting in session misdetection failures. Summary of the invention

[0007] The purpose of the embodiments of the present application is to provide a CCM message counting method, device, electronic device and storage medium to ensure that there are no large numbers of redundant copy messages between line cards and chips, thereby avoiding the impact of attack messages from the source. The specific technical solution is as follows:

[0008] In a first aspect of the present application, a method for counting CCM messages is provided, the method comprising:

[0009] When it is detected that a continuity detection CCM message is received, a hash table lookup operation is performed according to the CCM session identifier carried in the CCM message, and if a hash table item stored in the CCM message is hit, a table lookup result is obtained; the CCM session identifier includes a maintenance port identifier and a maintenance entity group identifier; the table lookup result includes a detection chip local identifier, an identifier of a target detection board and a target detection chip, and a counting index;

[0010] If the local identifier of the detection chip indicates that it is not the target detection chip, a first message header is encapsulated in the CCM message and transparently transmitted to the target detection chip on the target detection board; the first message header carries the counting index.

[0011] Optionally, if the local identifier of the detection chip indicates that it is a target detection chip, the value of the packet reception count is accumulated according to the counting index.

[0012] Optionally, the method further includes:

[0013] If the hash table item stored in the host is not hit, the CCM message is reported to the host so that the host determines the target detection board and the target detection chip, and sends the hash table item to each chip located on each line card board; the key value of the hash table item is the CCM session identifier, and the table lookup result of the hash table item includes: the local identifier of the detection chip, the identifier of the target detection board and the target detection chip, and the counting index;

[0014] Among them, the local identification of the detection chip is set in the table lookup result of the hash table item corresponding to the target detection chip; the local identification of the detection chip is not set in the table lookup result of the hash table item corresponding to other detection chips.

[0015] Optionally, the method further includes:

[0016] When it is detected that a continuity check CCM message carrying the first message header is received, a packet reception count value is accumulated according to the count index carried in the first message header.

[0017] A second aspect of the present application provides a method for detecting the continuity of a session state, the method comprising:

[0018] Receive a continuity detection CCM message reported by the chip, and determine the target detection board, target detection chip and counting index according to the CCM session identifier carried in the CCM message; the CCM session identifier includes a maintenance port identifier and a maintenance entity group identifier;

[0019] Sending a hash table entry with the CCM session identifier as the key value to each chip of each line card board, wherein the lookup result of the hash table entry includes: a local identification of the detection chip, an identifier of the target detection board and the target detection chip, and a counting index;

[0020] Among them, the local identification of the detection chip is set in the table lookup result of the hash table item corresponding to the target detection chip; the local identification of the detection chip is not set in the table lookup result of the hash table item corresponding to other detection chips.

[0021] Optionally, for the CCM session identifier, the packet receiving count value recorded by the target detection chip is accessed based on the counting index, and the continuity of the session state is detected according to the change of the packet receiving count value.

[0022] According to a third aspect of the present application, a CCM message counting device is provided, the device comprising:

[0023] A table lookup module is used to perform a hash table lookup operation according to the CCM session identifier carried in the CCM message when a continuity detection CCM message is detected, and obtain a table lookup result if a hash table item stored in the module is hit; the CCM session identifier includes a maintenance port identifier and a maintenance entity group identifier; the table lookup result includes a detection chip local identifier, an identifier of a target detection board and a target detection chip, and a counting index;

[0024] The transparent transmission module is used to encapsulate the first message header in the CCM message and transparently transmit it to the target detection chip on the target detection board if the local identification of the detection chip indicates that it is not the target detection chip; the first message header carries the counting index.

[0025] Optionally, a first accumulation module is further included, which is used to accumulate the value of the packet reception count according to the counting index if the local identifier of the detection chip indicates that it is a target detection chip.

[0026] Optionally, a reporting module is also included, which is used to:

[0027] If the hash table item stored in the host is not hit, the CCM message is reported to the host so that the host determines the target detection board and the target detection chip, and sends the hash table item to each chip located on each line card board; the key value of the hash table item is the CCM session identifier, and the table lookup result of the hash table item includes: the local identifier of the detection chip, the identifier of the target detection board and the target detection chip, and the counting index;

[0028] Among them, the local identification of the detection chip is set in the table lookup result of the hash table item corresponding to the target detection chip; the local identification of the detection chip is not set in the table lookup result of the hash table item corresponding to other detection chips.

[0029] Optionally, a second accumulation module is also included, which is used to accumulate the packet reception count value according to the counting index carried in the first message header when it is detected that a continuity check CCM message carrying the first message header is received.

[0030] In a fourth aspect of the present application, a session state continuity detection device is also provided, the device comprising:

[0031] A receiving module, configured to receive a continuity detection CCM message reported by a chip, and determine a target detection board, a target detection chip, and a counting index according to a CCM session identifier carried in the CCM message; the CCM session identifier includes a maintenance port identifier and a maintenance entity group identifier;

[0032] A sending module is used to send a hash table item with the CCM session identifier as a key value to each chip of each line card board, wherein the lookup result of the hash table item includes: a local identification of the detection chip, an identifier of the target detection board and the target detection chip, and a counting index;

[0033] Among them, the local identification of the detection chip is set in the table lookup result of the hash table item corresponding to the target detection chip; the local identification of the detection chip is not set in the table lookup result of the hash table item corresponding to other detection chips.

[0034] Optionally, a continuity detection module is also included for:

[0035] For the CCM session identifier, the packet receiving count value recorded by the target detection chip is accessed based on the count index, and the continuity detection of the session state is performed according to the change of the packet receiving count value.

[0036] In a fifth aspect of the present application, an electronic device is provided, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;

[0037] Memory, used to store computer programs;

[0038] The processor is used to implement any of the above-mentioned method steps when executing the program stored in the memory.

[0039] According to a sixth aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, any of the method steps described above is implemented.

[0040] Beneficial effects of the embodiments of the present application:

[0041] With the solution of this application, when the chip receives a CCM message, it does not need to send it to the multicast group, so the multicast replication mechanism is not used. Instead, the CCM message is transparently transmitted to the target detection chip. This ensures that there are no redundant duplicate messages between each line card board and each chip, avoiding the impact of attack messages from the source. This saves the bandwidth of cross-chip transmission within the device, reduces the impact of attack flows on normal business, and improves the device's anti-attack performance and overall stability.

[0042] In addition, the CCM message encapsulated with the first message header is transparently transmitted to the target detection chip, and the target detection chip directly reads the count index in the first message header to accumulate the packet receiving count without the need for hash table lookup, thus saving the processing flow. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention, and for ordinary technicians in this field, other embodiments can also be obtained based on these drawings.

[0044] Figure 1 This is a schematic diagram of the connection between devices;

[0045] Figure 2 A flow chart of a method for counting CCM messages provided in an embodiment of the present application;

[0046] Figure 3 A flow chart of a method for detecting the continuity of a session state provided in an embodiment of the present application;

[0047] Figure 4 A schematic diagram of a structure of a CCM message counting device provided in an embodiment of the present application;

[0048] Figure 5 A structural diagram of a session state continuity detection device provided in an embodiment of the present application;

[0049] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0050] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field based on the present application belong to the scope of protection of the present application.

[0051] In order to facilitate the understanding of the present application, relevant technical terms are first introduced.

[0052] MD (Maintenance Domain): specifies the scope of connectivity error detection.

[0053] MA (Maintenance Association): belongs to MD. Multiple maintenance associations can be configured in a maintenance domain as needed. Each maintenance association is a collection of maintenance points in the maintenance domain.

[0054] MEP (Maintenance association End Point): belongs to MA.

[0055] See also Figure 1 , is a schematic diagram of the connection between devices. As shown in the figure, device 1, device 2, and device 3 belong to the same MD, where 1 / 0 / 1 of device 1 and 1 / 0 / 1 of device 3 are MEPs and belong to the same MA. Device 1 sends CCM messages to device 3 at intervals of 10ms. After receiving the CCM message sent by device 1, device 3 sets a 35ms timer for detection. If the corresponding CCM message is received later, the timer is reset. If the timer times out and the corresponding CCM message is not received, it is considered that the link is faulty.

[0056] Those skilled in the art can understand that in the x / y / z port of the device, x, y and z represent the slot number, subcard number and physical port number respectively. For example, 1 / 0 / 1 represents the first port on the 0th subcard in the 1st slot, and each slot corresponds to a line card; 2 / 0 / 1 represents the first port on the 0th subcard in the 2nd slot, and 3 / 0 / 1 represents the first port on the 0th subcard in the 3rd slot.

[0057] As shown in the figure, device 3 may receive CCM messages from device 1 from slot 2 or slot 3. Therefore, it is necessary to aggregate the CCM messages to the same chip on the same board for cumulative counting, thereby facilitating timer detection.

[0058] At present, the implementation of the existing solution is as follows:

[0059] The host of the device sends the ACL table to all chips of all line cards contained in the device, matches the characteristics of the CCM message, and sends it to a specific multicast group after a successful match. Among them, the specific chip of each line card joins the multicast group. For example, the host selects chip0 of each line card to join the multicast group.

[0060] The host of the device sends a hash table to all chips of all line cards included in the device. The table lookup result includes the identification and count index of the detection board and the detection chip.

[0061] Therefore, when a chip on any single board receives a CCM message, it will hit the ACL table and be sent to the multicast group. That is, through the multicast mechanism, a copy of the message is sent to chip0 of all line cards. Subsequently, the detection chip on the detection board accumulates the count value corresponding to the count index. Other chips do not process after recognizing that they are not detection chips.

[0062] It can be seen that according to the current implementation, if the attack flow hits the above ACL table, the attack flow will be sent to the multicast group, so that the attack flow will attack all chips in the line card board that join the multicast group. For example, it will attack Chip0 of all line card boards.

[0063] On the other hand, if bandwidth restrictions are imposed on multicast replication, CCM messages of normal multicast replication may be congested in the context of attack flows, resulting in session misdetection failures.

[0064] In order to solve the above technical problems, the present application embodiment provides a CCM message counting method, such as Figure 2 As shown, the method comprises the following steps:

[0065] S201: When it is detected that a continuity detection message has been received, a hash table lookup operation is performed according to the continuity detection session identifier carried in the continuity detection message. If a hash table entry stored in itself is hit, the table lookup result is obtained; the continuity detection session identifier includes a maintenance port identifier and a maintenance entity group identifier; the table lookup result includes a local identifier of a detection chip, an identifier of a target detection board and a target detection chip, and a counting index.

[0066] In the following text, CCM message refers to the continuity check message, and CCM session identifier refers to the continuity check session identifier.

[0067] The method provided in the embodiment of the present application can be applied to electronic devices, and specifically to chips in electronic devices, such as forwarding chips in routing devices. The chip can identify the message characteristics of the CCM message by ACL matching, and then confirm that the received message is a CCM message.

[0068] After identifying the CCM message, a hash table lookup operation is performed based on the CCM session identifier carried in the CCM message. Specifically, the CCM session identifier carried by the CCM message includes a maintenance port identifier and a maintenance entity group identifier. The combination of the two identifiers can uniquely identify the CCM session. Among them, the maintenance port identifier is the MEP ID, and the maintenance entity group identifier is the MEG (maintenance entity group identifiers). The MEG is composed of the MD and MA in a certain format.

[0069] The hash table lookup operation is performed based on the CCM session identifier, specifically: a preset hash algorithm is used to perform a hash operation on the CCM session identifier to obtain a hash operation result, and then a table lookup is performed based on the hash operation result. The hash table entry is pre-issued by the host of the device.

[0070] In the embodiment of the present application, a hash table lookup operation is performed according to the CCM session identifier, and there are two results obtained. One is that the hash table item is hit, that is, the table lookup result can be obtained. The other is that the hash table item cannot be hit, that is, the table lookup result cannot be obtained.

[0071] In the case of hitting a hash table entry, the table lookup result includes: a local identification of the detection chip, identifiers of the target detection board and the target detection chip, and a counting index.

[0072] Among them, the local identification of the detection chip is used to indicate whether the chip is the target detection chip of the CCM message, and can be represented by 1 bit. For example, if the bit is set, it means that the chip is the target detection chip, and if the bit is not set, it means that the chip is not the target detection chip.

[0073] In the embodiment of the present application, the hash table items sent by the host to different chips are different, so that the local identification of the detection chip is set in the table lookup result of the hash table item corresponding to the target detection chip; the local identification of the detection chip is not set in the table lookup result of the hash table item corresponding to other detection chips. For details about the sending process of the hash table item, please refer to the following.

[0074] In the embodiment of the present application, the counting index represents the address offset of the packet receiving count, and there is a corresponding relationship between the counting index and the CCM session identifier.

[0075] For example, the target detection chip A is used to count the number of received CCM messages corresponding to the CCM session identifier a. Then, each time a CCM message corresponding to the CCM session identifier a is received, the received packet count is increased by 1.

[0076] The address used to store the value of the packet receiving count is related to the count index, which serves as the address offset.

[0077] S202: If the local identification of the detection chip indicates that it is not the target detection chip, encapsulate the first message header in the continuity detection message and transparently transmit it to the target detection chip on the target detection board; the first message header carries a counting index.

[0078] Specifically, in an embodiment of the present application, if the chip confirms itself as a target detection chip based on the local identification of the detection chip, then the address offset represented by the counting index is added to the default initial address to obtain the address for storing the numerical value of the packet receiving count, and the count value is added by 1.

[0079] If the chip confirms that it is not the target detection chip based on the local identification of the detection chip, the first message header is encapsulated in the CCM message and transparently transmitted to the target detection chip on the target detection board. Specifically, since the table lookup result contains the identifiers of the target detection board and the target detection chip, the target detection chip and the target detection board where the target detection chip is located can be determined through the identifiers, and then transparent transmission can be performed.

[0080] The full name of transparent transmission is transparent transmission, which means that the data is not changed during the transmission from the sender to the receiver, and there is no data damage, loss or tampering, as if the transmission process is transparent.

[0081] Since the transparent transmission method is adopted, the intermediate forwarding node will not perform any processing on the CCM message encapsulating the first message header, but only transmit it intactly. Only after it is transmitted to the target detection chip, the target detection chip will identify the first message header.

[0082] When the target detection chip receives the CCM message carrying the first message header, it can directly accumulate the value of the packet reception count according to the counting index carried in the first message header.

[0083] In one embodiment of the present application, the first message header may carry a type identifier that identifies the message type. The target detection chip identifies the type identifier in the first message header, and can confirm that the message is a CCM message encapsulated with the first message header, and the target detection chip corresponding to the message is itself. That is, after the target detection chip identifies the type identifier carried by the first message header, it directly executes the specified action, which is to read the count index from the first message header and accumulate the value of the packet receiving count corresponding to the count index.

[0084] The process of accumulating the packet receiving count according to the counting index is as described above and will not be described in detail.

[0085] It can be seen that the counting method of CCM messages provided in the embodiment of the present application is applied. When it is detected that a continuity detection CCM message is received, a hash table lookup operation is performed according to the CCM session identifier carried in the CCM message. If the hash table item stored in itself is hit, the table lookup result is obtained; the CCM session identifier includes a maintenance port identifier and a maintenance entity group identifier; the table lookup result includes a local identifier of the detection chip, an identifier of the target detection board and the target detection chip, and a counting index; if the local identifier of the detection chip indicates that it is not a target detection chip, a first message header is encapsulated in the CCM message and transmitted to the target detection chip on the target detection board; the first message header carries the counting index.

[0086] Therefore, when the chip receives a CCM message, it does not need to send it to the multicast group, and thus does not use the multicast replication mechanism. Instead, it uses the message transparent transmission method to transparently transmit the CCM message to the target detection chip. This ensures that there are no redundant duplicate messages between each line card board and each chip, and avoids the impact of attack messages from the source. This saves the bandwidth of cross-chip transmission within the device, reduces the impact of attack flows on normal services, and improves the device's anti-attack performance and overall stability.

[0087] In addition, the CCM message encapsulated with the first message header is transparently transmitted to the target detection chip, and the target detection chip directly reads the count index in the first message header to accumulate the packet receiving count without the need for hash table lookup, thus saving the processing flow.

[0088] In one embodiment of the present application, if the chip performs a hash table lookup operation according to the CCM session identifier, the result obtained is: the hash table entry cannot be hit, that is, the table lookup result cannot be obtained, which means that the host has not issued a hash table entry for the CCM session identifier.

[0089] At this time, the CMM message is reported to the host, which determines the target detection board and the target detection chip, and sends hash table entries to each chip of each line card board.

[0090] Among them, the host can determine the target detection board and the target detection chip on the target detection board by itself, and can select any line card board as the target detection board and any chip in the target detection board as the target detection chip.

[0091] As an example, select the line card with the smallest number as the target detection board, and select the chip with the smallest number in the target detection board as the target detection chip.

[0092] Subsequently, the CCM messages with specific CCM session identifiers are aggregated to the target detection chip on the target detection board, and the target detection chip records the number of CCM messages received.

[0093] It should be noted that when counting the number of CCM messages, it is necessary to count separately for different CCM session identifiers, that is, CCM messages with different CCM session identifiers are counted separately. Therefore, different CCM session identifiers correspond to different counting indexes, and the two are in a one-to-one correspondence.

[0094] The counting index is determined by the host. After receiving the CMM message with the new CCM session identifier reported by the chip, the host will determine a new counting index based on the new CCM session identifier. When the table entry is issued, the counting index will be carried in the table lookup result.

[0095] Furthermore, for the CCM message with the new CCM session identifier, the host needs to specify the target detection board and the target detection chip, the purpose of which is to aggregate all the CCM messages with the CCM session identifier to the target detection chip of the target detection board for counting.

[0096] Subsequently, the session continuity test is performed by accessing the count value counted by the target detection chip. If no change in the count value is detected within a certain period of time (for example, 35ms), it can be confirmed that the session continuity test has failed and the link is faulty.

[0097] As an example, a timer is set inside the chip, and the timer is reset after detecting a change in the count value. If the timer times out and no change in the count value is detected, a link failure is confirmed.

[0098] After the host specifies the target detection board and the target detection chip, since the corresponding CCM messages may be received from different line card boards, it is necessary to send hash table entries for each chip of each line card board. The sent hash table entries include the identifiers and count indexes of the target detection board and the target detection chip, as well as the local identifier of the detection chip.

[0099] Among them, in the hash table items sent to different chips, the identifiers and count indexes of the target detection board and the target detection chip are the same, but the local identification of the detection chip is different. Specifically, the local identification of the detection chip is set in the table lookup result of the hash table item corresponding to the target detection chip; the local identification of the detection chip is not set in the table lookup result of the hash table item corresponding to other detection chips.

[0100] As an example, device A includes line card board 1, line card board 2, and line card board 3, each line card board includes 3 chips. If the host of device A specifies line card board 1 as the target detection board, chip0 included in line card board 1 is used as the target detection chip. After the hash table entry is sent, only the local detection chip identifier is set in the table lookup result of the hash table entry corresponding to chip0 of line card board 1; the local detection chip identifier is not set in the table lookup result of the hash table entry corresponding to other detection chips.

[0101] For example, the CCM session identifier is recorded as X, and a hash operation is performed based on X to obtain Y. A table lookup is performed based on Y, and a table lookup is performed based on the hash table item corresponding to chip0 of line card board 1. The result is recorded as y0, and the bit corresponding to the local identifier of the detection chip in y0 is "1". A table lookup is performed based on the hash table items corresponding to other chips, and the result is recorded as ym, and the bit corresponding to the local identifier of the detection chip in ym is "0".

[0102] Therefore, after performing a hash table lookup based on the CCM session identifier, only the local identification of the detection chip in the table lookup result of chip0 is set, so chip0 confirms that it is the target detection chip, and the value of the packet receiving count can be directly accumulated according to the counting index. The local identification of the detection chip in the table lookup results of other chip0s is not set, that is, other chip0s confirm that they are not the target detection chip. Since the table lookup results also include the identifiers of the target detection board and the target detection chip, after encapsulating the first message header, the message can be transparently transmitted to the target detection chip on the target detection board according to the identifier.

[0103] It can be seen that in the embodiment of the present application, when the host sends hash table entries to each chip of each line card board, only the local identification of the detection chip in the lookup result of the hash table entry corresponding to the target detection chip is set, thereby ensuring that after other chips receive the corresponding CCM message, they confirm that they are not the target detection chip, and transmit the message to the target detection chip, so as to realize the aggregation of all CCM messages with a specific CCM session identifier to the same chip of the same line card board for statistics, and the whole process does not involve multicast and message replication, thereby ensuring that there are no large number of redundant replicated messages between the chips of each line card board, thereby avoiding the impact of attack messages from the source.

[0104] The embodiment of the present application also provides a method for detecting the continuity of a session state, which can be applied to an electronic device, and specifically to a host in a forwarding device.

[0105] See also Figure 3 , the method comprises the following steps:

[0106] S301: Receive a continuity detection message reported by a chip, and determine a target detection board, a target detection chip, and a counting index according to a continuity detection session identifier carried in the continuity detection message; the continuity detection session identifier includes a maintenance port identifier and a maintenance entity group identifier.

[0107] The combination of the maintenance port identifier and the maintenance entity group identifier can uniquely identify the CCM session. The maintenance port identifier is the MEP ID, and the maintenance entity group identifier is the MEG. The MEG is composed of the MD and the MA in a certain format.

[0108] As described above, if the chip performs a hash table lookup operation based on the CCM session identifier, the result obtained is: the hash table entry cannot be hit, that is, the table lookup result cannot be obtained. This means that the host has not yet issued a hash table entry for the CCM session identifier.

[0109] At this time, the chip reports the CMM message to the host, which determines the target detection board and the target detection chip, and sends hash table entries to each chip of each line card board.

[0110] The host can determine the target detection board and the target detection chip on the target detection board by itself, and can select any line card board as the target detection board and any chip in the target detection board as the target detection chip.

[0111] Subsequently, the CCM messages with specific CCM session identifiers are aggregated to the target detection chip on the target detection board, and the target detection chip records the number of CCM messages received.

[0112] It should be noted that when counting the number of CCM messages, it is necessary to count separately for different CCM session identifiers, that is, CCM messages with different CCM session identifiers are counted separately. Therefore, different CCM session identifiers correspond to different counting indexes, and the two are in a one-to-one correspondence.

[0113] The counting index is determined by the host. After receiving the CMM message with the new CCM session identifier reported by the chip, the host determines a new counting index according to the new CCM session identifier.

[0114] S302: A hash table entry with a continuity detection session identifier as a key value is issued to each chip of each line card board, wherein the lookup result of the hash table entry includes: a local identifier of the detection chip, identifiers of the target detection board and the target detection chip, and a counting index; wherein the local identifier of the detection chip is set in the lookup result of the hash table entry corresponding to the target detection chip; and the local identifier of the detection chip is not set in the lookup result of the hash table entry corresponding to other detection chips.

[0115] After the host specifies the target detection board and the target detection chip, since the corresponding CCM messages may be received from different line card boards, it is necessary to send hash table entries for each chip of each line card board. The sent hash table entries include the identifiers and count indexes of the target detection board and the target detection chip, as well as the local identifier of the detection chip.

[0116] Among them, in the hash table items sent to different chips, the identifiers and count indexes of the target detection board and the target detection chip are the same, but the local identification of the detection chip is different. Specifically, the local identification of the detection chip is set in the table lookup result of the hash table item corresponding to the target detection chip; the local identification of the detection chip is not set in the table lookup result of the hash table item corresponding to other detection chips.

[0117] Therefore, after the hash table entry is issued for the CCM session identifier a, no matter which chip of which line card receives the CCM message corresponding to the CCM session identifier a, a hash table lookup operation can be performed, and the hash table entry can be hit to obtain the table lookup result.

[0118] In an embodiment of the present application, the host sends a hash table entry with the CCM session identifier as the key value to each chip of each line card board, so that the chip receives the CCM message, performs a hash table lookup operation according to the CCM session identifier carried in the CCM message, hits the hash table entry stored in itself, and obtains the table lookup result; if the local identifier of the detection chip in the table lookup result indicates that it is not the target detection chip, the first message header is encapsulated in the CCM message and transmitted to the target detection chip on the target detection board; the first message header carries a counting index; if the local identifier of the detection chip in the table lookup result indicates that it is the target detection chip, the value of the packet reception count is accumulated according to the counting index.

[0119] It can be seen that the session state continuity detection method provided in the embodiment of the present application does not use the multicast replication mechanism, ensuring that there are no large amounts of redundant replication messages between line cards and chips, thus avoiding the impact of attack messages from the source. This saves bandwidth for cross-chip transmission within the device, reduces the impact of attack flows on normal services, and improves the device's anti-attack capability and overall stability.

[0120] In one embodiment of the present application, the method for detecting continuity of session status further includes: for the CCM session identifier, accessing the packet receiving count value recorded by the target detection chip based on the counting index, and performing continuity detection of the session status according to the change of the packet receiving count value.

[0121] Specifically, each CCM session identifier corresponds to a counting index. The host accesses the value of the packet receiving count recorded by the target detection chip based on the counting index. If the value of the packet receiving count does not change within a certain period of time, it means that the target detection chip of the target detection board has not received the CCM message sent by the remote MEP within a certain period of time, then it is confirmed that there is a problem with the link, and the associated upper-layer application can be notified or the alarm log can be output.

[0122] For example, the host sets a 35ms timer. If a change is detected in the value of the packet receiving count during the time period, the timer is reset, indicating that the CCM session state is maintained. If no change is detected in the value of the packet receiving count after the timer times out, a link failure is confirmed.

[0123] See also Figure 4 , is a structural diagram of a CCM message counting device provided in an embodiment of the present application, comprising the following modules:

[0124] The table lookup module 401 is used to perform a hash table lookup operation according to the CCM session identifier carried in the CCM message when a continuity detection CCM message is detected, and obtain a table lookup result if a hash table item stored in the CCM message is hit; the CCM session identifier includes a maintenance port identifier and a maintenance entity group identifier; the table lookup result includes a detection chip local identifier, an identifier of a target detection board and a target detection chip, and a counting index;

[0125] The transparent transmission module 402 is used to encapsulate a first message header in the CCM message and transparently transmit it to the target detection chip on the target detection board if the local identification of the detection chip indicates that it is not the target detection chip; the first message header carries the counting index.

[0126] It can be seen that the counting device of the CCM message provided in the embodiment of the present application, when detecting the reception of the continuity detection CCM message, performs a hash table lookup operation according to the CCM session identifier carried in the CCM message, and if the hash table item stored in itself is hit, the table lookup result is obtained; the CCM session identifier includes the maintenance port identifier and the maintenance entity group identifier; the table lookup result includes the local identifier of the detection chip, the identifier of the target detection board and the target detection chip, and the counting index; if the local identifier of the detection chip indicates that it is not the target detection chip, the first message header is encapsulated in the CCM message and transmitted to the target detection chip on the target detection board; the first message header carries the counting index.

[0127] Therefore, when the chip receives a CCM message, it does not need to send it to the multicast group, and thus does not use the multicast replication mechanism. Instead, it uses the message transparent transmission method to transparently transmit the CCM message to the target detection chip. This ensures that there are no redundant duplicate messages between each line card board and each chip, and avoids the impact of attack messages from the source. This saves the bandwidth of cross-chip transmission within the device, reduces the impact of attack flows on normal services, and improves the device's anti-attack performance and overall stability.

[0128] In addition, the CCM message encapsulated with the first message header is transparently transmitted to the target detection chip, and the target detection chip directly reads the count index in the first message header to accumulate the packet receiving count without the need for hash table lookup, thus saving the processing flow.

[0129] In one embodiment of the present application, a first accumulation module is further included, which is used to accumulate the value of the packet reception count according to the counting index if the local identification of the detection chip indicates that it is a target detection chip.

[0130] In one embodiment of the present application, a reporting module is further included, which is used to:

[0131] If the hash table item stored in the host is not hit, the CCM message is reported to the host so that the host determines the target detection board and the target detection chip, and sends the hash table item to each chip located on each line card board; the key value of the hash table item is the CCM session identifier, and the table lookup result of the hash table item includes: the local identifier of the detection chip, the identifier of the target detection board and the target detection chip, and the counting index;

[0132] Among them, the local identification of the detection chip is set in the table lookup result of the hash table item corresponding to the target detection chip; the local identification of the detection chip is not set in the table lookup result of the hash table item corresponding to other detection chips.

[0133] It can be seen that in the embodiment of the present application, when the host sends hash table entries to each chip of each line card board, only the local identification of the detection chip in the lookup result of the hash table entry corresponding to the target detection chip is set, thereby ensuring that after other chips receive the corresponding CCM message, they confirm that they are not the target detection chip, and transmit the message to the target detection chip, so as to realize the aggregation of all CCM messages with a specific CCM session identifier to the same chip of the same line card board for statistics, and the whole process does not involve multicast and message replication, thereby ensuring that there are no large number of redundant replicated messages between the chips of each line card board, thereby avoiding the impact of attack messages from the source.

[0134] In one embodiment of the present application, it also includes:

[0135] The second accumulation module is used to accumulate the packet reception count value according to the count index carried in the first message header when it is detected that the continuity check CCM message carrying the first message header is received.

[0136] See also Figure 5 , a session state continuity detection device provided in an embodiment of the present application, the device includes:

[0137] The receiving module 501 is used to receive the continuity detection CCM message reported by the chip, and determine the target detection board, the target detection chip and the counting index according to the CCM session identifier carried in the CCM message; the CCM session identifier includes a maintenance port identifier and a maintenance entity group identifier;

[0138] The sending module 502 is used to send a hash table item with the CCM session identifier as a key value to each chip of each line card board, wherein the lookup result of the hash table item includes: a local identification of the detection chip, an identifier of the target detection board and the target detection chip, and a counting index;

[0139] Among them, the local identification of the detection chip is set in the table lookup result of the hash table item corresponding to the target detection chip; the local identification of the detection chip is not set in the table lookup result of the hash table item corresponding to other detection chips.

[0140] It can be seen that the session state continuity detection method provided in the embodiment of the present application does not use the multicast replication mechanism, ensuring that there are no large amounts of redundant replication messages between line cards and chips, thus avoiding the impact of attack messages from the source. This saves bandwidth for cross-chip transmission within the device, reduces the impact of attack flows on normal services, and improves the device's anti-attack capability and overall stability.

[0141] In one embodiment of the present application, the device further includes:

[0142] The continuity detection module is used to access the packet receiving count value recorded by the target detection chip based on the count index for the CCM session identifier, and perform continuity detection of the session state according to the change of the packet receiving count value.

[0143] See also Figure 6 , is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application, including a processor 601, a communication interface 602, a memory 603 and a communication bus 604, wherein the processor 601, the communication interface 602, and the memory 603 communicate with each other through the communication bus 604;

[0144] Memory 603, used for storing computer programs;

[0145] The processor 601 is used to implement any step of the aforementioned CCM message counting method or session state continuity detection method when executing the program stored in the memory 603.

[0146] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0147] The communication interface is used for communication between the above electronic device and other devices.

[0148] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0149] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0150] In another embodiment of the present invention, a computer-readable storage medium is provided, which stores a computer program. When the computer program is executed by a processor, the steps of any of the above-mentioned CCM message counting methods or session status continuity detection methods are implemented.

[0151] In another embodiment of the present invention, a computer program product comprising instructions is provided. When the computer program product is run on a computer, the computer executes the steps of any CCM message counting method or session status continuity detection method in the above embodiments.

[0152] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive Solid State Disk (SSD)), etc.

[0153] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0154] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, electronic device, computer-readable storage medium, and computer program product embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.

[0155] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims

1. A method for counting CCM messages, characterized in that: The method comprises: When it is detected that a continuity detection CCM message is received, a hash table lookup operation is performed according to the CCM session identifier carried in the CCM message, and if a hash table item stored in the CCM message is hit, a table lookup result is obtained; the CCM session identifier includes a maintenance port identifier and a maintenance entity group identifier; the table lookup result includes a detection chip local identifier, an identifier of a target detection board and a target detection chip, and a counting index; If the local identification of the detection chip indicates that it is not the target detection chip, a first message header is encapsulated in the CCM message and transparently transmitted to the target detection chip on the target detection board; the first message header carries the counting index; If the local identification of the detection chip indicates that it is a target detection chip, the value of the packet receiving count is accumulated according to the counting index.

2. The method according to claim 1, characterized in that The method further comprises: If the hash table item stored in the host is not hit, the CCM message is reported to the host so that the host determines the target detection board and the target detection chip, and sends the hash table item to each chip located on each line card board; the key value of the hash table item is the CCM session identifier, and the table lookup result of the hash table item includes: the local identifier of the detection chip, the identifier of the target detection board and the target detection chip, and the counting index; Among them, the local identification of the detection chip is set in the table lookup result of the hash table item corresponding to the target detection chip; the local identification of the detection chip is not set in the table lookup result of the hash table item corresponding to other detection chips.

3. The method according to claim 1 or 2, characterized in that: The method further comprises: When it is detected that a continuity check CCM message carrying the first message header is received, a packet reception count value is accumulated according to the count index carried in the first message header.

4. A method for detecting the continuity of a session state, characterized in that: The method comprises: Receive a continuity detection CCM message reported by the chip, and determine the target detection board, target detection chip and counting index according to the CCM session identifier carried in the CCM message; the CCM session identifier includes a maintenance port identifier and a maintenance entity group identifier; A hash table entry with the CCM session identifier as the key value is issued to each chip of each line card board, wherein the table lookup result of the hash table entry includes: the local identifier of the detection chip, the identifier of the target detection board and the target detection chip, and the counting index; so that the chip receives the CCM message, performs a hash table lookup operation according to the CCM session identifier carried in the CCM message, hits the hash table entry stored in itself, and obtains the table lookup result; if the local identifier of the detection chip in the table lookup result indicates that it is not the target detection chip, encapsulates the first message header in the CCM message, and transparently transmits it to the target detection chip on the target detection board, and the first message header carries the counting index; if the local identifier of the detection chip in the table lookup result indicates that it is the target detection chip, the value of the packet reception count is accumulated according to the counting index; Among them, the local identification of the detection chip is set in the table lookup result of the hash table item corresponding to the target detection chip; the local identification of the detection chip is not set in the table lookup result of the hash table item corresponding to other detection chips.

5. The method according to claim 4, characterized in that The method further comprises: For the CCM session identifier, the packet receiving count value recorded by the target detection chip is accessed based on the count index, and the continuity detection of the session state is performed according to the change of the packet receiving count value.

6. A CCM message counting device, characterized in that: The device comprises: A table lookup module is used to perform a hash table lookup operation according to the CCM session identifier carried in the CCM message when a continuity detection CCM message is detected, and obtain a table lookup result if a hash table item stored in the module is hit; the CCM session identifier includes a maintenance port identifier and a maintenance entity group identifier; the table lookup result includes a detection chip local identifier, an identifier of a target detection board and a target detection chip, and a counting index; A transparent transmission module is used to encapsulate the first message header in the CCM message and transparently transmit it to the target detection chip on the target detection board if the local identification of the detection chip indicates that it is not the target detection chip; the first message header carries the counting index; if the local identification of the detection chip indicates that it is the target detection chip, the value of the packet receiving count is accumulated according to the counting index.

7. A session state continuity detection device, characterized in that: Applied to a host, the device comprises: A determination module, configured to determine a target detection board, a target detection chip and a counting index according to a CCM session identifier carried in the CCM message after receiving a continuity detection CCM message reported by the chip; the CCM session identifier includes a maintenance port identifier and a maintenance entity group identifier; A sending module is used to send hash table items with the CCM session identifier as the key value to each chip of each line card board, wherein the table lookup result of the hash table item includes: the local identifier of the detection chip, the identifier of the target detection board and the target detection chip, and the counting index; so that the chip receives the CCM message, performs a hash table lookup operation according to the CCM session identifier carried in the CCM message, hits the hash table item stored in itself, and obtains the table lookup result; if the local identifier of the detection chip in the table lookup result indicates that it is not the target detection chip, encapsulates the first message header in the CCM message, and transparently transmits it to the target detection chip on the target detection board, and the first message header carries the counting index; if the local identifier of the detection chip in the table lookup result indicates that it is the target detection chip, accumulates the value of the packet reception count according to the counting index; Among them, the local identification of the detection chip is set in the table lookup result of the hash table item corresponding to the target detection chip; the local identification of the detection chip is not set in the table lookup result of the hash table item corresponding to other detection chips.

8. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 1-3 or 4-5 when executing a program stored in a memory.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of claims 1-3 or 4-5 are implemented.

Citation Information

Patent Citations

  • Method and apparatus for transmitting continuous check information message

    CN101355466A

  • System, apparatus and method for transmitting and receiving check information message continuously

    CN101378333A