This project provides runnable reference implementations to transfer files using MQTT (QoS 1 and 2), CoAP (confirmable + blockwise), and HTTP, while measuring per-transfer latency and throughput and estimating application-layer overhead from sender to receiver.
-
Use your provided DataFiles directly Place the four provided files in
DataFiles/(already present) and ensure they are exactly these sizes: -
~100 bytes
-
~10 KiB
-
~1 MiB
-
~10 MiB The code auto-discovers them by size and uses their actual filenames.
-
Install dependencies
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txtNote: uvloop was removed to avoid build failures on Python 3.13; no functionality depends on it.
- Configure addresses (create/edit
.env)
cp .env.example .env # if present, otherwise create .env with the same keysVars: BROKER_HOST, BROKER_PORT, COAP_HOST, COAP_PORT, HTTP_HOST, HTTP_PORT.
- MQTT experiments
Broker (e.g., Mosquitto):
mosquitto -p 1883Subscriber (leave running in a separate shell):
python -m mqtt.subscriber --qos 1
python -m mqtt.subscriber --qos 2Publisher (reads from DataFiles by default):
python -m mqtt.publisher --qos 1
python -m mqtt.publisher --qos 2Logs: logs/mqtt/.
- CoAP experiments Server (serves from DataFiles):
python -m coap.serverClient (requests discovered filenames):
python -m coap.client- HTTP experiments Server (serves from DataFiles):
python -m http_proto.serverClient (requests discovered filenames):
python -m http_proto.client- Aggregate to Excel
python -m tools.aggregate_results --out "results/Results File.xlsx"If you prefer direct script paths, set PYTHONPATH=. before the command, e.g.:
PYTHONPATH=. python3 mqtt/publisher.py --qos 1- Overhead excludes reverse-direction control traffic per assignment.
- For MQTT, sender→receiver counts publisher→broker plus broker→subscriber PUBLISH bytes.
- Sync clocks (NTP) for best cross-device timing.
- Python 3.10+ recommended.