IDEAS home Printed from https://ideas.repec.org/a/abq/ijist1/v8y2026i3p44-62.html

Machine Learning-Based Classification of Encrypted VPN and Non-VPN Traffic with Temporal Features Analysis

Author

Listed:
  • Dilawer Khan,Musawer Hamad Khan,Muhammad Bilal,Hameed Ullah Khan,Shafiq Ur Rehman Khan,Alishba Khalid

    (Department of Computer Science, Namal University,Mianwali, Pakistan.Department of Computer Science, Sir Syed CASE Institute of Technology,Islamabad, Pakistan)

Abstract

As Virtual Private Network (VPN) usage increases globally for privacy preservation and unrestricted access, distinguishing VPN traffic from regular internet traffic has become both critically important and challenging. Traditional detection methods relying on port-based rules and deep packet inspection are no longer reliable against encrypted communications, prompting the need for smarter, adaptive, machine learning (ML) solutions. This study proposes a comprehensive ML-based framework to classify VPN and non-VPN traffic using a large-scale, balanced dataset of approximately six million packets, covering common application types (Mail, Video Conferencing, SSH, Non-Streaming) and five VPN protocols (L2TP, OpenVPN, PPTP, SSTP, and WireGuard). Five models were evaluated: Logistic Regression, Decision Tree, K-Nearest Neighbors (KNN), Random Forest, and Artificial Neural Networks (ANN). When temporal (i.e., timestamp) features were included, KNN, Random Forest, and ANN achieved perfect classification accuracy of 100%, while Logistic Regression and Decision Tree reached 99%. Upon removal of timestamp features to simulate temporal generalizability, accuracy declined substantially across all models: Logistic Regression dropped to 67%, ANN to 86%, KNN to 90%, and both Decision Tree and Random Forest achieved 92%. False positive rates without timestamps ranged from 0.009% (Logistic Regression) to 31.1% (Decision Tree), and false negative rates ranged from 0% to 39.1%. Critically, source and destination port numbers emerged as the most discriminative features for accurate classification, with VPN traffic concentrated on just 11 of over 1,700 observed ports. These findings demonstrate the significant role of temporal features in VPN traffic classification, quantify the performance degradation caused by their removal (timestamp bias), and establish that ML-based approaches—particularly ensemble methods—can effectively address the challenges of encrypted traffic analysis even in temporally limited training scenarios.

Suggested Citation

  • Dilawer Khan,Musawer Hamad Khan,Muhammad Bilal,Hameed Ullah Khan,Shafiq Ur Rehman Khan,Alishba Khalid, 2026. "Machine Learning-Based Classification of Encrypted VPN and Non-VPN Traffic with Temporal Features Analysis," International Journal of Innovations in Science & Technology, 50sea, vol. 8(3), pages 44-62, April.
  • Handle: RePEc:abq:ijist1:v:8:y:2026:i:3:p:44-62
    as

    Download full text from publisher

    File URL: https://journal.50sea.com/index.php/IJIST/article/view/1800/2671
    Download Restriction: no

    File URL: https://journal.50sea.com/index.php/IJIST/article/view/1800
    Download Restriction: no
    ---><---

    References listed on IDEAS

    as
    1. Petr Velan & Milan Čermák & Pavel Čeleda & Martin Drašar, 2015. "A survey of methods for encrypted traffic classification and analysis," International Journal of Network Management, John Wiley & Sons, vol. 25(5), pages 355-374, September.
    Full references (including those not matched with items on IDEAS)

    Most related items

    These are the items that most often cite the same works as this one and are cited by the same works as this one.
    1. Aristide Tanyi‐Jong Akem & Guillaume Fraysse & Marco Fiore, 2025. "Real‐Time Encrypted Traffic Classification in Programmable Networks with P4 and Machine Learning," International Journal of Network Management, John Wiley & Sons, vol. 35(1), January.
    2. Tao Liu & Xiting Ma & Ling Liu & Xin Liu & Yue Zhao & Ning Hu & Kayhan Zrar Ghafoor, 2024. "LAMBERT: Leveraging Attention Mechanisms to Improve the BERT Fine-Tuning Model for Encrypted Traffic Classification," Mathematics, MDPI, vol. 12(11), pages 1-22, May.

    More about this item

    Keywords

    ;
    ;
    ;
    ;
    ;
    ;
    ;
    ;
    ;
    ;
    ;
    ;
    ;
    ;

    Statistics

    Access and download statistics

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:abq:ijist1:v:8:y:2026:i:3:p:44-62. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    If CitEc recognized a bibliographic reference but did not link an item in RePEc to it, you can help with this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: Iqra Nazeer (email available below). General contact details of provider: .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.