CACS460 Internet of Things

Internet of ThingsUnit 29 min read

IoT Architecture: Layers, Platforms & Design Methodology

Unit 2 of Internet of Things explores the 4-layer IoT architecture (perception, network, processing, application), platform design methodologies (modularity, scalability, interoperability), and real-world IoT ecosystems like smart cities and industrial IoT. Covers protocol stacks, data flow diagrams, and comparative an


1. The 4-Layer IoT Architecture: A Visual Breakdown

IoT systems are structured in four hierarchical layers, each with distinct functions. Below is the standardized model (with variations in some frameworks):

Application Layer (End-userinterfaces)Processing Layer (Cloud/Edgeanalytics)Network Layer (Connectivityprotocols)Perception Layer(Sensors/Actuators)Data flow direction
Standard 4-layer IoT architecture with directional data flow (arrows indicate communication paths)

1.1 Perception Layer (Physical Layer)

Definition: The hardware interface where physical data is collected (sensors) or actions are performed (actuators). Key Components:

  • Sensors: Temperature (DHT11), humidity (SHT31), motion (PIR), GPS (NEO-6M).
  • Actuators: Relays, motors, LEDs, smart locks.
  • RFID/NFC tags: For asset tracking (e.g., Daraz warehouse inventory).

Worked Example: Smart Traffic Light System (Kathmandu)

  • Sensors: Inductive loops detect vehicle count.
  • Actuators: Traffic lights change based on real-time data.
  • Data Flow: Vehicle → Loop Sensor → Microcontroller → Cloud → Traffic Controller → Actuator (Light).

Advantages: ✔ Low power consumption (battery-operated nodes). ✔ Scalable (add more sensors without redesigning the network).

Disadvantages: ✖ Vulnerable to physical tampering. ✖ Limited processing power (offloads tasks to higher layers).


2. Network Layer: Connectivity Protocols

Transmits data between perception and processing layers. Protocol choice depends on:

  • Range (short: Bluetooth, long: LoRaWAN).
  • Power (low: Zigbee, high: Wi-Fi).
  • Bandwidth (real-time: MQTT, bulk: CoAP).

2.1 Protocol Comparison Table

Protocol Use Case Data Rate Power Range Example
MQTT Lightweight messaging Low Very Low LAN/WAN eSewa payment notifications
CoAP RESTful IoT (HTTP-like) Medium Low LAN Smart home devices
LoRaWAN Long-range, low-power Very Low Extremely Low 10+ km Agricultural soil sensors
NB-IoT Cellular IoT Medium Low City-wide Ncell smart meters
Zigbee Mesh networking Low Low 10–100m Smart lighting grids

Worked Example: NTC’s Smart Grid Monitoring

  • Protocol: NB-IoT (cellular) for remote substations.
  • Data Flow: Substation Sensor → NB-IoT Module → NTC Cloud → Analytics Engine → Alert System.
  • Why NB-IoT?
    • Covers Nepal’s rugged terrain (mountains block Wi-Fi).
    • Low power = 10-year battery life for sensors.

3. Processing Layer: Cloud vs. Edge Computing

Decides where data is processed (centralized cloud or decentralized edge).

3.1 Cloud Processing (Centralized)

  • Definition: Data sent to remote servers (AWS, Google Cloud) for analytics.
  • Example: Google Nest processes thermostat data in the cloud to predict energy use.

Merits: ✔ High computational power. ✔ Global accessibility.

Demerits: ✖ Latency (delays in real-time systems). ✖ Privacy risks (data leaves local network).

3.2 Edge Processing (Decentralized)

  • Definition: Data processed near the source (e.g., Raspberry Pi, Arduino with SD card).
  • Example: Pathao’s real-time ride matching uses edge servers in driver apps to reduce cloud load.

Merits: ✔ Low latency (critical for autonomous vehicles). ✖ Privacy (data stays local).

Demerits: ✖ Limited storage/compute power. ✖ Higher upfront cost.


4. Application Layer: User Interfaces and APIs

Where end-users interact with IoT systems via:

  • Web Dashboards (e.g., eSewa’s transaction history).
  • Mobile Apps (e.g., Khalti’s QR payment scanner).
  • Voice Assistants (e.g., Google Home for smart lights).

4.1 API Gateways in IoT

  • Role: Translates between device protocols (MQTT) and user-facing APIs (REST).
  • Example: AWS IoT Core lets a smart lock app (HTTP) talk to a Zigbee lock (MQTT).
sequenceDiagram
    participant User
    participant MobileApp
    participant API_Gateway
    participant IoT_Device

    User->>MobileApp: Requests lock status (HTTP)
    MobileApp->>API_Gateway: Sends REST API call
    API_Gateway->>IoT_Device: Converts to MQTT
    IoT_Device-->>API_Gateway: Sends lock status (MQTT)
    API_Gateway-->>MobileApp: Returns JSON
    MobileApp-->>User: Displays "Unlocked"

Worked Example: Daraz’s Warehouse Automation

  • Application Layer: Web portal shows real-time inventory.
  • Processing Layer: Edge servers in warehouses track stock levels.
  • Network Layer: LoRaWAN for pallet tracking.
  • Perception Layer: RFID tags on products.

5. IoT Platform Design Methodologies

5.1 Key Principles

  1. Modularity: Separate hardware/software components (e.g., swap sensors without rewriting code).
  2. Scalability: Add nodes without overloading the system (e.g., Kubernetes for cloud IoT).
  3. Interoperability: Devices from different vendors must communicate (e.g., OPC UA standard).
  4. Security by Design: Encrypt data in transit (TLS) and at rest (AES-256).

5.2 Platform Comparison

Platform Vendor Key Feature Best For
AWS IoT Core Amazon Serverless MQTT broker Enterprise-scale deployments
Google Cloud IoT Google Edge ML integration Predictive maintenance
Azure IoT Hub Microsoft Device provisioning & telemetry Industrial IoT
Arduino IDE Arduino Open-source, drag-and-drop coding Prototyping
PlatformIO PlatformIO Multi-board support (ESP32, Raspberry Pi) Cross-platform development

6. Domain-Specific IoT Applications

6.1 Smart Cities (NTC, Kathmandu Metro)

  • Use Case: Traffic optimization, energy management.
  • Example: NTC’s smart poles use cameras + AI to detect congestion.

6.2 Healthcare (Nepal’s Rural Clinics)

  • Use Case: Remote patient monitoring.
  • Example: BP sensors → LoRaWAN → Cloud → Doctor’s app.

6.3 Agriculture (Daraz’s Farm Partners)

  • Use Case: Soil moisture + weather data for irrigation.
  • Example: DHT22 sensor → NodeMCU → Farm dashboard.

7. Data Management in IoT

7.1 Storage Techniques

Method Use Case Example
SQL Databases Structured data (e.g., sensor logs) MySQL for eSewa transactions
NoSQL Unstructured (e.g., video feeds) MongoDB for CCTV analytics
Time-Series DB Metrics over time (e.g., temperature) InfluxDB for weather stations

7.2 Processing Techniques

  • Batch Processing: Store data first, analyze later (e.g., monthly energy reports).
  • Stream Processing: Real-time (e.g., Apache Kafka for stock market IoT).

## In the Real World

  1. eSewa’s IoT Payment Terminals

    • Layer Used: Network (NB-IoT) + Application (Mobile App API).
    • How: Merchant terminals use cellular IoT to sync transactions with eSewa’s cloud in real time.
  2. Pathao’s Driver App (Edge + Cloud Hybrid)

    • Layer Used: Edge (Ride matching on driver phones) + Cloud (Global dispatch).
    • Why: Edge reduces latency for nearby riders; cloud handles city-wide routing.
  3. NTC’s Smart Grid Pilot (LoRaWAN + NB-IoT)

    • Layer Used: Perception (Current sensors) + Network (LoRaWAN for rural areas, NB-IoT for cities).
    • Impact: Cuts power theft by 30% via real-time monitoring.

## Exam Tip

What Examiners Want to See

  1. Layer-wise Analysis: Always map examples to all 4 layers (e.g., "In a smart lock system, the perception layer uses a Bluetooth sensor...").
  2. Protocol Justification: For questions like "Why use MQTT over HTTP?", list latency, power, and payload size trade-offs.
  3. Real-World Tie-Ins: Link theory to Nepali companies (e.g., "Ncell’s NB-IoT uses edge processing for...").
  4. Diagrams: Draw sequence diagrams for protocol flows (e.g., MQTT publish-subscribe) or layered models for architecture.
  5. Critical Thinking: Compare cloud vs. edge for a given use case (e.g., "A hospital’s patient monitor needs edge processing because...").

Common Pitfalls

❌ Mixing layers: Saying "the application layer sends data to the sensor" (wrong! Sensors are perception layer). ❌ Ignoring power constraints: Assuming all IoT devices use Wi-Fi (LoRaWAN is often better for rural areas). ❌ Vague examples: "IoT is used in healthcare" → Specify: "Wearable ECG patches use Bluetooth LE to send data to a nurse’s tablet."


Final Checklist Before Exam:

  • Can I draw the 4-layer IoT model from memory?
  • Do I know 3 protocols and their trade-offs?
  • Can I explain edge vs. cloud with a Nepali example?
  • Have I practiced sequence diagrams for MQTT/HTTP flows?

Based on the TU BCA syllabus for Internet of Things (CACS460), unit 2.

Discussion

Loading…