A Low-cost Classification Method for High-speed Network Processors