Detection and classification of peer-to-peer traffic are still difficult tasks for bandwidth shapers. First, peer-to-peer traffic is not easy to detect, and can be a serious problem. Second, some peer-to-peer applications may be desirable, while some may be undesirable. Hence, different peer-to-peer applications should also be treated differently. The previous work of peer-to-peer traffic detection still faces both problems. So, in this paper, we propose new classification mechanisms to solve the problems. Our proposed solution has been implemented by using JAVA, and experimented on a network test-bed. Experimental results have demonstrated that our extended classification mechanism can improve the peer-to-peer traffic detection and classification.