A packet classification language (PCL) is provided to specify data packets
in a routing device. The PCL uses regular expressions to match incoming
data packets. Class identifiers associated with each regular expression
identifies the class to which each recognized packet belongs for
subsequent processing. A PCL compiler produces a DFA which recognizes the
data packets as defined by the regular expressions. A hardware
implemented DFA is used to scan the input stream which constitutes the
data packets.