Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,033 changes: 497 additions & 536 deletions distributed-systems-final-report.tex

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions figures/components.mmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
flowchart TB
subgraph host["Docker network (single host)"]
subgraph sims["Machine Simulators (1..N)"]
direction LR
SIM1["machine-simulator-1"]
SIMN["machine-simulator-N"]
end
BROKER(["MQTT broker (Mosquitto)"])
COORD["Coordinator Service"]
CORE["Core REST Service :3000"]
DB[("MongoDB :27017")]
end
CLIENT["HTTP clients\n(Swagger UI / Web GUI)"]

sims -- "MQTT publish\ntelemetry + heartbeat" --> BROKER
BROKER -- "MQTT subscribe" --> COORD
COORD -- "HTTP + service token:\nPOST /api/telemetry\nPATCH /api/machines/:id/state" --> CORE
DB --- CORE
CLIENT -- "HTTP + JWT" --> CORE
Binary file added figures/components.pdf
Binary file not shown.
7 changes: 7 additions & 0 deletions figures/machine-states.mmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
stateDiagram-v2
[*] --> off : machine created
off --> operational : turned on
operational --> off : turned off
operational --> anomaly : anomaly detected
anomaly --> operational : back to normal
anomaly --> off : turned off
Binary file added figures/machine-states.pdf
Binary file not shown.
Binary file added figures/screenshot/swagger-login.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added figures/screenshot/swagger-overview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added figures/screenshot/swagger-telemetry.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions figures/telemetry-flow-ingestion.mmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
sequenceDiagram
participant S as Simulator
participant B as Broker
participant C as Coordinator
participant R as Core REST
participant M as MongoDB

S->>B: publish telemetry
B->>C: deliver event
C->>C: validate + evaluate anomaly
C->>R: POST /telemetry (service token)
R->>M: insert (unique eventId)
alt duplicate eventId
R-->>C: 409 Conflict
else stored
R-->>C: 201 Created
end
Binary file added figures/telemetry-flow-ingestion.pdf
Binary file not shown.
15 changes: 15 additions & 0 deletions figures/telemetry-flow-state.mmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
sequenceDiagram
participant C as Coordinator
participant R as Core REST
participant M as MongoDB
actor U as User

opt machine condition changed
C->>R: PATCH /machines/{id}/state
R->>R: check transition
R->>M: atomic update
R-->>C: 200 OK / 422 invalid
end

U->>R: GET /telemetry?machineId=... (JWT)
R-->>U: paginated history
Binary file added figures/telemetry-flow-state.pdf
Binary file not shown.
Binary file removed figures/universe.jpg
Binary file not shown.