簡易檢索 / 詳目顯示

研究生: 李哲瑋
Lee, Zhe-Wei
論文名稱: 使用預訓練 GLM 與 Mamba 模型實現基於封包的流量分類
Packet Based Traffic Classification Using Pretrained GLM and Mamba Models
指導教授: 張燕光
Chang, Yeim-Kuan
學位類別: 碩士
Master
系所名稱: 電機資訊學院 - 資訊工程學系
Department of Computer Science and Information Engineering
論文出版年: 2025
畢業學年度: 113
語文別: 英文
論文頁數: 69
中文關鍵詞: 深度學習流量分類大型語言模型預訓練模型
外文關鍵詞: Deep Learning, Traffic Classification, Large Language Models, Pretrained Models
相關次數: 點閱:94下載:0
分享至:
查詢本校圖書館目錄 查詢臺灣博碩士論文知識加值系統 勘誤回報
  • 隨著加密技術(如 VPN)的普及,網路流量中加密封包的比例逐漸升高,對於流量分類任務提出更高挑戰。傳統流量分類方法如基於連接埠的識別與深度封包檢查(DPI)在加密情境下效果大幅下降,而深度學習模型則面臨訓練資料不足與計算成本高昂等問題。
    為了解決上述問題,本研究提出兩種基於大型預訓練語言模型的應用策略,期望在資料有限的情況下依然能有效完成加密流量分類任務。第一種方法使用 GLM-4 模型,將封包特徵嵌入特定格式的 prompt 中,並以微調後的分類頭進行訓練;第二種方法則採用 Mamba 模型,將封包 payload 轉換為十六進位字串後進行 token 化,並透過線性時間的選擇性狀態空間架構完成分類。
    實驗結果顯示,本研究方法在 ISCXP-VPN 與 ISCX-Tor 資料集上皆達到極高的準確率,與現有的深度學習方法相比展現出優異的表現,特別是在模型泛化能力與長序列處理效率方面更具潛力。
    這篇論文展示了我們通過設計合理的資料前處理,成功應用了大型語言模型,並且在資料量稀缺的環境中達到一樣或更好的準確率。這些成果證明了預訓練模型在加密流量分類中的潛力,為未來網路領域提供了寶貴的技術參考。

    With the widespread adoption of encryption technologies such as VPN, the proportion of encrypted packets in network traffic has significantly increased, posing greater challenges to traffic classification tasks. Traditional approaches, including port-based identification and deep packet inspection (DPI), suffer from drastic performance degradation under encrypted scenarios. Deep learning-based methods, on the other hand, often struggle with limited labeled data and high computational costs.
    To address these challenges, this study proposes two strategies leveraging large pretrained language models to achieve effective encrypted traffic classification even in data-scarce environments. The first approach employs the GLM-4 model, where extracted packet features are embedded into structured prompts and processed by a fine-tuned classification head. The second approach utilizes the Mamba model, in which packet payloads are transformed into hexadecimal strings, tokenized, and classified through a linear-time selective state space architecture.
    Experimental results on the ISCX-VPN and ISCX-Tor datasets demonstrate that the proposed methods achieve exceptionally high accuracy and outperform several state-of-the-art deep learning baselines. Notably, these methods exhibit strong generalization capabilities and improved efficiency in handling long sequences. This research highlights the potential of pretrained language models in encrypted traffic classification, offering valuable insights for future developments in the network security domain.

    摘要 i Abstract ii 誌謝 iii TABLE OF CONTENTS iv LIST OF TABLES vi LIST OF FIGURES vii Chapter 1 Introduction 1 1.1 Introduction 1 1.2 Organization of the Thesis 4 Chapter 2 Related Work 6 2.1 Background of Traffic classification 6 2.2 Transformer 7 2.3 Large language model 9 2.3.1 GLM 10 2.3.2 Mamba 10 2.4 State-of-art method 11 2.4.1 YaTC 11 2.4.2 . Pert 11 2.4.3 Et-Bert 12 2.5 Network tool 13 2.5.1 Scapy 13 2.5.2 Tshark 13 Chapter 3 Proposed scheme 15 3.1 Overview 15 3.2 GLM-Packet 16 3.2.1 Data Preprocessing 16 3.2.2 Model Architecture 18 3.2.3 Pre-Train and FineTune 21 3.2.4 Lora PEFT 25 3.3 Mamba-Packet 26 3.3.1 Data Preprocessing 26 3.3.2 Model Archtecture 29 3.3.3 Finetuning procedure 32 3.4 Conclusion 34 Chapter 4 Experimental Results 36 4.1 Dataset description 36 4.2 Experimental Setup 38 4.3 Evaluation metrics 40 4.4 Experiments of GLM-Packet 41 4.5 Experiment on Mamba-Packet 49 4.6 Comparison with State-of-the-Art Methods 54 Chapter 5 Conclusion 57 References 58

    [1] Bujlow, T., Carela-Español, V., & Barlet-Ros, P. (2015). Independent comparison of popular DPI tools for traffic classification. Computer Networks, 76, 75–89.
    [2] Sharafaldin, I., Lashkari, A. H., & Ghorbani, A. A. (2018). Toward Generating a New Intrusion Detection Dataset and Intrusion Traffic Characterization.
    [3] Velan, P., Čermák, M., Čeleda, P., & Drašar, M. (2015). A survey of methods for encrypted traffic classification and analysis. International Journal of Network Management, 25(5), 355–374.
    [4] Nguyen, T. T., & Armitage, G. (2008). A survey of techniques for internet traffic classification using machine learning. IEEE Communications Surveys & Tutorials, 10(4), 56–76.
    [5] Draper-Gil, G., Lashkari, A. H., Mamun, M. S. I., & Ghorbani, A. A. (2016). Characterization of Encrypted and VPN Traffic using Time-related Features.
    [6] Rezaei, S., & Liu, X. (2019). Deep Learning for Encrypted Traffic Classification: An Overview. IEEE Communications Magazine, 57(5), 76–81.
    [7] Liu, C., He, L., Xiong, G., Cao, Z., & Li, Z. (2019). FS-Net: A Flow Sequence Network For Encrypted Traffic Classification.
    [8] Liu, C., Wang, W., Wang, M., Lv, F., & Konan, M. (2017). An efficient instance selection algorithm to reconstruct training set for support vector machine. Knowledge-Based Systems, 116, 58–73.
    [9] LeCun, Y., Bengio, Y. & Hinton, G. Deep learning. Nature 521, 436–444 (2015).
    [10] Lotfollahi, M., Siavoshani, M. J., Zade, R. S. H., & Saberian, M. (2019). Deep packet: a novel approach for encrypted traffic classification using deep learning. Soft Computing, 24(3), 1999–2012.
    [11] Wang, N. W., Zhu, N. M., Zeng, N. X., Ye, N. X., & Sheng, N. Y. (2017). Malware traffic classification using convolutional neural network for representation learning.
    [12] Wang, W., Zhu, M., Wang, J., Zeng, X., & Yang, Z. (2017). End-to-end encrypted traffic classification with one-dimensional convolution neural networks.
    [13] Draper-Gil, G., Lashkari, A. H., Mamun, M. S. I., & Ghorbani, A. A. (2016). Characterization of Encrypted and VPN Traffic using Time-related Features.
    [14] Lashkari, A. H., Gil, G. D., Mamun, M. S. I., & Ghorbani, A. A. (2017). Characterization of Tor Traffic using Time based Features.
    [15] Van Ede, T., Bortolameotti, R., Continella, A., Ren, J., Dubois, D. J., Lindorfer, M., Choffnes, D., Van Steen, M., & Peter, A. (2020). FlowPrint: Semi-Supervised Mobile-App Fingerprinting on Encrypted Network Traffic.
    [16] Zheng, W., Gou, C., Yan, L., & Mo, S. (2020). Learning to Classify: A Flow-Based Relation Network for Encrypted Traffic Classification.
    [17] Vaswani, A., Shazeer, N.M., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A.N., Kaiser, L., & Polosukhin, I. (2017). Attention is All you Need. Neural Information Processing Systems.
    [18] Zhao, R., Huang, Y., Deng, X., Xue, Z., Li, J., Huang, Z., & Wang, Y. (2021). Flow Transformer: A Novel Anonymity Network Traffic Classifier with Attention Mechanism. 2021 17th International Conference on Mobility, Sensing and Networking.
    [19] Luo, Y., Chen, X., Ge, N., Feng, W., & Lu, J. (2022). Transformer-Based Malicious Traffic Detection for Internet of Things. ICC 2022 - IEEE International Conference on Communications.
    [20] A. Ali, T. Sheykh Esmaili, and M. H. Mahoor, “Enhancing Network Traffic Classification with Large Language Models,” arXiv preprint arXiv:2310.08321, 2023.
    [21] Team GLM et al., “ChatGLM: A Family of Large Language Models from GLM-130B to GLM-4 All Tools,” arXiv preprint arXiv:2406.12793, 2024. [Online]. Available: https://arxiv.org/abs/2406.12793
    [22] A. Gu, T. Dao, K. Goel, A. Rudra, and C. Ré, “Mamba: Linear-Time Sequence Modeling with Selective State Spaces,” arXiv preprint arXiv:2312.00752, 2023.
    [23] Finsterbusch, M., Richter, C., Rocha, E., Muller, J. A., & Hanssgen, K. (2014). A Survey of Payload-Based Traffic Classification Approaches. IEEE Communications Surveys & Tutorials, 16(2), 1135–1156.
    [24] Bujlow, T., Carela-Español, V., & Barlet-Ros, P. (2015b). Independent comparison of popular DPI tools for traffic classification. Computer Networks, 76, 75–89.
    [25] Hochreiter, S., & Schmidhuber, J. (1997). Long Short-Term Memory. Neural Computation, 9(8), 1735–1780.
    [26] https://scapy.net/
    [27] https://www.wireshark.org/docs/man-pages/tshark.html
    [28] X. Wang, J. Zhang, Y. Huang, Y. Du, L. Guo, and J. Cao, “YaTC: A Novel Self-Supervised Framework Based on Masked Autoencoder for Traffic Classification,” in *Proc. IEEE MASS*, Guangzhou, China, Oct. 2023, pp. 515–523, doi: 10.1109/MASS58274.2023.00085.
    [29] He, H. Y., Yang, Z. G., & Chen, X. N. (2020). PERT: Payload Encoding Representation from Transformer for Encrypted Traffic Classification.
    [30] Lin, X., Xiong, G., Gou, G., Li, Z., Shi, J., & Yu, J. (2022). ET-BERT: A Contextualized Datagram Representation with Pre-training Transformers for Encrypted Traffic Classification. Proceedings of the ACM Web Conference 2022.

    無法下載圖示
    2029-09-01公開
    電子論文及紙本論文均尚未授權公開
    QR CODE