Access control list rule modification method, network equipment and readable medium

By first writing new rules and then deleting old rules when modifying ACL rules, the problem of long effective time of ACL rules and low stability of network equipment is solved, achieving rapid effectiveness of ACL rules and improving equipment stability.

CN118555086APending Publication Date: 2024-08-27ZTE CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310208297.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-02-27
Publication Date
2024-08-27

AI Technical Summary

Technical Problem

When modifying access control list (ACL) rules, existing technology causes the problem that the ACL rules take a long time to take effect and the stability of network equipment is reduced.

Method used

Use the method of first writing the new ACL rules into the ACL rule container and then deleting the old ACL rules to ensure that the new rules have taken effect before the old rules are deleted to avoid the situation where no ACL rules take effect, thereby shortening the effective time of the ACL rules and improving the network Equipment stability.

Benefits of technology

This method ensures that the ACL rules take effect in a short time, avoids the situation where no rules take effect, and improves the stability and modification efficiency of network equipment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118555086A
    Figure CN118555086A
Patent Text Reader

Abstract

The invention provides a method for modifying an access control list rule. The method comprises the following steps: acquiring an ACL configuration instruction; the ACL configuration instruction represents configuration of an ACL rule; according to the ACL configuration instruction, adding target ACL rule information and corresponding original ACL rule information into an ACL rule container; the target ACL rule information represents a configured target ACL rule, the original ACL rule information represents an original ACL rule corresponding to the target ACL rule before configuration, the ACL rule container is used for indicating modification of a chip table item, and the target ACL rule and the original ACL rule which correspond to each other have the same identifier. The invention further provides network equipment and a computer readable medium.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of access control lists, and in particular to a method for modifying access control list rules, a network device, and a computer-readable medium. Background Art

[0002] Access Control List (ACL) is an access control technology based on packet filtering. ACL includes one or more "ACL rules", each of which specifies specific processing for packets that meet specific conditions; therefore, the ports of network devices can filter the passing packets according to the above conditions, select the packets that meet the conditions, and allow them to pass or discard them.

[0003] However, when the ACL rules need to be modified, there are problems such as the ACL rules taking effect for a long time and the reduced stability of network devices. Summary of the invention

[0004] The present disclosure provides a method for modifying access control list rules, a network device, and a computer-readable medium.

[0005] In a first aspect, an embodiment of the present disclosure provides a method for modifying an ACL rule, which includes:

[0006] Obtaining an ACL configuration instruction; the ACL configuration instruction represents the configuration of the ACL rule;

[0007] According to the ACL configuration instruction, target ACL rule information and corresponding original ACL rule information are added to the ACL rule container; the target ACL rule information represents the configured target ACL rule, and the original ACL rule information represents the original ACL rule corresponding to the target ACL rule before configuration; the ACL rule container is used to indicate the modification of the chip table item, and the corresponding target ACL rule and the original ACL rule have the same identifier.

[0008] In a second aspect, an embodiment of the present disclosure provides a network device, which includes one or more memories and one or more processors; the memory stores a computer program that can be executed by the processor, and when the computer program is executed by the processor, it implements any one of the ACL rule modification methods of the embodiment of the present disclosure.

[0009] In a third aspect, an embodiment of the present disclosure provides a computer-readable medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for modifying an ACL rule in any one of the embodiments of the present disclosure is implemented.

[0010] In the disclosed embodiment, the new ACL rule (target ACL rule information) and the old ACL rule (target ACL rule information) are first written into the "ACL rule container" correspondingly, so that the new ACL rule is written before the old ACL rule is deleted, or it can be said that the "first add and then delete" method is adopted. Therefore, in the disclosed embodiment, the old ACL rule is not deleted after the new ACL rule is written, and there is no situation where no ACL rule is effective. The ACL rule takes effect for a short time and the network device has good stability. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] In the accompanying drawings of the embodiments of the present disclosure:

[0012] Figure 1 A flowchart of a method for modifying access control list rules provided by an embodiment of the present disclosure;

[0013] Figure 2 A flowchart of another method for modifying access control list rules provided by an embodiment of the present disclosure;

[0014] Figure 3 A flowchart of another method for modifying access control list rules provided by an embodiment of the present disclosure;

[0015] Figure 4 A block diagram of a network device provided in an embodiment of the present disclosure;

[0016] Figure 5 A block diagram of another network device provided in an embodiment of the present disclosure;

[0017] Figure 6 A block diagram of a computer-readable medium provided for an embodiment of the present disclosure. DETAILED DESCRIPTION

[0018] To enable those skilled in the art to better understand the technical solution of the present disclosure, the method for modifying access control list rules, network device, and computer-readable medium provided by the embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.

[0019] The present disclosure will be described more fully below with reference to the accompanying drawings, but the embodiments shown may be embodied in different forms, and the present disclosure should not be construed as being limited to the embodiments set forth below. On the contrary, the purpose of providing these embodiments is to make the present disclosure thorough and complete, and will enable those skilled in the art to fully understand the scope of the present disclosure.

[0020] The accompanying drawings of the embodiments of the present disclosure are used to provide a further understanding of the embodiments of the present disclosure, and constitute a part of the specification, and are used together with the detailed embodiments to explain the present disclosure, and do not constitute a limitation of the present disclosure. By describing the detailed embodiments with reference to the accompanying drawings, the above and other features and advantages will become more apparent to those skilled in the art.

[0021] The present disclosure may be described with reference to plan views and / or cross-sectional views by means of ideal schematic views of the present disclosure. Therefore, the exemplary illustrations may be modified according to manufacturing techniques and / or tolerances.

[0022] In the absence of conflict, the various embodiments of the present disclosure and the various features therein may be combined with each other.

[0023] The terms used in the present disclosure are only used to describe specific embodiments and are not intended to limit the present disclosure. The term "and / or" as used in the present disclosure includes any and all combinations of one or more related enumerated items. The singular forms "one" and "the" as used in the present disclosure are also intended to include plural forms, unless the context clearly indicates otherwise. The terms "including", "made of..." as used in the present disclosure specify the presence of the features, wholes, steps, configurations, elements and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, configurations, elements, components and / or groups thereof.

[0024] Unless otherwise defined, all terms (including technical and scientific terms) used in this disclosure have the same meaning as commonly understood by those of ordinary skill in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and this disclosure, and will not be interpreted as having an idealized or overly formal meaning unless explicitly defined in this disclosure.

[0025] The present disclosure is not limited to the embodiments shown in the drawings, but includes modifications of the configurations formed based on the manufacturing process. Therefore, the regions illustrated in the drawings have schematic properties, and the shapes of the regions shown in the drawings illustrate the specific shapes of the regions of the elements, but are not intended to be limiting.

[0026] ACL is an access control technology based on packet filtering. ACL includes one or more "ACL rules", each of which specifies specific processing for packets that meet specific conditions, such as not allowing packets from specific source IP addresses to pass.

[0027] Therefore, after determining the ACL rules (stored and effective in the form of chip table entries), the ports of the network device can filter the passing data packets according to the conditions therein, screen out the data packets that meet the conditions, allow them to pass or discard them, such as discarding data packets with specific source IP.

[0028] During use, it is often necessary to modify and update existing ACL rules, such as changing the specific source IP of packets that are not allowed to pass. In some related technologies, when modifying ACL rules, the old ACL rules are deleted first, and then the new ACL rules are written. Therefore, from the time when the old ACL rules are deleted to the time when the new ACL rules are written, there are actually no ACL rules available, and the ACL rules are not effective during this period. As a result, the ACL rules take a long time to take effect and the stability of network devices is reduced.

[0029] In a first aspect, the present disclosure provides a method for modifying access control list (ACL) rules.

[0030] The method of the embodiment of the present disclosure is used for a network device, which refers to a device that can transmit data packets in a network, such as a router, etc. The network device can process the transmitted data packets accordingly according to the ACL rules therein, and the embodiment of the present disclosure is used to modify the ACL rules in the network device.

[0031] Reference Figure 5 The network device of the embodiment of the present disclosure may include a configuration module, a forwarding table management module, a chip management module, etc.

[0032] Among them, the configuration module is used to receive the ACL configuration instructions input by the user and confirm that the forwarding table management module completes the corresponding operation; the forwarding table management module is used to modify the ACL rules according to the ACL configuration instructions (such as incremental modification); the chip management module is used to receive the information sent by the forwarding table management module to modify the chip table items.

[0033] Reference Figure 1 The method for modifying ACL rules in the embodiment of the present disclosure includes:

[0034] S101: Obtain ACL configuration instructions.

[0035] The ACL configuration instruction represents the configuration of the ACL rule.

[0036] The forwarding table management module of the network device receives the ACL configuration instruction from the configuration module. The content of the ACL configuration instruction may indicate what kind of ACL rules need to be configured (ie, the configuration of ACL rules), such as indicating that an ACL rule needs to be added.

[0037] The sources of ACL configuration instructions are various. For example, the user may input ACL rules in the interactive interface of the configuration module, and the configuration module converts them into corresponding ACL configuration instructions; or the configuration module may automatically generate ACL configuration instructions.

[0038] The specific forms of the ACL configuration instructions are various, for example, they may include operation type, command ID, ACL rule type, ACL rule name, ACL rule sequence number, action type, public information, etc.

[0039] The operation type may indicate the type of ACL rule configuration to be performed (eg, configuration of a new ACL rule, configuration of a target ACL rule, or configuration of a deleted ACL rule).

[0040] The command ID indicates whether the ACL configuration directive is applied to the port.

[0041] The ACL rule type, bound port type, bound port direction, ACL rule name, and ACL rule sequence number are specific parameters of the ACL rule to be configured.

[0042] S102: Add target ACL rule information and corresponding original ACL rule information to the ACL rule container according to the ACL configuration instruction.

[0043] The target ACL rule information represents the configured target ACL rule, the original ACL rule information represents the original ACL rule corresponding to the target ACL rule before configuration, the ACL rule container is used to indicate the modification of the chip table entry, and the corresponding target ACL rule and original ACL rule have the same identifier.

[0044] The ACL configuration instructions are parsed to determine the new ACL rules (target ACL rules) after the ACL rules are configured and the old ACL rules (original ACL rules) before the configuration, and the two are written into a preset ACL rule container in the form of corresponding target ACL rule information and original ACL rule information, that is, data in the form of (target ACL rule information, original ACL rule information) is written into the ACL rule container.

[0045] Among them, the "corresponding" target ACL rule and the original ACL rule refer to the description of the "same ACL rule", which respectively represent the content of the ACL rule after configuration and the "original" content of the ACL rule before configuration. Therefore, the corresponding target ACL rule and the original ACL rule have the same "identifier (i.e., the identifier of the ACL rule)" to reflect that the two correspond to the same ACL rule, such as the identifier can be in the form of the above "ACL rule name, ACL rule serial number" and so on.

[0046] It can be seen that the new ACL rule has actually been written into the ACL rule container, so that the content of the chip table entry stored in the network device can be updated according to the content of the ACL rule container. Among them, the chip table entry is the data directly based on when filtering data packets.

[0047] In the disclosed embodiment, the new ACL rule (target ACL rule information) and the old ACL rule (target ACL rule information) are first written into the "ACL rule container" correspondingly, so that the new ACL rule is written before the old ACL rule is deleted, or it can be said that the "first add and then delete" method is adopted. Therefore, in the disclosed embodiment, the old ACL rule is not deleted after the new ACL rule is written, and there is no situation where no ACL rule is effective. The ACL rule takes effect for a short time and the network device has good stability.

[0048] In some embodiments, the configuration of the ACL rule includes at least one of the configuration of adding a new ACL rule, the configuration of a target ACL rule, and the configuration of deleting an ACL rule;

[0049] For the configuration of the newly added ACL rule, the target ACL rule information is the information of the newly added target ACL rule, and the original ACL rule information is empty;

[0050] Corresponding to the configuration of the target ACL rule, the target ACL rule information is the information of the newly added target ACL rule, and the original ACL rule information is the information of the original ACL rule;

[0051] For the configuration of deleting ACL rules, the target ACL rule information is empty and the original ACL rule information is the original ACL rule information.

[0052] As one method of an embodiment of the present disclosure, the configuration of ACL rules may specifically include the following three types:

[0053] (1) Add a new ACL rule (newly added ACL rule), such as adding an ACL rule that does not allow packets from other source IP addresses to pass through.

[0054] (2) Change the original ACL rules to new ACL rules (update the configuration of ACL rules), such as changing the specific value of the source IP of a data packet that is not allowed to pass in a certain ACL rule.

[0055] (3) Delete the original ACL rules (delete the configuration of ACL rules), such as deleting the ACL rules that do not allow packets from a specific source IP to pass through.

[0056] It should be understood that for the configuration of updating ACL rules, if the updated ACL rules are different from the original ACL rules, it is a modification of the ACL rules, or an "incremental ACL rule"; and if the updated ACL rules are the same as the original ACL rules, although the actual ACL rules have not changed, the method of the embodiment of the present disclosure can still be performed and the ACL rules are deemed to have been updated.

[0057] There are various ways to determine the type of configuration of the ACL rule, such as determining it according to the "operation type" item in the ACL configuration instruction.

[0058] For modifications of different types of ACL rules, the data in the ACL rule container can also be set to different corresponding formats:

[0059] (1) Configuration of a newly added ACL rule: This is equivalent to "no" corresponding original ACL rule (with the same identifier), so the target ACL rule information is the information of the newly added ACL rule, while the original ACL rule information is "empty", for example, data in the form of (information of the newly added ACL rule, NULL) can be written into the ACL rule container.

[0060] (2) Configuration of updated ACL rules: the updated ACL rules and the original ACL rules are the ACL rules after and before the update respectively. For example, data in the form of (information of the newly added ACL rules and information of the original ACL rules) can be written into the ACL rule container.

[0061] (3) Deleting the configuration of ACL rules: This is equivalent to "no" newly added ACL rules, so the target ACL rule information is "empty", and the original ACL rule information is the information of the original ACL rule, such as data in the form of (NULL, information of the original ACL rule) that can be written in the ACL rule container.

[0062] Therefore, different types of ACL rule modifications are added to the ACL rule container in different forms.

[0063] In some embodiments, according to the ACL configuration instruction, adding target ACL rule information and corresponding original ACL rule information in the ACL rule container (S102) includes:

[0064] S102A: Corresponding to the configuration of the newly added ACL rule, add the target ACL rule information and the corresponding original ACL rule information in the newly added type of ACL rule container.

[0065] S102B, corresponding to the configuration of the target ACL rule, adding the target ACL rule information and the corresponding original ACL rule information in the updated type ACL rule container.

[0066] S102C: corresponding to the configuration of deleting the ACL rule, add the target ACL rule information and the corresponding original ACL rule information in the ACL rule container of the deletion type.

[0067] Further, see Figure 3As one method of the embodiment of the present disclosure, the ACL rule containers can also be divided into different types, that is, different types of ACL rule modifications (configurations) correspond to different types of ACL rule containers, and the information corresponding to each type of ACL rule modification should be written into the corresponding type of ACL rule container, so that the chip table entry can obtain different types of ACL rule modifications from different types of ACL rule containers.

[0068] It should be understood that the ACL rule container may not be classified, but a type identifier may be added to its data (target ACL rule information, original ACL rule information) to distinguish the type of ACL rule modification; or, the type of ACL rule modification may be determined by analyzing the target ACL rule information and the original ACL rule information being empty.

[0069] In some embodiments, after setting the target ACL rule information and the original ACL rule information corresponding to the configuration of the ACL rule in the ACL rule container (S102), the method further includes:

[0070] S103: In response to the ACL configuration instruction being applied to the port, modify the chip table entry according to the ACL rule container.

[0071] The ACL rules configured by the ACL configuration instruction may be directly applied to the port, that is, the modified ACL rules need to be "enabled" immediately to filter the data packets; at this time, after the corresponding information is written into the ACL rule container, the chip table items used as the basis for data packet filtering may be modified directly according to the content of the ACL rule container (such as incremental modification).

[0072] There are various ways to determine whether the ACL configuration instruction is applied to the port, such as determining it according to the "command ID" item in the ACL configuration instruction.

[0073] In some embodiments, modifying the chip table entry according to the ACL rule container (S103) includes:

[0074] S1031. Incrementally modify the chip entry according to the ACL rule container.

[0075] The incremental modification is the modification of the configuration of the ACL rule according to the ACL configuration instruction.

[0076] As a method of an embodiment of the present disclosure, when a chip table entry is modified according to an ACL configuration instruction, only the ACL rules that are actually required to be modified in the ACL configuration instruction may be sent to the chip table entry, thereby only changing the "incremental part" of the chip table entry, that is, only performing "incremental modification" or "incremental sending" on the chip table entry.

[0077] It should be understood that the above "increment" refers to a change relative to the original chip table entry (or original ACL rule), and does not necessarily mean a "newly added" chip table entry (or ACL rule).

[0078] In some related technologies, for the sake of simplicity, when modifying ACL rules, all original chip table entries are usually deleted first, and then the modified new chip table entries are written as a whole, that is, "full delivery". However, when there are many ACL rules (such as tens of thousands), deleting old chip table entries and writing new chip table entries involve a large amount of data modification, which takes a long time, resulting in a long time for the ACL rules to be ineffective, and at the same time reducing the stability of network equipment operation.

[0079] The disclosed embodiment adopts the above-mentioned "incremental delivery" method to modify the chip table entries, that is, only the (incremental) chip table entries that are actually changed this time are delivered, so the actual amount of modified data is greatly reduced compared to the "full delivery" method, the ACL rules can take effect quickly, and the stability of network device operation can be improved.

[0080] In some embodiments, reference Figure 2 , modifying the chip table entry according to the ACL rule container (S103) includes:

[0081] S10321. According to the target ACL rule information, add a table entry corresponding to the target ACL rule in the chip table entry.

[0082] S10322. According to the original ACL rule information, delete the table entry corresponding to the original ACL rule from the chip table entry.

[0083] Since the ACL rule container contains the corresponding information of the old and new ACL rules (target ACL rule information and original ACL rule information), it is possible to add a corresponding entry to the chip table according to the target ACL rule information and delete the entry corresponding to the original ACL rule information, thereby realizing the modification of the chip table.

[0084] It should be understood that the modification of chip table entries also includes the modification of "empty" table entries. For example, when adding a new ACL rule, the old table entry does not actually exist, so the step of deleting the table entry corresponding to the original ACL rule is actually deleting the empty table entry; and for deletion modification, the new table entry actually has no content, so the step of adding the table entry corresponding to the target ACL rule is actually adding an empty table entry.

[0085] In some embodiments, according to the ACL configuration instruction, adding target ACL rule information and corresponding original ACL rule information in the ACL rule container (S102) includes:

[0086] S1021. Modify the software entry according to the ACL configuration instruction.

[0087] S1022: Add target ACL rule information and corresponding original ACL rule information to the ACL rule container according to the software entry.

[0088] As one method of the embodiment of the present disclosure, the network device may also have a software entry that directly records the ACL rule. Therefore, the software entry may be directly modified according to the target ACL rule information, and then the ACL rule container may be modified according to the modified software entry.

[0089] In some embodiments, the target ACL rule information includes a target ACL rule node; the original ACL rule information includes an original ACL rule node.

[0090] According to the ACL configuration instructions, refer to Figure 2 , adding target ACL rule information and corresponding original ACL rule information in the ACL rule container (S102) includes:

[0091] S1023. Determine target ACL rules according to the ACL configuration instruction.

[0092] S1024: Create a target ACL rule node according to the target ACL rule, and search for an original ACL rule node corresponding to the target ACL rule node in a preset cache space.

[0093] S1025: Add the target ACL rule node and the corresponding original ACL rule node to the unprocessed ACL rule container, and use the target ACL rule node to replace the corresponding original ACL rule node in the cache space.

[0094] As one method of an embodiment of the present disclosure, the ACL rule information may be in the form of an "ACL rule node", that is, the content of the ACL rule may be written as a piece of data (node) and distinguished by an identifier of the ACL rule.

[0095] Among them, all original ACL rule nodes corresponding to old ACL rules (original ACL rules) are stored in a cache space.

[0096] After receiving the ACL configuration instruction, a new ACL rule (target ACL rule) can be parsed from it, and a corresponding target ACL rule node can be generated. At the same time, the corresponding original ACL rule node can be searched in the cache space according to the identifier (such as searching according to the ACL rule sequence number); then, the target ACL rule node and the original ACL rule node are written in pairs into the unprocessed (ungrouped) ACL rule container.

[0097] After the target ACL rule node and the original ACL rule node are written into the ACL rule container, the new ACL rule (added first) has been recorded in the ACL rule container. Therefore, if there is any further modification to this ACL rule, it is based on the "target ACL rule" at this time, that is, the "target ACL rule" has become the "original ACL rule"; therefore, it is also necessary to replace the original ACL rule node in the cache space with the target ACL rule node (but still as the original ACL rule node).

[0098] It can be seen that the above method itself ensures that all original ACL rule nodes are stored in the cache space, because all ACL rules are obtained through continuous modification. For example, when the ACL rule is initially created, it is equivalent to the configuration of the newly added ACL rule, and after the configuration is completed, the newly configured target ACL rule becomes the original ACL rule node.

[0099] It should be understood that the specific form of the ACL rule node is also relative to the configuration type. For example, for the configuration of adding a new ACL rule, the original ACL rule node with the same identifier may not be found in the cache space, that is, the original ACL rule node is empty; and for the configuration of deleting an ACL rule, the target ACL rule node is empty.

[0100] In some embodiments, after adding the target ACL rule node and the corresponding original ACL rule node to the unprocessed ACL rule container (S1025), the method further includes:

[0101] S1033: Modify the chip entry according to the unprocessed ACL rule container.

[0102] After the chip entry is modified, the ACL rule container storing the target ACL rule node and the original ACL rule node no longer belongs to the unprocessed ACL rule container.

[0103] In some embodiments, the chip table entry can be modified according to the above "unprocessed ACL rule container", and after the modification, the ACL rule container is no longer "unprocessed", that is, it will not be used for the "next" modification of the chip table entry; therefore, the modifications made to the chip table entry according to the unprocessed ACL rule container are all modifications indicated by the ACL configuration instruction in "this process (from the last modification of the chip table entry to this time)", that is, "incremental modification" or "incremental delivery".

[0104] It should be understood that there are various specific ways to "make the ACL rule container no longer unprocessed", such as clearing the ACL rule container and setting it as "unprocessed" again, or completely deleting the ACL rule container and then using a new unprocessed ACL rule container.

[0105] It should be understood that the above description order and step numbering order of the ACL rule container operation are not limitations on the actual execution order of the corresponding steps. For example, multiple target ACL rule nodes may be generated within a period of time, and then these target ACL rule nodes and the corresponding original ACL rule nodes are added to the ACL rule container when needed.

[0106] The specific implementation methods of the embodiments of the present disclosure are various, refer to Figure 3 , a specific method of the embodiment of the present disclosure may include:

[0107] A101. Obtain ACL configuration instructions.

[0108] The forwarding table management module obtains the ACL configuration instruction from the configuration module. The ACL configuration instruction can be input by the user or automatically generated by the configuration module.

[0109] ACL configuration instructions may include operation type, command ID, ACL rule type, ACL rule name, ACL rule sequence number, action type, public information, etc., which are used to instruct operations such as configuring new ACL rules, updating ACL rule configuration, deleting ACL rule configuration, etc. (addition operation, update operation, deletion operation).

[0110] Among them, the ACL rule type may include but is not limited to LINK type, I PV4 extension type, I PV6 extension type, etc., and its filtering conditions may include but are not limited to source MAC address, destination MAC address, source IP address, destination IP address, protocol type, etc.; and the action type may be deny or permit.

[0111] The operation type is used to indicate whether the operation to be performed is a new operation, an update operation, a delete operation, etc.; and the operation type may also include a "completion operation", which is used to indicate the end of the current instruction and update the chip table entry.

[0112] The ACL rule sequence number is used as an identifier of the ACL rule.

[0113] The command ID is used to indicate whether the ACL configuration instruction is applied to the port.

[0114] A102, obtain ungrouped cache nodes.

[0115] Apply for ungrouped cache nodes for subsequent steps.

[0116] Among them, the cache node is a map data structure, specifically a collection of key-value pairs; and "ungrouped" means that the cache node is "unused", that is, no subsequent operations are performed.

[0117] A1031. Parse the ACL configuration instruction and store the target ACL rule information in a new ACL rule node (target ACL rule node).

[0118] Parse the ACL configuration instruction, obtain the ACL rule type, ACL rule name, ACL rule sequence number, action type, public information and other information, edit it into the corresponding target ACL rule information, and add a new ACL rule node.

[0119] A1032. Add the new ACL rule node to the cache node.

[0120] Using the ACL rule number as the key and the corresponding new ACL rule node as the value, the new ACL rule node is added to the cache node in the form of a key-value pair.

[0121] When adding a new ACL rule node to a cache node, the existing ungrouped cache nodes can be traversed with the ACL rule sequence number. If the ACL rule node corresponding to the ACL rule sequence number is not found, it indicates that only one update has been made to the ACL rule. Therefore, the ACL rule sequence number is used as the key, and the corresponding new ACL rule node is inserted into the cache node as the value. If an existing ACL rule node is found in the cache node according to the ACL rule sequence number, it indicates that the corresponding ACL rule has been continuously "updated multiple times (such as adding first and then updating)", so the new ACL rule node is used to replace the original ACL rule node to ensure that the cache node records the "last" update.

[0122] A104. Parse the completed operation from the ACL configuration instruction.

[0123] After all new ACL rule nodes are added to the cache node, the configuration module may issue an ACL configuration instruction including a completion-type operation to indicate that the update may begin.

[0124] If the operation is not completed, the corresponding modification can be cached only in the program and will not be sent to the chip table.

[0125] A105. Filter out new ACL rule nodes from the cache nodes, search for corresponding old ACL rule nodes (original ACL rule nodes) in the cache space according to the ACL sequence number, add target ACL rule information (new ACL rule nodes) and original ACL rule information (old ACL rule nodes) to the corresponding type of ACL rule container, and update the old ACL rule nodes in the cache space with the new ACL rule nodes.

[0126] The ACL rule container data type is a structure including corresponding new ACL rules and old ACL rules, which can be used as a basis for modifying chip table entries.

[0127] Among them, refer to Figure 3 , this step (A105) may specifically include:

[0128] A1051. Determine whether the ungrouped cache node is empty.

[0129] By traversing, it is determined whether each ungrouped cache node is empty, that is, whether there is a value (new ACL rule node) representing the ACL rule to be modified.

[0130] A1052A. If the ungrouped cache node is empty, search for the corresponding old ACL rule node.

[0131] When the ungrouped cache node is empty (ie, the new ACL rule node is empty), it is possible to search in the cache space whether an "old" ACL rule node already exists according to the ACL rule type, ACL rule name, ACL rule sequence number, and the like.

[0132] A1052AA. Store the data in the form of (NULL, old ACL rule node) in the ACL rule container of the deletion type.

[0133] If the ungrouped cache node is empty, after finding the old ACL rule node, it indicates that a deletion operation should be performed, so empty information (NULL) is used as the target ACL rule information, and the old ACL rule node is used as the original ACL rule information, which is written into the ACL rule container of the deletion type.

[0134] A1052B, if the ungrouped cache node is not empty, find out whether there is a corresponding old ACL rule node. When the ungrouped cache node is not empty, it is also possible to find out whether there is an "old" ACL rule node in the cache space according to the ACL rule type, ACL rule name, ACL rule sequence number, etc.

[0135] A1052BA: If there is a corresponding old ACL rule node, store the data in the updated type ACL rule container in the form of (new ACL rule node, old ACL rule node).

[0136] If the ungrouped cache node is not empty and the old ACL rule node also exists, it indicates that an update operation should be performed. Therefore, the new ACL rule node in the ungrouped cache node is used as the target ACL rule information, and the old ACL rule node is used as the original ACL rule information, which is written into the update type ACL rule container.

[0137] A1052BB, if there is no corresponding old ACL rule node, the data is converted to (new ACL rule node,

[0138] NULL) and is stored in the newly added ACL rule container.

[0139] If the ungrouped cache node is not empty, and the old ACL rule node does not exist (that is, the old ACL rule node is empty), it indicates that a new operation should be performed. Therefore, the new ACL rule node in the ungrouped cache node is used as the target ACL rule information, and the empty information (NULL) is used as the original ACL rule information, which is written into the newly added type of ACL rule container.

[0140] Therefore, based on the ungrouped cache nodes (new ACL rule nodes) and the old ACL rule nodes, the modification to be made to the ACL rule is determined, and the corresponding information is written into the ACL rule container of the corresponding type.

[0141] A106. Modify corresponding chip table entries according to various types of ACL rule containers.

[0142] That is, according to the target ACL rule information and the original ACL rule information in the ACL rule container, the chip management module actually performs a corresponding type of modification on the chip table entry.

[0143] When it is determined based on the command ID that the ACL configuration instruction is applied to the port, it indicates that the modified ACL rule needs to be "enabled" immediately to filter the data packets. Therefore, the chip table entries that serve as the basis for data packet filtering can be modified (such as incremental modification), such as adding the table entries corresponding to the target ACL rule information and deleting the table entries corresponding to the original ACL rule information.

[0144] It should be understood that after the chip table entry is modified using the ACL rule container, it is no longer "unprocessed" and can be cleared and recorded as "unprocessed" again, or the ACL rule container can be deleted and a new ACL rule container can be used later.

[0145] Second, refer to Figure 4 An embodiment of the present disclosure provides a network device, which includes one or more memories and one or more processors; the memory stores a computer program that can be executed by the processor, and when the computer program is executed by the processor, it implements any one of the ACL rule modification methods of the embodiment of the present disclosure.

[0146] Thirdly, refer to Figure 6 The embodiment of the present disclosure provides a computer-readable medium on which a computer program is stored. When the computer program is executed by a processor, any one of the ACL rule modification methods of the embodiment of the present disclosure is implemented.

[0147] Among them, the processor is a device with data processing capabilities, including but not limited to the central processing unit (CPU); the memory is a device with data storage capabilities, including but 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); the I / O interface (read-write interface) is connected between the processor and the memory, and can realize information exchange between the memory and the processor, including but not limited to the data bus (Bus), etc.

[0148] Those skilled in the art will appreciate that all or some of the steps, systems, and functional modules / units in the apparatus disclosed above may be implemented as software, firmware, hardware, or a suitable combination thereof.

[0149] In hardware implementations, the division between functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be performed by several physical components in cooperation.

[0150] Some physical components or all physical components may be implemented as software executed by a processor, such as a central processing unit (CPU), a digital signal processor or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-temporary medium) and a communication medium (or temporary medium). As known to those of ordinary skill in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules or other data). Computer storage media include, but are 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 disk storage; read-only compact disk (CD-ROM), digital versatile disk (DVD) or other optical disk storage; magnetic cassettes, magnetic tapes, 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, it is well known to those skilled in the art that communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

[0151] The present disclosure has disclosed example embodiments, and although specific terms are employed, they are used and should be interpreted only in a general illustrative sense and not for limiting purposes. In some instances, it will be apparent to those skilled in the art that, unless otherwise expressly stated, features, characteristics, and / or elements described in conjunction with a particular embodiment may be used alone or in combination with features, characteristics, and / or elements described in conjunction with other embodiments. Therefore, those skilled in the art will appreciate that various changes in form and detail may be made without departing from the scope of the present disclosure as set forth in the appended claims.

Claims

1. A method for modifying an access control list (ACL) rule, comprising: Obtaining an ACL configuration instruction; the ACL configuration instruction represents the configuration of the ACL rule; According to the ACL configuration instruction, add the target ACL rule information and the corresponding original ACL rule information in the ACL rule container; The target ACL rule information represents the configured target ACL rule, the original ACL rule information represents the original ACL rule corresponding to the target ACL rule before configuration, the ACL rule container is used to indicate the modification of the chip table entry, and the corresponding target ACL rule and the original ACL rule have the same identifier.

2. The method according to claim 1, wherein: The configuration of the ACL rule includes at least one of the configuration of adding a new ACL rule, the configuration of a target ACL rule, and the configuration of deleting an ACL rule; Corresponding to the configuration of the newly added ACL rule, the target ACL rule information is the information of the newly added target ACL rule, and the original ACL rule information is empty information; Corresponding to the configuration of the target ACL rule, the target ACL rule information is the information of the newly added target ACL rule, and the original ACL rule information is the information of the original ACL rule; Corresponding to the configuration of deleting the ACL rule, the target ACL rule information is empty information, and the original ACL rule information is the information of the original ACL rule.

3. The method according to claim 2, wherein: The adding target ACL rule information and corresponding original ACL rule information in the ACL rule container according to the ACL configuration instruction includes: Corresponding to the configuration of the newly added ACL rule, adding the target ACL rule information and the corresponding original ACL rule information in the newly added type of ACL rule container; Corresponding to the configuration of the target ACL rule, adding the target ACL rule information and the corresponding original ACL rule information in the updated type ACL rule container; Corresponding to the configuration of deleting the ACL rule, the target ACL rule information and the corresponding original ACL rule information are added to the ACL rule container of the deletion type.

4. The method according to claim 1, wherein: After adding the target ACL rule information and the corresponding original ACL rule information in the ACL rule container, the method further includes: In response to the ACL configuration instruction being applied to the port, the chip table entry is modified according to the ACL rule container.

5. The method according to claim 4, wherein: The modifying the chip entry according to the ACL rule container includes: The chip table entry is incrementally modified according to the ACL rule container; the incremental modification is a modification of the configuration of the ACL rule according to the ACL configuration instruction.

6. The method according to claim 4, wherein: The modifying the chip entry according to the ACL rule container includes: According to the target ACL rule information, adding a table entry corresponding to the target ACL rule in the chip table entry; According to the original ACL rule information, the table entry corresponding to the original ACL rule is deleted from the chip table entry.

7. The method according to claim 1, wherein: The adding target ACL rule information and corresponding original ACL rule information in the ACL rule container according to the ACL configuration instruction includes: Modify the software table entry according to the ACL configuration instruction; According to the software entry, target ACL rule information and corresponding original ACL rule information are added to the ACL rule container.

8. The method according to claim 1, wherein: The target ACL rule information includes a target ACL rule node; the original ACL rule information includes an original ACL rule node; The adding target ACL rule information and corresponding original ACL rule information in the ACL rule container according to the ACL configuration instruction includes: Determine the target ACL rule according to the ACL configuration instruction; According to the target ACL rule, create the target ACL rule node, and search for the original ACL rule node corresponding to the target ACL rule node in a preset cache space; The target ACL rule node and the corresponding original ACL rule node are added to an unprocessed ACL rule container, and the target ACL rule node is used to replace the corresponding original ACL rule node in the cache space.

9. The method according to claim 8, wherein: After adding the target ACL rule node and the corresponding original ACL rule node to the unprocessed ACL rule container, the method further includes: The chip table entry is modified according to the unprocessed ACL rule container; after the chip table entry is modified, the ACL rule container storing the target ACL rule node and the original ACL rule node no longer belongs to the unprocessed ACL rule container.

10. A network device, comprising one or more memories and one or more processors; the memories store a computer program executable by the processor, and when the computer program is executed by the processor, the method for modifying ACL rules described in any one of claims 1 to 9 is implemented.

11. A computer-readable medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the method for modifying ACL rules described in any one of items 1 to 9 is implemented.