Hash creation using arbitrary header field combinations
Particular embodiments described herein provide for a system, an apparatus, and a method for hash creation using arbitrary header field combinations. One example implementation can include operations associated with generating a first hash key from user-defined fields for a first packet, generating a second hash key from user-defined fields for a second packet. The first packet can be directed along a first direction in a network and the second packet can be directed along a second direction that is different from the first direction in the network. The first hash key and the second hash key can result in a same hash for the first and second packets, and the same hash is used to select an outgoing port channel member interface to be used in sending at least a portion of the first and the second packets in the network.
1 . A method, comprising:
extracting first data from user-defined fields for a first packet having a first network header stack, and generating a first hash key from the extracted first data; and
extracting second data from user-defined fields for a second packet having a second network header stack different from the first network header stack, and generating a second hash key from the extracted second data, such that the first hash key and the second hash key result in a same hash for both the first packet and the second packet independent of differences between the first and second network header stacks,
wherein the first packet is directed along a first direction in a network and the second packet is directed along a second direction that is different from the first direction in the network, and
further wherein the same hash is used to select an outgoing port channel member interface to be used in sending at least a portion of the first and the second packets in the network.
2 . The method of claim 1 , wherein content of the first and second hash keys is user-configurable and contains fields extracted from headers for the first and second packets.
3 . The method of claim 1 , wherein content of the first and second hash keys is user-configurable and contains fields extracted from internal variables generated by an application specific integrated circuit (ASIC) for the first and second packets.
4 . The method of claim 1 , wherein the generating of the first and second hash keys for hashing for the first and second packets is configurable per packet type.
5 . The method of claim 1 , wherein the generating of the first and second hash keys includes defining a hashing criteria for a particular set of packet types.
6 . The method of claim 1 , wherein the user-defined fields are user configurable and the user-defined fields include a source internet protocol (IP) address and a destination IP address.
7 . The method of claim 1 , wherein the first packet includes an encapsulated header, and the second packet includes a non-encapsulated header.
8 . The method of claim 1 , further comprising:
performing packet load balancing using arbitrary header field combinations associated with a traffic flow for packets that include encapsulated headers and non-encapsulated packets to generate the same hash.
9 . The method of claim 1 , wherein the same hash is generated by symmetrically hashing on only selected IP port fields and layer four (L4) port fields.
10 . The method of claim 1 , wherein the sending of at least a portion of the first and the second packets in the network comprises making a copy of at least a portion of the first and second packets to send in the network.
11 . The method of claim 1 , wherein the sending of at least a portion of the first and the second packets in the network comprises forwarding at least a portion of the first and second packets in the network.
12 . A network device, comprising:
a key generation engine configured to:
extracting first data from user-defined fields for a first packet having a first network header stack, and generating a first hash key from the extracted first data; and
extracting second data from user-defined fields for a second packet having a second network header stack different from the first network header stack, and generating a second hash key from the extracted second data, such that the first hash key and the second hash key result in a same hash for both the first packet and the second packet independent of differences between the first and second network header stacks,
wherein the first packet is directed along a first direction in a network and the second packet is directed along a second direction that is different from the first direction in the network, and
further wherein the same hash is used to select an outgoing port channel member interface to be used in sending at least a portion of the first and the second packets in the network.
13 . The network device of claim 12 , wherein content of the first and second hash keys is user-configurable and contains fields extracted from headers for the first and second packets.
14 . The network device of claim 12 , wherein content of the first and second hash keys is user-configurable and contains fields extracted from internal variables generated by an application specific integrated circuit (ASIC) for the first and second packets.
15 . The network device of claim 12 , wherein the generating of the first and second hash keys for hashing for the first and second packets is configurable per packet type.
16 . The network device of claim 12 , wherein the generating of the first and second hash keys includes defining a hashing criteria for a particular set of packet types.
17 . Computer-readable medium for hash creation in a network, the computer-readable medium containing instructions executable by a processor for:
extracting first data from user-defined fields for a first packet having a first network header stack, and generating a first hash key from the extracted first data; and
extracting second data from user-defined fields for a second packet having a second network header stack different from the first network header stack, and generating a second hash key from the extracted second data, such that the first hash key and the second hash key result in a same hash for both the first packet and the second packet independent of differences between the first and second network header stacks,
wherein the first packet is directed along a first direction in the network and the second packet is directed along a second direction that is different from the first direction in the network; and
further wherein the same hash is used to select an outgoing port channel member interface to be used in sending at least a portion of the first and the second packets in the network.
18 . The computer-readable medium of claim 17 , wherein the medium contains instructions executable by the processor for:
performing packet load balancing using arbitrary header field combinations associated with a traffic flow for packets that include encapsulated headers and non-encapsulated packets to generate the same hash.
19 . The computer-readable medium of claim 17 , wherein the first packet includes an encapsulated header, and the second packet includes a non-encapsulated header.
20 . The computer-readable medium of claim 17 , wherein the generating of the first and second hash keys includes defining a hashing criteria for a particular set of packet types.