# amithgspn/etc_smartnic architecture

> Architecture diagram of the GitHub repository amithgspn/etc_smartnic, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/amithgspn/etc_smartnic
- Repository: https://github.com/amithgspn/etc_smartnic

## Overview

This repository is an experimental P4-based network traffic classifier, with model/rule artifacts and accompanying performance and latency analysis. The intended packet workflow is feature extraction followed by categorical traffic classification and then messaging or multimedia classification; the tree supports these stages, but the empty README and sampled excerpts do not establish their runtime wiring. Dashed, uncited links indicate this inferred workflow. The Python analysis scripts and datasets represent evaluation activities; no unsampled runtime behavior is assumed.

Main entry points: [`P4_codes/categorical_classifier.p4`](https://github.com/amithgspn/etc_smartnic/blob/main/P4_codes/categorical_classifier.p4) (Categorical classifier), [`P4_codes/feature_extraction.p4`](https://github.com/amithgspn/etc_smartnic/blob/main/P4_codes/feature_extraction.p4) (Feature extraction), [`Machine_learning_models`](https://github.com/amithgspn/etc_smartnic/tree/main/Machine_learning_models) (ML model artifacts), [`generate_table_entries_ternary.py`](https://github.com/amithgspn/etc_smartnic/blob/main/generate_table_entries_ternary.py) (Ternary table generator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dataplane["Dataplane classification"]
  node_feature_extract["Feature extraction"]
  node_categorical["Categorical classifier"]
  node_messaging["Messaging classifier"]
  node_multimedia["Multimedia classifier"]
  node_pipeline_io["Pipeline configuration"]
  node_host_io["Host configuration"]
end

subgraph group_artifacts["Classifier artifacts"]
  node_table_generator["Ternary table generator"]
  node_rule_tables["Classification rule tables"]
  node_messaging_rules["Messaging rule tables"]
  node_multimedia_rules["Multimedia rule tables"]
  node_models["ML model artifacts"]
end

subgraph group_evaluation["Evaluation data"]
  node_training_data[("Training and test data")]
  node_throughput_data[("Throughput results")]
  node_latency_data[("Latency results")]
end

subgraph group_analysis["Performance analysis"]
  node_throughput_analysis["Throughput analysis"]
  node_throughput_plots["Throughput plotting"]
  node_latency_plots["Latency CDF plots"]
end

node_traffic_source(("Network traffic"))
node_engineer(("Engineer / operator"))

node_traffic_source -.->|"supplies packets"| node_feature_extract
node_feature_extract -.->|"passes features"| node_categorical
node_categorical -.->|"routes traffic"| node_messaging
node_categorical -.->|"routes traffic"| node_multimedia
node_table_generator -.->|"generates entries"| node_rule_tables
node_rule_tables -.->|"configures rules"| node_categorical
node_messaging_rules -.->|"configures rules"| node_messaging
node_multimedia_rules -.->|"configures rules"| node_multimedia
node_models -.->|"supports inference"| node_categorical
node_models -.->|"supports inference"| node_messaging
node_models -.->|"supports inference"| node_multimedia
node_pipeline_io -.->|"configures pipeline"| node_feature_extract
node_host_io -.->|"configures host"| node_feature_extract
node_training_data -.->|"trains or tests"| node_table_generator
node_throughput_data -->|"summarizes results"| node_throughput_analysis
node_throughput_data -.->|"plots metrics"| node_throughput_plots
node_latency_data -->|"plots latency"| node_latency_plots
node_engineer -.->|"generates tables"| node_table_generator
node_engineer -.->|"analyzes results"| node_throughput_analysis
node_engineer -.->|"reviews latency"| node_latency_plots

click node_feature_extract "https://github.com/amithgspn/etc_smartnic/blob/main/P4_codes/feature_extraction.p4"
click node_categorical "https://github.com/amithgspn/etc_smartnic/blob/main/P4_codes/categorical_classifier.p4"
click node_messaging "https://github.com/amithgspn/etc_smartnic/blob/main/P4_codes/messaging_classifier.p4"
click node_multimedia "https://github.com/amithgspn/etc_smartnic/blob/main/P4_codes/multimedia_classifier.p4"
click node_table_generator "https://github.com/amithgspn/etc_smartnic/blob/main/generate_table_entries_ternary.py"
click node_rule_tables "https://github.com/amithgspn/etc_smartnic/tree/main/Categorical_classification_rules"
click node_messaging_rules "https://github.com/amithgspn/etc_smartnic/tree/main/Messaging_classification_rules"
click node_multimedia_rules "https://github.com/amithgspn/etc_smartnic/tree/main/Multimedia_classification_rules"
click node_models "https://github.com/amithgspn/etc_smartnic/tree/main/Machine_learning_models"
click node_pipeline_io "https://github.com/amithgspn/etc_smartnic/tree/main/Pipeline_io_files"
click node_host_io "https://github.com/amithgspn/etc_smartnic/tree/main/Host_io_files"
click node_training_data "https://github.com/amithgspn/etc_smartnic/tree/main/Csv_files"
click node_throughput_data "https://github.com/amithgspn/etc_smartnic/tree/main/Throughput_results"
click node_latency_data "https://github.com/amithgspn/etc_smartnic/tree/main/latency"
click node_throughput_analysis "https://github.com/amithgspn/etc_smartnic/blob/main/Throughput_results/summarize_throughput.py"
click node_throughput_plots "https://github.com/amithgspn/etc_smartnic/blob/main/latency/plot_scripts/generate_thoughput_plots.py"
click node_latency_plots "https://github.com/amithgspn/etc_smartnic/tree/main/latency/plot_scripts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_feature_extract,node_categorical,node_messaging,node_multimedia,node_pipeline_io,node_host_io toneBlue
class node_table_generator,node_rule_tables,node_messaging_rules,node_multimedia_rules,node_models toneAmber
class node_training_data,node_throughput_data,node_latency_data toneMint
class node_throughput_analysis,node_throughput_plots,node_latency_plots toneRose
class node_traffic_source,node_engineer toneIndigo
```

## Components

### Dataplane classification

- [Feature extraction](https://github.com/amithgspn/etc_smartnic/blob/main/P4_codes/feature_extraction.p4): `P4_codes/feature_extraction.p4`
- [Categorical classifier](https://github.com/amithgspn/etc_smartnic/blob/main/P4_codes/categorical_classifier.p4): `P4_codes/categorical_classifier.p4`
- [Messaging classifier](https://github.com/amithgspn/etc_smartnic/blob/main/P4_codes/messaging_classifier.p4): `P4_codes/messaging_classifier.p4`
- [Multimedia classifier](https://github.com/amithgspn/etc_smartnic/blob/main/P4_codes/multimedia_classifier.p4): `P4_codes/multimedia_classifier.p4`
- [Pipeline configuration](https://github.com/amithgspn/etc_smartnic/tree/main/Pipeline_io_files): `Pipeline_io_files`
- [Host configuration](https://github.com/amithgspn/etc_smartnic/tree/main/Host_io_files): `Host_io_files`

### Classifier artifacts

- [Ternary table generator](https://github.com/amithgspn/etc_smartnic/blob/main/generate_table_entries_ternary.py): `generate_table_entries_ternary.py`
- [Classification rule tables](https://github.com/amithgspn/etc_smartnic/tree/main/Categorical_classification_rules): `Categorical_classification_rules`
- [Messaging rule tables](https://github.com/amithgspn/etc_smartnic/tree/main/Messaging_classification_rules): `Messaging_classification_rules`
- [Multimedia rule tables](https://github.com/amithgspn/etc_smartnic/tree/main/Multimedia_classification_rules): `Multimedia_classification_rules`
- [ML model artifacts](https://github.com/amithgspn/etc_smartnic/tree/main/Machine_learning_models): `Machine_learning_models`

### Evaluation data

- [Training and test data](https://github.com/amithgspn/etc_smartnic/tree/main/Csv_files): `Csv_files`
- [Throughput results](https://github.com/amithgspn/etc_smartnic/tree/main/Throughput_results): `Throughput_results`
- [Latency results](https://github.com/amithgspn/etc_smartnic/tree/main/latency): `latency`

### Performance analysis

- [Throughput analysis](https://github.com/amithgspn/etc_smartnic/blob/main/Throughput_results/summarize_throughput.py): `Throughput_results/summarize_throughput.py`
- [Throughput plotting](https://github.com/amithgspn/etc_smartnic/blob/main/latency/plot_scripts/generate_thoughput_plots.py): `latency/plot_scripts/generate_thoughput_plots.py`
- [Latency CDF plots](https://github.com/amithgspn/etc_smartnic/tree/main/latency/plot_scripts): `latency/plot_scripts`

### Other components

- **Network traffic**
- **Engineer / operator**

## Connections

- Network traffic → Feature extraction: supplies packets
- Feature extraction → Categorical classifier: passes features
- Categorical classifier → Messaging classifier: routes traffic
- Categorical classifier → Multimedia classifier: routes traffic
- Ternary table generator → Classification rule tables: generates entries
- Classification rule tables → Categorical classifier: configures rules
- Messaging rule tables → Messaging classifier: configures rules
- Multimedia rule tables → Multimedia classifier: configures rules
- ML model artifacts → Categorical classifier: supports inference
- ML model artifacts → Messaging classifier: supports inference
- ML model artifacts → Multimedia classifier: supports inference
- Pipeline configuration → Feature extraction: configures pipeline
- Host configuration → Feature extraction: configures host
- Training and test data → Ternary table generator: trains or tests
- Throughput results → Throughput analysis: summarizes results (evidence: `Throughput_results/summarize_throughput.py`)
- Throughput results → Throughput plotting: plots metrics
- Latency results → Latency CDF plots: plots latency (evidence: `latency/plot_scripts/plot_cdf_categorical_latency.py`)
- Engineer / operator → Ternary table generator: generates tables
- Engineer / operator → Throughput analysis: analyzes results
- Engineer / operator → Latency CDF plots: reviews latency
