# titchtheo/bachelorthesis-bacnet-dpmi architecture

> Architecture diagram of the GitHub repository titchtheo/bachelorthesis-bacnet-dpmi, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/titchtheo/bachelorthesis-bacnet-dpmi
- Repository: https://github.com/titchtheo/bachelorthesis-bacnet-dpmi

## Overview

DPMI-BACnet extends passive network measurement with a consumer that extracts BACnet traffic, decodes and classifies packets, computes device statistics, and exports results. Its main workflow is documented in the README; source-index references support the classifier’s use of the decoder, statistics, output, and protocol code. The repository also includes BACnet device simulation and a separate traffic-clustering capability. Some runtime wiring is not shown in the excerpts, so uncertain links are omitted or marked unverified.

Main entry points: [`consumer-bacnet/bacnet_classifier.cpp`](https://github.com/titchtheo/bachelorthesis-bacnet-dpmi/blob/main/consumer-bacnet/bacnet_classifier.cpp) (BACnet consumer), [`consumer-bacnet/bacnet_decoder.cpp`](https://github.com/titchtheo/bachelorthesis-bacnet-dpmi/blob/main/consumer-bacnet/bacnet_decoder.cpp) (Packet decoder), [`consumer-bacnet/output_handler.cpp`](https://github.com/titchtheo/bachelorthesis-bacnet-dpmi/blob/main/consumer-bacnet/output_handler.cpp) (Output selection), [`consumer-bacnet/extract.cpp`](https://github.com/titchtheo/bachelorthesis-bacnet-dpmi/blob/main/consumer-bacnet/extract.cpp) (Packet extraction)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Capture processing"]
  node_extract["Packet extraction<br/>[extract.cpp]"]
  node_classifier["BACnet consumer"]
end

subgraph group_protocol["BACnet protocol"]
  node_decoder["Packet decoder<br/>[bacnet_decoder.cpp]"]
  node_bacnetcore["BACnet data types"]
  node_services["Protocol services"]
  node_objects["Device objects"]
  node_network["Network stack"]
end

subgraph group_analysis["Analysis"]
  node_statistics["Device statistics"]
  node_deviceinfo["BACnet metadata<br/>[bacnet_info.h]"]
  node_clustering["Traffic clustering<br/>[classifier_ml.py]"]
  node_simulation["BACnet simulation<br/>[Device_10.py]"]
end

subgraph group_delivery["Output and integrations"]
  node_output["Output selection<br/>[output_handler.cpp]"]
  node_http["HTTP output<br/>[http.cpp]"]
end

node_dpmi(("DPMI traffic"))
node_influx[("InfluxDB")]
node_terminal(("Terminal"))

node_dpmi -->|"supplies packets"| node_extract
node_extract -.->|"passes traffic"| node_classifier
node_classifier -->|"decodes packets"| node_decoder
node_decoder -->|"uses codecs"| node_bacnetcore
node_decoder -->|"uses services"| node_services
node_classifier -->|"updates statistics"| node_statistics
node_classifier -->|"records metadata"| node_deviceinfo
node_classifier -->|"sends results"| node_output
node_output -->|"uses HTTP"| node_http
node_http -.->|"writes metrics"| node_influx
node_output -->|"prints results"| node_terminal
node_simulation -.->|"generates traffic"| node_dpmi
node_classifier -.->|"feeds categorization"| node_clustering

click node_extract "https://github.com/titchtheo/bachelorthesis-bacnet-dpmi/blob/main/consumer-bacnet/extract.cpp"
click node_classifier "https://github.com/titchtheo/bachelorthesis-bacnet-dpmi/blob/main/consumer-bacnet/bacnet_classifier.cpp"
click node_decoder "https://github.com/titchtheo/bachelorthesis-bacnet-dpmi/blob/main/consumer-bacnet/bacnet_decoder.cpp"
click node_bacnetcore "https://github.com/titchtheo/bachelorthesis-bacnet-dpmi/tree/main/consumer-bacnet/bacnet"
click node_services "https://github.com/titchtheo/bachelorthesis-bacnet-dpmi/tree/main/consumer-bacnet/bacnet/basic/service"
click node_objects "https://github.com/titchtheo/bachelorthesis-bacnet-dpmi/tree/main/consumer-bacnet/bacnet/basic/object"
click node_network "https://github.com/titchtheo/bachelorthesis-bacnet-dpmi/tree/main/consumer-bacnet/bacnet/datalink"
click node_statistics "https://github.com/titchtheo/bachelorthesis-bacnet-dpmi/blob/main/consumer-bacnet/bacnet_statistics.cpp"
click node_deviceinfo "https://github.com/titchtheo/bachelorthesis-bacnet-dpmi/blob/main/consumer-bacnet/bacnet_info.h"
click node_clustering "https://github.com/titchtheo/bachelorthesis-bacnet-dpmi/blob/main/Clustering/classifier_ml.py"
click node_simulation "https://github.com/titchtheo/bachelorthesis-bacnet-dpmi/blob/main/bacnet-simulation/Device_10.py"
click node_output "https://github.com/titchtheo/bachelorthesis-bacnet-dpmi/blob/main/consumer-bacnet/output_handler.cpp"
click node_http "https://github.com/titchtheo/bachelorthesis-bacnet-dpmi/blob/main/consumer-bacnet/http.cpp"

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_extract,node_classifier toneBlue
class node_decoder,node_bacnetcore,node_services,node_objects,node_network,node_influx toneAmber
class node_statistics,node_deviceinfo,node_clustering,node_simulation toneMint
class node_output,node_http toneRose
class node_dpmi,node_terminal toneIndigo
```

## Components

### Capture processing

- [Packet extraction](https://github.com/titchtheo/bachelorthesis-bacnet-dpmi/blob/main/consumer-bacnet/extract.cpp): `consumer-bacnet/extract.cpp`
- [BACnet consumer](https://github.com/titchtheo/bachelorthesis-bacnet-dpmi/blob/main/consumer-bacnet/bacnet_classifier.cpp): `consumer-bacnet/bacnet_classifier.cpp`

### BACnet protocol

- [Packet decoder](https://github.com/titchtheo/bachelorthesis-bacnet-dpmi/blob/main/consumer-bacnet/bacnet_decoder.cpp): `consumer-bacnet/bacnet_decoder.cpp`
- [BACnet data types](https://github.com/titchtheo/bachelorthesis-bacnet-dpmi/tree/main/consumer-bacnet/bacnet): `consumer-bacnet/bacnet`
- [Protocol services](https://github.com/titchtheo/bachelorthesis-bacnet-dpmi/tree/main/consumer-bacnet/bacnet/basic/service): `consumer-bacnet/bacnet/basic/service`
- [Device objects](https://github.com/titchtheo/bachelorthesis-bacnet-dpmi/tree/main/consumer-bacnet/bacnet/basic/object): `consumer-bacnet/bacnet/basic/object`
- [Network stack](https://github.com/titchtheo/bachelorthesis-bacnet-dpmi/tree/main/consumer-bacnet/bacnet/datalink): `consumer-bacnet/bacnet/datalink`

### Analysis

- [Device statistics](https://github.com/titchtheo/bachelorthesis-bacnet-dpmi/blob/main/consumer-bacnet/bacnet_statistics.cpp): `consumer-bacnet/bacnet_statistics.cpp`
- [BACnet metadata](https://github.com/titchtheo/bachelorthesis-bacnet-dpmi/blob/main/consumer-bacnet/bacnet_info.h): `consumer-bacnet/bacnet_info.h`
- [Traffic clustering](https://github.com/titchtheo/bachelorthesis-bacnet-dpmi/blob/main/Clustering/classifier_ml.py): `Clustering/classifier_ml.py`
- [BACnet simulation](https://github.com/titchtheo/bachelorthesis-bacnet-dpmi/blob/main/bacnet-simulation/Device_10.py): `bacnet-simulation/Device_10.py`

### Output and integrations

- [Output selection](https://github.com/titchtheo/bachelorthesis-bacnet-dpmi/blob/main/consumer-bacnet/output_handler.cpp): `consumer-bacnet/output_handler.cpp`
- [HTTP output](https://github.com/titchtheo/bachelorthesis-bacnet-dpmi/blob/main/consumer-bacnet/http.cpp): `consumer-bacnet/http.cpp`

### Other components

- **DPMI traffic**
- **InfluxDB**
- **Terminal**

## Connections

- DPMI traffic → Packet extraction: supplies packets
- Packet extraction → BACnet consumer: passes traffic
- BACnet consumer → Packet decoder: decodes packets (evidence: `consumer-bacnet/bacnet_classifier.cpp`)
- Packet decoder → BACnet data types: uses codecs (evidence: `consumer-bacnet/bacnet_decoder.cpp`)
- Packet decoder → Protocol services: uses services (evidence: `consumer-bacnet/bacnet_decoder.cpp`)
- BACnet consumer → Device statistics: updates statistics (evidence: `consumer-bacnet/bacnet_classifier.cpp`)
- BACnet consumer → BACnet metadata: records metadata (evidence: `consumer-bacnet/bacnet_classifier.cpp`)
- BACnet consumer → Output selection: sends results (evidence: `consumer-bacnet/bacnet_classifier.cpp`)
- Output selection → HTTP output: uses HTTP
- HTTP output → InfluxDB: writes metrics
- Output selection → Terminal: prints results
- BACnet simulation → DPMI traffic: generates traffic
- BACnet consumer → Traffic clustering: feeds categorization
