Lab06: Smart-Grid -- Modbus¶
Learning Goals¶
Goals for this week's lab
- See basic networking concepts in action (IP addresses, interfaces, subnets, connectivity)
- Understand basic networking protocols in industrial automation
- See common system integration tools in action
- Interpret data and control system parameters
Initial Setup¶
- Connect to your VM with your credentials as usual.
- Download the project and import it into GNS3 via File → Import portable project: GNS3 project – lab06
- Start all nodes using the green "play" button in GNS3.
- Launch Firefox from the desktop (inside the VM) for visualizations.
Setup overview¶
The setup has three main blocks:
- Local industrial site: a water tank and its PLC, which exposes Modbus
- Remote site: SCADA / HMI in the form of Node-RED
- Local forwards: let us view the Node-RED dashboard and the simulator's live status

Once running, you can right-click any link and select Start capture to open Wireshark with a live view of that link.
Components: water tank simulator, Node-RED and OpenPLC runtime.
Learn more
To learn more about the components, see the slides for an overview of the setup and what each component does: Setup information
Important URLs¶
Before you start with the tasks, open these URLs in a browser inside your VM to access various dashboards and tools:
Water tank view
Node-RED / Flow
Node-RED dashboard
Tasks¶
Submission
Submissions are done in your groups on Canvas.
1. IP addresses¶
- In GNS3, click View → Show/hide interface labels. You can also hover over links between nodes to display the interfaces they connect.
- Double-click a node to open a terminal on it.
- In the terminal, use the command below to find the IP addresses of all interfaces on the node:
Fill in the IP addresses of interface eth0 of Node-RED and interface eth1 of OpenPLC.
- 192.168.1.60/24 and 192.168.1.40/24
- 192.168.1.40/24 and 192.168.1.60/24
- 172.18.0.136/24 and 192.168.2.60/24
- 192.168.2.50/24 and 192.168.2.60/24
2. IP subnets¶
Investigating the IP addresses further, which interfaces share /24 subnets? Pick all correct pairs.
eth0of Node-RED andeth1of OpenPLCeth1of OpenPLC andeth1of WaterTankSimulatoreth0of OpenPLC andeth0of WaterTankSimulatoreth0of Node-RED andeth0of OpenPLC
3. Modbus/TCP ports¶
Right-click on a link, select Start packet capture and check the Start the capture visualization program option to open Wireshark and inspect activity on that link.
Which TCP destination port is used for the Modbus/TCP queries you can observe on the link between Node-RED and OpenPLC?
- 502
- 9977
- 5020
- 7799
4. Modbus/TCP IPs¶
What is the destination IP address of Modbus/TCP responses on the link between Node-RED and OpenPLC?
- 192.168.1.60
- 192.168.2.50
- 192.168.1.40
- 192.168.2.60
- None of the above
5. Interval and number of Modbus/TCP queries¶
Investigating the connection between Node-RED and OpenPLC further, find out the frequency and number of Modbus/TCP queries that are sent.
Tip
To make analysis easier, use a filter in Wireshark to show only Modbus/TCP packets towards a specific IP address:
- 5 queries are sent every second.
- 1 query is sent every second.
- 15 queries are sent every 5 seconds.
- 1 query is sent every 5 seconds.
6. Exploring Node-RED¶
Open Firefox inside the VM and navigate to the Node-RED tab (http://172.18.0.136:1880).
Locate the Write Setpoint Min node and find which server and port it communicates with to update the setpoint for the water tank.
- 192.168.1.60:5020
- 192.168.1.40:502
- 192.168.1.40:5020
- 192.168.1.60:502
- Neither of the listed
7. Exploring the Node-RED dashboard¶
- Open Firefox inside the VM and navigate to the Node-RED dashboard tab (
http://172.18.0.136:1880/ui). - (Re-)start a capture on the connection between Node-RED and OpenPLC, and move one of the sliders for Setpoint Min / Max back and forth a couple of times.
What kind of Modbus/TCP message types ("function codes") does movement of the sliders trigger?
- Func 4: Read Input Register
- Func 6: Write Single Register
- Func 4: Write Single Register
- Func 16: Write Multiple Registers
8. Security¶
Having observed Modbus/TCP traffic in Wireshark, reflect on why plain Modbus/TCP traffic could be a potential security risk.
- Lack of encryption.
- Lack of data integrity.
- Both lack of encryption and data integrity.
- None of the provided options.