Network switch and anomaly detection method
By using access control lists and anomaly detection programs in network switches to accumulate abnormal event count values, and only process them when the threshold is reached, the problem of reduced utilization caused by frequent processor processing is solved, and higher processor efficiency and Network switch performance optimization.
Patent Information
- Application Number
- CN202110504048.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-10
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2041-05-10
AI Technical Summary
When an abnormal event occurs in an existing network switch, the processor executes the exception handling process too frequently, resulting in reduced utilization.
Design a network switch that filters grouped data through the access control list and anomaly detection program in the memory, and accumulates abnormal event count values in multiple time intervals. When the count value reaches the threshold, an exception notification is sent to the processor. Exception handling.
It avoids excessively frequent exception handling by the processor, improves processor utilization, and optimizes the performance of the network switch by dynamically adjusting parameters.
Smart Images

Figure CN115412431B_ABST
Abstract
Description
Technical Field
[0001] The embodiments described in the present disclosure are related to a network technology, and more particularly to a network switch and an anomaly detection method. Background Art
[0002] With the development of science and technology, network systems have been widely used in business or life. Generally speaking, a network switch is configured in a network system. The network switch is mainly used to exchange data between different network devices. In some related technologies, once an abnormal event occurs, the network switch will immediately execute the abnormality handling process. However, this will cause the processor in the network switch to execute the abnormality handling process too frequently, thereby reducing its utilization rate. Summary of the invention
[0003] Some embodiments of the present disclosure are related to a network switch. The network switch is used to receive multiple packet data and includes a memory and a processor. The memory is used to store an access control list and an anomaly detection program, filter the packet data according to the access control list, and perform an anomaly detection process on the packet data according to the anomaly detection program. If at least one abnormal event occurs in one of the multiple time intervals, the count value increases. When the count value reaches a count threshold, the memory sends an abnormal notification to the processor so that the processor performs an abnormal processing process on the packet data.
[0004] Some embodiments of the present disclosure are related to an anomaly detection method. The anomaly detection method includes: receiving a plurality of packet data through a network switch; filtering the packet data according to an access control table through a memory in the network switch, and performing an anomaly detection process on the packet data according to an anomaly detection program; if at least one abnormal event occurs in one of a plurality of time intervals, increasing a count value; and when the count value reaches a count threshold, sending an abnormality notification to a processor in the network switch through the memory, so that the processor performs an abnormality processing process on the packet data. BRIEF DESCRIPTION OF THE DRAWINGS
[0005] In order to make the above and other purposes, features, advantages and embodiments of the present disclosure more clearly understood, the accompanying drawings are described as follows:
[0006] Figure 1 is a schematic diagram of a network switch according to some embodiments of the present disclosure;
[0007] Figure 2 is a timing diagram of an anomaly detection procedure illustrated in accordance with some embodiments of the present disclosure;
[0008] Figure 3 is a schematic diagram of parameter configuration according to some embodiments of the present disclosure; and
[0009] Figure 4 is a flow chart of an anomaly detection method according to some embodiments of the present disclosure. DETAILED DESCRIPTION
[0010] As used herein, the term “coupled” may also refer to “electrically coupled”, and the term “connected” may also refer to “electrically connected”. “Coupled” and “connected” may also refer to two or more elements cooperating or interacting with each other.
[0011] refer to Figure 1 . Figure 1 FIG. 1 is a schematic diagram of a network switch 100 according to some embodiments of the present disclosure. In some embodiments, the network switch 100 is an Ethernet switch.
[0012] by Figure 1 For example, the network switch 100 includes a port P1, a port P2, and a port P3. The network switch 100 is coupled to the networking device D1 through the port P1, coupled to the networking device D2 through the port P2, and coupled to the external analysis device D3 through the port P3. The network switch 100 can receive the packet data PK from the networking device D1 through the port P1, and output the packet data PK' to the networking device D2 through the port P2 according to the destination address. The external analysis device D3 can perform an analysis process on the packet data PK.
[0013] by Figure 1 For example, the network switch 100 includes a memory 110 , a processor 120 , a counter 130 , and a register 140 . In addition to the ports P1 - P3 , the memory 110 is further coupled to the processor 120 , the counter 130 , and the register 140 . The register 140 is coupled to the processor 120 .
[0014] The memory 110 is used to store the access control list AL and the anomaly detection program AD. The memory 110 can filter the packet data PK according to the access control list AL. For example, the access control list AL can include multiple entries. Each entry can correspond to a rule and an action. The memory 110 can compare the packet data PK with these rules and perform corresponding actions on the packet data PK according to the comparison results to complete the filtering process and generate the packet data PK'. The above-mentioned "action" can be, for example, notification, rate limiting, discarding packets, forwarding packets, etc.
[0015] In some embodiments, the memory 110 is a ternary content addressable memory (TCAM). In these embodiments, the packet data PK is compared with these rules in a "parallel" manner. That is, the packet data PK can be compared with these rules at the same time.
[0016] by Figure 1 For example, the access control list AL includes a control block AL1 and a control block AL2. The control block AL1 and the control block AL2 each include a plurality of entries. In some embodiments, the control block AL1 is an ingress control block, and the control block AL2 is an egress control block. In other words, the control block AL1 (ingress control block) can be used to filter the packet data PK input into the network switch 100 and not yet processed by the network switch 100. The control block AL2 (egress control block) is used to filter the packet data PK that has been processed by the network switch 100.
[0017] Taking the control block AL1 as an example, the header of the packet data PK that has just been input into the network switch 100 and has not yet been processed by the network switch 100 can be intercepted. Then, the intercepted header is compared with the rules of the entries in the control block AL1, and the corresponding actions are executed on these packet data PK according to the comparison results to complete the ingress filtering process. The control block AL2 has similar operations to complete the egress filtering process, so it will not be repeated here.
[0018] Since the control block AL1 and the control block AL2 share the storage space of the memory 110, Figure 1 The architecture is also called "shared ternary content addressable memory (share TCAM) architecture". In some embodiments, the ratio of control block AL1 and control block AL2 in memory 110 can be adjusted by the user according to actual needs. For example, when the user inputs (sets) the ratio of control block AL1 and control block AL2 through an input device, a corresponding partition number instruction PN is generated in the network switch 100. Then, the ratio of control block AL1 and control block AL2 in memory 110 will be configured according to the partition number instruction PN.
[0019] On the other hand, the memory 110 can perform an anomaly detection process on the packet data PK according to an anomaly detection program AD. The anomaly detection program AD includes a detection block AD1 and a detection block AD2.
[0020] by Figure 1For example, the detection block AD1, the control block AL1, the control block AL2, and the detection block AD2 are sequentially arranged in the memory 110. To explain in another way, the detection block AD1 is adjacent to the control block AL1, and the detection block AD2 is adjacent to the control block AL2. Under this arrangement, the detection block AD1 can be used to enable the control block AL1 to support the abnormality detection process, and the detection block AD2 can be used to enable the control block AL2 to support the abnormality detection process. Accordingly, both the detection block AD1 and the detection block AD2 can support the abnormality detection process.
[0021] In some related technologies, only one anomaly detection process is configured and the anomaly detection process is adjacent to the control block AL1 (or the control block AL2 ). Accordingly, only the control block AL1 (or the control block AL2 ) can support the anomaly detection process.
[0022] Compared with the above-mentioned related technologies, in the present disclosure, the detection block AD1 and the detection block AD2 are configured at the same time. Accordingly, the detection block AD1 and the detection block AD2 can be used to enable the control block AL1 and the control block AL2 to support the abnormality detection process.
[0023] Next, refer to Figure 1 as well as Figure 2 . Figure 2 is a timing diagram of an anomaly detection process illustrated in accordance with some embodiments of the present disclosure.
[0024] The following description will be made by taking the detection block AD1 enabling the control block AL1 to support the abnormality detection process as an example. Since the detection block AD2 and the control block AL2 have similar operations, they will not be described in detail.
[0025] In operation, when the network switch 100 receives the packet data PK, the control block AL1 filters the packet data PK and the detection block AD1 enables the control block AL1 to support an anomaly detection process.
[0026] First, multiple time intervals T1-T4 (e.g., 1 millisecond) may be set for a specific type of packet data PK. In practical applications, different types of packet data PK may correspond to different time interval lengths. In addition, a flow rate upper limit value (e.g., 10M bits per second) may be set for this specific type of packet data PK. In practical applications, different types of packet data PK may correspond to different flow rate upper limits.
[0027] In some embodiments, when the flow rate of the packet data PK of the specific type reaches the flow rate upper limit, it indicates that an abnormal event has occurred. Figure 2For example, two abnormal events occur in time interval T1, and five abnormal events occur in time interval T3. In some embodiments, no matter how many abnormal events occur in a time interval, the count value of counter 130 is increased by 1. Figure 2 In the example, the initial count value of the counter 130 is 0 and after the time interval T1, the count value of the counter 130 will increase by 1 (the count value becomes 1). Then, after the time interval T3, the count value of the counter 130 will increase by 1 again (the count value becomes 2).
[0028] In addition, a counting threshold may be set for this specific type of packet data PK. In practical applications, different types of packet data PK may correspond to different counting thresholds. The count value of the counter 130 may be compared with the counting threshold. When the count value of the counter 130 reaches the counting threshold, the memory 110 will send an exception notification IRT to the processor 120 to notify the processor 120 to perform an exception handling process on the packet data PK.
[0029] In some embodiments, the length of the time interval T1-T4, the flow upper limit value or the counting threshold value can be temporarily stored in the register 140. In some embodiments, the length of the time interval T1-T4, the flow upper limit value or the counting threshold value temporarily stored in the register 140 can be adjusted by the user according to actual needs (for example: the importance of this specific type of packet data PK or the degree of impact on the system). For example, when the user inputs (sets) the length of the time interval T1-T4, the flow upper limit value or the counting threshold value through the input device, the network switch 100 will generate a corresponding setting instruction CM. Then, the processor 120 can send an update signal US according to the setting instruction CM to update the length of the time interval T1-T4, the flow upper limit value or the counting threshold value temporarily stored in the register 140. Accordingly, the flexibility of the application of the network switch 100 can be increased.
[0030] It is particularly noted here that, in some other embodiments, the register 140 may be implemented by a plurality of registers.
[0031] In some embodiments, the exception handling process may be a packet discarding process or a packet forwarding process. In other words, when the count value of the counter 130 reaches the count threshold, the packet data PK may be discarded or forwarded to the port P3.
[0032] Regarding the packet discarding process, in some embodiments, when the count value of the counter 130 reaches the count threshold, it means that the network switch 100 often receives a large number of packet data PK of a specific type. This will occupy the internal bandwidth of the network switch 100. However, if the packet data PK is discarded when the count value of the counter 130 reaches the count threshold, the internal bandwidth of the network switch 100 can be effectively saved, and the backend server can be prevented from being paralyzed (e.g., crashing) due to a large number of packets.
[0033] Regarding the packet forwarding process, in some embodiments, when the count value of the counter 130 reaches the count threshold, the packet data PK may be forwarded to the external analysis device D3, and the external analysis device D3 may analyze the forwarded packet data PK to generate an analysis result AR (e.g., analyzing the current network status). Then, the network switch 100 may automatically adjust the parameters (e.g., the flow upper limit value or the count threshold) temporarily stored in the register 140 according to the analysis result AR. For example, if the analysis result AR shows that this particular type of packet data PK does require a larger bandwidth in this network state, the processor 120 may send an update signal US according to the analysis result AR to increase the flow upper limit value temporarily stored in the register 140. Accordingly, the network switch 100 can achieve the effects of self-learning and dynamic adjustment.
[0034] In some other embodiments, the processor 120 may adjust the count threshold temporarily stored in the register 140 according to the frequency of receiving the abnormal notification IRT. For example, if the frequency of receiving the abnormal notification IRT is too high, the processor 120 may send an update signal US to increase the count threshold temporarily stored in the register 140. If the frequency of receiving the abnormal notification IRT is too low, the processor 120 may send an update signal US to lower the count threshold temporarily stored in the register 140. Accordingly, the utilization rate of the processor 120 can be improved.
[0035] In some related technologies, once an abnormal event occurs, the network switch will immediately execute the abnormality handling process, which will cause the processor in the network switch to execute the abnormality handling process too frequently, thereby reducing the utilization rate of the processor.
[0036] Compared to the above-mentioned related technologies, in the present disclosure, if an abnormal event occurs within a time interval, the count value will be increased, and when the count value reaches the count threshold, an abnormal notification IRT is issued to the processor 120 to perform an abnormal processing process on the packet data PK. Accordingly, it is possible to avoid the processor 120 from performing the abnormal processing process too frequently, thereby improving the utilization rate of the processor 120. In addition, in some embodiments of the present disclosure, no matter how many abnormal events occur within a time interval, the count value is increased by 1. Accordingly, the number of bits required for the counter 130 can be less, thereby reducing the hardware cost.
[0037] refer to Figure 1 , Figure 2 as well as Figure 3 . Figure 3 is a schematic diagram of a parameter configuration 300 according to some embodiments of the present disclosure.
[0038] by Figure 3 For example, the parameter configuration 300 can be stored in the register 140 and used for the user to set the time interval length TS, the counting threshold MT and the exception handling process RD. The time interval length TS represents the length of the time interval T1-T4 used to detect whether an abnormal event occurs. The counting threshold MT represents that if the count value of the counter 130 reaches this value, an exception notification IRT will be issued to the processor 120. The exception handling process RD represents discarding or forwarding the packet data PK. For example, if the exception handling process RD is 0, it means that the currently set exception handling process RD is to discard the packet data PK. If the exception handling process RD is 0x000A, it means that the currently set exception handling process RD is to forward the packet data PK to the port P3. In some embodiments, the parameter configuration 300 further includes the aforementioned flow upper limit value for the user to set the flow upper limit value. The flow upper limit value is the judgment standard for whether an abnormal event occurs.
[0039] refer to Figure 4 . Figure 4 is a flow chart of an anomaly detection method 400 according to some embodiments of the present disclosure. In some embodiments, the anomaly detection method 400 is applied to Figure 1 The network switch 100 in FIG. 1 is a network switch 100 in FIG. 1 , but the present disclosure is not limited thereto. Figure 4 For example, the anomaly detection method 400 includes operations S402 , S404 , S406 , and S408 .
[0040] In operation S402, a plurality of packet data PK is received by the network switch 100. In some embodiments, the network switch 100 is an Ethernet switch.
[0041] In operation S404, the memory 110 filters the packet data PK according to the access control list AL, and performs an anomaly detection process on the packet data PK according to the anomaly detection program AD. In some embodiments, the memory 110 is a ternary content addressable memory.
[0042] In operation S406, if at least one abnormal event occurs in one of the time intervals T1-T4, the count value is increased. In some embodiments, no matter how many abnormal events occur in a time interval, the count value of the counter 130 is increased by 1.
[0043] In operation S408, when the count value reaches the count threshold, the memory 110 sends an exception notification IRT to the processor 120, so that the processor 120 performs an exception processing process on the packet data PK. In some embodiments, the exception processing process may be a packet discarding process or a packet forwarding process.
[0044] In summary, in the network switch and the anomaly detection method disclosed in the present invention, if an abnormal event occurs within a time interval, the count value will be increased, and when the count value reaches the count threshold, an abnormal notification will be issued to the processor to perform an abnormal processing process on the packet data. Accordingly, the processor can be prevented from performing the abnormal processing process too frequently, thereby improving the utilization rate of the processor.
[0045] Various functional elements and blocks have been disclosed herein. For those of ordinary skill in the art, the functional blocks may be implemented by circuits (whether dedicated circuits or general purpose circuits operating under the control of one or more processors and coded instructions), which generally include transistors or other circuit elements for controlling the operation of electrical circuits corresponding to the functions and operations described herein. It is further understood that the specific structure and interconnection of circuit elements generally may be determined by a compiler, such as a register transfer language (RTL) compiler. The register transfer language compiler operates on instruction codes (scripts) that are quite similar to assembly language code (assembly language code), and compiles the instruction codes into a form used to layout or make the final circuit.
[0046] Although the present disclosure has been disclosed in the above-mentioned implementation mode, it is not intended to limit the present disclosure. Any ordinary technician in the field can make various changes and modifications without departing from the spirit and scope of the present disclosure. Therefore, the protection scope of the present disclosure shall be determined by the scope of the attached patent application.
[0047] Description of Reference Numerals
[0048] 100: Network switch
[0049] 110: Memory
[0050] 120: Processor
[0051] 130: Counter
[0052] 140: Register
[0053] 300: Parameter configuration
[0054] 400: Anomaly Detection Methods
[0055] P1,P2,P3:Port
[0056] D1,D2: Networking devices
[0057] D3: External analysis device
[0058] PK,PK': Grouped data
[0059] AL: Access Control List
[0060] AL1, AL2: Control block
[0061] AD: Anomaly Detection Program
[0062] AD1, AD2: detection blocks
[0063] PN: Distinguish numerical instructions
[0064] T1-T4: Time interval
[0065] IRT: Exception Notification
[0066] AR: Analysis results
[0067] CM: Set command
[0068] US: Update signal
[0069] TS: Time interval length
[0070] MT: Count threshold
[0071] RD: Exception handling process
[0072] S402, S404, S406, S408: Operation
Claims
1. A network switch for receiving a plurality of packet data, wherein the network switch comprises: A memory, for storing an access control list and an anomaly detection program, filtering the plurality of packet data according to the access control list, and performing an anomaly detection process on the plurality of packet data according to the anomaly detection program; as well as A processor, wherein if an abnormal event occurs in one of the multiple time intervals, the count value increases, and no matter how many abnormal events occur in one time interval, the count value increases by 1; the abnormal event is that the flow value of the multiple packet data reaches the flow upper limit value; When the count value reaches the count threshold, the memory sends an exception notification to the processor, so that the processor performs an exception processing process on the plurality of packet data.
2. The network switch of claim 1, wherein the network switch further comprises: At least one register is used to store the lengths of the multiple time intervals, counting thresholds or flow upper limits.
3. The network switch of claim 2, wherein the lengths of the plurality of time intervals, the counting thresholds or the flow upper limits are updated according to setting instructions corresponding to user input. 4 . The network switch of claim 1 , wherein the processor is configured to adjust a counting threshold according to a frequency of receiving the abnormality notification.
5. The network switch of claim 1, wherein the exception handling process comprises a packet discarding process or a packet forwarding process.
6. The network switch as claimed in claim 5, wherein the packet forwarding process is to forward the plurality of packet data to a port in the network switch coupled to an external analysis device, wherein the processor is further configured to adjust the flow upper limit value according to an analysis result of the external analysis device.
7. The network switch of claim 1, wherein the access control table comprises a first control block and a second control block, and the anomaly detection program comprises a first detection block and a second detection block, wherein the first detection block, the first control block, the second control block and the second detection block are sequentially arranged in a memory, and the first detection block and the second detection block are respectively used to enable the first control block and the second control block to support the anomaly detection process.
8. The network switch of claim 1, wherein the memory is a ternary content addressable memory.
9. An anomaly detection method, comprising: Receiving a plurality of packet data via a network switch; filtering the plurality of packet data according to the access control table by means of a memory in the network switch, and performing an anomaly detection process on the plurality of packet data according to an anomaly detection program; If an abnormal event occurs in one of the multiple time intervals, the count value is increased, and no matter how many abnormal events occur in one time interval, the count value is increased by 1; the abnormal event is that the flow value of the multiple packet data reaches the flow upper limit value; as well as When the count value reaches the count threshold, the memory sends an exception notification to the processor in the network switch, so that the processor performs an exception processing process on the plurality of packet data.
