基于网络包分类算法在时间和空间复杂度上的限制,启发式策略一般具有较快的速度,同时在应用上具有较好的前景,提出了一种基于统计决策树的启发式包分类算法。该算法把规则头部中的每一位看作一个特征属性,因为不同位有不同的区分效果,根据对规则的统计把最具有区分意义的几位提取出来作为决策树的决策属性,使规则在子集中分布比较均匀,在子集中也做同样的处理,递归形成树形的数据结构;匹配时在树的每一层根据区分位判断其所属的子集,直到找到相匹配的规则。算法测试表明能实现高效的分类。
Heuristic algorithms usually have good effect on packet classification to deal with the algorithm limitation between time and space. They also have advantages in the network application. A new heuristic algorithm based on the statistical decision tree is proposed in this paper. Since the different bit of packet header has the distinguished effect in classification, we get the distinguished bits according to the distinguishing effect based on statistic and take it as the decision attribute to partition the whole rules to subsets, then do it recursively in the subsets to set up a decision tree ultimately; when a packet arrives, we can compare the corresponding bit in the packet header with the bit in the decision tree to obtain the rule matched. The experiment shows this algorithm has a satisfactory result.