A non-transitory computer readable storage medium, including instructions stored thereon for monitoring logical network traffic flows, which when read and executed by one or more computers cause the one or more computers to perform steps comprising:
- associating a plurality of entries of a ternary content-addressable memory (TCAM) with a network port of a network device;
- providing a first entry of the plurality of entries of the TCAM with a first value, wherein the first value comprises a first set of data found in a packet header and a second set of data found in a packet header;
- providing a second entry of the plurality of entries of the TCAM with a second value, wherein the second value comprises the first set of data found in the packet header and a first mask;
- providing a third entry of the plurality of entries of the TCAM with a third value, wherein the third value comprises the second set of data found in the packet header and a second mask;
- providing a first counter, a second counter, and a third counter;
- retrieving, by the network port, a predefined set of values from at least one header field of a data packet processed by the network port;
- aggregating each value in the predefined set of values into a search value;
- and
- performing at least one of:
- comparing the search value to the first value of the first entry of the plurality of entries of the TCAM and incrementing the first counter, the second counter, and the third counter, when a match is determined between the search value and the first value of the first entry of the plurality of entries of the TCAM value stored in each TCAM entry;
- comparing the search value to the second value of the second entry of the plurality of entries of the TCAM and incrementing the first counter when a match is determined between the search value and the second value of the second entry of the plurality of entries of the TCAM;
- and
- comparing the search value to the third value of the third entry of the plurality of entries of the TCAM and incrementing the third counter when a match is determined between the search value and the third value of the third entry of the plurality of entries of the TCAM.