# abdurrahmantolay/ebpf-iot-ddos-thesis architecture

> Architecture diagram of the GitHub repository abdurrahmantolay/ebpf-iot-ddos-thesis, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/abdurrahmantolay/ebpf-iot-ddos-thesis
- Repository: https://github.com/abdurrahmantolay/ebpf-iot-ddos-thesis

## Overview

The repository implements an XDP-based UDP flood detector with a user-space controller that reads kernel trace alerts, suppresses repeats, blocks reported IPs, logs alerts, and notifies Telegram. The README also describes Docker and Raspberry Pi evaluation and CPU/mitigation analysis, but the available tree and excerpts do not expose their implementation. The README names a different kernel source filename; this graph uses the existing `ebpf/udp_filter.c`.

Main entry points: [`controller/controller.py`](https://github.com/abdurrahmantolay/ebpf-iot-ddos-thesis/blob/main/controller/controller.py) (Trace Monitor), [`ebpf/udp_filter.c`](https://github.com/abdurrahmantolay/ebpf-iot-ddos-thesis/blob/main/ebpf/udp_filter.c) (UDP Flood Detector)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_detection["Kernel Detection"]
  node_xdp["UDP Flood Detector<br/>[udp_filter.c]"]
  node_counts[("Per-IP Packet Counts<br/>[udp_filter.c]")]
  node_trace["Kernel Trace Pipe"]
end

subgraph group_controller["User Controller"]
  node_monitor["Trace Monitor<br/>[controller.py]"]
  node_cooldown["Alert Cooldown<br/>[controller.py]"]
end

subgraph group_response["Mitigation and Alerts"]
  node_block["IP Blocking<br/>[controller.py]"]
  node_iptables["iptables"]
  node_logging["Alert Logging<br/>[controller.py]"]
  node_alertfile["Local Alert Log"]
  node_notification["Telegram Notifications<br/>[controller.py]"]
  node_telegram["Telegram Bot API"]
end

node_traffic(("Incoming Traffic"))

node_traffic -->|"enters"| node_xdp
node_xdp -->|"updates"| node_counts
node_xdp -->|"emits alert"| node_trace
node_trace -->|"reads"| node_monitor
node_monitor -->|"checks"| node_cooldown
node_monitor -->|"calls"| node_block
node_monitor -->|"calls"| node_logging
node_monitor -->|"calls"| node_notification
node_block -->|"runs command"| node_iptables
node_logging -->|"appends"| node_alertfile
node_notification -->|"posts alert"| node_telegram

click node_xdp "https://github.com/abdurrahmantolay/ebpf-iot-ddos-thesis/blob/main/ebpf/udp_filter.c"
click node_counts "https://github.com/abdurrahmantolay/ebpf-iot-ddos-thesis/blob/main/ebpf/udp_filter.c"
click node_monitor "https://github.com/abdurrahmantolay/ebpf-iot-ddos-thesis/blob/main/controller/controller.py"
click node_cooldown "https://github.com/abdurrahmantolay/ebpf-iot-ddos-thesis/blob/main/controller/controller.py"
click node_block "https://github.com/abdurrahmantolay/ebpf-iot-ddos-thesis/blob/main/controller/controller.py"
click node_logging "https://github.com/abdurrahmantolay/ebpf-iot-ddos-thesis/blob/main/controller/controller.py"
click node_notification "https://github.com/abdurrahmantolay/ebpf-iot-ddos-thesis/blob/main/controller/controller.py"

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_xdp,node_counts,node_trace toneBlue
class node_monitor,node_cooldown toneAmber
class node_block,node_iptables,node_logging,node_alertfile,node_notification,node_telegram toneMint
class node_traffic toneIndigo
```

## Components

### Kernel Detection

- [UDP Flood Detector](https://github.com/abdurrahmantolay/ebpf-iot-ddos-thesis/blob/main/ebpf/udp_filter.c): `ebpf/udp_filter.c`
- [Per-IP Packet Counts](https://github.com/abdurrahmantolay/ebpf-iot-ddos-thesis/blob/main/ebpf/udp_filter.c): `ebpf/udp_filter.c`
- **Kernel Trace Pipe**

### User Controller

- [Trace Monitor](https://github.com/abdurrahmantolay/ebpf-iot-ddos-thesis/blob/main/controller/controller.py): `controller/controller.py`
- [Alert Cooldown](https://github.com/abdurrahmantolay/ebpf-iot-ddos-thesis/blob/main/controller/controller.py): `controller/controller.py`

### Mitigation and Alerts

- [IP Blocking](https://github.com/abdurrahmantolay/ebpf-iot-ddos-thesis/blob/main/controller/controller.py): `controller/controller.py`
- **iptables**
- [Alert Logging](https://github.com/abdurrahmantolay/ebpf-iot-ddos-thesis/blob/main/controller/controller.py): `controller/controller.py`
- **Local Alert Log**
- [Telegram Notifications](https://github.com/abdurrahmantolay/ebpf-iot-ddos-thesis/blob/main/controller/controller.py): `controller/controller.py`
- **Telegram Bot API**

### Other components

- **Incoming Traffic**

## Connections

- Incoming Traffic → UDP Flood Detector: enters (evidence: `README.md`)
- UDP Flood Detector → Per-IP Packet Counts: updates (evidence: `ebpf/udp_filter.c`)
- UDP Flood Detector → Kernel Trace Pipe: emits alert (evidence: `ebpf/udp_filter.c`)
- Kernel Trace Pipe → Trace Monitor: reads (evidence: `controller/controller.py`)
- Trace Monitor → Alert Cooldown: checks (evidence: `controller/controller.py`)
- Trace Monitor → IP Blocking: calls (evidence: `controller/controller.py`)
- Trace Monitor → Alert Logging: calls (evidence: `controller/controller.py`)
- Trace Monitor → Telegram Notifications: calls (evidence: `controller/controller.py`)
- IP Blocking → iptables: runs command (evidence: `controller/controller.py`)
- Alert Logging → Local Alert Log: appends (evidence: `controller/controller.py`)
- Telegram Notifications → Telegram Bot API: posts alert (evidence: `controller/controller.py`)
