Method for storing and matching ACL (Access Control List) table items and network equipment

By splitting the ACL table entries and storing them in TCAM and SRAM respectively, TCAM stores address information and SRAM to store other matches, and through hash value association processing, TCAM capacity and price issues are solved, and ACL feature specifications and redundantness are improved Freedom, simplifies configuration and expansion.

CN119094439AActive Publication Date: 2024-12-06NEW H3C TECH CO LTD

Patent Information

Application Number
CN202411215676.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-30
Publication Date
2024-12-06
Estimated Expiration
2044-08-30

AI Technical Summary

Technical Problem

In the prior art, TCAM has limited capacity and is expensive, resulting in difficulty in configuration and limited expansion of ACL rule sets; conflicts and search performance may occur in the SRAM table, complex dynamic updates, and large hardware overhead.

Method used

Split the ACL table entry into two parts. The first part includes the source address and the destination address to be stored in TCAM. The second part includes the information of Srcport, Dstport, Ip protocol, Next Header, Dscp, and Port is stored in SRAM and passed the hash value. Association processing.

Benefits of technology

The specifications of ACL characteristics of network equipment have been improved, theoretically increased by 200%-300%, and the redundancy of ACL characteristics has been reduced by 50%-100%, which simplifies the configuration and expansion process and reduces maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119094439A_ABST
    Figure CN119094439A_ABST
Patent Text Reader

Abstract

The invention provides a method for storing and matching ACL table entries and a network device.The method for storing the ACL table entries comprises the steps that the ACL table entries to be stored are obtained, the ACL table entries are split into a first part and a second part, the first part comprises source addresses and destination addresses of the ACL table entries, and the second part comprises part or all of information in Srcport, Dstport, Ip protocol, Next Header, Dscp and Port of the ACL table entries; the first part is stored in the TCAM, and the second part is stored in the SRAM. Through the method, the specification of the ACL characteristic of the network equipment can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technology, and in particular to a method for storing and matching ACL entries and a network device. Background Art

[0002] ACL: Access Control List, a collection of rules for identifying message flows. The rules here refer to judgment statements that describe message matching conditions. Matching conditions can be the source address, destination address, port number, etc. of the message. The device identifies specific messages based on ACL rules and processes them according to pre-set policies. The most common application is to use ACL for message filtering. In addition, ACL can also be used to identify messages in services such as routing, security, and QoS. The specific processing method of these messages is determined by the service module that applies ACL.

[0003] TCAM: Ternary Content Addressable Memory. As a storage resource for device expansion, it is often used to store service entries such as ARP, ACL, and routing. By configuring the TCAM operation mode, you can adjust the storage space allocated by TCAM to each service entry to meet the needs of service operation.

[0004] SRAM: Static Random Access Memory is a static random access memory that stores data in word form and requires addresses to access and operate data. SRAM chips can be embedded in network devices (such as routers, switches, etc.) to store and execute access control policies. In this way, the device can quickly and accurately process incoming and outgoing data packets according to predefined rules. By using SRAM, ACL services can achieve fast packet filtering and access control, improving network security and performance.

[0005] HASH: Hash Function generates a fixed-length hash value by calculating and transforming data of any length, which is used to uniquely represent the input data. It has the characteristics of determinism, irreversibility, efficiency and decentralization, and is widely used in cryptography, data integrity verification, content addressing, data uniqueness verification and other fields. The HASH algorithm can quickly process large amounts of data and provide unique identification and fast search functions for data. It is an indispensable and important technology in information security and data management.

[0006] When processing packets, network devices (such as switches and routers) usually use access control lists (ACLs) to control the flow of packets. ACLs filter and match incoming and outgoing packets according to predetermined rules to achieve security and network management purposes. However, as network scale and data traffic continue to increase, the rule set of traditional ACLs has become increasingly large, resulting in performance degradation and configuration difficulties. Summary of the invention

[0007] To overcome the problems existing in the related art, this specification provides a method and a network device for storing and matching ACL entries.

[0008] According to a first aspect of an embodiment of this specification, a method for storing an ACL entry is provided, the method comprising:

[0009] Obtain the ACL entry to be stored, and split the ACL entry into a first part and a second part;

[0010] The first part includes the source address and destination address of the ACL entry, and the second part includes part or all of the information of Srcport, Dstport, Ip protocol, Next Header, Dscp, and Port of the ACL entry;

[0011] The first part is stored in the TCAM memory, and the second part is stored in the SRAM memory.

[0012] The step of storing the first part in a TCAM memory and storing the second part in an SRAM memory includes:

[0013] Storing the first part in a TCAM memory and assigning a first identifier;

[0014] storing the second part in the SRAM memory and assigning a second identifier;

[0015] The first identifier uniquely corresponds to the second identifier.

[0016] The first part also includes one of the source interface, destination interface, IP protocol, service code point, and Next Header in the ACL table item; the second part includes information in the ACL table item other than the first part.

[0017] It can be seen from the above embodiments that by splitting the ACL entry into two parts, one part is stored in the TCAM memory and the other part is stored in the SRAM memory, the specification of the ACL feature of the network device can be effectively improved.

[0018] According to a second aspect of an embodiment of this specification, a method for matching an ACL entry is provided, the method comprising:

[0019] Receive a first message, and obtain source IP and destination IP information of the first message;

[0020] Using the source IP and destination IP information of the first message to match the first part of each ACL table entry stored in the TCAM memory, and obtaining a first identifier according to the matching result;

[0021] Using the first identifier and part or all of the information in Srcport, Dstport, Ip protocol, Next Header, Dscp, and Port of the first message to match the second part of each ACL table entry stored in the SRAM memory to obtain a matching result;

[0022] Processing the first message according to the matching result;

[0023] Among them, the first part includes the correspondence between the source IP and destination IP information of each ACL table item and the first identifier, and the second part includes the correspondence between part or all of the information in Srcport, Dstport, Ip protocol, Next Header, Dscp, and Port of each ACL table item and the second identifier, wherein each first identifier uniquely corresponds to each second identifier.

[0024] The method of using the first identifier and part or all of the information in Srcport, Dstport, Ip protocol, NextHeader, Dscp, and Port of the first message to match the second part of each ACL table entry stored in the SRAM memory to obtain a matching result includes:

[0025] Combine part or all of the information in Srcport, Dstport, Ip protocol, Next Header, Dscp, and Port of the first message with the first identifier, and obtain a hash value through hash calculation;

[0026] Determine the target second partial area stored in the SRAM using the hash value and the first identifier;

[0027] Part or all of the information in Srcport, Dstport, Ip protocol, Next Header, Dscp, and Port of the first message is matched with the second part area of ​​the target to obtain a matching result.

[0028] The first part also includes one of the source interface, destination interface, IP protocol, service code point, and Next Header in the ACL table item; the second part includes information in the ACL table item other than the first part.

[0029] The step of processing the first message according to the matching result includes:

[0030] The first message is discarded or passed according to the matching result.

[0031] It can be seen from the above embodiments that ACL processing of messages can be completed based on the situation that ACL entries are split and stored in different memories.

[0032] According to a third aspect of the embodiments of this specification, the embodiments of the present disclosure further provide a network device, wherein the network device is configured with a TCAM memory and an SRAM memory, and the network device includes:

[0033] an acquisition module, configured to acquire an ACL entry to be stored, and split the ACL entry into a first part and a second part, wherein the first part includes a source address and a destination address of the ACL entry, and the second part includes part or all of the information in Srcport, Dstport, Ip protocol, Next Header, Dscp, and Port of the ACL entry;

[0034] The processing module is used for storing the first part in the TCAM memory and storing the second part in the SRAM memory.

[0035] According to a fourth aspect of the embodiments of this specification, the embodiments of the present disclosure further provide a network device, the network device comprising:

[0036] A receiving module, used to receive a first message and obtain source IP and destination IP information of the first message;

[0037] A matching module, configured to match the source IP and destination IP information of the first message with the first part of each ACL table entry stored in the TCAM memory, and obtain a first identifier according to the matching result;

[0038] The matching module is further used to use the first identifier and part or all of the information in Srcport, Dstport, Ipprotocol, Next Header, Dscp, and Port of the first message to match the second part of each ACL table entry stored in the SRAM memory to obtain a matching result;

[0039] A processing module, used for processing the first message according to the matching result;

[0040] Among them, the first part includes the correspondence between the source IP and destination IP information of each ACL table item and the first identifier, and the second part includes the correspondence between part or all of the information in Srcport, Dstport, Ip protocol, Next Header, Dscp, and Port of each ACL table item and the second identifier, wherein each first identifier uniquely corresponds to each second identifier.

[0041] The matching module is specifically used to combine part or all of the information in Srcport, Dstport, Ip protocol, Next Header, Dscp, and Port of the first message with the first identifier, and obtain a hash value through hash calculation;

[0042] Determine the target second partial area stored in the SRAM using the hash value and the first identifier;

[0043] Part or all of the information in Srcport, Dstport, Ip protocol, Next Header, Dscp, and Port of the first message is matched with the second part area of ​​the target to obtain a matching result.

[0044] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present specification. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the specification and, together with the description, serve to explain the principles of the specification.

[0046] Figure 1 It is a logical schematic diagram of a TCAM solution shown in this specification according to an exemplary embodiment.

[0047] Figure 2 It is a logic diagram of an SRAM solution shown in this specification according to an exemplary embodiment.

[0048] Figure 3 This is a flowchart of a method for storing ACL entries according to an exemplary embodiment of the present specification.

[0049] Figure 4 It is a flowchart of a method for matching ACL entries according to an exemplary embodiment of this specification. DETAILED DESCRIPTION

[0050] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with this specification. Instead, they are merely examples of devices and methods consistent with some aspects of this specification as detailed in the appended claims.

[0051] The terms used in this specification are for the purpose of describing specific embodiments only and are not intended to limit this specification. The singular forms "a", "the" and "the" used in this specification and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0052] It should be understood that although the terms first, second, third, etc. may be used in this specification to describe various information, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of this specification, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0053] Currently, in one implementation, Figure 1 The figure shows a TCAM solution, which stores ACL rules in TCAM. By using TCAM's high-speed matching and parallel comparison, fast packet filtering and classification can be achieved. For example, the compression algorithm compresses ACL rules and stores them in TCAM, and hierarchical storage divides ACL rules into multiple levels and stores them in different TCAM chips.

[0054] In this example, the following problems exist:

[0055] 1. Capacity limitation: TCAM capacity is usually relatively small and cannot accommodate large-scale ACL rule sets. In particular, as the network scale grows and the complexity of ACL rules increases, TCAM capacity may quickly reach its upper limit.

[0056] 2. Expensive: TCAM chips are expensive, which limits their use in large-scale ACL equipment. Deploying large-scale TCAM equipment may require significant investment costs.

[0057] 3. Difficulty of static configuration: Since the capacity of TCAM is limited and the rules cannot be updated dynamically, the rules need to be statically configured in advance. This will bring difficulties in configuration management, especially in large-scale and complex network environments.

[0058] 4. Limited scalability: Due to the limited capacity and high price of TCAM, it is difficult to quickly expand and upgrade the equipment. In the case of increasing the number of ACL rules or adapting to network growth, the entire device may need to be replaced or upgraded, which increases maintenance costs and complexity.

[0059] In another example, Figure 2 As shown, the ACL rules are stored in the SRAM table through the HASH algorithm. The HASH table is used to quickly search and match data packets, and a smaller memory capacity can be used to store more ACL rules.

[0060] In this example, although the capacity of the SRAM table can be expanded to a certain extent as needed and can better meet the storage requirements of large-scale ACL rule sets, the following problems still exist:

[0061] 1. Conflict problem: In the SRAM table, different ACL rules may be mapped to the same HASH value, causing conflicts. When a conflict occurs, additional operations are required to resolve the conflict, which may introduce additional delays and overhead.

[0062] 2. Search performance: Although the SRAM table has the characteristic of fast search, as the number of ACL rules increases, the search performance of the SRAM table may decrease. Especially when there are many conflicts, the search speed may be significantly slowed down.

[0063] 3. Difficult to update: Compared with TCAM-based implementations, ACL rules in SRAM tables can be updated dynamically. However, updating the rules in the SRAM table may involve rebuilding or adjusting the entire SRAM table, which may introduce higher overhead and latency.

[0064] 4. Hardware overhead: To support high-performance SRAM table implementations, more complex hardware structures and algorithms may need to be used, which may increase the complexity of the implementation and the hardware overhead.

[0065] In order to solve the above technical problems, the present disclosure provides a method for storing ACL entries, such as Figure 3 As shown, the method includes:

[0066] S301 obtains the ACL entry to be stored, and splits the ACL entry into a first part and a second part;

[0067] The first part includes the source address and destination address of the ACL table item, and the second part includes part or all of the information of Srcport (source port), Dstport (destination port), Ip protocol (protocol), Next Header (next hop header field), Dscp (differentiated services code point), and Port (logical endpoint) of the ACL table item;

[0068] S302 stores the first part in the TCAM memory and stores the second part in the SRAM memory.

[0069] In this embodiment, the ACL table entry is split into a first part and a second part, and each split ACL table entry is associated and stored through the introduced first identifier (such as acl_cascade_key) and the second identifier (such as acl_cascade_action).

[0070] In this embodiment, when configuring ACL-related services, such as when a carrier network device configures ACL-related services, IPv4 and IPv6 protocol stacks may be involved. As shown in Table 1, ACL matching fields involved in the two protocol stacks of IPv4 and IPv6 are listed.

[0071]

[0072] Table 1

[0073] As can be seen from the preceding table, the IPv4 protocol stack requires 122 bits of resources when performing a full ACL match, while the IPv6 protocol stack requires 314 bits of resources when performing a full ACL match.

[0074] In this embodiment, in order to save resources of the network device for storing ACL entries, the ACL entry may be split into a first part and a second part, and the first part and the second part are stored in different memories respectively.

[0075] As shown in Table 1, in the IPv4 protocol stack, when the two parameters of the source address and the destination address (SrcIp and DstIp) are matched with the ACL, there may be a mask address (address network segment). Similarly, in the IPv6 protocol stack, when the two parameters of the source address and the destination address (SrcIpv6 and DstIpv6) are matched with the ACL, there may be a mask address (address network segment). Therefore, SrcIp and DstIp or SrcIpv6 and DstIpv6 that may have mask address parameters are stored in the TCAM memory as the first part after the ACL table entry is split to achieve subsequent flexible matching.

[0076] The other matching items (L4 Srcport, L4 Dstport, Ip protocol, Dscp, Port) for ACL matching of IPv4 and the other matching items (L4 Srcport, L4 Dstport, Next Header, Dscp, Port) for ACL matching of IPv6 need to be fully matched. Therefore, the other matching items (L4 Srcport, L4 Dstport, Ip protocol, Dscp, Port, or L4 Srcport, L4 Dstport, Next Header, Dscp, Port) can be stored in the SRAM memory as the second part after the ACL table items are split.

[0077] In this embodiment, when the second part of the ACL table entry is stored in the SRAM memory, a HASH operation may be performed on the second part, and the second part of the ACL table entry may be stored in the SRAM memory according to the operation result.

[0078] In one embodiment, as shown in Table 2, since the TCAM memory supports storage of entries with a specification of 80-160 bits, when the stored parameters are less than 80 bits, invalid bits are automatically added. Usually, in IPv4, the source address (SrcIp) and the destination address (DstIp) occupy 64 bits. Therefore, any parameter among the source interface, destination interface, IP protocol, and service code point can be stored in the TCAM memory to improve the utilization rate of the TCAM memory and avoid waste of resources.

[0079]

[0080] Table 2

[0081] Similarly, as shown in Table 3, in IPv6, the source address (SrcIp) and the destination address (DstIp) occupy 128 bits.

[0082]

[0083] Table 3

[0084] Therefore, any parameter of the source interface, destination interface, Next Header, and service code point can be stored in the TCAM memory to improve the utilization rate of the TCAM memory resources.

[0085] In this embodiment, after the first part of the ACL table entry is stored in the TCAM storage, a first identifier is assigned, such as the Cascade Action in Table 2 or Table 3, and after the second part is stored in the SRAM memory, a second identifier is assigned, such as the Cascade Key in Table 2 or Table 3. The first identifier and the second identifier are uniquely corresponding.

[0086] In an example, assuming that there are three ACL entries, ACL1, ACL2, and ACL3, they are stored according to the methods in the above embodiments, as shown in Table 4:

[0087]

[0088]

[0089] Table 4

[0090] In Table 4, ACL1, ACL2, and ACL3 are split into the first part and the second part respectively. The first parts of ACL1, ACL2, and ACL3 are stored in the TCAM memory, that is, the contents of ACL1 TCAM, ACL2TCAM, and ACL3 TCAM in Table 4, and the second parts of ACL1, ACL2, and ACL3 are stored in the SRAM memory, that is, the contents of ACL1 SRAM, ACL2 SRAM, and ACL3SRAM in Table 4.

[0091] The first identifiers Cascade Action1, Cascade Action1, and Cascade Action3 are assigned to ACL1 TCAM, ACL2 TCAM, and ACL3 TCAM, respectively, and the second identifiers Cascade Key1, Cascade Key1, and Cascade Key3 are assigned to ACL1 SRAM, ACL2 SRAM, and ACL3 SRAM, respectively. It can be seen that the first identifiers of ACL1 TCAM and ACL2 TCAM are the same, and since the first identifier uniquely corresponds to the second identifier, the second identifiers of ACL1 SRAM and ACL2 SRAM are both Cascade Key1.

[0092] In one example, if the rule information sent in the TCAM is the same, then the two ACLs will be assigned the same Cascade Key, and only one split ACL needs to be sent in the TCAM resource. However, the ACL sent in the SRAM still needs to send two split ACL rules because its corresponding rule information is different.

[0093] It should be noted that, in this embodiment, when the network device configures the ACL feature, it will be applied to both the inbound direction and the outbound direction of the interface. The ACL in both the inbound and outbound directions is applicable to the technology in this disclosure.

[0094] It can be seen from the above embodiments that when storing ACL table entries, the ACL table entries are split and stored in the TCAM memory and the SRAM memory respectively, which can effectively improve the specifications of the ACL characteristics of the network device. In theory, its specifications can be increased to 200%-300% on the original basis, and the ACL characteristic redundancy can be reduced by 50%-100%.

[0095] For example, in a set of test results, the environment background is a certain network device of an operator, and its TCAM resources are: 12*1024*160bit=12288*160bit,

[0096] Among them, 12: indicates that there are 12 Bank resources that can be accessed in parallel.

[0097] 1024: Indicates that there are Entry resources in each Bank that need to be accessed serially.

[0098] 160bit: indicates that each Entry resource can store an ACL with a maximum width of 160 bits.

[0099] Among them, its TCAM resources are: 12*1024*160bit=12288*160bit

[0100] When an ACL is applied to an interface of a device, and the same ACL rules are applied to both inbound and outbound directions, the same IPv4 and IPv6 ACLs are used.

[0101] 1. When using TCAM resources alone: ​​an IPv4 ACL needs to occupy 1*160 bits, so inbound and outbound need to occupy 2*160 bits at the same time; an IPv6 ACL needs to occupy 1*320 bits, so inbound and outbound need to occupy 2*320 bits = 4*160 bits at the same time. The ACL specifications that the device can finally support are 2048 IPv4 ACLs and 2048 IPv4 ACLs. It can meet the needs of parallel and high-performance lookups.

[0102] 2. When using SRAM resources alone: ​​the requirements cannot be met, only IPv4 ACL can be supported, and IPv6 ACL cannot be delivered.

[0103] 3. When TCAM and SRAM resources are integrated: one IPv4 ACL needs to occupy 1*80bit TCAM resources and 2*60bit SRAM resources; one IPv6 ACL needs to occupy 1*160bit TCAM resources and 2*60bit SRAM resources. Limited by the specifications of TCAM resources, the ACL specifications that the final device can support are 8192 IPv4 ACLs and 8192 IPv6 ACLs. It can meet the needs of parallel and high-performance lookups.

[0104] The test results show that increasing the ACL specifications of the operator's network equipment by 300% can reduce the redundancy of ACL features by 50% (in the case where each ACL is completely different, if the parts of the ACLs that are split and sent to the TCAM are the same, the redundancy can be further reduced).

[0105] Based on the above method embodiments, the present disclosure also provides a method for matching ACL entries, such as Figure 4 As shown, the method includes:

[0106] S401 receives a first message and obtains source IP and destination IP information of the first message;

[0107] S402 uses the source IP and destination IP information of the first message to match the first part of each ACL table entry stored in the TCAM memory, and obtains a first identifier according to the matching result;

[0108] S403 uses the first identifier and part or all of the information in Srcport, Dstport, Ip protocol, Next Header, Dscp, and Port of the first message to match the second part of each ACL table entry stored in the SRAM memory to obtain a matching result;

[0109] S404 processes the first message according to the matching result;

[0110] Among them, the first part includes the correspondence between the source IP and destination IP information of each ACL table item and the first identifier, and the second part includes the correspondence between part or all of the information in Srcport, Dstport, Ip protocol, Next Header, Dscp, and Port of each ACL table item and the second identifier, wherein each first identifier uniquely corresponds to each second identifier.

[0111] In step S401, after receiving the first message, the network device may determine the ACL policy of the first message through two matches, wherein after receiving the first message, the network device first selects the content for matching with the TCAM memory.

[0112] For example, if the first part stored in the TCAM memory includes: source IP and destination IP information, the source IP and destination IP information carried are obtained from the first message. In other embodiments, if the first part stored in the TCAM memory includes: source IP, destination IP information and Srcport, the source IP, destination IP and Srcport information carried are obtained from the first message.

[0113] In this embodiment, the source IP and destination IP information obtained from the first message is matched with the first part of each ACL table entry stored in the TCAM memory, as shown in Table 4. Assuming that the match is determined to be with the ACL1 TCAM, the first identifier: Cascade Action1 is obtained.

[0114] After obtaining Cascade Action1, Cascade Action1 is superimposed with other information in the first message except the source IP and destination IP information, and the superimposed content is matched with the content in the SRAM memory.

[0115] In one embodiment, the superimposed content can be matched one by one with all the content in the SRAM memory. In another embodiment, the superimposed content can be matched with the content corresponding to Cascade Action1 in the SRAM memory. In this method, the range in the SRAM memory used to match the superimposed content can be narrowed first, thereby saving the computing resources of the network device and improving the matching speed.

[0116] Among them, when matching other information of the first message except IP and destination IP information with the SRAM memory, the other information of the first message except IP and destination IP information and Cascade Action (first identifier) ​​can be first obtained by hash calculation through hash value, and the hash value and the first identifier are used to determine the target second part area stored in the SRAM. In this step, the second part can be stored using the hash value and the second identifier as indexes. For example, in the SRAM memory, the same hash value can correspond to multiple second parts of content, and the part corresponding to the second identifier in the SRAM memory is determined by the first identifier, and the target second part area is determined from the part corresponding to the second identifier by the hash value (in other embodiments, the part corresponding to the hash value of the first message in the SRAM can also be determined first, and then the target second part area is determined according to the second identifier corresponding to the first identifier), and part or all of the information in Srcport, Dstport, Ip protocol, NextHeader, Dscp, and Port of the first message is used to match the target second part area to obtain a matching result.

[0117] In step S404, the first message is processed according to the matching result, including discarding the first message or processing the first message according to the matching result.

[0118] It can be seen from the above embodiments that after the ACL is split and issued, matching is performed from TCAM resources in the Ingress ACL-1 stage, and matching is performed from SRAM resources in the Ingress ACL-2 / Egress ACL stage, so that the specifications of the ACL characteristics of the operator network equipment can be significantly improved, generally the specifications can be increased to 200%-300% on the original basis, and the ACL characteristic redundancy can be reduced by 50%-100%.

[0119] Based on the above embodiments, the embodiment of the present disclosure further provides a network device, wherein the network device is configured with a TCAM memory and an SRAM memory, and the network device includes:

[0120] an acquisition module, configured to acquire an ACL entry to be stored, and split the ACL entry into a first part and a second part, wherein the first part includes a source address and a destination address of the ACL entry, and the second part includes part or all of the information in Srcport, Dstport, Ip protocol, Next Header, Dscp, and Port of the ACL entry;

[0121] The processing module is used for storing the first part in the TCAM memory and storing the second part in the SRAM memory.

[0122] Based on the above embodiments, the present disclosure further provides a network device, the network device comprising:

[0123] A receiving module, used to receive a first message and obtain source IP and destination IP information of the first message;

[0124] A matching module, configured to match the source IP and destination IP information of the first message with the first part of each ACL table entry stored in the TCAM memory, and obtain a first identifier according to the matching result;

[0125] The matching module is further used to use the first identifier and part or all of the information in Srcport, Dstport, Ipprotocol, Next Header, Dscp, and Port of the first message to match the second part of each ACL table entry stored in the SRAM memory to obtain a matching result;

[0126] A processing module, used for processing the first message according to the matching result;

[0127] Among them, the first part includes the correspondence between the source IP and destination IP information of each ACL table item and the first identifier, and the second part includes the correspondence between part or all of the information in Srcport, Dstport, Ip protocol, Next Header, Dscp, and Port of each ACL table item and the second identifier, wherein each first identifier uniquely corresponds to each second identifier.

[0128] The matching module is specifically used to combine part or all of the information in Srcport, Dstport, Ip protocol, Next Header, Dscp, and Port of the first message with the first identifier, and obtain a hash value through hash calculation;

[0129] Determine the target second partial area stored in the SRAM using the hash value and the first identifier;

[0130] Part or all of the information in Srcport, Dstport, Ip protocol, Next Header, Dscp, and Port of the first message is matched with the second part area of ​​the target to obtain a matching result.

[0131] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this specification. A person of ordinary skill in the art can understand and implement it without paying creative labor.

[0132] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0133] Those skilled in the art will readily appreciate other embodiments of the specification after considering the specification and practicing the invention claimed herein. The specification is intended to cover any variations, uses or adaptations of the specification that follow the general principles of the specification and include common knowledge or customary techniques in the art that are not claimed in the specification. The specification and examples are to be considered exemplary only, and the true scope and spirit of the specification are indicated by the following claims.

[0134] It should be understood that the present description is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present description is limited only by the appended claims.

[0135] The above description is only a preferred embodiment of this specification and is not intended to limit this specification. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of this specification should be included in the scope of protection of this specification.

Claims

1. A method for storing ACL entries, characterized in that: The method comprises: Obtain the ACL entry to be stored, and split the ACL entry into a first part and a second part; The first part includes the source address and destination address of the ACL entry, and the second part includes part or all of the information of Srcport, Dstport, Ip protocol, Next Header, Dscp, and Port of the ACL entry; The first part is stored in the TCAM memory, and the second part is stored in the SRAM memory.

2. The method according to claim 1, characterized in that The step of storing the first part in a TCAM memory and storing the second part in an SRAM memory comprises: Storing the first part in a TCAM memory and assigning a first identifier; storing the second part in the SRAM memory and assigning a second identifier; The first identifier uniquely corresponds to the second identifier.

3. The method according to claim 1, characterized in that The first part also includes one of the source interface, the destination interface, the IP protocol, the service code point, and the Next Header in the ACL table item; the second part includes the information in the ACL table item other than the first part.

4. A method for matching ACL entries, characterized in that: The method comprises: Receive a first message, and obtain source IP and destination IP information of the first message; Using the source IP and destination IP information of the first message to match the first part of each ACL table entry stored in the TCAM memory, and obtaining a first identifier according to the matching result; Using the first identifier and part or all of the information in Srcport, Dstport, Ip protocol, Next Header, Dscp, and Port of the first message to match the second part of each ACL table entry stored in the SRAM memory to obtain a matching result; Processing the first message according to the matching result; Among them, the first part includes the correspondence between the source IP and destination IP information of each ACL table item and the first identifier, and the second part includes the correspondence between part or all of the information in Srcport, Dstport, Ip protocol, Next Header, Dscp, and Port of each ACL table item and the second identifier, wherein each first identifier uniquely corresponds to each second identifier.

5. The method according to claim 4, characterized in that The method of using the first identifier and part or all of the information in Srcport, Dstport, Ip protocol, Next Header, Dscp, and Port of the first message to match the second part of each ACL table entry stored in the SRAM memory to obtain a matching result includes: Combine part or all of the information in Srcport, Dstport, Ip protocol, Next Header, Dscp, and Port of the first message with the first identifier, and obtain a hash value through hash calculation; Determine the target second partial area stored in the SRAM using the hash value and the first identifier; Part or all of the information in Srcport, Dstport, Ip protocol, Next Header, Dscp, and Port of the first message is matched with the second part area of ​​the target to obtain a matching result.

6. The method according to claim 4, characterized in that The first part also includes one of the source interface, the destination interface, the IP protocol, the service code point, and the Next Header in the ACL table item; the second part includes the information in the ACL table item other than the first part.

7. The method according to claim 4, characterized in that The processing of the first message according to the matching result includes: The first message is discarded or passed according to the matching result.

8. A network device, characterized in that: The network device is configured with a TCAM memory and an SRAM memory, and the network device comprises: an acquisition module, configured to acquire an ACL entry to be stored, and split the ACL entry into a first part and a second part, wherein the first part includes a source address and a destination address of the ACL entry, and the second part includes part or all of the information in Srcport, Dstport, Ip protocol, Next Header, Dscp, and Port of the ACL entry; The processing module is used for storing the first part in the TCAM memory and storing the second part in the SRAM memory.

9. A network device, characterized in that: The network equipment includes: A receiving module, used to receive a first message and obtain source IP and destination IP information of the first message; A matching module, configured to match the source IP and destination IP information of the first message with the first part of each ACL table entry stored in the TCAM memory, and obtain a first identifier according to the matching result; The matching module is further used to use the first identifier and part or all of the information in Srcport, Dstport, Ip protocol, Next Header, Dscp, and Port of the first message to match the second part of each ACL table entry stored in the SRAM memory to obtain a matching result; A processing module, used for processing the first message according to the matching result; Among them, the first part includes the correspondence between the source IP and destination IP information of each ACL table item and the first identifier, and the second part includes the correspondence between part or all of the information in Srcport, Dstport, Ip protocol, Next Header, Dscp, and Port of each ACL table item and the second identifier, wherein each first identifier uniquely corresponds to each second identifier.

10. The network device according to claim 9, characterized in that: The matching module is specifically used to combine part or all of the information in Srcport, Dstport, Ip protocol, Next Header, Dscp, and Port of the first message with the first identifier, and obtain a hash value through hash calculation; Determine the target second partial area stored in the SRAM using the hash value and the first identifier; Part or all of the information in Srcport, Dstport, Ip protocol, Next Header, Dscp, and Port of the first message is matched with the second part area of ​​the target to obtain a matching result.

Citation Information

Patent Citations

  • Generation method and device for access control list application

    CN101651623A

  • Method and device for configuring ACL table item

    CN107168900A

  • Message processing method and device, equipment and medium

    CN115834515A

  • Multicast table processing method and device and electronic equipment

    CN115955435A

  • Data transmission method and device based on IPSEC VPN

    CN117879996A

Cited By

  • Methods for storing ACL entries and methods for matching ACL entries and network apparatuses

    EP4704379A1