Skip to content

qursa-uc3m/pq-mqtt-sn-clients

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MQTT-SN Clients with wolfMQTT Library for PQC Testing

This repository contains MQTT-SN clients based on wolfMQTT's wolfMQTT/examples/sn-client

Build wolfSSL and wolfMQTT

wolfSSL

Clone this repository and navigate to the project directory. Run the wolfSSL installation script:

./scripts/install_wolfssl.sh

By default, this script installs wolfSSL version 5.6.4-stable. You can change the version by modifying the INSTALL_TAG variable in the install_wolfssl.sh script.

wolfMQTT

After installing wolfSSL, install wolfMQTT:

./scripts/install_wolfMQTT.sh

By default, this script installs wolfMQTT version 1.19.0. You can change the version by modifying the INSTALL_TAG variable in the install_wolfMQTT.sh script.

Note: Ensure that the versions of wolfSSL and wolfMQTT are compatible with each other and with the MQTT-SN clients in this repository.

Configuration

Key Exchange Groups

You can configure the key exchange groups for TLS/DTLS connections by defining MQTT_WOLFSSL_GROUPS in src/common/mqttexample.c. This setting defines which groups will be allowed for key exchange during the TLS handshake.

For example, to set P-256 as the key exchange group:

#define MQTT_WOLFSSL_GROUPS "P-256"

or KYBER_LEVEL_1 if PQC is enabled.

Build the project

mkdir build
cd build
cmake ..
make

Alternatively, you can run the ./scripts/build_clients.sh script.

Running the clients

To run the MQTT-SN client:

./build/bin/sn-client -t 

To run the MQTT-SN publisher:

./build/bin/sn-pub -t 

To run the MQTT-SN subscriber:

./build/bin/sn-sub -t 

Testing

The repository includes a test script (test.sh) to evaluate both publisher and subscriber clients.

Usage

./test.sh [-n iterations] [-m pub|sub]

Options:

  • -n: Number of iterations (default: 1)
  • -m: Mode - 'pub' for publisher or 'sub' for subscriber (default: pub)

For example, to run the publisher 5 times:

./test.sh -n 5 -m pub

Releases

No releases published

Packages

No packages published