Alarm method, electronic device, readable medium and computer program product
By obtaining the identifier and channel identifier from the network element interface to generate alarm data, the problem of difficulty in monitoring individual network elements within the service channel between network elements in the existing technology is solved, realizing flexible alarm data transmission and monitoring, and reducing network overhead and redundancy.
Patent Information
- Application Number
- CN202410846199.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-26
- Publication Date
- 2025-12-26
AI Technical Summary
Existing technologies make it difficult to flexibly monitor individual network elements within the service channels between network elements, and end-to-end link monitoring methods increase network overhead and redundant alarm information.
By obtaining the interface identifier and the channel identifier of the service channel from the abnormal interface of the first network element, alarm data is generated and sent to the second network element in the service channel. The alarm data is transmitted using the switching chip of the Ethernet interface board, thus avoiding end-to-end link monitoring.
It enables flexible monitoring of network elements within the service channel, reduces network overhead and redundant alarm information, and improves the coverage and accuracy of alarm data.
Smart Images

Figure CN121217533A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of data processing, and in particular, to an alarm method, an electronic device, a readable medium, and a computer program product. BACKGROUND
[0002] A network element is a basic concept in communication technology, which is composed of one or more machine plates or machine frames and can independently complete certain transmission functions. In a network management system, a network element can be understood as an element and device in a network, and is the smallest unit that can be monitored and managed in a network management system. For example, a network element can include a provider edge (PE) network element, a customer edge (CE) network element, and various types.
[0003] Among them, through the communication between adjacent network elements, the network transmission of data content can be realized. Considering that the connection link between a network element and its adjacent network element may fail, in order to avoid the communication being affected due to the link failure, the link state of the connection link between any two network elements needs to be monitored, and an alarm is triggered when a link failure is monitored. However, in the related art, only end-to-end link monitoring for two network elements can be performed, and it is difficult to conveniently perform link monitoring setting on the network element interfaces involved in the entire service channel. SUMMARY
[0004] The present disclosure provides an alarm method, an electronic device, a readable medium, and a computer program product.
[0005] In a first aspect, an embodiment of the present disclosure provides an alarm method suitable for a first network element, which includes:
[0006] In a case where it is detected that a first interface in the first network element is abnormal, an interface identifier of the first interface and a channel identifier of a service channel corresponding to the first interface are acquired;
[0007] Alarm data containing the interface identifier and the channel identifier are generated, and the alarm data are sent to a second network element in the service channel through a second interface in the first network element.
[0008] In a second aspect, an embodiment of the present disclosure provides an alarm method suitable for a second network element, which includes:
[0009] Alarm data from a first network element are acquired; the alarm data are generated based on the above method;
[0010] According to an interface identifier and a channel identifier of a service channel contained in the alarm data, alarm information is generated and reported.
[0011] In a third aspect, an electronic device is provided, which includes a memory and a processor. The memory stores a computer program executable by the processor. The computer program, when executed by the processor, implements the permission management method described above.
[0012] In a fourth aspect, a computer readable medium is provided, which stores a computer program. The computer program, when executed by a processor, implements the permission management method described above.
[0013] In a fifth aspect, a computer program product is provided, which includes a computer program. The computer program, when executed by a processor, implements the permission management method described above.
[0014] The first network element in the embodiments of the present disclosure can acquire the interface identifier of the first interface and the channel identifier of the service channel corresponding to the first interface when detecting that the first interface is abnormal, and generate alarm data containing the interface identifier and the channel identifier, so as to send the alarm data to the second network element in the service channel through the second interface in the first network element. This way can send alarm data through the second interface of the first network element when the first interface of the first network element is abnormal, compared with the end-to-end link monitoring method, this way is convenient for monitoring a single network element in a service channel. In other words, this way does not need to take the end-to-end link as the monitoring object, but can directly take a certain interface in a certain network element as the monitoring object, so that the monitoring range is more flexible. Moreover, through the channel identifier of the service channel corresponding to the first interface, the alarm data can be transmitted in the service channel, so that the alarm data can be transmitted to the second network element in the service channel, so as to ensure that other network elements in the service channel receive the alarm data in time. BRIEF DESCRIPTION OF DRAWINGS
[0015] In the drawings of the embodiments of the present disclosure:
[0016] Figure 1 A flowchart of an alarm method provided by the embodiments of the present disclosure is shown;
[0017] Figure 2 A flowchart of an alarm method provided by another embodiment of the present disclosure is shown;
[0018] Figure 3 A communication network architecture diagram implemented based on EFM and CFM is shown;
[0019] Figure 4 A flowchart of an alarm method on the first network element side is shown;
[0020] Figure 5 A flowchart of an alarm method on the second network element side is shown;
[0021] Figure 6 A structural schematic diagram of an electronic device is provided for the embodiments of the present disclosure. DETAILED DESCRIPTION
[0022] To make the skilled in the art better understand the technical solutions of the present disclosure, the embodiments of the present disclosure are described in detail below in combination with the drawings.
[0023] The present disclosure will be described more fully hereinafter with reference to the accompanying drawings, in which embodiments of the present disclosure are shown. The present disclosure may, however, be embodied in different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the present disclosure to those skilled in the art.
[0024] The accompanying drawings, which are included to provide a further understanding of the present disclosure and constitute a part of this specification, illustrate embodiments of the present disclosure and together with the detailed description serve to explain the present disclosure. The above and other features and advantages of the present disclosure will become more apparent from the following detailed description, taken in conjunction with the accompanying drawings.
[0025] The present disclosure can be described with reference to plan views and / or cross-sectional views by way of idealized schematic illustrations of the present disclosure. Consequently, the example illustrations can vary depending on the manufacturing technology and / or tolerances.
[0026] The embodiments of the present disclosure and the features in the embodiments can be combined with each other if there is no conflict.
[0027] The terms used in the present disclosure are only used to describe particular embodiments and are not intended to limit the present disclosure. As used in the present disclosure, the term "and / or" includes any and all combinations of one or more of the associated listed items. As used in the present disclosure, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. As used in the present disclosure, the terms "comprises," "comprising," "includes," "including," "has," "having," and the like are intended to be open-ended terms that specifically permit the presence of one or more other features, integers, steps, operations, elements, and / or groups thereof, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, and / or groups thereof.
[0028] Unless otherwise defined, all terms used in the present disclosure, including technical and scientific terms, have the same meaning as those commonly understood by one of ordinary skill in the art. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the relevant art and the present disclosure, and will not be interpreted in an overly idealized or overly formal sense unless expressly so defined herein.
[0029] The present disclosure is not limited to the embodiments shown in the drawings, but includes modifications of the configuration formed based on a manufacturing process. Therefore, the regions exemplified in the drawings have a schematic property, and the shape of the regions shown in the drawings exemplifies a specific shape of a region of an element, but is not intended to be restrictive.
[0030] In some related technologies, in order to avoid the communication from being affected due to link failure, it is necessary to monitor the link state of the connection link between any two network elements and trigger an alarm when a link failure is monitored: for example, in a manner of end-to-end connectivity fault detection, two network elements can be configured based on end-to-end, so that a connectivity detection packet is periodically sent between the two network elements, and then it is judged whether an end-to-end link failure occurs according to the reception of the connectivity detection packet. However, in the above manner, the operation of periodically sending the connectivity packet will inevitably occupy a certain bandwidth, thereby increasing the network overhead. Moreover, this manner can only perform end-to-end link monitoring for two network elements, and it is difficult to perform separate monitoring for a single network element contained in a service channel.
[0031] To solve the above problems, the present application provides an alarm method, an electronic device, a readable medium and a computer program product.
[0032] In a first aspect, the embodiments of the present disclosure provide an alarm method. Figure 1 A flowchart of an alarm method provided by the embodiments of the present disclosure. The alarm method is mainly applied to a first network element. As shown in the figure, the method comprises the following steps: Figure 1
[0033] Step S110: In a case where it is detected that a first interface in the first network element appears abnormal, obtaining an interface identifier of the first interface and a channel identifier of a service channel corresponding to the first interface.
[0034] The first network element can be any network element in the service channel to be monitored. In this embodiment, interface monitoring can be performed for any network element in the service channel based on the service channel. The first interface is any abnormal interface in the first network element, and the interface monitoring function can be realized through various interface monitoring mechanisms.
[0035] In a case where it is determined that the first interface in the first network element appears abnormal, the interface identifier of the first interface and the channel identifier of the service channel corresponding to the first interface are obtained. The interface identifier of the first interface is used to uniquely identify the first interface, and the interface identifier can be determined according to the network element identifier of the first network element where the first interface is located, the single board slot number where the first interface is located, the interface number of the first interface, etc. The service channel corresponding to the first interface refers to the channel corresponding to the service configured in advance for the first interface, and the channel identifier can be a virtual local area network identifier (VID) of the service channel.
[0036] Step S120: generating alarm data containing the interface identifier and the channel identifier, and sending the alarm data to the second network element in the service channel through the second interface in the first network element.
[0037] The alarm data can be an alarm message, an alarm frame, or other forms. The alarm data contains the interface identifier and the channel identifier. The interface identifier is used to locate the abnormal network element interface, and the channel identifier is used to enable the alarm data to be transmitted in the corresponding service channel, so that other network elements in the service channel corresponding to the channel identifier receive the alarm data.
[0038] The second network element in the service channel refers to other network elements in the service channel except the first network element, and the number of second network elements is usually multiple. Therefore, the alarm data can be transmitted between multiple network elements contained in the service channel, so that multiple network elements in the service channel can trigger an alarm, and the maintainer can quickly notice the abnormal situation in the service channel.
[0039] In the embodiments of the present disclosure, in the case that the first interface of the first network element is abnormal, the alarm data can be sent through the second interface of the first network element. Compared with the end-to-end link monitoring mode, this mode facilitates individual monitoring of a single network element in a service channel. In other words, this mode does not need to take the end-to-end link as the monitoring object, but can directly take a certain interface in a certain network element as the monitoring object, so that the monitoring range is more flexible. Moreover, through the channel identifier of the service channel corresponding to the first interface, the alarm data can be transmitted in the service channel, so that the alarm data can be transmitted to the second network element in the service channel, to ensure that other network elements in the service channel receive the alarm data in time.
[0040] In some embodiments, the alarm data can be an alarm frame. By setting a preset field in the alarm frame for representing the type of the alarm frame, the type of the alarm frame can be represented as an alarm frame, thereby being distinguished from ordinary service frames or data frames. Optionally, the preset field can be composed of two associated fields. For example, the frame header of the alarm frame includes a first preset field and a second preset field associated with the first preset field. The first preset field can be a media access control (MAC) address field, and the second preset field can be an Ethernet type field. The field value of the MAC address field is determined according to a first preset protocol, and the field value of the Ethernet type field is determined according to a second preset protocol. Since the two associated fields are respectively assigned values based on different protocols, the alarm frame can be avoided from being mistaken for a certain known type of service frame or data frame, thereby ensuring that the alarm frame can be accurately identified as a digital frame of the alarm type. The alarm frame is a special data frame containing alarm information defined in the present disclosure.
[0041] In an alternative implementation, the first preset protocol is a slow protocol, and the second preset protocol is another protocol different from the slow protocol. Correspondingly, the field value of the MAC address field can be "01-80-c2-00-00-02", and the field value of the Ethernet type field can be "0x880a" to distinguish from 0x8809 of the slow protocol.
[0042] In some embodiments, the MAC address field includes a source MAC address field and a destination MAC address field, wherein the field value of the destination MAC address field is determined according to the first preset protocol, and the source MAC address field is determined according to the MAC address of the first network element. In addition, the frame header of the alarm frame further includes a channel identifier of a service channel corresponding to the first interface, which can be implemented based on a QinQ protocol. The frame content of the alarm frame includes an interface identifier of the first interface and a service identifier corresponding to the service channel. The service identifier can be a service ID, etc., which can quickly and uniquely identify a service.
[0043] In some embodiments, multiple services can be configured on the same interface, and accordingly, the interface corresponds to multiple service channels. In this case, in order to ensure that other network elements in each service channel can receive corresponding alarm information, multiple alarm data need to be generated respectively for the multiple service channels.
[0044] In the case where the channel identifier of the service channel corresponding to the first interface is multiple, multiple alarm data corresponding to the multiple channel identifiers are generated, wherein the interface identifier included in each alarm data is the same. For each alarm data, the alarm data is sent to the second network element in the service channel corresponding to the channel identifier according to the channel identifier included in the alarm data. By generating alarm data corresponding to each service channel respectively, it can be ensured that the second network element in each service channel associated with the first interface can receive the alarm data, thereby improving the comprehensiveness of alarm data coverage.
[0045] In some embodiments, in order to ensure reliable reception of the alarm data, the alarm data is periodically sent to the second network element in the service channel in the case where the first interface is not detected to be restored to normal. By means of periodic sending, the alarm effect of the alarm data can be improved. In the case where the first interface is detected to be restored to normal, the sending of the alarm data is stopped. In this way, the generation and elimination of the alarm can be determined, thereby facilitating the elimination of the alarm information.
[0046] In some embodiments, the first network element is a network element implemented based on an Ethernet interface board; detecting that the first interface in the first network element is abnormal comprises: determining that the first interface in the first network element is abnormal in a case where an interface abnormality notification event triggered by an interface detection mechanism of the Ethernet interface board is received; and sending the alarm data to the second network element in the service channel comprises: sending the alarm data to the second network element in the service channel through a switching chip in the Ethernet interface board. The switching chip in the Ethernet interface board has a spontaneous packet function and can realize sending of the alarm data. In addition, interface detection is performed by means of the interface detection mechanism of the Ethernet interface board, without the need to send connectivity detection packets, so that the detection cost can be reduced.
[0047] In some embodiments, before detecting that the first interface in the first network element is abnormal, the method further comprises: configuring an alarm monitoring strategy for implementing the alarm method for a plurality of network elements in a service channel of a to-be-monitored service according to a channel identifier of the service channel. The channel identifier of the to-be-monitored service can be a virtual local area network identifier (VID). For example, the channel identifier can be a service tag of a virtual local area network. Accordingly, the service tag of the virtual local area network can be used to determine all network elements in the service channel of the to-be-monitored service, so as to configure the alarm monitoring strategy for all network elements in the service channel of the to-be-monitored service. It can be seen that, in this embodiment, the to-be-monitored service can be quickly configured with a unified monitoring strategy based on the channel identifier of the service channel, without the need to configure an end-to-end monitoring strategy for a communication link between any two network elements, so that the monitoring efficiency is improved. Accordingly, the first network element comprises any network element in the service channel, and the second network element comprises a plurality of network elements in the service channel except the first network element.
[0048] It can be seen that, by the above method, any network element in the service channel can transmit alarm data to any other network element in the service channel through the channel identifier of the service channel in a case where an interface of the network element is abnormal, so that the coverage of the alarm data is improved and the alarm effect is improved.
[0049] In a second aspect, the embodiments of the present disclosure provide an alarm method, which is mainly applied to a second network element. Figure 2 A flowchart of the alarm method is shown. As shown in Figure 2 The method comprises the following steps:
[0050] Step S210: Obtain alarm data from a first network element.
[0051] The alarm data can be based on Figure 1The method shown is generated. The execution subject of this step can be any network element (i.e. the second network element) in the service channel corresponding to the channel identification contained in the alarm data. Since the alarm data can be forwarded by each network element in the corresponding service channel based on the channel identification, the alarm data is forwarded layer by layer and can be transmitted to each network element in the service channel.
[0052] Step S220: generating and reporting alarm information according to the interface identification contained in the alarm data and the channel identification of the service channel.
[0053] The second network element generates alarm information according to the interface identification contained in the alarm data and the channel identification of the service channel, and reports the generated alarm information to the host computer to achieve the alarm purpose.
[0054] In some embodiments, generating and reporting alarm information according to the interface identification contained in the alarm data and the channel identification of the service channel includes: in the case of receiving multiple alarm data containing the same interface identification, obtaining the channel identification of multiple service channels contained in the multiple alarm data; generating and reporting alarm information according to the interface identification and the channel identification of the multiple service channels; wherein the alarm information includes the interface identification and multiple service identifications corresponding to the multiple service channels. Wherein, the multiple service identifications can be the identification IDs of the multiple services. As can be seen, in the case that multiple alarm data corresponding to different service channels (i.e. corresponding to different service identifications) are generated at the same interface, the second network element merges the multiple alarm data corresponding to different service channels (i.e. corresponding to different service identifications) according to the interface identification, so that only one alarm information is generated at the same interface, and the identification IDs of the multiple services corresponding to the interface are included in the alarm information, thereby reducing the number of alarm information and reducing information redundancy.
[0055] In some embodiments, after generating and reporting alarm information, the following operation is further performed: if the time interval between the current time and the time when the alarm data was last received is greater than a preset interval threshold, the alarm information is cleared; wherein the preset interval threshold is greater than a preset sending threshold at which the alarm data is periodically sent. As can be seen, in this way, it is continuously judged whether the time interval between the current time and the time when the alarm data was last received is greater than the preset interval threshold, and the alarm information is cleared if the judgment result is yes. As mentioned above, the first network element will continuously and periodically send alarm data to the second network element in the service channel if the first interface has not recovered. Correspondingly, the second network element in the service channel will continuously and periodically receive alarm data if the first interface has not recovered. Once the second network element no longer receives alarm data, it means that the first interface has recovered. Through this way, the generation and disappearance of faults can be accurately judged.
[0056] In some embodiments, the alarm data from the first network element is acquired by: in the case of detecting the alarm data from the first network element, matching the alarm data with a pre-configured access control list (ACL); in the case of successful matching, acquiring the alarm data. The access control list includes the following: a MAC address field determined according to a first preset protocol, an Ethernet type field determined according to a second preset protocol, and a channel identifier field of the service channel. The second network element can receive various data transmitted in the service channel, but considering that there are many types of data transmitted in the service channel, in order to avoid processing irrelevant data, the second network element determines whether the detected data needs to be processed by the network element through the access control list. Specifically, the received alarm data is matched with each item in the pre-configured access control list, and in the case of successful matching, the alarm data is acquired and processed. The ACL stores the MAC address field determined according to the first preset protocol and the Ethernet type field determined according to the second preset protocol, and by means of the combination of the two fields, it can be determined whether the data type is the preset alarm type. In addition, the ACL also stores the channel identifier field of the service channel, according to which the second network element can determine whether to acquire and process the alarm data, so as to avoid processing irrelevant data.
[0057] In order to facilitate understanding, the following describes the alarm method in the embodiment by taking an example.
[0058] The example proposes a method of transmitting the connection failure alarm of the network interface between network elements based on QinQ service on the Ethernet interface board of the OTN / PTN device, thereby providing a basis for rapid positioning in the service interruption fault scenario.
[0059] Under the background of the increasing application scale of wavelength division networks and bearer networks, a customer service private line may need to cross multiple network elements, or even multiple operator networks. If a network interface of a network element carrying a user service private line fails, the fault network element usually reports an alarm for positioning the interface. From the perspective of service maintenance, because the user service crosses multiple network elements, when the service is interrupted or switched, the maintainer may not immediately notice that the network interface of a network element carrying the user service has an alarm.
[0060] In the related art, in order to realize the interface connection failure detection and fault notification of Ethernet, EFM OAM (Ethernet in the First Mile OAM) complying with IEEE 802.3ah protocol and Ethernet CFM (Connectivity Fault Management) complying with IEEE 802.1ag protocol can be used. However, both of the above two technologies can only provide end-to-end connectivity fault detection, and the alarm reported thereby is only applicable to end-to-end node network elements. Moreover, both of the above two technologies need to periodically send connectivity detection messages regardless of whether the service link is connected or interrupted. It can be seen that the above two methods at least have the following defects:
[0061] (1) If there are multiple Ethernet nodes in a service, end-to-end configuration needs to be performed for each two Ethernet nodes in the service, i.e., the monitoring for all Ethernet nodes in a service can be realized through multiple end-to-end configurations;
[0062] (2) In order to realize end-to-end link detection, connectivity detection messages need to be periodically sent for each service, and the connectivity detection messages need to be periodically sent regardless of whether the link is normal or not, thus occupying a certain bandwidth;
[0063] (3) If the network interface of a node fails and there are multiple services on the node, an alarm information will be reported for each service when the alarm information is reported, thus causing redundant reporting of alarm information and increasing the processing complexity of the host computer.
[0064] In order to solve the above problems, the present example proposes a lightweight link interface detection technology, which improves the following points in view of the defects of EFM OAM and CFM:
[0065] (1) Configuration does not need to be performed for two end-to-end nodes respectively, but a monitoring strategy can be configured on multiple network elements of a service channel at the same time based on the service channel, thus the alarm can be reported on the network element nodes (i.e., network elements with Ethernet interface boards) of the entire service path, thereby avoiding the defect of the above (1).
[0066] (2) When the service link interface is connected normally, no detection message will be sent, and the interface abnormality can be detected based on the interface detection mechanism, thereby avoiding the defect of the above (2).
[0067] (3) For the case of a network interface connection failure, the second network element only reports an alarm on the service node network element, and the alarm content contains the identification information of each affected service, i.e., the second network element can perform aggregation processing on the service identification in multiple alarm data sent by the same interface, so as to generate an alarm information containing multiple service identifications according to the aggregation result, thereby avoiding the above-mentioned defect (3) and reducing the processing complexity of the upper computer.
[0068] Figure 3 A communication network architecture diagram implemented based on EFM and CFM is shown as follows: Figure 3 As shown in the figure, a PE device is arranged at the core layer of the communication network, NPE, PE-AGG, UPE and other network devices are arranged at the CFM metropolitan area network access and aggregation layer, and a CE device used for being connected with a user terminal device is arranged at the EFM OAM layer. It is assumed that EFM and CFM are not used in the Figure 3 , but the method described in the present example is used. If the connection between the Ethernet interface of the CE network element and the user device fails, each Ethernet board on the entire service path from the CE network element to the core layer can report an interface alarm positioned at the CE network element.
[0069] The present example proposes a method that can transmit the alarm data of Ethernet interface connection failure across network elements. The method can transmit the interface connection failure alarm data on the Ethernet interface board of a certain network element on a service channel, so that if there is an interface connection failure alarm at one network element, each network element with an Ethernet interface board on the corresponding service path will report the alarm, thereby facilitating the maintainer to locate the fault as soon as possible. To achieve the above function, the present example proposes a new method. The general idea of the method is as follows: when a connection failure alarm occurs at the network interface of the Ethernet interface board, the alarm and location information are encapsulated into an Ethernet data frame (hereinafter referred to as an alarm frame), and then sent out from the other connection normal interfaces of the affected service; when the Ethernet interface board of other network elements on the service path receives the alarm frame, the alarm and location information are parsed and reported on the network element. It should be noted that if a certain network element on the service path does not support the Ethernet interface board, it cannot parse and report the alarm, but the network element will transmit the alarm frame to other network elements on the service path that support the Ethernet interface board.
[0070] Figure 4 A flowchart of the alarm method is shown as follows: Figure 4 As shown in the figure, the alarm method on the first network element side includes the following steps:
[0071] Step S401: In the case that the first interface in the first network element is detected to be abnormal, a pre-configured callback function is called to execute a preset monitoring processing strategy through the callback function.
[0072] Wherein, there will be an interface detection mechanism on the Ethernet interface board (such as L2 interface board), when a connection failure occurs in a certain interface, the interface detection mechanism can initiate an interface connection failure event notification; similarly, if the connection state of a certain interface changes from failure to success, the interface detection mechanism also initiates an interface connection success event notification. The present example is driven by the event notification of the change of the interface connection state to realize the sending enablement or closing of the alarm frame. For example, in the case that the interface connection failure event notification is detected, a pre-configured callback function is triggered, and the business function of the callback function is to execute the subsequent alarm data sending operation.
[0073] In order to achieve the above purpose, when creating a QinQ service, an alarm frame sending mechanism based on the interface implementation of the QinQ service needs to be established. As described above, the alarm frame sending enablement or closing is driven by the event notification, and a callback interface driven by the event notification needs to be registered, which functions to enable the periodic sending of the alarm frame when receiving the event notification of the connection failure of a certain interface of the service, and to send the alarm frame from other interfaces of the service which are connected normally; and to close the alarm frame sending when receiving the event notification of the connection success of the interface of the service. The sending interface of the alarm frame is usually provided by the SDK of the switching chip, and the frame format and content can be customized, and the sending interface number can be specified.
[0074] Step S402: The interface identifier of the first interface and the channel identifier of the service channel corresponding to the first interface are obtained through the above callback function.
[0075] Wherein, in the case that the interface connection failure event notification is detected, the callback function first obtains the interface identifier of the first interface, and judges whether there is a pre-configured service that needs to be alarmed on the corresponding interface, if yes, further obtains the related information of the pre-configured service on the first interface to realize the framing processing of the alarm frame.
[0076] Wherein, the interface identifier of the first interface can be represented by the MAC address of the first network element, the slot number of the single board where the first interface is located, and the interface number of the first interface. The channel identifier of the service channel can be represented by the virtual local area network identifier and the service ID of the service channel.
[0077] Step S403: Alarm data containing the above interface identifier and channel identifier is generated.
[0078] According to the interface identifier and the channel identifier, framing processing is performed, so that an alarm frame is encapsulated. The L2 frame header of the alarm frame needs to meet the following two requirements: (1) it can be distinguished from service packets and existing defined protocol packets, so as to avoid being mistaken as a service packet or a regular data packet; (2) it can be forwarded in a service channel. Based on the above two requirements, the L2 frame header of the alarm frame of the present example includes the following information:
[0079] (1) Destination MAC: 01-80-c2-00-00-02; wherein the frame header borrows the destination MAC of the slow protocol, so as to avoid the alarm frame being treated as a service packet on the terminal.
[0080] (2) Source MAC: the MAC address of the faulty network element, i.e. the MAC address of the first network element, used for uniquely identifying the first network element.
[0081] (3) Ether type: 0x880a; wherein the protocol type is 0x880a, mainly for distinguishing from 0x8809 of the slow protocol, so as to avoid the alarm frame being treated as a slow protocol packet.
[0082] (4) Channel identifier of the service channel corresponding to the first interface, i.e. VLAN tag: channel VID of the QinQ service on the first interface, ensuring that the message corresponding to the alarm frame can be forwarded in the service channel. Wherein, any message with a VLAN tag can be forwarded between multiple network elements included in the corresponding service channel. Since the QinQ service can be configured with an SVLAN translation, the VLAN tag of the alarm frame can be modified by the service during the forwarding process, but it does not affect the normal forwarding operation in the service channel.
[0083] In addition, the frame content of the alarm frame can include: network element ID of the first network element; board slot number; interface number of the first interface generating the alarm. Wherein, considering that different slots can have interfaces with the same number, therefore, an interface is identified by the slot number and the interface number. In addition, the frame content of the alarm frame can also include: service ID. With the service ID, the corresponding service can be quickly determined.
[0084] It should be noted that if the first interface corresponds to multiple to-be-monitored services, the channel identifier and service ID of the service channel of each to-be-monitored service need to be obtained respectively, and multiple alarm frames corresponding to the multiple to-be-monitored services need to be generated respectively. For example, in the case where the first interface corresponds to N to-be-monitored services, N alarm frames corresponding to the N to-be-monitored services are generated, wherein the channel identifier and service ID of the service channel of the to-be-monitored service in each alarm frame are different, but other information (such as destination MAC, source MAC, Ether type, network element ID of the first network element, board slot number, interface number of the first interface generating the alarm) in each alarm frame are all the same.
[0085] Step S404: sending the alarm data to the second network element in the service channel through a second interface in the first network element.
[0086] The second interface is another normal interface in the first network element, for example, the second interface can be another interface in the first network element for implementing the to-be-monitored service. For example, all interfaces of the service can be obtained from the service information, and at least one available interface can be selected as the second interface from all available interfaces according to the interface link state. In addition, the number of second interfaces can also be multiple, and the sending mode through multiple second interfaces can help to improve the success rate of receiving the alarm data.
[0087] In the case where the first interface is not detected to be restored to normal, the second interface in the first network element periodically sends the alarm data to the second network element in the service channel. In the case where the alarm data includes multiple pieces, each piece of alarm data needs to be sent periodically.
[0088] Of course, in the case where the event notification of the interface connection state from failure to success is detected, the sending of the alarm data is stopped.
[0089] Figure 5 The flowchart of the alarm method suitable for the second network element side is shown, as shown in Figure 5 The alarm method of the second network element side includes the following steps:
[0090] Step S501: in the case where the alarm data from the first network element is detected, matching the alarm data with a pre-configured access control list.
[0091] The operation of capturing the alarm frame and sending it to the CPU for analysis is implemented by using an access control list (ACL) to report the alarm on the network element. The access control list is configured in the following manner: when a QinQ service is created on the L2 interface board, an ACL entry in the incoming direction is created, the key of the ACL entry is set as (destination MAC: 01-80-c2-00-00-02) && (type: 0x880a) && (service channel VID), and the action (action) of the ACL entry is set as "copy to CPU", that is, the action is to copy one copy of the alarm frame and send it to the CPU of the board, and meanwhile, the original alarm frame is not affected and continues to be forwarded in the service channel.
[0092] Step S502: In the case of successful matching, the alarm data is acquired.
[0093] If the alarm data matches the pre-configured access control list successfully, it indicates that the alarm frame needs to be processed by the network element. Accordingly, the alarm frame is acquired and analyzed.
[0094] Step S503: Alarm information is generated according to the interface identifier contained in the alarm data and the channel identifier of the service channel.
[0095] To facilitate analysis, a resident alarm frame analysis task can be created on the board, which acquires and analyzes the alarm frame sent by the switching chip to the CPU on a periodic basis. If an alarm frame is acquired, an interface alarm is reported at the end of each period. By analyzing the alarm frame, the network element MAC, network element ID, board slot number, interface number, and ID of the affected service, and other related information of the interface connection failure alarm can be obtained.
[0096] In addition, considering that one interface on the L2 interface board can access multiple customer services, if the interface fails, each service on the interface will send an alarm frame. If the alarm frame analysis and alarm reporting manner are different for different services, it can cause too many alarms to be reported. Therefore, when analyzing the alarm frame, the example records multiple service IDs carried by multiple alarm frames located on the same interface in the same period, and then reports the recorded multiple service IDs as a set in the alarm information to the upper computer.
[0097] For example, assuming that there are N alarm frames located on the same interface (also called the fault interface, i.e., the first interface) in the same period, N service IDs in the N alarm frames are recorded, the recorded N service IDs are taken as a service set, and an alarm information is generated according to the first interface and the service set, thereby greatly reducing the data volume of the alarm information.
[0098] Step S504: reporting the alarm information to the upper computer.
[0099] The second network element reports the alarm information to the upper computer at the node. In the case where the number of the second network elements is multiple, each second network element independently reports the alarm information generated by itself to the corresponding upper computer.
[0100] Step S505: in the case where it is detected that the time interval from the last time when the alarm data is received to the current time is greater than the preset interval threshold, the alarm information is cleared.
[0101] The reporting of the interface connection failure alarm can only represent the affected service ID set generated or updated by the alarm, and cannot represent the disappearance of the alarm. In order to accurately determine whether the alarm has disappeared, the upper computer (network management) receiving the alarm frame can be configured to clear the alarm on the interface in a certain time without receiving the alarm frame positioned on the interface.
[0102] Therefore, the manner in the example can be designed to be enabled by default with the Ethernet QinQ service configuration, without the need for user configuration, and without sending the alarm frame in the case where the network interface connection state is normal. The example can be applied to the Ethernet interface board of the wavelength division product and the packet product, and developed as the demand of the operation and maintenance diagnosis topic.
[0103] On the other hand, the electronic device provided by the embodiment of the present disclosure includes a memory and a processor. The memory stores a computer program executable by the processor. The computer program is executed by the processor to implement any alarm method of the embodiment of the present disclosure.
[0104] Figure 6 The block diagram of the electronic device provided by the embodiment of the present disclosure is shown in FIG. 8.
[0105] Referring to Figure 6 The electronic device provided by the embodiment of the present disclosure includes at least one processor 101, at least one memory 102, and one or more I / O interfaces 103 connected between the processor 101 and the memory 102. The memory 102 stores one or more computer programs executable by the at least one processor 101. The one or more computer programs are executed by the at least one processor 101 to enable the at least one processor 101 to execute the alarm method described above.
[0106] The embodiment of the present disclosure further provides a computer readable medium having a computer program stored thereon. The computer program is executed by a processor to implement the alarm method described above.
[0107] The embodiment of the present disclosure further provides a computer program product comprising a computer program, which, when executed by a processor, implements the alarm method described above.
[0108] The processor is a device with data processing capability, including but not limited to a central processing unit (CPU) and the like; the memory is a device with data storage capability, including but not limited to a random access memory (RAM, more specifically SDRAM, DDR, etc.), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a flash memory (FLASH), and the like; the I / O interface (read-write interface) is connected between the processor and the memory, and can realize information interaction between the memory and the processor, and includes but is not limited to a data bus (Bus) and the like.
[0109] Those skilled in the art can understand that all or some of the functional modules / units in the above disclosed steps, systems and devices can be implemented as software, firmware, hardware and appropriate combinations thereof.
[0110] In the hardware implementation, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component can have multiple functions, or one function or step can be executed by several physical components in cooperation.
[0111] Some or all of the physical components can be implemented as software executed by a processor, such as a central processing unit (CPU), a digital signal processor or a microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software can be distributed on a computer readable medium, which can include computer storage media (or non-transitory media) and communication media (or transitory media). As is well known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Computer storage media includes, but is not limited to, random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory (FLASH) or other magnetic disk storage; compact discs (CD-ROM), digital versatile discs (DVD) or other optical disk storage; magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage; any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, as is well known to those skilled in the art, communication media typically includes computer readable instructions, data structures, program modules or other data in modulated data signals such as carrier waves or other transport mechanisms, and can include any information delivery medium.
[0112] The present disclosure has disclosed example embodiments, and while specific terminology has been employed, it is merely in the service of a general descriptive purpose and should not be construed as limiting. In some instances, it will be apparent to those skilled in the art that features, characteristics or / and elements described in connection with a particular embodiment can be used in conjunction with other embodiments unless otherwise explicitly stated. As such, those skilled in the art will appreciate that various changes can be made in form and detail without departing from the scope of the disclosure as set forth in the appended claims.
Claims
1. An alarm method suitable for a first network element, comprising: in a case where an abnormality of a first interface in the first network element is detected, obtaining an interface identifier of the first interface and a channel identifier of a service channel corresponding to the first interface; generating alarm data containing the interface identifier and the channel identifier, and sending the alarm data to a second network element in the service channel through a second interface in the first network element.
2. The method of claim 1, wherein, The alarm data is an alarm frame, and a frame header of the alarm frame comprises a media access control (MAC) address field and an Ethernet type field; wherein a field value of the MAC address field is determined according to a first preset protocol, and a field value of the Ethernet type field is determined according to a second preset protocol.
3. The method of claim 2, wherein, The MAC address field comprises a source MAC address field and a destination MAC address field; wherein a field value of the destination MAC address field is determined according to the first preset protocol, and the source MAC address field is determined according to a MAC address of the first network element; and the frame header of the alarm frame further comprises a channel identifier of the service channel corresponding to the first interface, and the service channel is implemented based on a QinQ protocol; wherein frame content of the alarm frame comprises an interface identifier of the first interface and a service identifier corresponding to the service channel.
4. The method of any one of claims 1-3, wherein, In a case where the channel identifier of the service channel corresponding to the first interface is multiple, the generating alarm data containing the interface identifier and the channel identifier, and sending the alarm data to the second network element in the service channel through the second interface in the first network element comprises: generating multiple alarm data corresponding to the multiple channel identifiers one by one; wherein the interface identifier contained in each alarm data is the same; for each alarm data, sending the alarm data to the second network element in the service channel corresponding to the channel identifier contained in the alarm data.
5. The method of any one of claims 1-3, wherein, The sending the alarm data to the second network element in the service channel comprises: in a case where the first interface is not detected to be normal, periodically sending the alarm data to the second network element in the service channel.
6. The method of any one of claims 1-3, wherein, The first network element is a network element implemented based on an Ethernet interface board; The detecting the abnormality of the first interface in the first network element comprises: in a case where an interface abnormality notification event triggered by an interface detection mechanism of the Ethernet interface board is received, determining that the first interface in the first network element is abnormal; and the sending the alarm data to the second network element in the service channel comprises: sending the alarm data to the second network element in the service channel through a switching chip in the Ethernet interface board.
7. The method of claim 6, wherein, Before the detecting the abnormality of the first interface in the first network element, further comprising: according to a channel identifier of a service channel of a to-be-monitored service, configuring an alarm monitoring strategy for implementing the alarm method for multiple network elements in the service channel; wherein the first network element comprises any network element in the service channel; and the second network element comprises multiple network elements in the service channel except the first network element.
8. An alarm method, applicable to a second network element, comprising: obtaining alarm data from a first network element; the alarm data is generated based on the method of any one of claims 1-7; generating and sending an alarm message according to the interface identifier contained in the alarm data and the channel identifier of the service channel.
9. The method of claim 8, wherein, the generating and sending an alarm message according to the interface identifier contained in the alarm data and the channel identifier of the service channel comprises: in the case of receiving a plurality of alarm data containing the same interface identifier, obtaining the channel identifiers of a plurality of service channels contained in the plurality of alarm data; generating and sending an alarm message according to the interface identifier and the channel identifiers of the plurality of service channels; wherein the alarm message includes the interface identifier and a plurality of service identifiers corresponding to the plurality of service channels.
10. The method of claim 8, wherein, after the generating and sending an alarm message, further comprising: if the time interval between the current time and the time when the alarm data was last received is greater than a preset interval threshold, clearing the alarm message; wherein the preset interval threshold is greater than a preset sending threshold of the periodic sending of the alarm data.
11. The method of any one of claims 8-10, wherein, the obtaining alarm data from a first network element comprises: in the case of detecting alarm data from a first network element, matching the alarm data with a preconfigured access control list; in the case of successful matching, obtaining the alarm data; wherein the access control list includes the following contents: a MAC address field determined according to a first preset protocol, an Ethernet type field determined according to a second preset protocol, and a channel identifier field of a service channel.
12. An electronic device comprising a memory and a processor; the memory stores a computer program executable by the processor, and the computer program is executed by the processor to implement the alarm method of any one of claims 1-11.
13. A computer readable medium having a computer program stored thereon, wherein the computer program is executed by a processor to implement the alarm method of any one of claims 1-11.
14. A computer program product comprising a computer program, wherein the computer program is executed by a processor to implement the alarm method of any one of claims 1-11.