# davideandreotti/dcmb architecture

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

- Interactive diagram: https://gitdiagram.com/davideandreotti/dcmb
- Repository: https://github.com/davideandreotti/dcmb

## Overview

This research prototype studies inspection of encrypted FaaS traffic through two approaches: DCMB, using delegated credentials, and ETSI TLMSP, using a policy middlebox. The main workflow is client traffic through the relevant middlebox to an application service, alongside certificate/attestation verification; separate campaign tools run and analyze latency and other benchmarks. README documents deployment profiles and benchmark capabilities, but sampled excerpts do not expose all service wiring, so some subsystem links are documented or marked unverified rather than inferred from names.

Main entry points: [`ETSI/NewMiddlebox/middleboxHandler.go`](https://github.com/davideandreotti/dcmb/blob/main/ETSI/NewMiddlebox/middleboxHandler.go) (TLMSP middlebox), [`DC/Middlebox/cmd/gateway/main.go`](https://github.com/davideandreotti/dcmb/blob/main/DC/Middlebox/cmd/gateway/main.go) (Backend gateway), [`DC/Middlebox/cmd/middlebox/middleboxHandler.go`](https://github.com/davideandreotti/dcmb/blob/main/DC/Middlebox/cmd/middlebox/middleboxHandler.go) (DCMB middlebox), [`ETSI/Benchmarking/run_campaign.py`](https://github.com/davideandreotti/dcmb/blob/main/ETSI/Benchmarking/run_campaign.py) (TLMSP campaign runner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dcmb["DCMB services"]
  node_dcclient["DCMB client<br/>[main.go]"]
  node_gateway["Backend gateway<br/>[main.go]"]
  node_middlebox["DCMB middlebox"]
  node_certserver["Certificate service<br/>[main.go]"]
  node_quoteverify["DCAP quote verifier"]
  node_appserver["Application server<br/>[main.go]"]
  node_docker["Docker backend<br/>[docker_backend.go]"]
end

subgraph group_tlmsp["TLMSP policy"]
  node_tlmspclient["TLMSP client<br/>[client.go]"]
  node_tlmspmiddlebox["TLMSP middlebox"]
  node_tlmsp_listener["TLMSP listener<br/>[listener.go]"]
  node_policy["Python policy<br/>[mb.py]"]
  node_policy_types["Policy message types<br/>[MessageTypes.py]"]
  node_policy_jwt["JWT validation<br/>[jwtParser.py]"]
  node_policy_flow["Policy workflow model<br/>[randomize.py]"]
end

subgraph group_bench["Benchmarking"]
  node_dc_campaign["DCMB campaign runner<br/>[run.py]"]
  node_dc_plot["DCMB results plotter<br/>[plot_latency.py]"]
  node_tlmsp_campaign["TLMSP campaign runner<br/>[run_campaign.py]"]
  node_tlmsp_latency["Latency analysis<br/>[run_latency.py]"]
end

subgraph group_internal["Protocol internals"]
  node_tlshello["TLS ClientHello parsing<br/>[tlshello.go]"]
  node_ticketidentity["Ticket identity<br/>[ticketidentity.go]"]
  node_quoteheader["DCAP verifier interface<br/>[quoteverify_dcap.h]"]
end

node_user(("FaaS client"))
node_faas(("FaaS application"))

node_user -->|"sends requests"| node_dcclient
node_dcclient -.->|"uses DCMB path"| node_gateway
node_gateway -.->|"routes traffic"| node_middlebox
node_middlebox -.->|"requests credentials"| node_certserver
node_middlebox -.->|"forwards requests"| node_appserver
node_gateway -.->|"manages backends"| node_docker
node_middlebox -.->|"parses ClientHello"| node_tlshello
node_gateway -.->|"uses affinity"| node_ticketidentity
node_certserver -.->|"uses verifier API"| node_quoteheader
node_quoteheader -->|"declares interface"| node_quoteverify
node_user -.->|"sends requests"| node_tlmspclient
node_tlmspclient -.->|"uses TLMSP"| node_tlmspmiddlebox
node_tlmspmiddlebox -.->|"accepts connections"| node_tlmsp_listener
node_tlmspmiddlebox -.->|"invokes policy"| node_policy
node_policy -->|"matches messages"| node_policy_types
node_policy -->|"validates tokens"| node_policy_jwt
node_policy_flow -->|"uses message types"| node_policy_types
node_policy_flow -->|"validates tokens"| node_policy_jwt
node_tlmspmiddlebox -.->|"serves requests"| node_faas
node_dc_campaign -.->|"runs experiments"| node_dcclient
node_dc_campaign -->|"produces results for"| node_dc_plot
node_tlmsp_campaign -->|"runs analysis"| node_tlmsp_latency
node_tlmsp_campaign -.->|"starts stack"| node_tlmspmiddlebox
node_tlmsp_campaign -->|"shares campaign results"| node_dc_plot

click node_dcclient "https://github.com/davideandreotti/dcmb/blob/main/DC/Middlebox/cmd/client/main.go"
click node_gateway "https://github.com/davideandreotti/dcmb/blob/main/DC/Middlebox/cmd/gateway/main.go"
click node_middlebox "https://github.com/davideandreotti/dcmb/blob/main/DC/Middlebox/cmd/middlebox/middleboxHandler.go"
click node_certserver "https://github.com/davideandreotti/dcmb/blob/main/DC/Middlebox/cmd/certserver/main.go"
click node_quoteverify "https://github.com/davideandreotti/dcmb/blob/main/DC/Middlebox/cmd/certserver/quoteverify_dcap.cpp"
click node_appserver "https://github.com/davideandreotti/dcmb/blob/main/DC/Middlebox/cmd/appserver/main.go"
click node_docker "https://github.com/davideandreotti/dcmb/blob/main/DC/Middlebox/cmd/gateway/docker_backend.go"
click node_tlmspclient "https://github.com/davideandreotti/dcmb/blob/main/ETSI/NewMiddlebox/client.go"
click node_tlmspmiddlebox "https://github.com/davideandreotti/dcmb/blob/main/ETSI/NewMiddlebox/middleboxHandler.go"
click node_tlmsp_listener "https://github.com/davideandreotti/dcmb/blob/main/ETSI/NewMiddlebox/listener.go"
click node_policy "https://github.com/davideandreotti/dcmb/blob/main/ETSI/Middlebox/mb.py"
click node_policy_types "https://github.com/davideandreotti/dcmb/blob/main/ETSI/Middlebox/MessageTypes.py"
click node_policy_jwt "https://github.com/davideandreotti/dcmb/blob/main/ETSI/Middlebox/jwtParser.py"
click node_policy_flow "https://github.com/davideandreotti/dcmb/blob/main/ETSI/Middlebox/randomize.py"
click node_dc_campaign "https://github.com/davideandreotti/dcmb/blob/main/DC/Middlebox/benchmarking/run.py"
click node_dc_plot "https://github.com/davideandreotti/dcmb/blob/main/DC/Middlebox/benchmarking/plot_latency.py"
click node_tlmsp_campaign "https://github.com/davideandreotti/dcmb/blob/main/ETSI/Benchmarking/run_campaign.py"
click node_tlmsp_latency "https://github.com/davideandreotti/dcmb/blob/main/ETSI/Benchmarking/run_latency.py"
click node_tlshello "https://github.com/davideandreotti/dcmb/blob/main/DC/Middlebox/internal/tlshello/tlshello.go"
click node_ticketidentity "https://github.com/davideandreotti/dcmb/blob/main/DC/Middlebox/internal/ticketidentity/ticketidentity.go"
click node_quoteheader "https://github.com/davideandreotti/dcmb/blob/main/DC/Middlebox/cmd/certserver/quoteverify_dcap.h"

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_dcclient,node_gateway,node_middlebox,node_certserver,node_quoteverify,node_appserver,node_docker,node_user toneBlue
class node_tlmspclient,node_tlmspmiddlebox,node_tlmsp_listener,node_policy,node_policy_types,node_policy_jwt,node_policy_flow toneAmber
class node_dc_campaign,node_dc_plot,node_tlmsp_campaign,node_tlmsp_latency toneMint
class node_tlshello,node_ticketidentity,node_quoteheader toneRose
class node_faas toneIndigo
```

## Components

### DCMB services

- [DCMB client](https://github.com/davideandreotti/dcmb/blob/main/DC/Middlebox/cmd/client/main.go): `DC/Middlebox/cmd/client/main.go`
- [Backend gateway](https://github.com/davideandreotti/dcmb/blob/main/DC/Middlebox/cmd/gateway/main.go): `DC/Middlebox/cmd/gateway/main.go`
- [DCMB middlebox](https://github.com/davideandreotti/dcmb/blob/main/DC/Middlebox/cmd/middlebox/middleboxHandler.go): `DC/Middlebox/cmd/middlebox/middleboxHandler.go`
- [Certificate service](https://github.com/davideandreotti/dcmb/blob/main/DC/Middlebox/cmd/certserver/main.go): `DC/Middlebox/cmd/certserver/main.go`
- [DCAP quote verifier](https://github.com/davideandreotti/dcmb/blob/main/DC/Middlebox/cmd/certserver/quoteverify_dcap.cpp): `DC/Middlebox/cmd/certserver/quoteverify_dcap.cpp`
- [Application server](https://github.com/davideandreotti/dcmb/blob/main/DC/Middlebox/cmd/appserver/main.go): `DC/Middlebox/cmd/appserver/main.go`
- [Docker backend](https://github.com/davideandreotti/dcmb/blob/main/DC/Middlebox/cmd/gateway/docker_backend.go): `DC/Middlebox/cmd/gateway/docker_backend.go`

### TLMSP policy

- [TLMSP client](https://github.com/davideandreotti/dcmb/blob/main/ETSI/NewMiddlebox/client.go): `ETSI/NewMiddlebox/client.go`
- [TLMSP middlebox](https://github.com/davideandreotti/dcmb/blob/main/ETSI/NewMiddlebox/middleboxHandler.go): `ETSI/NewMiddlebox/middleboxHandler.go`
- [TLMSP listener](https://github.com/davideandreotti/dcmb/blob/main/ETSI/NewMiddlebox/listener.go): `ETSI/NewMiddlebox/listener.go`
- [Python policy](https://github.com/davideandreotti/dcmb/blob/main/ETSI/Middlebox/mb.py): `ETSI/Middlebox/mb.py`
- [Policy message types](https://github.com/davideandreotti/dcmb/blob/main/ETSI/Middlebox/MessageTypes.py): `ETSI/Middlebox/MessageTypes.py`
- [JWT validation](https://github.com/davideandreotti/dcmb/blob/main/ETSI/Middlebox/jwtParser.py): `ETSI/Middlebox/jwtParser.py`
- [Policy workflow model](https://github.com/davideandreotti/dcmb/blob/main/ETSI/Middlebox/randomize.py): `ETSI/Middlebox/randomize.py`

### Benchmarking

- [DCMB campaign runner](https://github.com/davideandreotti/dcmb/blob/main/DC/Middlebox/benchmarking/run.py): `DC/Middlebox/benchmarking/run.py`
- [DCMB results plotter](https://github.com/davideandreotti/dcmb/blob/main/DC/Middlebox/benchmarking/plot_latency.py): `DC/Middlebox/benchmarking/plot_latency.py`
- [TLMSP campaign runner](https://github.com/davideandreotti/dcmb/blob/main/ETSI/Benchmarking/run_campaign.py): `ETSI/Benchmarking/run_campaign.py`
- [Latency analysis](https://github.com/davideandreotti/dcmb/blob/main/ETSI/Benchmarking/run_latency.py): `ETSI/Benchmarking/run_latency.py`

### Protocol internals

- [TLS ClientHello parsing](https://github.com/davideandreotti/dcmb/blob/main/DC/Middlebox/internal/tlshello/tlshello.go): `DC/Middlebox/internal/tlshello/tlshello.go`
- [Ticket identity](https://github.com/davideandreotti/dcmb/blob/main/DC/Middlebox/internal/ticketidentity/ticketidentity.go): `DC/Middlebox/internal/ticketidentity/ticketidentity.go`
- [DCAP verifier interface](https://github.com/davideandreotti/dcmb/blob/main/DC/Middlebox/cmd/certserver/quoteverify_dcap.h): `DC/Middlebox/cmd/certserver/quoteverify_dcap.h`

### Other components

- **FaaS client**
- **FaaS application**

## Connections

- FaaS client → DCMB client: sends requests (evidence: `README.md`)
- DCMB client → Backend gateway: uses DCMB path
- Backend gateway → DCMB middlebox: routes traffic
- DCMB middlebox → Certificate service: requests credentials
- DCMB middlebox → Application server: forwards requests
- Backend gateway → Docker backend: manages backends
- DCMB middlebox → TLS ClientHello parsing: parses ClientHello
- Backend gateway → Ticket identity: uses affinity
- Certificate service → DCAP verifier interface: uses verifier API
- DCAP verifier interface → DCAP quote verifier: declares interface (evidence: `DC/Middlebox/cmd/certserver/quoteverify_dcap.cpp`)
- FaaS client → TLMSP client: sends requests
- TLMSP client → TLMSP middlebox: uses TLMSP
- TLMSP middlebox → TLMSP listener: accepts connections
- TLMSP middlebox → Python policy: invokes policy
- Python policy → Policy message types: matches messages (evidence: `ETSI/Middlebox/mb.py`)
- Python policy → JWT validation: validates tokens (evidence: `ETSI/Middlebox/mb.py`)
- Policy workflow model → Policy message types: uses message types (evidence: `ETSI/Middlebox/randomize.py`)
- Policy workflow model → JWT validation: validates tokens (evidence: `ETSI/Middlebox/randomize.py`)
- TLMSP middlebox → FaaS application: serves requests
- DCMB campaign runner → DCMB client: runs experiments
- DCMB campaign runner → DCMB results plotter: produces results for (evidence: `README.md`)
- TLMSP campaign runner → Latency analysis: runs analysis (evidence: `ETSI/Benchmarking/run_campaign.py`)
- TLMSP campaign runner → TLMSP middlebox: starts stack
- TLMSP campaign runner → DCMB results plotter: shares campaign results (evidence: `README.md`)
