Patent ID: 8072894

Claim:
A network device comprising: a plurality of interfaces connected via an interconnect, where each of the plurality of interfaces includes: a memory, a packet processing unit to: receive a first packet and a second packet, and forward, through a sampling unit, the first packet and the second packet for transmission toward respective destinations; and the sampling unit to: determine a first flow identifier (ID) and a second flow ID, where the first flow ID and the second flow ID identify, respectively, a first flow associated with the first packet and a second flow associated with the second packet, determine that the first flow ID does not match any of a plurality of existing flow IDs stored in the memory, and that the second flow ID matches one of the plurality of existing flow IDs stored in the memory, determine that a particular one of the plurality of existing flow IDs in the memory is old, where the particular one of the plurality of existing flow IDs in the memory is old when a sent packet, related to the particular one of the plurality of existing flow IDs in the memory, has not been received from the packet processing unit within a particular period of time, access, in response to determining that the second flow ID matches one of the plurality of existing flow IDs stored in the memory, additional data included in the memory and associated with the second flow ID, sample, in response to determining that the first flow ID does not match any of the plurality of existing flow IDs stored in the memory, the first packet, sample, based on accessing the additional data included in the memory and associated with the second flow ID, the second, and transmit, within the network device, the first flow ID, the second flow ID, the sampled first packet, and the sampled second packet to another of the plurality of interfaces.