Method for performing packet filtering in a network switch and related filters
By using the access control list circuit and routing circuit in the network switch to record only part of the IP address, the hardware cost and circuit area problems under the IPv6 protocol are solved, and the more powerful network switch filtering function is realized. Safety protection.
Patent Information
- Application Number
- CN202110281073.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-16
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2041-03-16
AI Technical Summary
When implementing the IPv6 protocol, existing Ethernet switches have increased IP address fields in the access control list, resulting in a burden of hardware cost and circuit area, and it is difficult to improve the filter setability without increasing hardware requirements. Safety protection function.
By introducing the coordinated operation of the access control list circuit and the routing circuit in the network switch, the access control list only records part of the IP address, while the routing circuit records the complete IP address, thereby realizing packet filtering and reducing the need for access control list hardware. , and provides more powerful filtering without adding hardware.
Effectively reduces the hardware requirements of the access control list circuit, expands the function and setability of the filter, enhances the security protection function of the network switch, and can perform IP header verification, MAC/IP address checks and unicast reverse paths. Verifications such as forwarding have improved the functional strength of the firewall and black and white lists.
Smart Images

Figure CN115150107B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a network switch, a method for performing packet filtering in the network switch through the coordinated operation of an access control list circuit and a routing circuit, and a related filter. Background Art
[0002] In Ethernet communication systems, a network switch is a piece of hardware that connects devices on a network system by receiving and forwarding data to a target device through packet switching. A network switch can filter packets according to administrator policies, thereby implementing network security protection mechanisms such as firewalls, whitelists, or blacklists.
[0003] Generally speaking, Ethernet switches contain access control lists. Based on management policies, the items in the access control list define specific rule information to allow or prohibit specific packets from being forwarded through the switch, thereby achieving packet filtering. In order to increase the speed of packet switching, the function of the access control list is usually implemented by a hardware circuit, which includes a memory for recording the access control list and a comparison circuit for comparing the packet header information with the items in the access control list. Therefore, if the configurability of the access control list needs to be improved, the relevant hardware circuit must be expanded.
[0004] On the other hand, with the evolution of network generations, IPv6 protocol has gradually become popular. Although it has solved the problem of insufficient IP addresses, it has also brought impacts on network devices. For example, the field requirements of the aforementioned active access control list will increase significantly due to the longer IP addresses in the IPv6 protocol. Under normal circumstances, an item in the access control list may require more than 40 bytes of memory space, which is a considerable burden on the hardware cost and circuit area of the Ethernet switch. Summary of the invention
[0005] In view of this, the present invention provides a method for performing packet filtering in a network switch. Among them, the present invention realizes the packet filtering function of the network switch through the joint operation of an access control list circuit and a routing circuit. In the present invention, the access control list circuit will filter according to a part of the source IP address and / or a part of the destination IP address, and the routing circuit will filter according to the complete source IP address and / or the complete destination IP address. Further, in the process of packet filtering, the items in the access control list will only record part of the source IP address and / or the destination IP address, while the routing table in the routing circuit will record the complete content of the source IP address and the destination IP address. Through such a design method, the present invention can effectively reduce the hardware requirements for the access control list circuit.
[0006] An embodiment of the present invention provides a method for performing packet filtering in a network switch, the method comprising: filtering received packets using an access control list circuit, wherein the access control list circuit performs filtering by comparing the header information of the received packets according to the access control list, the access control list having at least one item, and the rule information for an IP address in the item only includes a portion of the IP address, and the portion of the IP address does not overlap with the portion of the IP address in other access control lists; and filtering the packets passing through the access control list circuit again using a routing circuit, wherein the routing circuit performs filtering by comparing the header information of the packets passing through the access control list circuit according to a routing table, wherein the routing table has at least one item, and the rule information for an IP address in the item includes the complete content of the IP address.
[0007] An embodiment of the present invention provides a filter implemented in a network switch, the filter comprising: an access control list circuit and a routing circuit. The access control list circuit is used to filter received packets, wherein the access control list circuit performs filtering by comparing the header information of the received packets according to the access control list, the access control list has at least one item, and the rule information for the IP address in the item only includes part of the IP address, and the part of the IP address does not overlap with the part of the IP address in other access control lists. The routing circuit is used to filter the packets passing through the access control list circuit again, wherein the routing circuit performs filtering by comparing the header information of the packets passing through the access control list circuit according to the routing table, wherein the routing table has at least one item, and the rule information for the IP address in the item includes the complete content of the IP address. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] Figure 1 The filter structure diagram of one embodiment of the present invention.
[0009] Figure 2A and Figure 2B They are schematic diagrams of the item contents of the access control list and the routing table in the embodiments of the present invention respectively.
[0010] Figure 3 FIG. 1 is a schematic diagram of the hardware stages of a network switch according to an embodiment of the present invention.
[0011] Figure 4 A flowchart of a filter according to an embodiment of the present invention. DETAILED DESCRIPTION
[0012] In the following text, many specific details are described to provide readers with a thorough understanding of the embodiments of the present invention. However, those skilled in the art will understand how to implement the present invention without one or more specific details, or using other methods, elements, materials, etc. In other cases, well-known structures, materials, or operations will not be shown or described in detail to avoid obscuring the core concepts of the present invention.
[0013] The reference to "one embodiment" in the specification means that the specific features, structures or characteristics described in the embodiment may be included in at least one embodiment of the present invention. Therefore, the "in one embodiment" that appears in various places in this specification does not necessarily mean the same embodiment. In addition, the aforementioned specific features, structures or characteristics can be combined in one or more embodiments in any suitable form.
[0014] Please refer to Figure 1 , which shows an architecture diagram of a filter according to an embodiment of the present invention. As shown in the figure, the filter 100 is implemented by multiple hardware components of the network switch 10, and is used in the network switch 10 to filter the packets received by the network switch. Among them, the filter 100 includes an access control list circuit 110 and a routing circuit 120. The access control list circuit 110 includes a comparison circuit 112 and a storage unit 113. The storage device 113 stores an access control list 111, which has multiple items EA1~EAN. The content of the items is determined by the administrator's policy. Each of the items EA1~EAN records specific rule information, such as the characteristics of the packets that can pass through the filter 100, or the packets that cannot pass through the filter 100. These characteristics are as follows: Figure 2A As shown, it includes (but is not limited to): one or more of the source IP address, the destination IP address, the source port number, the destination port number, the source / destination media access control address, and the Ethernet type. The access control list circuit 110 will compare the rule information recorded in the items EA1~EAN and the information recorded in the packet header through the comparison circuit 112 to determine whether a packet can pass the screening of the access control list circuit 110, and the packet that meets the rule information will be further transmitted to the routing circuit 120, and the packet that does not meet the rule information will be discarded. In the access control list 111 of the access control list circuit 110, only part of the source IP address and the destination IP address are recorded in the rule information for the source IP address and the destination IP address. In addition, it should be noted that the part of the content about the IP address in the access control list 111 does not overlap with the part of the IP address in other access control lists in the access control list circuit 110.
[0015] Furthermore, if the network switch 10 is a network device that complies with the IPv6 protocol, the source IP address and the destination IP address in the header information of the received packet also comply with the IPv6 protocol and may be 128 bits long. The rule information about the source IP address and the destination IP address recorded in the access control list 111 does not contain the full 128 bits, but only a part of the 128 bits. In other words, when the source IP address and / or the destination IP address of a packet comply with the rule information in the access control list 111, it is still possible that it cannot pass the screening performed by the routing circuit 120 in the next stage. In addition, it should be noted that Figure 2A The content of the items in the access control list 111 shown is not a limitation of the invention. In different embodiments of the invention, the rule information of an item in the access control list 111 may include more or fewer grouping features.
[0016] Furthermore, the routing circuit 120 includes a storage unit 123, and the storage unit 123 has a routing table 121. When implementing the packet filtering operation of the filter 110, the items EB1-EBK of the routing table 121 may be as follows: Figure 2B As shown, at least one or more of the packet characteristics such as source IP address, destination IP address, source port number, destination port number, etc. are recorded. Routing circuit 120 will compare the packet header information with items EB1~EBK in routing table 121 to determine whether a packet can pass through filter 100. Packets that meet the content of items EB1~EBK will pass through to the next layer (L3) and wait for other parts of the network switch 10 to forward the packet. Packets that do not meet the content of the items will be discarded. In the present invention, the complete content of the source IP address and the destination IP address are recorded in the items for the source IP address and the destination IP address in routing table 121. In the example of IPv6, the rule information about the source IP address and the destination IP address recorded in routing table 121 contains complete 128 bits of information. In addition, it should be noted that Figure 2B The content of the items in the routing table 121 is not intended to be limiting of the invention. In different embodiments of the invention, the rule information of an item in the routing table 121 may include more or fewer grouping features.
[0017] Since the routing circuit 120 also serves as the routing engine of the network switch 10, and packet filtering belongs to L2 behavior, the routing circuit 120 will turn off some functions belonging to L3 behavior when performing packet filtering operations, so that the routing circuit 120 will not perform any possible modification operations on the packet header when performing packet filtering. These prohibited modification operations include: replacing the source address (Source Address Replacement), modifying the virtual local area network ID (VirtualLAN ID Replacement) and reducing the packet hop limit (Hop limit), etc.; the above-mentioned functions will be turned off when the routing circuit 120 performs packet filtering operations, and will not be turned on until the routing circuit 120 performs packet routing.
[0018] In one embodiment, when performing packet filtering operations, the routing circuit 120 may perform other verification / check operations, such as IP header verification, MAC / IP address verification, such as checking for address inconsistency, zero address, and IP class (IPClass), or performing unicast reverse path forwarding checks, in addition to comparing header information based on items in the routing table 121 to determine whether to discard or forward packets. Generally speaking, if these verification / check operations are implemented via the access control list circuit 110, the hardware requirements of the access control list circuit 110 will increase. However, the routing circuit 120 itself has circuit elements for implementing the above verification / check operations. Therefore, the filter 100 of the present invention can provide functions such as IP header verification, MAC / IP address verification, and unicast reverse path forwarding checks without increasing the hardware requirements of the access control list circuit 110.
[0019] In the present invention, the hardware of the access control list circuit 110 and the routing circuit 120 must be implemented in different hardware stages of the network switch 10, so as to ensure that the access control list circuit 110 and the routing circuit 120 can work together to perfectly implement the filter 100. If the two are implemented in the same hardware stage, hardware resource conflicts may occur. Please refer to Figure 3 Schematic diagram of hardware stages. As shown in the figure, the network switch 10 of the present invention can set the processing circuit related to packet parsing in the first-stage hardware S1, set the access control list circuit 110 in the second-stage hardware S2, set the processing circuit related to the virtual local area network in the third-stage hardware S3, and set the routing circuit 120 in the fourth-stage hardware S4. Please note that the above description is only an example of the present invention. In other embodiments of the present invention, the number of hardware stages of the network switch 10 may be more or less, and the arrangement method of the circuit units in the network switch 10 is also different from the example shown in the figure.
[0020] Figure 4 A simplified flow chart of a method for implementing packet filtering by using the coordinated operation of the access control list circuit 110 and the routing circuit 120 in the above embodiment is shown. The flow chart includes the following steps:
[0021] Step 210: Filter the received packets using an access control list circuit, wherein the access control list circuit filters by comparing the header information of the received packets according to the access control list, the access control list has at least one item, and the rule information for the IP address in the item only includes part of the IP address, and the part of the IP address does not overlap with the part of the IP address in other access control lists; and
[0022] Step 220: Utilize the routing circuit to filter the packets passing through the access control list circuit again, wherein the routing circuit compares the header information of the packets passing through the access control list circuit according to the routing table to filter, wherein the routing table has at least one item, and the information for the IP address in the item contains the complete content of the IP address.
[0023] Since the principles and operational details of the above steps have been clearly explained in the previous embodiments, they will not be further explained here. It is worth noting that in other embodiments of the present invention, the overall effect of the technology can be improved by adding other additional steps based on known techniques in the field.
[0024] In summary, the present invention expands the function / configurability of the filter without increasing the hardware requirements of the access control list circuit, making the firewall, black / white list and other functions of the network switch more powerful. In addition, part of the packet filtering operation of the present invention is implemented by the routing circuit in the network switch, which allows the present invention to perform verification / check operations including: IP header verification, MAC / IP address verification, and unicast reverse path forwarding when performing packet filtering operations, which is an effect that traditional access control list circuits cannot achieve. Therefore, the present invention significantly improves the security protection function of the network switch.
[0025] The embodiments of the present invention may be implemented using hardware, software, firmware, and combinations thereof. By using an appropriate instruction execution system, the embodiments of the present invention may be implemented using software or firmware stored in a memory. As for hardware, any of the following technologies or combinations thereof may be used to implement the embodiments: individual operation logic having logic gates that can perform logic functions according to data signals, an application specific integrated circuit (ASIC) having suitable combinational logic gates, a programmable gate array (PGA), or a field programmable gate array (FPGA), etc.
[0026] The flow process and square block in the flow chart in the specification illustrate the architecture, function and operation that can be realized by the system, method and computer software product based on various embodiments of the present invention. In this respect, each square block in the flow chart or function block diagram can represent the module, section or part of the program code, which includes one or more executable instructions for realizing the specified logical function. In addition, each square block in the function block diagram and / or the flow chart, and the combination of square blocks, can be basically realized by the special hardware system that performs the specified function or action, or the combination of special hardware and computer program instructions. These computer program instructions can also be stored in a computer-readable medium, which can make a computer or other programmable data processing device work in a special way, so that the instructions stored in the computer-readable medium realize the function / action specified by the square block in the flow chart and / or the function block diagram.
[0027] The above description is only a preferred embodiment of the present invention. All equivalent changes and modifications made according to the scope of the patent application of the present invention should fall within the scope of the present invention.
[0028] Description of Reference Numerals
[0029] 10 Network switch
[0030] 100 Filters
[0031] 110 Access Control List Circuit
[0032] 111 Access Control List
[0033] 112 Comparison Circuit
[0034] 113 Storage Units
[0035] 120 Routing Circuit
[0036] 121 Routing Table
[0037] 123 Storage Units
[0038] EA1~EAN、EB1~EBK Table items
[0039] S1~S4 Hardware Stage
[0040] Steps 210-220
Claims
1. A method for performing packet filtering in a network switch, comprising: Filtering the received packets using an access control list circuit, wherein the access control list circuit compares the header information of the received packets according to the access control list to perform filtering, the access control list having at least one item, and the rule information for the IP address in the item only includes part of the IP address, and the part of the IP address does not overlap with the part of the IP address in other access control lists; and The packets passing through the access control list circuit are filtered again using a routing circuit, wherein the routing circuit compares the header information of the packets passing through the access control list circuit according to a routing table to perform filtering, wherein the routing table has at least one item, and the rule information for the IP address in the item contains the complete content of the IP address.
2. The method of claim 1, wherein the access control list circuit and the routing circuit are respectively set in different hardware stages of the network switch.
3. The method as claimed in claim 1, wherein the rule information in the item of the access control list also includes at least one of a portion of the source IP address, a portion of the destination IP address, a source port number, a destination port number, a media access control address, and an Ethernet network type.
4. The method of claim 1, wherein the rule information in the item of the routing table further includes at least one of a complete source IP address, a complete destination IP address, a source port number, and a destination port number.
5. The method of claim 1, wherein the step of using the routing circuit to filter comprises: When the routing circuit performs packet filtering, the routing circuit is not used to modify the header information of the packet passing through the access control list circuit, wherein the modification operation includes: replacing the source address, modifying the virtual local area network ID, and reducing the packet hop limit.
6. The method of claim 1, wherein the step of using the routing circuit to perform filtering comprises: When the routing circuit performs packet filtering, the routing circuit is used to perform verification / checking operations on the packets passing through the access control list circuit, wherein the verification / checking operations include at least one of IP header verification, MAC / IP address verification, and unicast reverse path forwarding.
7. The method of claim 1, wherein the network switch is a network device compliant with the IPv6 protocol, and the IP address is in IPv6 format.
8. A filter implemented in a network switch, comprising: An access control list circuit, used for filtering received packets, wherein the access control list circuit filters by comparing header information of received packets according to the access control list, the access control list having at least one item, and the rule information for the IP address in the item only includes part of the IP address, and the part of the IP address does not overlap with the part of the IP address in other access control lists; and A routing circuit is used to filter the packets passing through the access control list circuit again, wherein the routing circuit compares the header information of the packets passing through the access control list circuit according to the routing table to perform filtering, wherein the routing table has at least one item, and the rule information for the IP address in the item contains the complete content of the IP address.
9. The filter as claimed in claim 8, wherein the access control list circuit and the routing circuit are respectively disposed in different hardware stages of the network switch.
10. The filter as claimed in claim 8, wherein the rule information in the item of the routing table further includes at least one of a complete source IP address, a complete destination IP address, a source port number, and a destination port number.
