1. A method for classifying a packet, the method comprising: receiving a packet; searching for a rule matching the packet in at least one created decision tree, wherein the decision tree is a decision tree created after an original rule set is divided based on a segmentation code; and classifying the packet according to a found rule.