Sunday, June 28, 2020

IoT Standards and Protocols

There are many protocols and standards we can choose from to build an IoT network. In this lesson, I’ll give you an overview of common standards and protocols.  iot-standards-protocols-1080p.mp4

Protocols

There are many protocols that have a direct or indirect role in IoT. We’ll focus on two protocol types in particular:

  • Network protocols
  • Data protocols

Network Protocols

The network protocols we use for IoT should be open standards because our IoT network has to support devices from multiple vendors. Proprietary protocols increase complexity because you then need devices that can translate between the different protocols.

The Internet Protocol (IP) is well established and we have been using IP for IT networks for a long time. This is one of the reasons why IP is also the main choice for IoT networks.

Using IPv6 is encouraged because there are no address space limitations as there are with IPv4. Solutions such as IPv6 over Low-Power Wireless Personal Area Networks (6LoWPAN) or IPv6 Routing Protocol for LLNs (RPL) don’t even support IPv4, only IPv6.

Data Protocols

We need to transfer data between our devices and other systems such as an IoT platform. Some devices have sensors that push data at a regular interval. Other sensors work with a pull model where you have to request the information. There are several data protocols we can use in IoT. Here are three popular protocols:

  • Message Queuing Telemetry Transport (MQTT)
  • Constrained Application Protocol (CoAP)
  • Extensible Message and Presence Protocol (XMPP)

MQTT

MQTT is probably the most used protocol in IoT. It’s a lightweight message protocol that uses publish and subscribe operations to transmit data between a client and server. It uses TCP as the transport protocol.

Packets are tiny and require little bandwidth. MQTT uses a client-server model. The server is called a broker. There are two operations:

  • Publish: a device (client) sends data to a broker (server).
  • Subscribe: a device (client) wants to receive data from a broker (server).

CoAP

CoAP is also a lightweight protocol and was developed as a standard (RFC 7252). It’s based on a REST model. A server makes resources available under a URL and clients access these resources with GET, PUT, POST, and DELETE methods. It is easy to get started with CoAP because many developers are familiar with REST.

CoAP can carry different payload types including XML and JSON and uses UDP as the transport protocol.

XMPP

XMPP is an open standard (RFC6120) and is based on XML technology for real-time communication. It’s used for a range of applications including VoIP, instant messaging, and IoT.

XMPP has been around for a while and has proven scalability and security. There are many servers that have used XMPP for many years. Software is available for any programming language making it easy to get started. Because XMPP was originally an instant messaging protocol and uses XML, it has more overhead compared to a lightweight protocol like MQTT.

Standards

Besides protocols,there are many standards that we can use for IoT solutions. One of the most important choices to make is how to connect our devices to the Internet.

Network Types

There are wired and wireless network types. Let’s start with an illustration of different network types and the distance they cover:

Network Types Spatial Scopes

Let’s take a look at each network type.

Nano Network

A nano network is a set of small devices (a few hundred nanometers or a few micrometers) that can perform only simple tasks. These devices could be sensors, actuators, or data storage or computing devices. Nano networks allow new applications in fields such as environmental research, military technology, and the biomedical field. IEEE created the P1906.1 workgroup to develop a common framework for nano-scale and molecular communication.

Body Area Network (BAN)

BAN is a wireless network for devices near or inside the body. BAN devices include wearable technology such as smartwatches or earbuds but also devices inside the body such as implants. This network type is also known as a wireless body area network (WBAN), body sensor network (BSN), or medical body area network (MBAN). The latest standard for WBANs is IEEE 802.15.6.

Personal Area Network (PAN)

A PAN is a network that connects devices within a person’s workspace. This includes devices like laptops, smartphones, and tablets. We can use a PAN for connectivity between these devices or connect to another network type (LAN or WAN) where one device becomes the gateway for all other devices. PAN networks can be wired (for example USB) or wireless. A wireless personal area network (WPAN) is a PAN that uses short-distance low-power wireless technology. For example, Bluetooth or Zigbee. A WPAN covers anywhere between a few centimeters to a few meters.

Local Area Network (LAN)

The LAN is the network type we are all familiar with. It’s a network that covers a limited area like an office building. Ethernet and Wi-Fi are the two most common technologies on the LAN.

Campus Area Network (CAN)

A CAN is a network that covers multiple LANs in a smaller geographical area like a university. The range of a CAN is about 1 to 5 kilometers.

Metropolitan Area Network (MAN)

The MAN is a larger network that covers the size of a metropolitan area. MANs connect multiple LANs in a city into a larger network. The MAN can offer a connection for all these LANs to a WAN. We use technologies like Metro Ethernet here.

Radio Access Network (RAN)

A RAN uses radio access technology. RANs have been in use since the beginning of cellular technology. This network uses a base station and antennas to cover a region. This includes 3G, 4G, and 5G network connections.

Wide Area Network (WAN)

A WAN network provides connectivity between LANs that are kilometers apart. For IoT we also have Low Power Wide Area Networks (LPWAN). These are low-bandwidth networks designed for long-range communication, with battery-powered devices in mind. LoRaWAN is an example of a LPWAN.

Requirements

How do we decide which network type we should use for our IoT network? It depends on the following factors:

  • Does the network support many devices?
  • How reliable is the network?
  • Is it possible to transmit real-time data with minimal delays?
  • How secure is the network?
  • How much does it cost to connect our devices?

Wired connections are reliable and offer high bandwidth but are not always feasible due to cost or because we use mobile devices that require a wireless connection. Wireless technology is a common choice for IoT networks. As a rule of thumb in wireless networking, range decreases as bandwidth increases.

The following graphic shows some common wireless technologies and their relation to bandwidth and range:

Standards Bandwidth Range

An important aspect to consider when choosing a network type is power consumption. Especially when we use battery-powered devices.

Applications

There are two IoT application types:

  • Analytic
  • Control

Analytic Application

We can collect, process, and store large amounts of data from our devices. All this data is meaningless unless we can make sense of the data. That’s what analytic applications are for. They analyze our data and show us statistics, trends, forecasts, and patterns. Useful information that aids business organizations to make better decisions.

Two examples of analytic applications are inventory optimization and predictive maintenance.

Inventory Optimization

Each inventory item you want to track has an RFID tag with a unique ID. The tag contains data about the inventory item like a model, type,and  batch number. When someone scans the tag with a RFID scanner, the data is transmitted to the cloud. The cloud receives the data and location from the tag. With this data, we can now monitor in real-time how items move through the warehouse.

Predictive Maintenance

Predictive maintenance focuses on how to predict when certain conditions will occur and when something will fail. Thanks to machine learning and the scalability of the cloud, predictive maintenance is available not just to large organizations but to everyone.

Each machine in a factory has sensors that collect data which we send to a central location. Predictive analysis algorithms require large amounts of data and processing power. These algorithms analyze our data, recognize patterns, and generate insights which we can use to create alerts or display on a dashboard.

Control Application

A control application controls devices. The control application has intelligence that the devices don’t have. It can receive results from one device and use that to control other devices.

An example is an oil pipeline with valves and pumps. The control application opens and closes the valves and starts or stops the pumps when needed. The valves and pumps don’t have any knowledge about each other.

Another example is an office building with smoke detectors. When a smoke detector is triggered, we send the data to a central location. The application then signals all lights to enable them and signals an elevator to disable it due to a fire hazard.

Application Design

When you design an IoT application, there are some items you should consider:

  • Data structure
  • Frequency
  • Size
  • Volume

Data Structure

The data we capture from devices can be a mix of data formats, including structured, semi-structured, and unstructured data. Examples of data are sensor readings but also large files like videos.

Structured data is logically formatted and easy to use within an application. An example of a structured data format is XML or JSON.

It is important to think about the data you collect and how you will store and process it.

Frequency

How often does the device transmit data? Once per minute? Every second?

Size

The size of your data depends on the data type. A sensor reading doesn’t require much storage space. A video does.

Volume

The volume of data depends on the data structure, frequency, and size. If a device transmits 5 KB of data every second then it produces only 18 MB per hour. No problem, until you have 5000 devices. That means we have 18 MB * 5000 = 90.000 MB of data to process every hour.

Conclusion

You have learned about common protocols and standards we use for IoT networks:

  • We use network and data protocols:
    • Like regular IT networks, we use network protocols IP and IPv6 for IoT.
    • We use data protocols to transmit and/or receive data between devices, gateways, and IoT platforms. Three popular data protocols are:
      • MQTT
      • CoAP
      • XMPP
  • There are several wired and wireless network type standards to choose from.
  • Wireless is most convenient for (mobile) IoT devices but there are bandwidth and range restrictions.
  • We have analytic and control applications:
    • Analytic applications analyze our data and deliver value. They can create forecasts, and statistics, and find trends.
    • Control applications communicate with devices and control them to create solutions.

I hope you enjoyed this lesson. If you have any questions please leave a comment.

No comments:

Post a Comment