IoT Networking & Cybersecurity System | MQTT, Python, Real-Time Visualization

mqtt python paho-mqtt matplotlib packet-tracer tcp-ip cybersecurity iot networking

IoT Networking System

In this blog post, I’ll walk you through how I developed a smart, real-time IoT system using MQTT and Python that simulates environmental sensor behavior, sends commands between devices, and applies fundamental cybersecurity techniques. This project was the final submission for my Networking & Cybersecurity unit and earned TOP Marks.


🧠 What It Does

This system mimics how smart IoT devices communicate over a secure internal network:

  • Simulates a temperature & humidity sensor (Device 1)
  • Sends MQTT messages to control a fan (Device 2)
  • Integrates a Python monitoring client
  • Automates actions (like turning on a fan if temperature > 28°C)
  • Visualizes real-time sensor data using Matplotlib
  • Applies cybersecurity techniques like access control, TLS, and topic filtering

🛠️ Tech Stack

Tool / ConceptPurpose
MQTT (paho-mqtt)Lightweight messaging protocol between devices
PythonControls device logic and monitoring system
MatplotlibReal-time data visualization (temp & humidity)
Packet TracerPractical networking labs (routing, DNS, DHCP)
TCP/IPCore networking stack for device communication
CybersecurityExplored ACLs, TLS, and network isolation

🔍 Why I Built It

As part of my final project for the TNE20003 Networking unit, I wanted to build something practical and industry-relevant. IoT systems are everywhere now — from homes to factories — and combining them with secure communication, automation, and real-time analytics gave me the opportunity to apply all the networking and cybersecurity principles I learned in class.


💡 How It Works

  1. Device 1 (Python script) generates random temperature & humidity
  2. Publishes data to MQTT topics like <studentID>/temperature
  3. Device 2 listens to commands on <studentID>/commands
  4. Python monitoring app automates fan control if temperature > 28°C
  5. Public topics (public/#) were also used to simulate broadcasts
  6. Cybersecurity layer includes topic access control, TLS proposal, and broker hardening
  7. Sensor data is visualized in real time as dynamic charts

📄 Project Report

👉 View the Full Project Report (PDF)

These documents include:

  • ✅ Implementation details for all 4 grading levels (P to HD)
  • 💡 Diagrams and screenshots of device interaction
  • 🔐 Cybersecurity concerns and proposed solutions
  • 📊 Real-time data visualization examples
  • 🛠️ Instructions to run the full MQTT + Python system

📚 What I Learned

  • 📡 How to simulate device communication using MQTT
  • 🔁 Working with publish-subscribe models for sensors and actuators
  • 🧪 Secure communication: ACLs, TLS, port usage (1883/8883)
  • 📶 Packet Tracer topologies: NAT, DHCP, DNS, subnetting
  • 🖥️ Creating a real-time data dashboard with Python
  • 🔐 Cybersecurity thinking in every layer of a networked system

🧠 Final Thoughts

This was one of the most hands-on, rewarding projects I’ve built. It helped me connect real-world IoT logic with theoretical networking knowledge — and showed me how to apply cybersecurity best practices in actual system design.

Whether you’re building smart home systems or industrial sensors, this kind of MQTT + Python automation is the real deal.

Secure the communication. Automate the response. Visualize the data.