To install the MQTT Broker

The MQTTRoute will execute and the command prompt will appear. You can see the TCP port using 1883.

To create IoT devices, we must install the IoT simulator on the client machine using Bevywise_IoTSimulator_3.exe

-
The web interface of the IoT Simulator opens in Edge browser. In the IoT Simulator, you can view the default network named HEALTH_CARE and several devices.

Next, we will create a virtual IoT network and virtual IoT devices. Click on the menu icon and select the +New Network option.

The Create New Network popup appears. Type any name (here, CEH_FINANCE_NETWORK) and description. Click on Create.
In the next screen, we will setup the Simulator Settings. Set the Broker IP Address as 10.10.1.19 (the IP address of the Windows Server 2019 ). Since we have installed the Broker on the web server, the created network will interact with the server using MQTT Broker. Do not change default settings and click on Save.

To add IoT devices to the created network, click on the Add blank Device button.

The Create New Device popup opens. Type the device name (here, we use Temperature_Sensor), enter Device Id (here, we use TS1), provide a Description and click on Save.

The device will be added to the CEH_FINANCE_NETWORK.

To connect the Network and the added devices to the server or Broker, click on the Start Network red color circular icon in right corner.

When a connection is established between the network and the added devices and the web server or the MQTT Broker, the red button turns into green.
Next, switch to the Windows Server 2019 machine. Open a web browser, and go to
http://localhost:8080 and login using admin/admin (here, we are using Firefox Browser).

Since the Broker was left running, you can see a connection request from machine 10.10.1.22 for the device TS1 under Recent Connections section.

Switch back to Windows Server 2022 machine. Next, we will create the Subscribe command for the device Temperature_Sensor.
Click on the Plus icon in the top right corner and select the Subscribe to Command option.

The Subscribe for command - TS1 popup opens. Select On start under the Subscribe on tab, type High_Tempe under the Topic tab, and select 1 Atleast once below the Qos option. Click on Save. Scroll down the page, you can see the Topic added under the Subscribe to Commands section.

Next, we will capture the traffic between the virtual IoT network and the MQTT Broker to monitor the secure communication.
Minimise the Edge browser. Click Type here to search field on the Desktop, search for wireshark in the search bar and select Wireshark from the results.
The Wireshark Application window appears, select the Ethernet as interface
Make sure you have selected interface which has 10.10.1.22 as the IP address.
Click on the Start Wireshark icon to start the capturing packets, leave the Wireshark running.
Leave the IoT simulator running and switch to the Windows Server 2019 machine.
Navigate to Devices menu and click on connected device i.e.TS1.

Now, we will send the command to TS1 using the High_Tempe topic. In Send Command section, select Topic as High_Tempe, type Alert for High Temperature in Message field and click on the Submit button.

Message sent to TS1 appears under Message box which indicates that the message was successfully sent to TS1.

Next, switch to Windows Server 2022 machine. We have left the IoT simulator running in the web browser. To see the alert message, maximise the Edge browser and expand the arrow under the connected Temperature_Sensor, Device Log section. You can see the alert message «Alert for High Temperature»

To verify the communication, we have executed Wireshark application, switch to the Wireshark traffic capturing window. Type mqtt under the filter field and press Enter. To display only the MQTT protocol packets.

Select any Publish Message packet from the Packet List pane. In the Packet Details pane at the middle of the window, expand the Transmission Control Protocol, MQ Telemetry Transport Protocol, and Header Flags nodes.
Under the MQ Telemetry Transport Protocol nodes, you can observe details such as Msg Len, Topic Length, Topic, and Message.
Publish Message can be used to obtain the message sent by the MQTT client to the broker.

Select any Publish Release packet from the Packet List pane. In the Packet Details pane at the middle of the window, expand the Transmission Control Protocol, MQ Telemetry Transport Protocol, and Header Flags nodes.
Under the MQ Telemetry Transport Protocol nodes, you can observe details such as Msg Len, Message Type, Message Identifier.

Now, scroll down, look for the Publish Complete packet from the Packet List pane, and click on it. In the Packet Details pane at the middle of the window, expand the Transmission Control Protocol, MQ Telemetry Transport Protocol, and Header Flags nodes.
Under the MQ Telemetry Transport Protocol nodes, you can observe details such as Msg Len and Message Identifier.

Now, scroll down, look for the Publish Received packet from the Packet List pane, and click on it. In the Packet Details pane at the middle of the window, expand the Transmission Control Protocol, MQ Telemetry Transport Protocol, and Header Flags nodes.
Under the MQ Telemetry Transport Protocol nodes, you can observe details such as Message Type, Msg Len and Message Identifier.

Similarly you can select Ping Request, Ping Response and Publish Ack packets and observe the details.