Unit 6: IoT Cloud & Edge Integration - Subjective Questions
ECE140 — Workshop On Iot For Digital Society • Practice Questions with Detailed Answers
20 questions
Define IoT architecture and explain the functions of its major layers.
IoT architecture is a structured framework that defines how IoT devices collect data, communicate, process information, and deliver services to users.
The major layers are:
- Perception or device layer: Contains sensors, actuators, RFID tags, microcontrollers, and embedded devices. It collects physical-world data such as temperature, humidity, motion, and pressure.
- Network or communication layer: Transfers data using technologies such as Wi-Fi, Bluetooth, Zigbee, LoRaWAN, Ethernet, or cellular networks. Protocols such as MQTT, HTTP, and CoAP may operate through this layer.
- Processing or middleware layer: Stores, filters, analyzes, and manages device data. It may include edge gateways, databases, message brokers, cloud platforms, and analytics services.
- Application layer: Provides user-oriented services such as smart-home monitoring, industrial automation, healthcare applications, and agricultural dashboards.
- Business layer: Manages business rules, reports, policies, billing, user access, and decisions based on IoT data.
Security, device management, and interoperability are cross-layer concerns that must be addressed throughout the architecture.
Explain the architecture and working of the MQTT protocol in an IoT system.
MQTT, or Message Queuing Telemetry Transport, is a lightweight publish-subscribe messaging protocol designed for constrained devices and unreliable networks.
Its main components are:
- Publisher: Produces data and publishes messages to a topic.
- Subscriber: Registers interest in one or more topics and receives matching messages.
- Broker: Receives messages from publishers, filters them by topic, and forwards them to subscribers.
- Topic: A hierarchical message-routing name, such as
factory/machine1/temperature.
Working process:
- A client establishes a TCP connection with the MQTT broker.
- The client sends a
CONNECTpacket, and the broker responds withCONNACK. - A subscriber sends a
SUBSCRIBErequest for a topic. - A publisher sends sensor data using a
PUBLISHpacket. - The broker forwards the message to all authorized subscribers of that topic.
- Keep-alive packets help detect broken connections.
MQTT is suitable for IoT because it has low overhead, supports asynchronous communication, and provides Quality of Service levels.
Describe the three MQTT Quality of Service levels and state where each level may be used.
MQTT provides three Quality of Service, or QoS, levels:
-
QoS 0 — At most once:
- The message is sent once without acknowledgment.
- Delivery is not guaranteed.
- It has the lowest delay and communication overhead.
- It is suitable for frequently transmitted, noncritical sensor readings where occasional loss is acceptable.
-
QoS 1 — At least once:
- The receiver acknowledges the message.
- The sender retransmits if an acknowledgment is not received.
- Delivery is guaranteed, but duplicate messages may occur.
- It is suitable for environmental monitoring and device status reporting.
-
QoS 2 — Exactly once:
- A four-step handshake ensures that the message is processed exactly once.
- It provides the highest reliability but has the greatest overhead.
- It is suitable for critical commands, billing transactions, or actuator operations where duplicates are unacceptable.
The QoS level should be selected by balancing reliability, bandwidth, latency, power consumption, and application criticality.
Explain how the HTTP protocol is used for communication between IoT devices and cloud applications.
HTTP is a request-response application protocol commonly used to connect IoT devices, gateways, web servers, and cloud applications.
A typical interaction works as follows:
- An IoT device or gateway acts as an HTTP client.
- It sends a request to a cloud endpoint identified by a URL.
- The server processes the request and returns an HTTP response with a status code and optional data.
Common HTTP methods include:
- GET: Retrieves device data or configuration.
- POST: Sends new sensor readings or creates a resource.
- PUT: Replaces an existing resource or updates complete configuration.
- PATCH: Partially updates a resource.
- DELETE: Removes a resource.
Data is commonly represented using JSON. HTTPS adds TLS encryption, server authentication, and data integrity.
HTTP integrates easily with web technologies and REST APIs, but its headers and repeated request-response exchanges may consume more bandwidth and energy than lightweight protocols such as MQTT or CoAP.
Distinguish between MQTT and HTTP for IoT communication.
MQTT and HTTP differ in communication style and resource requirements:
- Communication model: MQTT uses publish-subscribe communication through a broker, whereas HTTP uses direct client-server request-response communication.
- Transport: MQTT normally operates over TCP and may use TLS. HTTP also operates over TCP, while newer HTTP versions may use other transport mechanisms.
- Overhead: MQTT has small control packets and low bandwidth overhead. HTTP generally has larger headers.
- Communication direction: MQTT naturally supports asynchronous device-to-cloud and cloud-to-device messaging. Basic HTTP communication is initiated by the client.
- Reliability: MQTT provides QoS 0, 1, and 2. HTTP relies on transport reliability and application-level handling.
- Use cases: MQTT is appropriate for telemetry, remote monitoring, and event distribution. HTTP is appropriate for REST APIs, configuration, file transfer, and integration with web applications.
- Scalability: MQTT brokers efficiently distribute one message to many subscribers. HTTP servers handle separate requests from clients.
The choice depends on device capacity, network quality, latency, integration requirements, and communication pattern.
Define CoAP and explain its message model and suitability for constrained IoT devices.
CoAP, or Constrained Application Protocol, is a lightweight web transfer protocol designed for constrained devices and low-power, lossy networks. It follows REST principles and generally operates over UDP.
CoAP supports methods similar to HTTP:
- GET retrieves a resource.
- POST creates or submits data.
- PUT updates a resource.
- DELETE removes a resource.
Its message types are:
- Confirmable: Requires an acknowledgment and may be retransmitted.
- Non-confirmable: Does not require acknowledgment.
- Acknowledgment: Confirms receipt of a confirmable message.
- Reset: Indicates that a message was received but could not be processed.
CoAP is suitable for constrained IoT systems because it has compact binary headers, low processing overhead, multicast support, resource discovery, and an observe mechanism for receiving resource updates. Security may be provided using DTLS or object-level security mechanisms.
Compare MQTT, HTTP, and CoAP with respect to communication model, overhead, reliability, security, and suitable applications.
The three protocols can be compared as follows:
| Criterion | MQTT | HTTP | CoAP |
|---|---|---|---|
| Model | Publish-subscribe | Request-response | REST-based request-response with observe support |
| Main intermediary | MQTT broker | Web or application server | CoAP server or proxy |
| Typical transport | TCP | TCP | UDP |
| Overhead | Low | Relatively high | Very low |
| Reliability | QoS 0, 1, and 2 | Reliable transport and status responses | Confirmable messages and retransmission |
| Security | TLS and client authentication | HTTPS using TLS | DTLS or object security |
| Best suited for | Telemetry and event distribution | Web integration and REST APIs | Constrained devices and low-power networks |
Selection guidelines:
- Choose MQTT when many devices publish frequent telemetry and multiple applications need the data.
- Choose HTTP when direct compatibility with web servers, browsers, and enterprise REST APIs is important.
- Choose CoAP when devices have limited memory, power, and bandwidth.
A complete IoT architecture may use more than one protocol. For example, sensors may use CoAP to communicate with a gateway, while the gateway uses MQTT or HTTPS to send data to the cloud.
Describe the procedure for sending sensor data to ThingSpeak and visualizing it on a channel.
ThingSpeak is an IoT analytics platform that stores data in channels and provides tools for visualization and analysis.
The procedure is:
- Create a ThingSpeak account and create a new channel.
- Enable and name the required fields, such as temperature, humidity, and pressure.
- Obtain the channel's Write API Key and Read API Key.
- Connect the sensor to a microcontroller or IoT gateway.
- Read and format the sensor values.
- Send the values using an HTTP request or MQTT message. An HTTP update can supply values through parameters such as
field1andfield2. - ThingSpeak validates the API key and stores the values with timestamps.
- Configure line charts, gauges, or other widgets on the channel page.
- Use MATLAB analysis tools, alerts, or reactions for additional processing.
Security precautions include keeping the Write API Key confidential, using secure transport where available, validating sensor data, and using private channels for sensitive information.
Explain the main components of AWS IoT Core and describe the flow of data from a device to an AWS cloud application.
AWS IoT Core is a managed cloud service for securely connecting IoT devices with AWS services and applications.
Important components include:
- Device Gateway: Provides secure connectivity using protocols such as MQTT and HTTPS.
- Message Broker: Routes published MQTT messages to matching subscribers.
- Device Registry: Stores device identities and metadata.
- Device Shadow: Maintains desired and reported device states, even when the device is offline.
- Rules Engine: Filters, transforms, and routes messages to services such as Lambda, databases, storage, or notification systems.
- Authentication and authorization: Commonly use X.509 certificates, TLS, and IoT policies.
Data flow:
- A device is registered and receives credentials and permissions.
- It establishes a TLS connection with an AWS IoT endpoint.
- The device publishes telemetry to an MQTT topic.
- The message broker delivers the message to subscribers.
- An IoT rule evaluates the topic and message content.
- The rule sends data to storage, analytics, serverless processing, or alerting services.
- Applications can publish commands or update the desired state in a device shadow.
- The device receives the command and reports its updated state.
Explain the architecture and major services of Azure IoT Hub.
Azure IoT Hub is a managed service that provides secure, bidirectional communication between IoT devices and cloud applications.
Its major features include:
- Device identities: Each device has a unique identity and authentication credentials.
- Device-to-cloud messaging: Devices send telemetry and events to the hub.
- Cloud-to-device messaging: Cloud applications send commands or notifications to devices.
- Device twins: JSON documents store desired properties, reported properties, and metadata.
- Direct methods: Cloud applications invoke operations on connected devices and receive immediate responses.
- Message routing: Messages are filtered and routed to services such as storage, event-processing systems, or queues.
- File upload support: Devices can securely upload larger files through linked storage services.
- Device management: Applications can manage configurations, properties, connectivity, and update processes.
A device authenticates using a symmetric key, X.509 certificate, or a provisioning service. It then sends telemetry to the hub. Routing rules forward data to analytics or storage services, while device twins and direct methods support remote monitoring and control.
Compare AWS IoT Core and Azure IoT Hub as cloud platforms for IoT applications.
AWS IoT Core and Azure IoT Hub both provide secure device connectivity and cloud integration, but their terminology and service ecosystems differ.
Similarities:
- Secure device registration and authentication
- MQTT and HTTPS-based communication support
- Device-to-cloud and cloud-to-device messaging
- Device state synchronization
- Message routing to storage, analytics, and serverless services
- Integration with device management and update services
Differences:
- AWS uses Device Shadow for state synchronization, while Azure uses Device Twin.
- AWS uses the Rules Engine for message processing and routing, while Azure provides built-in message routing and integrates with Azure event services.
- AWS IoT policies define device permissions. Azure commonly uses per-device identities, access policies, and role-based access control for management.
- AWS integrates naturally with Lambda, S3, DynamoDB, and other AWS services. Azure integrates with Functions, Storage, Stream Analytics, and related Azure services.
The choice should consider the organization's existing cloud ecosystem, regional availability, pricing, required protocols, analytics tools, security model, and operational expertise.
Describe how an IoT device or gateway can be integrated with a cloud platform using a REST API.
REST API integration allows an IoT device or gateway to interact with cloud resources through HTTP methods.
A typical integration procedure is:
- Identify the resource: Select an endpoint such as
/api/devices/device123/telemetry. - Choose the method: Use POST for telemetry, GET for configuration, PUT or PATCH for updates, and DELETE for resource removal.
- Prepare the payload: Encode sensor data in JSON, for example temperature, humidity, device ID, and timestamp.
- Add headers: Specify content type, authorization credentials, API version, and other metadata.
- Secure the connection: Use HTTPS and an authentication mechanism such as an API key, token, OAuth credential, or client certificate.
- Send the request: The device or gateway transmits the request to the cloud endpoint.
- Process the response: Interpret status codes and response data.
- Handle failures: Apply timeouts, retries with backoff, local buffering, and duplicate detection.
The gateway should also validate payloads, protect credentials, limit request frequency, and maintain timestamps for reliable cloud processing.
Explain REST principles, common HTTP status codes, and security requirements relevant to an IoT REST API.
A REST-based IoT API follows these principles:
- Resource orientation: Devices, readings, and configurations are represented as resources with unique URIs.
- Statelessness: Each request contains all information needed for processing.
- Uniform interface: Standard HTTP methods are used consistently.
- Representations: Resource data is commonly exchanged in JSON.
- Cacheability: Responses indicate whether they may be cached.
- Layered architecture: Clients need not know whether gateways, proxies, or load balancers exist between them and the server.
Common status codes include:
- 200 OK: Request succeeded.
- 201 Created: A new resource was created.
- 204 No Content: Request succeeded without a response body.
- 400 Bad Request: Invalid payload or parameters.
- 401 Unauthorized: Authentication is missing or invalid.
- 403 Forbidden: Authenticated client lacks permission.
- 404 Not Found: Resource does not exist.
- 429 Too Many Requests: Rate limit was exceeded.
- 500 Internal Server Error: Server-side failure occurred.
Security requires HTTPS, strong device identity, least-privilege authorization, input validation, credential rotation, replay protection, logging, and rate limiting.
What is a real-time IoT dashboard? Explain its essential components and visualization techniques.
A real-time IoT dashboard is a user interface that displays current and historical device data with minimal delay. It helps users monitor conditions, detect anomalies, and control operations.
Essential components include:
- Data ingestion: Receives MQTT, HTTP, or CoAP data from devices or gateways.
- Stream processing: Filters, aggregates, transforms, and evaluates incoming events.
- Time-series storage: Stores timestamped readings for historical analysis.
- API or live update layer: Supplies data through REST APIs, WebSockets, server-sent events, or subscriptions.
- Visualization interface: Displays charts, maps, indicators, and device states.
- Alert system: Generates notifications when rules or thresholds are violated.
Useful visualization techniques include:
- Line charts for trends
- Gauges for current values
- Bar charts for comparisons
- Maps for device locations
- Heat maps for spatial intensity
- Status cards for connectivity and alarms
A good dashboard should show units, timestamps, update frequency, threshold ranges, and data quality while avoiding unnecessary visual clutter.
Design a real-time monitoring pipeline for industrial IoT data and explain how latency, scalability, and reliability can be maintained.
A real-time industrial monitoring pipeline may contain the following stages:
- Sensors and controllers: Collect temperature, vibration, pressure, and machine-status data.
- Edge gateway: Validates readings, filters noise, aggregates samples, and performs urgent anomaly detection.
- Secure messaging: Publishes data using MQTT over TLS or another suitable protocol.
- Cloud ingestion: A broker or IoT hub receives and authenticates messages.
- Stream processing: Rules calculate averages, identify threshold violations, and enrich data with device metadata.
- Storage: A time-series database stores operational data, while object storage archives raw data.
- Dashboard delivery: WebSockets or subscription mechanisms push updates to dashboards.
- Alerting: Critical events trigger notifications or automated actions.
Latency is reduced through edge processing, efficient payloads, regional cloud endpoints, and persistent connections. Scalability is maintained using partitioned topics, load balancing, autoscaling consumers, and distributed storage. Reliability is improved through QoS, buffering, acknowledgment, retry with exponential backoff, idempotent processing, monitoring, and redundant services.
Distinguish between edge computing and cloud computing in IoT.
Edge computing and cloud computing differ mainly in where data is processed.
- Processing location: Edge computing processes data near sensors or devices. Cloud computing processes data in remote data centers.
- Latency: Edge systems provide faster responses because data travels a shorter distance. Cloud processing may introduce network delay.
- Bandwidth: Edge processing filters or summarizes data, reducing network usage. Cloud processing may require large volumes of raw data to be uploaded.
- Connectivity: Edge systems can continue limited operation during cloud disconnection. Cloud systems depend more heavily on network availability.
- Resources: Edge devices have limited computing power and storage. Cloud platforms offer elastic computation and large-scale storage.
- Privacy: Sensitive data can remain local at the edge. Cloud use requires careful data governance and transmission security.
- Management: Edge deployments may involve many distributed nodes. Cloud services are more centralized.
Edge computing is ideal for immediate control and local filtering, while cloud computing is ideal for long-term storage, fleet-wide analytics, machine learning, and centralized management.
Propose a hybrid edge-cloud architecture for a smart traffic management system and justify the placement of major processing tasks.
A smart traffic system can use a hybrid architecture with cameras, vehicle detectors, traffic lights, edge gateways, and a cloud platform.
Tasks at the edge:
- Process camera feeds locally to count vehicles and detect congestion.
- Remove personally identifiable information before transmission.
- Adjust traffic-light timing for immediate local conditions.
- Buffer data during network failure.
- Generate urgent alerts for accidents or blocked roads.
These tasks belong at the edge because they require low latency, local resilience, privacy, and reduced bandwidth consumption.
Tasks in the cloud:
- Store long-term traffic history.
- Combine data from many intersections.
- Train traffic-prediction models.
- Generate city-wide reports and planning insights.
- Manage device identities, configurations, and firmware versions.
- Provide centralized dashboards to operators.
The edge gateway can publish summarized telemetry through MQTT, while cloud applications may use REST APIs for administration. Secure certificates, encrypted communication, role-based access, and OTA update controls are required across the architecture.
Explain how edge processing can reduce latency and bandwidth consumption. Support your answer using suitable expressions.
Without edge processing, the approximate response time may be written as:
With edge processing, the local response time becomes:
For time-critical applications, is generally smaller because the data does not need to travel to a distant cloud and back.
Suppose each of devices generates data at a rate of bytes per second. Without filtering, the required upload rate is:
If edge processing transmits only a fraction of the original data, where , the upload rate becomes:
Thus, the bandwidth reduction is:
Edge processing achieves this reduction through filtering, compression, aggregation, event detection, and local inference. However, cloud processing remains useful for long-term analysis, centralized coordination, and computationally intensive tasks.
What is an OTA firmware update? Describe the complete OTA update process for an IoT device.
An Over-the-Air firmware update is the remote delivery and installation of new device firmware through a network connection without physical access to the device.
A typical OTA process is:
- Developers create and test a new firmware version.
- The firmware image is assigned a version number and compatibility information.
- A cryptographic hash and digital signature are generated.
- The image and metadata are uploaded to a secure update server or cloud service.
- The device periodically checks for updates or receives an update notification.
- It verifies device model, hardware version, available memory, battery level, and update policy.
- The device downloads the image using a secure protocol.
- It verifies the image's integrity and digital signature.
- The image is written to an inactive firmware partition.
- The bootloader activates the new image and restarts the device.
- A health check confirms correct operation.
- If startup fails, the device rolls back to the previous working firmware.
- The device reports the update result to the management platform.
OTA updates enable security patches, bug fixes, and feature deployment across large device fleets.
Design a secure and fault-tolerant OTA firmware update mechanism for a large IoT device fleet.
A secure and fault-tolerant OTA mechanism should include the following elements:
- Hardware root of trust: Store trusted keys in protected hardware where possible.
- Secure boot: Allow execution only of firmware signed by an approved authority.
- Signed update packages: Sign firmware and metadata using the manufacturer's private key. Devices verify them using a trusted public key.
- Encrypted transport: Download updates through TLS or another protected channel.
- Integrity verification: Compare a cryptographic hash after download.
- Version and compatibility checks: Prevent installation on the wrong model or hardware revision.
- Anti-rollback protection: Block installation of vulnerable older versions unless an authorized recovery process is used.
- Dual partitions: Keep the current image in one partition and install the new image in another.
- Automatic rollback: Restore the previous firmware if boot or health checks fail.
- Resumable downloads: Continue interrupted transfers rather than restarting completely.
- Staged deployment: Release first to test devices, then small groups, and finally the full fleet.
- Monitoring and audit logs: Track version, progress, failure reason, and device health.
- Key rotation and revocation: Replace compromised signing keys and reject revoked certificates.
This design reduces the risks of malicious firmware, power failure, network interruption, incompatible updates, and fleet-wide deployment errors.
Define IoT architecture and explain the functions of its major layers.
IoT architecture is a structured framework that defines how IoT devices collect data, communicate, process information, and deliver services to users.
The major layers are:
- Perception or device layer: Contains sensors, actuators, RFID tags, microcontrollers, and embedded devices. It collects physical-world data such as temperature, humidity, motion, and pressure.
- Network or communication layer: Transfers data using technologies such as Wi-Fi, Bluetooth, Zigbee, LoRaWAN, Ethernet, or cellular networks. Protocols such as MQTT, HTTP, and CoAP may operate through this layer.
- Processing or middleware layer: Stores, filters, analyzes, and manages device data. It may include edge gateways, databases, message brokers, cloud platforms, and analytics services.
- Application layer: Provides user-oriented services such as smart-home monitoring, industrial automation, healthcare applications, and agricultural dashboards.
- Business layer: Manages business rules, reports, policies, billing, user access, and decisions based on IoT data.
Security, device management, and interoperability are cross-layer concerns that must be addressed throughout the architecture.
Did this save you a night before the exam?
LPU Notes is free, and it stays free. Ads cover part of the server bill. The rest comes out of a student's own pocket: the domain, the storage, and keeping the site up through the weeks everyone needs it at once.
The payment button didn't load. An ad blocker or a filtered network is the usual reason. to try again.
Nothing here is ever locked, and nothing unlocks. Chip in only if it was worth it. What it pays for →