• Request response model: The client is the IOT device that sends a request to the server. The request maybe for transfer of data or upload of data. The server maybe remote or local and can handle requests of multiple clients. The Request response model is stateless and hence each request is independently handled. Server can receive the request, decide its response and fetch the data.


  • request-response-model


  • Publish subscribe model: There are three entities publisher, broker and consumers. Publishers send the data to the brokers on topics managed by the brokers. Consumers subscribe to topics and brokers send the data on the topics to the consumers. Hence, brokers responsibility is to accept data from publishers and send it to the appropriate consumer.


  • iot-communication-protocols-publish-subscribe


  • Push-pull: Data producer push data to queues and consumer pull data from queues. Producers and consumers are not aware of each other. Queues act as buffers and are useful when producers produce data at a rate at which is faster than rate at which consumers can download.


  • Push-pull model


  • Exclusive pair: It is a bi-directional, full duplex commincation model that uses a persistent connection between client and server. The connection is persistent and remains open till client sends a request to close the connection. This is a stateful connection model and server is aware of all open connections.


  • Exclusive pair-model
  • REST is acronym for REpresentational State Transfer. It follows request response model.


  • Guiding Principles of REST


    1. Client–server – By separating the user interface concerns from the data storage concerns, we improve the portability of the user interface across multiple platforms and improve scalability by simplifying the server components. This means that the client user interface should not be concerned with the storage of data as that is looked after by server. Similarly, server should not be concerned with user interface which is handled by client.


    2. Stateless – Each request from client to server must contain all of the information necessary to understand the request, and cannot take advantage of any stored context on the server. Session state is therefore kept entirely on the client.


    3. Cacheable – Cache constraints require that the data within a response to a request be implicitly or explicitly labeled as cacheable or non-cacheable. If a response is cacheable, then a client cache is given the right to reuse that response data for later, equivalent requests.


    4. Uniform interface – Method of interaction between client and server should be uniform. All resources are identified by unique identifiers and these ID's are mentioned in the client requests. Based on the requested resource the client is provided a representation of the resource. It can update or modify this representation.


    5. Layered system – The layered system style allows an architecture to be composed of hierarchical layers by constraining component behavior such that each component cannot “see” beyond the immediate layer with which they are interacting.


    6. Code on demand (optional) – REST allows client functionality to be extended by downloading and executing code in the form of applets or scripts. This simplifies clients by reducing the number of features required to be pre-implemented.


  • Resource The key abstraction of information in REST is a resource. Any information that can be named can be a resource: a document or image, a temporal service, a collection of other resources, a non-virtual object (e.g. a person), and so on. REST uses a resource identifier to identify the particular resource involved in an interaction between components.


  • The state of the resource at any particular timestamp is known as resource representation. A representation consists of data, metadata describing the data and hypermedia links which can help the clients in transition to the next desired state.


  • Resource Methods- These are to be used to perform the desired transition


  • IOT systems consist of following components:


    1. Device: These may be sensors or actuators with capability of identifying, remote sensing or monitoring.


    2. Resources: These are software components on IOT devices for accessing, processing, storing software components or controlling actuators connected to device. Resources also include software components that enable network access.


    3. Controller service: It is a service that runs on the device and interacts with web services. Controller service sends data from the device to the web service and receives commands from the application via web services for controlling the device.


    4. Database: Stores data generated from device


    5. Web service: Provides a link between IOT device, applications, database and analysis components.


    6. Analysis component: It performs analysis of the data generated by the IOT device and generates results in a form which are easy for the user to understand.


    7. Application: Provides a system for the user to view the system status and view processed data. It also allows user to control and monitor various aspects of the IOT system.


  • IOT level 1 - IOT system consists of a single node/ device that performs sensing or actuations , stores data , analyses it and hosts the application.


  • Example: Consider an IOT device that monitors the lights in a house. The lights are controlled through switches. Status of each light is maintained in a local database. REST services deployed locally allow retrieving and updating state of each light in the database and triggers the switches accordingly. Application has a user interface for controlling the lights or applications locally. Device is connected to the internet and hence the application can be accessed remotely as well.


  • IOT level 1
  • IOT level 2 - A node performs sensing / actuation and local analysis. Data is stored in the cloud.


  • Example: A single node monitors the soil moisture in the field. This is sent to the database on cloud using REST APIs. Controller service continuously monitors moisture levels. Cloud based application is used for monitoring and controlling the IOT system.


  • IOT level 2
  • IOT level 3 -A single node monitors the environment and stores data in the cloud. Application is cloud based. This is suitable where data is voluminous and analysis is computationally intensive.


  • Example: A node is monitoring a package using devices like accelerometer and gyroscope. These devices track vibration levels. Controller service sends sends sensor data to cloud in real time using WebSocket API. Data is stored in cloud and visualised using cloud-based application. Analysis component triggers alert if vibration levels cross a threshold.


  • IOT level 3
  • IOT level 4 -Multiple nodes collect information and store in the cloud. A cloud based application controls the system. Local and remote observer nodes are present that subscribe to and receive information collected in cloud from various devices. Observer nodes can process information and use it for applications but do not perform control functions.


  • Example: Noise monitoring of a area requires various nodes functioning independent of each other. Each has its own controller service. Data is stored in cloud database. Analysis is done on the cloud and the entire IOT system is monitored on the cloud using an application.


  • IOT level 4
  • IOT level 5-Nodes present locally are of two types : end nodes and coordinator nodes. End nodes collect data and perform sensing or actuation or both. Coordinator nodes collect data from end nodes and sends it to cloud. Data is stored and analysed in cloud and application is cloud based.


  • Example: A monitoring system has various components: end nodes collect various data from the environment and send it to coordinator node. Coordinator node acts as gateway and allows the data to be transferred to cloud storage using REST API. Controller service on the coordinator node sends data to the cloud.


  • IOT level 5
  • IOT level 6- Multiple independent end nodes perform sensing and actuation and send data to cloud. Data is stored in cloud and application is cloud based. The analytics components analyses the data and stores the results in the cloud database. The results are visualized with cloud based application. The centralized controller is aware of the status of all the end nodes and sends control commands to the nodes.


  • Example: Weather monitoring consists of sensors that monitor different aspects of a system. The end nodes send data to cloud storage. Analysis component, application and storage are in cloud. Centralized controller controls all nodes and provides inputs.


  • IOT level 6