Disclosure of Invention
In view of the above problems, an object of the present invention is to provide a message flow monitoring system and method based on a switch, which implement filtering and flow control of messages, avoid the risk of safety or performance problems in messages sent from the switch to a central processing unit, and ensure the reliability of the central processing unit.
In order to achieve the purpose, the invention is realized by the following technical scheme: a message flow monitoring system based on a switch comprises: the system comprises a switch and an auxiliary processor, wherein a special application integrated circuit and a central processing unit are arranged in the switch. The auxiliary processor is respectively in data connection with the special application integrated circuit and the central processing unit through an Ethernet channel.
The special application integrated circuit is used for processing and analyzing the message service flow of the switch and sending the message to the auxiliary processor.
The auxiliary processor is used for receiving the message sent by the special application integrated circuit, isolating and monitoring the message flow between the special application integrated circuit and the central processing unit, determining the message sending speed by monitoring the working state of the central processing unit, and sending the message to the central processing unit at the determined message sending speed.
And the central processing unit is used for carrying out overall management on the switch according to the sent message.
Further, the auxiliary processor includes:
the isolation unit is used for carrying out statistical technology and content filtering analysis on the uploaded message, and redirecting the message to the central processing unit if the content filtering analysis is normal; when the CPU needs to reply to the ASIC with a message, the message is received and redirected to the ASIC. The isolation unit plays a role in isolating and monitoring the flow between the ASIC and the CPU.
And the monitoring unit is used for monitoring the working load of the central processing unit.
And the buffer unit is used for buffering the messages sent by the special application integrated circuit.
And the uploading speed control unit is used for starting a speed reduction strategy to control the rate of the uploading message according to the working load of the central processing unit.
Further, the isolation unit includes:
the filtering module is used for starting a preset filtering rule to filter out potential risk traffic and unnecessary traffic in the message traffic and directly discarding the traffic; and uploading the filtered message flow to a central processing unit, and recording the message flow into a log. Potential negative effects can occur to the central processor in an efficient manner.
And the protection module is used for starting a preset safety mechanism to identify illegal message flow in the message flow, directly discarding the illegal message flow and recording the illegal message flow into a log.
Further, the monitoring unit includes:
and the power consumption detection module is used for determining the working load of the central processing unit by detecting the power consumption of the central processing unit. The state of the central processing unit can be monitored efficiently.
Further, the speed reduction strategy comprises: when the work load of the central processing unit reaches 80% of the total load, the message sending rate is reduced to 80% of the initial rate, if the work load of the central processing unit continues to increase, the message sending rate is reduced according to a preset function curve, and if the work load of the central processing unit reaches 98% of the total load, the message sending is stopped.
Further, the auxiliary processor further comprises:
and the priority setting unit is used for determining the priority of the message according to the preset key value of the message and establishing a corresponding message uploading queue according to the priority of the message.
Correspondingly, the invention also discloses a message flow monitoring method based on the switch, which comprises the following steps:
s1: processing and analyzing the message service flow of the switch by using a special application integrated circuit, and uploading the message service flow to an auxiliary processor;
s2: after receiving the message, the auxiliary processor carries out isolation and monitoring processing of message flow, determines the speed of the message to be sent to the central processing unit by monitoring the working state of the central processing unit, and sends the processed message to the central processing unit at the determined sending speed;
s3: and the central processing unit performs the overall management of the switch according to the processed message.
Further, the step S2 includes:
the auxiliary processor receives the message sent by the special application integrated circuit;
judging whether the message meets the filtering rule, if so, directly discarding; otherwise, determining whether the message is a safe message by carrying out safety check on the message;
if the message is not a safe message, directly discarding the message; if the message is a safe message, determining the working load of the central processing unit by reading the power of the power supply of the central processing unit, and carrying out flow shaping and speed limiting on the message according to the load of the central processing unit and then uploading the message to the central processing unit.
Further, the filtering rules include:
setting unnecessary message types and message types with potential risks;
identifying whether the type of the current message is an unnecessary message type, if so, directly discarding; if not, identifying whether the type of the current message is a message type with potential risk;
if yes, directly discarding, and if not, finishing filtering.
Further, the step of performing traffic shaping and speed limiting on the message according to the load of the central processing unit and then sending the message to the central processing unit specifically comprises:
if the work load of the central processing unit is lower than 80% of the total load, the message is directly sent to the central processing unit; if the workload of the central processing unit reaches 80% of the total load, the rate of the message to be sent is reduced to 80% of the initial rate;
after the uploading rate is reduced, determining the priority of the message which is not uploaded by reading a preset key value of the message which is not uploaded; in the non-uploading guarantee, the message with the highest priority is uploaded to a central processing unit, and the rest messages are temporarily stored in a cache unit to wait for uploading; if the current cache unit has no storage space, directly discarding the rest messages;
if the current flow of the uploaded message is larger than the preset bandwidth of the central processing unit, temporarily storing the message with the preset proportion to a cache unit.
Compared with the prior art, the invention has the beneficial effects that:
1. the invention improves the safety of the message sent to the central processing unit from the special application integrated circuit, can effectively prevent the sending of error messages and malicious messages, and ensures the normal work of the switch.
2. The invention can effectively reduce the burden of the CPU for processing the message sent by the special application integrated circuit, and the auxiliary processor can discard some redundant or secondary messages before the CPU, thereby reducing the processing burden for the CPU.
3. The invention provides the flow shaping and speed limiting functions, can prevent the conditions of downtime, abnormality and the like of the central processing unit caused by abnormal message uploading conditions, and further ensures the working reliability of the central processing unit.
4. The invention has the priority queue function and can ensure the processing of the central processing unit on the important service of the switch under the condition of meeting the advantages.
5. The invention can directly utilize the prior auxiliary processor for monitoring the peripheral equipment of the switch, can further ensure the working reliability of the central processing unit under the condition of not increasing other components and improves the utilization efficiency of the auxiliary processor.
Therefore, compared with the prior art, the invention has prominent substantive features and remarkable progress, and the beneficial effects of the implementation are also obvious.
Detailed Description
The core of the invention is to provide a message flow monitoring system based on a switch, and in the prior art, the message sent to a CPU by the switch has the risk of safety or performance problems, so that the working reliability of the CPU cannot be guaranteed.
The invention provides a message flow monitoring system based on a switch, which adopts an auxiliary processor to be respectively connected with a special application integrated circuit and a central processing unit through an Ethernet channel. And the auxiliary processor is used for receiving the message sent by the special application integrated circuit, isolating and monitoring the message flow between the special application integrated circuit and the central processing unit, and controlling the speed of the message sent to the central processing unit by monitoring the working state of the central processing unit.
Therefore, the invention realizes the filtration and flow control of the message, avoids the risk of safety or performance problems in the message sent to the central processing unit by the switch, and ensures the working reliability of the central processing unit.
In order that those skilled in the art will better understand the disclosure, the invention will be described in further detail with reference to the accompanying drawings and specific embodiments. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The first embodiment is as follows:
as shown in fig. 1, this embodiment provides a message traffic monitoring system based on a switch, including: the system comprises a switch and an auxiliary processor 1, wherein an application specific integrated circuit 2 and a central processing unit 3 are arranged in the switch. The auxiliary processor 1 is respectively connected with the application specific integrated circuit 2 and the central processor 3 through Ethernet channels. And the special application integrated circuit 2 is used for processing, forwarding and analyzing the message service flow of the switch and sending the message to the auxiliary processor 1. And the central processing unit 3 is used for overall management of the message switch according to the sent message.
The auxiliary processor 1 is used for receiving the messages sent by the special application integrated circuit, isolating and monitoring the message flow between the special application integrated circuit 2 and the central processing unit 3, and controlling the speed of the messages sent to the central processing unit 3 by monitoring the working state of the central processing unit 3.
The auxiliary processor 1 includes: the device comprises an isolation unit 4, a monitoring unit 5, a buffer unit 6, an uploading speed control unit 7 and a priority setting unit 8.
The isolation unit 4 is used for carrying out statistical technology and content filtering analysis on the uploaded message, and redirecting the message to the central processing unit 3 if the content filtering analysis is normal; when the central processing unit 3 needs to reply to the asic 2 with a message, it receives the message sent down and redirects it to the asic 2. The isolation unit 4 is used for isolating and monitoring the flow between the asic 2 and the cpu 3.
The isolation unit 4 specifically includes:
the filtering module 41 is configured to start a preset filtering rule to filter out potential risk traffic and unnecessary traffic in the packet traffic, and directly discard the potential risk traffic and the unnecessary traffic; and uploading the filtered message flow to the central processing unit 3, and recording the message flow in a log. The filtering module 41 can directly discard the traffic with potential risk or unnecessary traffic on the auxiliary processor 1 to improve performance, so that the traffic is not sent to the central processing unit 3, potential negative effects on the central processing unit 3 are prevented, and meanwhile, the received hit traffic is recorded in a log, so that query and inspection in the future are facilitated;
and the protection module 42 is configured to start a preset security mechanism to identify an illegal message traffic in the message traffic, directly discard the illegal message traffic, and record the discarded illegal message traffic in a log. The preset security mechanism can adopt the self-contained security mechanism and anti-attack measures on the auxiliary processor 1, automatically identify a part of dangerous or illegal message flow, automatically discard the messages and record the messages;
and the monitoring unit 5 is used for monitoring the working load of the central processing unit 3. The monitoring unit 5 includes: and a power consumption detection module 51, configured to determine a workload of the central processing unit 3 by detecting power consumption of the central processing unit 3. The state of the central processing unit 3 can be monitored efficiently. Because the auxiliary processor 1 is also generally responsible for the state control of the peripheral equipments of the switches such as the fan, the power supply and the like, the monitoring of the load of the central processor 3 can be directly reflected by the power consumption of the central processor, when the power consumption is increased, the load of the central processor can be considered to be increased, the power when the central processor is fully loaded is taken as the reference of 100% of the load, and the monitoring unit 5 monitors the working load of the central processor by adopting the mode, so that the monitoring is more efficient and accurate.
And the buffer unit 6 is used for buffering the messages sent by the ASIC 2. The cache unit 6 is specifically configured to: 1. when the load of the central processing unit is too high, the message with low real-time requirement is cached, and when the load of the central processing unit is reduced, the message is uploaded. 2. When a large number of messages are uploaded, the uploading speed is firstly maintained unchanged, messages which are not uploaded are stored in the cache unit 6, and the uploading speed is slowly increased when the cache space of the cache unit 6 occupies too much space, so that the situation that a large number of messages are uploaded to the central processing unit 3 suddenly is prevented. Therefore, by using the cache unit 6, the shaping of the message flow is realized, that is, a large number of messages are prevented from being sent to the central processing unit 3 suddenly, which causes the load of the central processing unit 3 to rise rapidly and affects other functions of the central processing unit.
And the uploading speed control unit 7 is used for starting a speed reduction strategy to control the speed of the uploading message according to the working load of the central processing unit. The speed reduction strategy comprises the following steps: when the work load of the central processing unit reaches 80% of the total load, the message sending rate is reduced to 80% of the initial rate, if the work load of the central processing unit continues to increase, the message sending rate is reduced according to a preset function curve, and if the work load of the central processing unit reaches 98% of the total load, the message sending is stopped.
And the priority setting unit 8 is used for determining the priority of the message according to the preset key value of the message and establishing a corresponding message uploading queue according to the priority of the message. Therefore, the uploading sequence of the messages is determined according to the priority of the message uploading queue, and for the messages with important or high real-time requirements, the messages are preferentially uploaded or are not interrupted when the flow is increased or the work load of the central processing unit is overlarge, so that the interruption of important services is prevented.
In addition, a redundant connection channel is designed between the ASIC 2 and the CPU 3, so that the message traffic can still be guaranteed to be sent once the auxiliary processor 1 fails.
The embodiment provides a message flow monitoring system based on a switch, which adopts an auxiliary processor to be respectively in data connection with a special application integrated circuit and a central processing unit through an Ethernet channel. The auxiliary processor receives the message sent by the special application integrated circuit, isolates and monitors the message flow between the special application integrated circuit and the central processing unit, and controls the speed of the message sent to the central processing unit by monitoring the working state of the central processing unit. The method and the device realize the filtering and flow control of the message, avoid the risk of safety or performance problems in the message sent to the central processing unit by the switch, and ensure the working reliability of the central processing unit.
Example two:
based on the first embodiment, as shown in fig. 2, the present invention also discloses a message traffic monitoring method based on the switch, which includes the following steps:
s1: the message service flow of the switch is processed and analyzed through the special application integrated circuit and is uploaded to the auxiliary processor.
S2: after receiving the message, the auxiliary processor carries out isolation and monitoring processing of message flow, determines the speed of the message to be sent to the central processing unit by monitoring the working state of the central processing unit, and sends the processed message to the central processing unit at the determined sending speed.
This step provides a work flow of the auxiliary processor, as shown in fig. 3, specifically:
the auxiliary processor receives the message sent by the special application integrated circuit; judging whether the message meets the filtering rule, if so, directly discarding; otherwise, determining whether the message is a safe message by carrying out safety check on the message; if the message is not a safe message, directly discarding the message; and if the message is a safety message, determining the working load of the central processing unit by reading the power of the power supply of the central processing unit.
At this time, the message is sent to the central processing unit after the flow shaping and the speed limiting are carried out on the message according to the load of the central processing unit. The method specifically comprises the following steps: if the work load of the central processing unit is lower than 80% of the total load, the message is directly sent to the central processing unit; if the workload of the central processing unit reaches 80% of the total load, the rate of the message to be sent is reduced to 80% of the initial rate; after the uploading rate is reduced, determining the priority of the message which is not uploaded by reading a preset key value of the message which is not uploaded; in the non-uploading guarantee, the message with the highest priority is uploaded to a central processing unit, and the rest messages are temporarily stored in a cache unit to wait for uploading; if the current cache unit has no storage space, directly discarding the rest messages; if the current flow of the uploaded message is larger than the preset bandwidth of the central processing unit, temporarily storing the message with the preset proportion to a cache unit.
In the above method, the adopted filtering rule specifically includes: first, unnecessary message types and potentially risky message types are set. Then, identifying whether the type of the current message is an unnecessary message type, and if so, directly discarding the message; if not, continuously identifying whether the type of the current message is a message type with potential risk; if yes, directly discarding, and if not, finishing filtering.
S3: and the central processing unit performs the overall management of the switch according to the processed message.
The embodiment provides a message flow monitoring method based on a switch, which improves the security of a message sent to a central processing unit on a special application integrated circuit, can effectively prevent the sending of an error message and a malicious message, and ensures the normal work of the switch. The embodiment effectively reduces the burden of the central processing unit for processing the messages sent by the special application integrated circuit, and the auxiliary processor can discard some redundant or secondary messages before the central processing unit, thereby reducing the processing burden for the central processing unit. The embodiment also realizes the functions of flow shaping, speed limiting and priority queue, ensures that the central processing unit processes important services of the switch, can prevent the conditions of central processing unit downtime, abnormity and the like caused by abnormal message uploading conditions, and further ensures the working reliability of the central processing unit.
In conclusion, the invention realizes the filtering and flow control of the message, avoids the risk of safety or performance problems in the message sent to the central processing unit by the switch, and ensures the working reliability of the central processing unit.
The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other. The method disclosed by the embodiment corresponds to the system disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the description of the method part.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided by the present invention, it should be understood that the disclosed system, system and method can be implemented in other ways. For example, the above-described system embodiments are merely illustrative, and for example, the division of the units is only one logical functional division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, systems or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each module may exist alone physically, or two or more modules are integrated into one unit.
Similarly, each processing unit in the embodiments of the present invention may be integrated into one functional module, or each processing unit may exist physically, or two or more processing units are integrated into one functional module.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The message flow monitoring system and method based on the switch provided by the invention are introduced in detail above. The principles and embodiments of the present invention are explained herein using specific examples, which are presented only to assist in understanding the method and its core concepts. It should be noted that, for those skilled in the art, it is possible to make various improvements and modifications to the present invention without departing from the principle of the present invention, and those improvements and modifications also fall within the scope of the claims of the present invention.