隨著網路的快速發展,各式各樣的網路服務開始出現,每種服務運作時皆或多或少要佔用些許的網路頻寛,而要如何在有限的頻寛下能讓各種服務皆能正常運作,有效的頻寛分配與管理便成了相當重要的課題。 要能有效達到頻寛分配,首先便要能有效地分辨各種的通訊協定,然而舊有的封包過濾器皆未能有效地辨識P2P這類型的封包,因此本研究採用一種以正則表示法來分析應用層資訊的封包過濾器,並希望透過修改正則表示法函式庫的方式來提昇應用層封包過濾器的效能。本研究裏採用RE2這套新公佈的正則表式法函式庫為實驗組,原系統內建的GNU C Regex函式庫為對照組,透過比較二者的執行效能以驗証是否在改用RE2函式庫後能有效提昇封包過濾的效能,並進而達成改善頻寛分配的效能。 With the fast development of internet, various kinds of network service appear. Every of them need to take some amount of bandwidth when it work, so how to make all kinds of service work smoothly under limit bandwidth becomes very important issue for proper bandwidth distribution and management. If we want to distribute the bandwidth properly , at first, we have to correctly distinguish the communication protocol. However, the current packet filters are not able to recognize the P2P packet effectly. Thus,this research adopt the packet filter using regular expression for analyzing the application layer informations, and want to promote the efficiency of application layer packet filter through modifying the regular expression library. This research take RE2, a new released regular expression library on google code, as experimental group, and the original build-in GNU C Regex library as control group. Through comparing the execution efficiency to verify if we can promote the efficiency of packet filter after adopting the RE2 library, and to achieve the goal of bandwidth distribution improvement.