In 2012 engineers at Open Mobile Alliance SpecWorks (OMA) started working on the Lightweight M2M protocol, a communication protocol designed especially for remote device management and telemetry within the Internet of Things as well as in other M2M applications. Acting as the successor to OMA device management (OMA DM) standard, Lightweight M2M was designed intrinsically to reduce power and data consumption, thus recognising and responding to the demands of the growing M2M market for dedicated solutions for low-power devices with limited processing and storage capabilities (which are also known by the name of resource-constrained devices).
LwM2M protocol — why is it needed?
According to Statista, the global number of connected IoT devices will grow from 23 billion in 2018 to a forecasted mind-boggling 75 billion by the end of 2025. Shaping the way we view the future of technology, this grand and ever-expanding vision is in constant need of dedicated solutions for its proper and innovative deployment. In a world of disparate device standards, there is an ever stronger demand for quicker, easier and more effective communication while using less power.
The Lightweight M2M standard has been created as an answer to this market need.
The protocol’s specification describes many typical IoT device management functions, such as remote device actions, firmware and software updates (FOTA & SOTA), connectivity monitoring and management including cellular management and provisioning.
Unlike any other Internet of Things protocol on the market, the architecture of LwM2M supports four logical interfaces which help to standardize the way the actual device management and telemetry is done:
- Bootstrapping interface – this interface enables headless device management. This basically means that it is possible to configure a device to provide the right service without the need of preconfiguring it at the factory, which significantly reduces cost and optimises time-to-market for the product or service.
- Client registration interface – informs server about the client’s ‘existence’ and supported functionality. Also, it enables over-the-air firmware and software updates.
- Device management and service enablement interface – LwM2M allows the provider to access object instances and resources, which enables him to change device settings and parameters.
- Information reporting interface – thanks to publish/subscribe interaction, the user is able to obtain error reports from devices when the service no longer works properly as well as send queries about device status.
LwM2M as industry standard
With the constraints of M2M devices in mind, OMA SpecWorks developed the LwM2M standard in a response to the growing needs of vendors and service providers for a non-complex low-cost device management and service enablement protocol that would embrace cutting-edge architectural principles and function well over wireless connections. As an industry standard, Lightweight M2M has been especially designed to overcome some major limitations faced by the IoT scene, such as the management of low-power devices, security challenges and cross-standard interoperability.
As a member of Open Mobile Alliance SpecWorks, AVSystem has been actively participating in the creation of the LwM2M standard and has been one of the first to offer a comprehensive plug-and-play solution based on the Lightweight M2M protocol. AVSystem’s Coiote IoT Device Management platform that works as an LwM2M server takes advantage of the key functionalities of the OMA LwM2M to provide a leading solution suitable virtually for the whole of the IoT market, including, but not limited to, such devices as M2M gateways, sensors, controllers, meters, tracking devices, or security appliances which support the Lightweight M2M protocol. To complement this product, AVSystem also created Anjay – an LwM2M client, which is an open-source software that allows for easy implementation of the support for the LwM2M protocol in any device.
LwM2M makes use of a light and compact protocol, which enables it to function very well over potentially unstable and low bandwidth networks such as cellular or sensor networks. Its lightweight design however, does not change the fact that the protocol still works very efficiently on bigger IoT assets such as business routers or gateways. With an enormous range of possible applications, Lightweight M2M protocol finds its use in such fields as:
- manufacturing,
- logistics,
- telemedicine,
- utilities,
- remote controlling,
- robotics,
- automotive industry,
- security.
Achieve IoT project success faster with our expertise.
Speed up your time to market using LwM2M standardization and pre-built integrations for hardware and the cloud.
The natural evolution – LwM2M 1.1.1
With the arrival of the LwM2M 1.1.1 version, the standard has been enhanced with numerous features that extend its capabilities. Now, the protocol handles not only UDP as its communications protocol, but also TCP, which can be helpful in traversing firewall/NAT restrictions and generally provides a more reliable data transmission (although slower than in the case of UDP). The challenge, however, was how to eliminate the large overhead typical for IP and TCP/TLS payloads. What’s more, the TCP connection, as opposed to UDP, is known for its reliability, which means it is supposed to be long-lived and always available. This, in turn, is incompatible with the whole idea behind resource-constrained devices, since they are expected to be transmitting with very low frequency to save their batteries lives. Most of the time, these devices are in sleep mode. This is why the LwM2M 1.1.1 version also supports non-IP data delivery with the help of cellular networks, such as NB-IoT or LTE-M. These networks mitigate the problem by simply eliminating the TCP/IP stack completely. LwM2M 1.1.1 also added to its pool support for other low-power WANs, including 3GPP CIoT & LoRaWAN.
As security seems to be one of the greatest challenges of the whole IoT industry, we can also observe strong security enhancements in the newest version of the standard. The Lightweight M2M protocol now supports an application layer security protocol called object security for constrained RESTful Environments (OSCORE). OSCORE provides end-to-end security for underlying transport layer protocols – UDP, TCP and SMS. What’s significant, the transport bindings have now more independence in terms of security, since they can use OSCORE with or without DTLS/TLS. As OMA SpecWorks themselves put it OSCORE “can be used between LwM2M endpoint and non-LwM2M endpoint, for example, between an Application Server and an LwM2M Client. In this case, an LwM2M server thereby provides E2E security for communications over intermediate nodes.”.
By introducing “Composite” operations, LwM2M 1.1.1 improves performance in retrieving and updating Resources of multiple instances in a single request. The new operations are available for reading, writing and observing resources in an instance or across instances.
And last but not least, the LwM2M 1.1.1 version has further enhanced its already strong telemetry capabilities by supporting JSON using SenML with CBOR serialization. This results in much more compressed payloads and enables more efficient data transmission and compresses the payload.
Advantages of LwM2M over other M2M protocols
Apart from being a simple and efficient protocol for the management of low-power devices, LwM2M has a number of features that help it to get ahead of its competition.
Unlike traditional M2M solutions in which a device usually needs to keep up multiple stacks of technologies, protocols and security services, the Lightweight M2M model allows users to have one stack of technology for device management not only on the level of the device itself but also on the application level. What is more, LwM2M offers cross-vendor and cross-platform interoperability, which makes it ideal for service providers who want to avoid vendor lock-in. Combining DTLS, CoAP, Block, Observe, SenML LwM2M and Resource Directory, utilises them to form a device-server interface with a defined object structure. With all the above advantages put together, Lightweight M2M is able to provide perfect time to market as it is available for instant deployment.
As mentioned above, LwM2M, unlike many industry-proven protocols (such as MQTT), has a well-defined data model. The idea is very simple: a tree with maximum depth of 4, consisting of, respectively, Objects, Object Instances, Resources and Resource Instances. Objects can have Object Instances, Resources can have Resource Instances and Resources are located in Object Instances.
Resources are probably the most interesting ones, as this is where you directly interact with the device. If you want to, say, read the temperature value of a given device, you can do it by issuing a READ operation at a Resource level. The Resource informing about the temperature of the device, along with (potentially) some other Resources (informing about e.g. device location, signal strength etc.), can be located in a single Object Instance. So, if you would like to read all the values of the resources in a given Object Instance with only one operation, just execute the READ operation at the Object Instance level. The same logic applies to Object – by issuing a READ operation on the entire Object, you will get results for all Object Instances contained in this Object, all Resources contained in all Object Instances of this Object and so on. As Resources are also defined into certain data types, the information you get, depending on the specifics of the resource, can be sent as various data types such as Boolean, integer, float, string and more.
Another of LwM2M’s strong suits that differentiates it from other M2M protocols available on the market is the way it handles security issues, especially on low-power devices. It is based on the advanced DTLS protocol that supports credentials based on pre-shared keys, raw public keys, or certificates and implements authentication, confidentiality and data integrity between the Server and the Client.
Lastly, the Lightweight M2M protocol offers a well-defined device and data management model structure to enable a number of vendor-agnostic features such as secure device bootstrapping, object or resource access, and device reporting.
To sum things up, the Lightweight M2M protocol offers a flexible, scalable and vendor-agnostic device management with improved time to market which makes it especially suitable for low-power devices with limited processing and storage capabilities. Bearing all that in mind, LwM2M is the best solution to consider for large, complex and long-lived deployments involving cross-platform and cross-standard IoT services.