Multi-stage TCAM matching in network devices
Patent Information
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- INFINEON TECHNOLOGIES AMERICAS CORP
- Filing Date
- 2024-06-07
- Publication Date
- 2026-06-23
Smart Images

Figure 2026520566000001_ABST
Abstract
Claims
1. A method for processing packets by a network device operating in a network having multiple network nodes, the method comprising the following steps: The steps include: generating one or more search keys using the network device, which include information obtained from one or more fields in the header of a packet processed by the network device; The network device performs a first-stage search in a first-stage memory to map the one or more search keys to one or more search key identifiers, wherein each of the one or more search key identifiers is determined by a step shorter than the corresponding one of the one or more search keys. The step of the network device performing a second-stage search in the second-stage memory based on the combination of one or more search key identifiers in order to identify an entry in the second-stage memory that matches the combination of one or more search key identifiers, wherein the entry indicates a rule matched by the packet from a set of rules defined by the network device for processing packets. A method comprising the step of performing an action associated with the rule with respect to the packet.
2. The method according to claim 1, wherein the step of performing a first-stage search in the first-stage memory includes the step of performing a first-stage search based on a specific search key from one or more search keys in a first-stage tri-valued associative memory (TCAM) which includes a plurality of entries storing only a subset of possible values of a header field corresponding to a specific search key, the subset of possible values including only values used by nodes in the network.
3. The method according to claim 2, wherein the step of performing the first-stage search in the first-stage TCAM based on the specific search key includes the step of searching the first-stage TCAM to find an entry that matches the specific search key, the index of the entry that matches the specific search key corresponds to a search key identifier mapped to the specific search key.
4. The method according to claim 2, wherein the step of performing the first-stage search in the first-stage memory includes the step of performing each search in each of a plurality of first-stage TCAMs based on each of the one or more search keys to find each entry that matches each of the one or more search keys, the index of each entry that matches each of the one or more search keys corresponds to each search key identifier that maps to each search key.
5. The method according to claim 1, wherein the step of performing the second-stage search includes performing the second-stage search in a second-stage ternary associative memory (TCAM) having a plurality of entries that store search patterns corresponding to different combinations of one or more search key identifiers shorter than one of the corresponding search keys for one or more search keys.
6. The set of rules defined for processing packets by the aforementioned network device includes one or more rules that include a range of port numbers. The method according to claim 5, wherein the step of performing the first-stage search includes identifying an entry in the first-stage memory which includes a mask value that maps any value within a given range of port numbers to the same search key identifier.
7. The set of rules defined for processing packets by the aforementioned network device includes a first rule that includes a range of port numbers, and a second rule that includes port numbers within the range of port numbers; The step of performing the first stage search includes identifying a first entry in the first stage memory that includes a masked value and maps any value within the port number range to a first search key identifier, or identifying a second entry that includes a port number within the port number range and maps a port number within the port number range to a second search key identifier different from the first search key identifier. The method according to claim 5, wherein the step of performing the second-stage search includes identifying entries in the second-stage memory that match both the first search key identifier and the second search key identifier.
8. The step of performing a first-stage search in the first memory is: i) Mapping Layer 3 information extracted from the Layer 3 header of a packet and contained in one or more search keys to one or more search key identifiers, ii) Mapping Layer 4 information extracted from the Layer 4 header of a packet and contained in one or more search keys to one or more search key identifiers, The method according to claim 1, comprising the step of performing the first-stage search for one or both of the mappings.
9. The step of performing a first-stage search in the first memory is: i) Mapping a first lookup key extracted from the packet header, which includes an Internet Protocol version 4 (IPv4) or Internet Protocol version 6 (IPv6) source address, to a first lookup key identifier. ii) Mapping a second lookup key, extracted from the packet header and containing an IPv4 or IPv6 destination address, to a second lookup key identifier. iii) Mapping a third lookup key extracted from the packet header, which includes the source port number of the Transmission Control Protocol (TCP) or User Datagram Protocol (UDP), to a third lookup key identifier, or iv) Mapping a fourth lookup key, extracted from the packet header and containing the TCP or UDP destination port number, to a fourth lookup key identifier. The method according to claim 1, comprising the step of performing a first-stage search for one or more mappings among them.
10. The method according to claim 1, wherein the network is an automotive Ethernet network within a vehicle, and the step of performing an action associated with a rule concerning a packet includes the step of sending the packet to another device within the vehicle via the automotive Ethernet network.
11. A network device, The aforementioned network device, A packet processor configured to process packets communicated over a network having multiple network nodes, the packet processor includes a key generator configured to generate one or more lookup keys based on one or more header fields in the header of a packet processed by the network device, The aforementioned network device, A search engine is configured to determine an action to be taken with respect to a packet based on one or more search keys, and the search engine is configured to determine To map one or more search keys to one or more search key identifiers, a first-stage search is performed in first-stage memory, and each of the one or more search key identifiers is shorter than one of the corresponding search keys. In the second stage of memory, in order to identify entries that match one or more combinations of search key identifiers, the second stage search is performed based on the one or more combinations of search key identifiers, and the entries indicate the rules matched by the packets. Based on the rules matched by the packet, identify the action to be taken regarding the packet. Based on the aforementioned rules, provide the packet processor with instructions to perform an action on the packet. A network device configured in such a way.
12. The network device according to claim 11, wherein the first-stage memory includes a first-stage tri-valued associative memory (TCAM) having a plurality of entries that store only a subset of possible values of a header field corresponding to a particular search key, the subset of possible values including only values used by nodes in the network.
13. The network device according to claim 12, wherein the search engine is configured to search a first-stage TCAM based on a specific search key to find entries that match the specific search key, and the index of entries that match the specific search key corresponds to a search key identifier that maps to the specific search key.
14. The network device according to claim 12, wherein the first stage TCAM includes a plurality of TCAMs, each having an entry that stores each subset of possible values of each header field corresponding to each search key, and each subset of possible values includes only values used by nodes in the network.
15. The network device according to claim 12, wherein the second-stage memory includes a second-stage TCAM that stores a plurality of entries for storing search patterns corresponding to different combinations of one or more search key identifiers shorter than one corresponding to one or more search keys.
16. The set of rules defined for processing packets by the aforementioned network device includes one or more rules that include a range of port numbers. The network device according to claim 15, wherein the search engine is configured to identify entries in a first-stage memory that include a mask value that maps any value within a given range of port numbers to the same search key identifier in the first-stage search.
17. A set of rules defined for processing packets by a network device includes a first rule that includes a range of port numbers, and a second rule that includes port numbers within the said range of port numbers. The aforementioned search engine In the first stage of the search, a first entry in the first stage memory is identified that includes a masked value and maps any value within the port number range to a first search key identifier, or a second entry is identified that includes a port number within the port number range and maps a port number within the port number range to a second search key identifier different from the first search key identifier. The second stage of the search identifies entries in the second stage memory that match both the first and second search key identifiers. The network device according to claim 15, configured as described above.
18. The aforementioned packet processor, i) Mapping Layer 3 information extracted from the Layer 3 header of a packet and contained in one or more search keys to one or more search key identifiers, ii) Mapping Layer 4 information extracted from the Layer 4 header of a packet and contained in one or more search keys to one or more search key identifiers, The network device according to claim 11, configured to perform a first-stage search for one or both of the mappings.
19. The aforementioned packet processor, i) Mapping a first lookup key extracted from the packet header, which includes an Internet Protocol version 4 (IPv4) or Internet Protocol version 6 (IPv6) source address, to a first lookup key identifier. ii) Mapping a second lookup key, extracted from the packet header and containing an IPv4 or IPv6 destination address, to a second lookup key identifier. iii) Mapping a third lookup key extracted from the packet header, which includes the source port number of the Transmission Control Protocol (TCP) or User Datagram Protocol (UDP), to a third lookup key identifier, or iv) Mapping a fourth lookup key, extracted from the packet header and containing the TCP or UDP destination port number, to a fourth lookup key identifier. The network device according to claim 11, configured to perform a first-stage search for one or more mappings.
20. The network device according to claim 11, wherein the network is an automotive Ethernet network within a vehicle, and the packet processor is configured to route packets based on actions that send packets to another device within the vehicle via the automotive Ethernet network.