Skip to main content
QUICK REVIEW

[Paper Review] Packet2Vec: Utilizing Word2Vec for Feature Extraction in Packet Data

Eric Goodman, Chase Zimmerman|arXiv (Cornell University)|Apr 29, 2020
Network Security and Intrusion DetectionComputer Science5 citations
TL;DR

This paper introduces Packet2Vec, a novel method that adapts Word2Vec to automatically extract features from raw network packet data by treating packet content as sequences of n-grams. It achieves high performance in classifying benign vs. malicious traffic on the 2009 DARPA dataset, with AUC-ROC between 0.988–0.996 and AUC-PR between 0.604–0.667, demonstrating the feasibility of deep learning for end-to-end feature extraction in cyber intrusion detection without hand-crafted features.

ABSTRACT

One of deep learning's attractive benefits is the ability to automatically extract relevant features for a target problem from largely raw data, instead of utilizing human engineered and error prone handcrafted features. While deep learning has shown success in fields such as image classification and natural language processing, its application for feature extraction on raw network packet data for intrusion detection is largely unexplored. In this paper we modify a Word2Vec approach, used for text processing, and apply it to packet data for automatic feature extraction. We call this approach Packet2Vec. For the classification task of benign versus malicious traffic on a 2009 DARPA network data set, we obtain an area under the curve (AUC) of the receiver operating characteristic (ROC) between 0.988-0.996 and an AUC of the Precision/Recall curve between 0.604-0.667.

Motivation & Objective

  • To address the limitations of hand-crafted features in network intrusion detection, which are error-prone and require domain expertise.
  • To explore whether deep learning techniques like Word2Vec can automatically extract meaningful features directly from raw packet data.
  • To demonstrate that end-to-end feature learning from packet content can achieve high classification performance on real-world cyber threat detection.
  • To provide a scalable, automated alternative to traditional feature engineering in network security analytics.

Proposed method

  • Transform each network packet into a sequence of n-grams by extracting byte-level substrings, discarding IP and port information to focus on content.
  • Apply Word2Vec to learn dense vector embeddings for each frequent n-gram, capturing semantic similarity in packet content.
  • Generate fixed-size feature vectors for each packet by averaging the embeddings of all n-grams within the packet using the formula: v(p) = (1/|p|) * Σ e(t) for all t ∈ p.
  • Train a supervised classifier (e.g., using Scikit-learn) on the resulting packet-level embeddings for binary classification of benign vs. malicious traffic.
  • Implement the pipeline in C++ for performance, expose it to Python via Boost.Python, and parallelize using std::thread to handle large-scale data.
  • Use the 2009 DARPA network dataset as the training and evaluation benchmark, processing over 558 GB of raw packet data.

Experimental results

Research questions

  • RQ1Can Word2Vec be effectively adapted to extract meaningful features from raw network packet data without relying on hand-engineered features?
  • RQ2How well does a deep learning-based feature extraction method perform in classifying benign versus malicious network traffic compared to traditional feature-based approaches?
  • RQ3What is the impact of ignoring IP and port metadata on the model’s ability to detect malicious behavior?
  • RQ4Can a scalable, end-to-end deep learning pipeline be built to process large-scale network traffic data efficiently?
  • RQ5How does the performance of the Packet2Vec approach compare to existing methods on the same benchmark dataset?

Key findings

  • The Packet2Vec model achieved an area under the ROC curve (AUC-ROC) between 0.988 and 0.996 on the 2009 DARPA network dataset, indicating strong discrimination between benign and malicious traffic.
  • The model achieved an AUC of the Precision-Recall curve between 0.604 and 0.667, demonstrating solid performance in imbalanced detection scenarios.
  • The approach successfully learned meaningful representations from raw packet content without requiring domain-specific feature engineering or metadata such as IP addresses and ports.
  • The method demonstrated scalability, processing over 558 GB of raw packet data using a C++-based, parallelized implementation with Python integration.
  • Compared to prior work on the same dataset, including methods using flow-level features or temporal aggregation, Packet2Vec outperformed models with average precision of 0.03 and recall of 0.08, achieving significantly higher detection performance.
  • The results suggest that deep learning can effectively extract relevant features directly from packet payloads, reducing reliance on labor-intensive feature engineering in intrusion detection.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.