Skip to content

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

  1. Connect to your VM with your credentials as usual.
  2. Download the project and import it into GNS3 via File → Import portable project: GNS3 project – lab06
  3. Start all nodes using the green "play" button in GNS3.
  4. 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

Overview of the lab setup

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

file:///home/netlab/tmp/iikt2105-containers/site/index.html

Node-RED / Flow

172.18.0.136:1880

Node-RED dashboard

172.18.0.136:1880/ui

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:
ip address show

Fill in the IP addresses of interface eth0 of Node-RED and interface eth1 of OpenPLC.

  1. 192.168.1.60/24 and 192.168.1.40/24
  2. 192.168.1.40/24 and 192.168.1.60/24
  3. 172.18.0.136/24 and 192.168.2.60/24
  4. 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.

  1. eth0 of Node-RED and eth1 of OpenPLC
  2. eth1 of OpenPLC and eth1 of WaterTankSimulator
  3. eth0 of OpenPLC and eth0 of WaterTankSimulator
  4. eth0 of Node-RED and eth0 of 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?

  1. 502
  2. 9977
  3. 5020
  4. 7799

4. Modbus/TCP IPs

What is the destination IP address of Modbus/TCP responses on the link between Node-RED and OpenPLC?

  1. 192.168.1.60
  2. 192.168.2.50
  3. 192.168.1.40
  4. 192.168.2.60
  5. 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:

    ip.dst == 1.2.3.4 && modbus
  1. 5 queries are sent every second.
  2. 1 query is sent every second.
  3. 15 queries are sent every 5 seconds.
  4. 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.

  1. 192.168.1.60:5020
  2. 192.168.1.40:502
  3. 192.168.1.40:5020
  4. 192.168.1.60:502
  5. 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?

  1. Func 4: Read Input Register
  2. Func 6: Write Single Register
  3. Func 4: Write Single Register
  4. 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.

  1. Lack of encryption.
  2. Lack of data integrity.
  3. Both lack of encryption and data integrity.
  4. None of the provided options.