Apparatus and method for generating an index key for a network switch routing table using a programmable hash function
First Claim
1. A method for determining a network switch output port for transmission of a data packet having an address and having been received by a network switch, comprising:
- storing a user-selected hash function in a programmable register;
generating a hash key for the received data packet in response to the user-selected hash function and the corresponding address;
accessing a selected bin entry from a plurality of bin entries in an address table based on the hash key, each bin entry configured to reference a corresponding plurality of table entries, each table entry configured for identifying the output port for a corresponding address; and
determining the output port from one of the table entries of the selected bin entry based on the address.
3 Assignments
0 Petitions
Accused Products
Abstract
A network switch configured for switching data packets across multiple switch ports uses programmable hash functions to generate a hash key for each network address to access an address table storing switching logic. The address table is configured to include a programmable number of bin entries, where each bin entry is configured to reference a plurality of address table entries storing the switching logic information for respective network addresses. The address of an incoming data packet is used to generate a hash key that references a selected one of the bin entries. The switching logic for the corresponding address is then obtained by accessing the appropriate table entry referenced by the selected bin entry. If the number of table entries for a given bin exceeds a prescribed threshold, an external host reprograms the network switch to use another hash key to maintain an efficient access throughput of the address table. Use of programmable hash keys also enables the host processor to use different hash key polynomials for different network configurations to optimize the table access throughput.
-
Citations
20 Claims
-
1. A method for determining a network switch output port for transmission of a data packet having an address and having been received by a network switch, comprising:
-
storing a user-selected hash function in a programmable register;
generating a hash key for the received data packet in response to the user-selected hash function and the corresponding address;
accessing a selected bin entry from a plurality of bin entries in an address table based on the hash key, each bin entry configured to reference a corresponding plurality of table entries, each table entry configured for identifying the output port for a corresponding address; and
determining the output port from one of the table entries of the selected bin entry based on the address. - View Dependent Claims (2, 3, 6, 7, 8, 9, 10)
determining a number of table entries for at least one of the bin entries; and
selectively storing a second user-selected hash function in the programmable register based on said number of table entries exceeding a prescribed value, the generating step generating a new hash key in response to the second user-selected hash function stored in the programmable register.
-
-
7. The method of claim 6, further comprising storing a plurality of available hash functions in a nonvolatile memory, the selectively storing step comprising loading one of the available hash functions into the programmable register.
-
8. The method of claim 1, wherein the storing step comprises:
-
storing a plurality of available hash functions in a nonvolatile memory; and
selectively loading one of the available hash functions into the programmable register in response to the address table encountering a prescribed condition.
-
-
9. The method of claim 8, further comprising detecting as said prescribed condition the number of table entries for one of the bin entries exceeding a prescribed value.
-
10. The method of claim 1, further comprising:
-
clearing the address table;
storing a new user-selected hash function in the programmable register; and
assigning a new table entry in the address table to a second selected bin entry in response to generating a second hash key for an address specified in the new table entry.
-
-
4. A method for determining a network switch output port for transmission of a data packet having an address and having been received by a network switch, comprising:
-
storing a user-selected hash function in a programmable register;
generating a hash key for the received data packet in response to the user selected hash function and the corresponding address;
accessing a selected bin entry from a plurality of bin entries in an address table based on the hash key, each bin entry configured to reference a corresponding plurality of table entries, each table entry configured for identifying the output port for a corresponding address; and
determining the output port from one of the table entries of the selected bin entry based on the address, wherein the storing step comprises storing a bit pattern in the programmable register, each bit of the bit pattern corresponding to a coefficient of a corresponding polynomial value, the generating step comprises supplying the address as a bit stream to a hash function circuit responsive to the bit pattern, the hash function circuit outputting a hash-generated polynomial, the storing step further comprises storing a polynomial enable value in a polynomial enable register, the polynomial enable value specifying a number of the bits in the hash key, and the generating step comprises generating the hash key in response to the hash-generated polynomial and the polynomial enable value. - View Dependent Claims (5)
-
-
11. A method for controlling access of a network address table storing switching data for a plurality of network addresses, comprising:
-
storing a first number in a first programmable register, the first number specifying an addressable range of bin entries in the address table, each bin entry configured to reference a corresponding group of table entries for respective network addresses;
storing a second number specifying a user-specified hash function in a second programmable register, the hash function configured to map a network address value to one of the bin entries;
monitoring for at least one bin entry a number of the corresponding table entries; and
replacing the second number in the second programmable register with a third number specifying a second user-specified hash function in response to the number of table entries exceeding a prescribed threshold. - View Dependent Claims (12, 13, 14)
clearing the network address table;
selectively loading the third number from a plurality of stored available hash functions into the second programmable register; and
loading the network address table with new table entries based on the a new hash fiction determined by said third number.
-
-
13. The method of claim 11, further comprising storing a plurality of the user-specified hash functions in a nonvolatile memory, the replacing step including selecting one of the user-specified hash functions as the second user-specified hash function.
-
14. The method of claim 11, wherein the replacing step comprises:
-
clearing the network address table;
selectively loading the third number from a plurality of stored available hash functions into the second programmable register; and
causing a controller accessing the network address table using the hash function specified by the second programmable register to store learned addresses in the network address table.
-
-
15. A network switch configured for outputting a data packet having an address, comprising:
-
a first programmable register for storing a first number specifying an addressable range of bin entries;
a network address table for storing the addressable range of bin entries, each bin entry configured to reference at least one table entry and each table entry configured for storing switching data including an output port of the network switch for a corresponding address;
a second programmable register for storing a second number specifying a user-specified hash function;
a hash key generator configured to map the address of the data packet to one of the bin entries according to the user-specified hash function specified by the second number, the hash key generator outputting a hash key for addressing the one bin entry and having a number of bits based on the first number. - View Dependent Claims (16, 17)
a hash function circuit configured for generating a hash-generated polynomial for the address of the data packet according to the user-specified hash function in response to the second number; and
a logic circuit for outputting a portion of said hash-generated polynomial as said hash key in response to the first number.
-
-
17. The network switch of claim 15, wherein each bin entry is configured to reference a plurality of table entries using a link-list chain, wherein said each bin entry and each table entry includes a next-entry pointer segment, the next-entry pointer segment indicating one of another chain entry and an end-of-chain designation.
-
18. A system comprising:
-
a network switch configured for outputting a data packet having an address, comprising;
(1) a first programmable register for storing a first number specifying an addressable range of bin entries, (2) a network address table for storing the addressable range of bin entries, each bin entry configured to reference at least one table entry and each table entry configured for storing switching data including an output port of the network switch for a corresponding address, (3) a second programmable register for storing a second number specifying a user-specified hash function, and (4) a hash key generator configured to map the address of the data packet to one of the bin entries according to the user-specified hash function specified by the second number, the hash key generator outputting a hash key for addressing the one bin entry and having a number of bits based on the first number; and
a host processor configured for monitoring for at least one bin entry a number of the corresponding table entries, the host processor selectively reprogramming the second programmable register with a second number specifying another user-specified hash function in response to the number of table entries exceeding a prescribed threshold. - View Dependent Claims (19, 20)
-
Specification