MQTT has been an OASIS Standard since 15 October 2014.

The following sample shows an example of MQTT messages available in Packet Tracer. 

{"cmd":"ID","ID":"357fa587ed1de0L"} 
{"cmd":"CONNECT","client": "MQTT Client (357fa587ed1de0L)","protocolId":"MQTT","protocolVersion":"3.1.1", "clean":1, "clientId":"357fa587ed1de0L", "keepalive":60, "username":"cisco", "password":"cisco", "will":{}}
{"cmd":"CONNACK","client":"MQTT Client (357fa587ed1de0L)","returnCode":0,"sessionPresent":0}
{"cmd":"SUBSCRIBE","client":"MQTT Client (357fa587ed1de0L)","packetId":31276,"topic":"myhome/bedroom/temp","qos":0}
{"cmd":"SUBACK","client":"MQTT Client (357fa587ed1de0L)","packetId":31276,"topic":"myhome/bedroom/temp","qos":0,"returnCode":0}
{"cmd":"SUBSCRIBE","client":"MQTT Client (357fa587ed1de0L)","packetId":23347,"topic":"myhome","qos":0}
{"cmd":"SUBACK","client":"MQTT Client (357fa587ed1de0L)","packetId":23347,"topic":"myhome","qos":0,"returnCode":0}
{"cmd":"PUBLISH","client":"MQTT Client (357fa587ed1de0L)","qos":0,"dup":0,"topic":"myhome/bedroom/temp","payload":"TestTestTest","retain":0}
{"cmd":"PUBLISH","client":"MQTT Client (357fa587ed1de0L)","qos":0,"dup":0,"topic":"myhome/bedroom/temp","payload":"TestTestTest","retain":0}

How to configure MQTT in Cisco Packet Tracer ?

MQTT clients subscribe to MQTT message queues hosted by a MQTT broker.

MQTT client ant MQTT broker are available in Packet Tracer SBC-PT IoT module as Python projects in "Programming tab".

To install the MQTT broker role and make the MQTT Broker desktop app appear in the "Desktop" tab of the SBC-PT device :

  1. Open the "Programming" tab of the SBC-PT device
  2. Create a new Python project based on the "MQTT Broker - (Python)" Global Script Project
  3. Click on "Create" button
  4. When the new project has been created an opened in the programming, click on the "Install to Desktop" button to make the MQTT Broker appear in the "Desktop" tab

Install MQTT Broker in Cisco Packet Tracer SBC-PT device

The MQTT Broker can then be configured through the MQTT Broker desktop app. 

To add authorized MQTT users (optional):

  1. Open the MQTT Broker desktop app
  2. Enter a username
  3. Enter a password (optional)
  4. Click on Add

Cisco Packet Tracer MQTT broker desktop application

Connected MQTT clients and configured MQTT topics flowing through the network can then be viewed in the MQTT broker.

Connected MQTT clients and configured MQTT topics in Cisco Packet Tracer broker application