This directory contains a collection of detection modules for identifying timing anomalies in Ethernet traffic. All methods are based on analyzing frame.time_epoch from PCAP files, which captures the timestamp of each packet. By calculating the time delta (Δt) between packets, the modules apply a variety of techniques—statistical and machine learning—to detect bursts, silences, outliers, or unusual traffic patterns.
| Folder | Method Summary |
|---|---|
| Arima_Forecasting | Uses ARIMA forecasting to model normal timing behavior and flag deviations |
| Autoencoder | Trains a neural network to reconstruct normal Δt patterns and flags large reconstruction errors |
| Burst_Silence | Detects high-density traffic bursts and idle silences based on thresholding |
| Clustering | Applies DBSCAN and KMeans to detect timing-based outliers via clustering |
| Sliding_Window | Extracts window-based features (mean, std) and uses One-Class SVM to identify anomalies |
| Time_Delta | Flags Δt values outside mean ± 3×std as statistical outliers |
All modules follow a similar process:
- Use TShark to extract
frame.time_epochfrom a.pcapfile. - Compute Δt as the time difference between consecutive packets.
- Analyze the Δt series using a specific detection technique.
- Output detected anomalies through plotted or printed results.
Each script is standalone and may have unique requirements, but collectively the tools rely on:
- Python 3.x
- TShark (Wireshark CLI)
- Common Python libraries:
pandas, numpy, matplotlib, scikit-learn, statsmodels, keras, tensorflow
You can install the required packages with:
pip install -r requirements.txtTShark must also be installed and accessible in your system's PATH:
sudo apt install tsharkEach subfolder contains its own script and README file. To use any detection module:
- Navigate into the module's directory.
- Update the script to point to your PCAP file.
- Run the script using Python.
Example:
cd Arima_Forecasting
python arima_forecasting.py- Use
Time_DeltaorBurst_Silencefor fast, interpretable results. - Use
AutoencoderorSliding_Windowfor ML-based adaptive detection. - Use
Clusteringto explore unsupervised structure in timing behavior. - Use
Arima_Forecastingfor time series analysis of periodic anomalies.
Each module contains:
- A Python detection script
- A
README.mdfor usage - A
.txtfile explaining the theory and implementation details
These tools are modular and designed to support rapid experimentation with time-based anomaly detection. They can be extended to handle non-Ethernet traffic, alternate timestamp formats, or real-time processing.