Performing a finishing operation to improve the quality of a resulting hash
First Claim
1. A non-transitory machine readable medium storing a program that, when executed by at least one processing unit, generates a hash of a portion of a packet to process a packet, the program comprising sets of instructions for:
- generating a first hash from at least a portion of a packet header;
performing a finishing operation on the first hash to produce a resulting second hash, wherein the finishing operation comprises accumulating a length of the portion of the packet header into the hash by hashing a combination of the first hash and the length of the portion of the packet header; and
processing the packet based on the resulting second hash.
1 Assignment
0 Petitions
Accused Products
Abstract
Some embodiments provide a physical forwarding element that hashes portions of packet headers using several novel hashing techniques. The techniques include a novel set of finishing operations that improve the quality of resulting hashes by increasing their distribution and improving their apparent-randomness. In some embodiments, the finishing operation includes at least one of multiplying the hash by a prime number to increase distribution of the bits of the hash, accumulating a length of the portion into the hash, and combining higher bits of the hash with lower bits of the hash in order to increase the entropy of the lower bits of the hash.
164 Citations
20 Claims
-
1. A non-transitory machine readable medium storing a program that, when executed by at least one processing unit, generates a hash of a portion of a packet to process a packet, the program comprising sets of instructions for:
-
generating a first hash from at least a portion of a packet header; performing a finishing operation on the first hash to produce a resulting second hash, wherein the finishing operation comprises accumulating a length of the portion of the packet header into the hash by hashing a combination of the first hash and the length of the portion of the packet header; and processing the packet based on the resulting second hash. - View Dependent Claims (2, 3, 4, 5)
-
-
6. A non-transitory machine readable medium storing a program that, when executed by at least one processing unit, generates a hash for a packet, the program comprising sets of instructions for:
-
receiving a portion of a header of the packet from which to generate the hash for the packet; determining whether to hash the portion as a whole or hash a plurality of sections of the portion individually to generate the hash for the packet; generating the hash for the packet by hashing the portion as a whole when the determination is made to hash the portion as a whole; and when the determination is made to hash the plurality of sections of the portion individually; dividing the portion of the packet into the plurality of sections; and individually hashing each of the sections of the portion to generate resultant hashes and generating the hash for the packet by merging the resultant hashes from the individually hashed sections. - View Dependent Claims (7, 8, 9, 10, 11)
-
-
12. For a forwarding element, a method of generating a hash to process a packet, the method comprising:
-
generating a hash from at least a portion of a packet header; performing a finishing operation on the hash to produce a resulting hash, wherein the finishing operation comprises multiplying the hash by a prime number to increase distribution of the bits of the hash; and processing the packet based on the resulting hash. - View Dependent Claims (13, 14, 15)
-
-
16. A method for generating a hash for a packet, the method comprising:
-
receiving a portion of a header of the packet from which to generate the hash for the packet; determining whether to hash the portion as a whole or hash a plurality of sections of the portion individually to generate the hash for the packet; and when the determination is made to hash the plurality of sections of the portion individually; dividing the portion of the packet into a plurality of sections; and individually hashing each of the sections of the portion to generate resultant hashes and generating the hash for the packet by merging the resultant hashes from the individually hashed sections, wherein when the determination is made to hash the portion as a whole, the hash for the packet is generated by hashing the portion as a whole. - View Dependent Claims (17, 18, 19, 20)
-
Specification