Patent ID: 8407794

Claim:
A method of an apparatus searching for a signature in a packet, the method comprising: extracting a sub-payload to be compared with a signature from a payload packet; generating a search key that comprises the extracted sub-payload; and performing ternary content addressable memory (TCAM) matching to check if the generated search key matches a TCAM entry, wherein the TCAM entry comprises an offset that comprises a bit sequence, and the bit sequence of the offset is capable of being set according to the following conditions: where the bit sequence indicates that the signature is matched at a location of the offset in the payload of the packet, where the bit sequence indicates that the signature is matched at a location behind the offset in the payload of the packet, and where the bit sequence indicates that the signature is matched at a location ahead of the offset in the payload of the packet, and wherein the offset of the TCAM entry comprises a first bit group and at least one second bit group located behind the first bit group, the first bit group comprising a plurality of bits that correspond sequentially to sections of the payload, the sections being set by dividing the payload by a predetermined length, and the second bit group comprising a plurality of bits that correspond sequentially to subsections of each section corresponding to each bit of the first bit group, the subsections being set by dividing each section by a predetermined length smaller than the length used for dividing the section.