We use proprietary and third party's cookies to improve your experience and our services, identifying your Internet Browsing preferences on our website; develop analytic activities and display advertising based on your preferences. If you keep browsing, you accept its use. You can get more information on our Cookie Policy
Cookies Policy
FIWARE.OpenSpecification.IoT.Gateway.ProtocolAdapter - FIWARE Forge Wiki


From FIWARE Forge Wiki

Jump to: navigation, search
Name FIWARE.OpenSpecification.IoT.Gateway.ProtocolAdapter
Chapter IoT Services Enablement,
Catalogue-Link to Implementation Gateway Protocol Adapter - ZPA
Owner Orange, Ericsson, Telecom Italia,



Within this document you find a self-contained open specification of a FIWARE generic enabler, please consult as well the FIWARE Product Vision, the website on http://www.fiware.org and similar pages in order to understand the complete context of the FIWARE platform.


Legal Notice

Please check the following Legal Notice to understand the rights to use these specifications.


The Protocol Adapter GE deals with the incoming and outgoing traffic and messages between the IoT Gateway and registered devices, to be served by either the Gateway Device Management GE or the Data Handling GE. There may be multiple instances of Protocol Adapter GEs capable of serving not fully IoT compliant devices, i.e. devices that do not support ETSI M2M (the specifications may be found at the following link ETSI M2M Latest Drafts). These devices can be IP-based devices, that communicates using the IP stack (IPv4 or IPv6), or "legacy devices", meaning devices communicating using non-IP based protocols, for instance ZigBee, or Z-Wave.

The Protocol Adapter GE receives these device specific protocols and translates them to a uniform internal API. The exposed API handles capabilities to read and write to the resources, as well as IoT specific management and configuration services such as resource discovery consisting of both look-up and publication.

In particular, the ZigBee Protocol Adapter provides a communication conduit into a ZigBee PAN(s) (Personal Area Network). It supports a mechanism whereby a gateway can interact with individual ZigBee nodes to exert control over or to obtain data from those nodes, or conversely a mechanism whereby the nodes can communicate some information to the gateway.

Basic Concepts

An overview of the Protocol Adapter GE is provided below, and is followed by an identification of the interfaces.

Figure 1: IoT Gateway Architecture

There are three interfaces to the Protocol Adapter GE. The southbound APIs provide the gateway external interface to non-ETSI M2M devices hosting sensor and actuator resources. The currently supported interfaces are IETF CoRE (provided by Ericsson and no more supported) and ZigBee (the specifications may be found at the following link ZigBee Network Devices Standard Overview).

On the northbound side there are two interfaces:

  • the first interface is the Protocol Adapter Interface that is a communications protocol to the Gateway Device Management GE, based on the Generic Device Access API. This interface can be used for initiating subscriptions to resources and receiving notifications from resources that have been tasked with subscriptions, read or write resources that are determined to be online, publishing resource capabilities in the Resource Directory, or querying devices for their resources.
  • the second one is the Gateway Data Handling API, NGSI compliant, that allows to interact with the Gateway Data Handling GE. Through this interface, device events and data are published towards the Gateway Data Handling GE.

Figure 2 introduces the architecture of the FI-WARE implementation of the Protocol Adapter GE.

Figure 2: Protocol Adapter GE internal architecture

Base Driver

The Base Driver is the low-level API for legacy devices (i.e. an implementation of the device specific protocol stack). Base Drivers handle device discovery and access to sensor and actuator resources in a protocol specific way.

For instance, the ZigBee Base Driver is based on the Network Device Gateway Specification defined by the ZigBee Alliance (ZigBee document 075468r35 may be found at this link ZigBee Network Devices Standard Overview). The included operations in this specification are:

  • operations to read and write attributes, and configure and report events;
  • macro operations for network and service discovery;
  • endpoint management;
  • flexible start-up and network join operations;
  • bi-directional communication mechanisms between ZigBee Base Driver and gateway

Protocol Adaptation

A Protocol Adapter is the glue between a base driver and the Generic Device Access API or the Gateway Data Handling API. Via the base driver, it discovers devices, tracks events occurred on them and executes commands to actuate them. Therefore, a Protocol Adapter is necessary for each protocol that the Base Drivers support. Whether the protocol is standardized or proprietary does not matter. As far as the Base Driver is available and the Protocol Adapter is implemented on top, the Generic Device Access API or the Gateway Data Handling API are able to support the protocol and provide a unified way to access devices with the protocol. The Protocol Adapter is able to support:

  • Device discovery. When a new device is discovered and gets available, it shall create and register this device as a service within the Protocol Adapter framework. When a previously discovered device gets unavailable, it shall unregister the corresponding service.
  • Device measurement update. When a service parameter update occurs on a device, it shall update the corresponding variable on the device in the Protocol Adapter framework and trigger update for the corresponding device service.
  • Device actuation. For each action in a service that a device supports, it should implement a protocol specific logic and put it as an action in the device service that is registered in the Protocol Adapter framework.
  • Device event and data. Its behavior is like an Event Producer and for each device connected it shall send events and data

Generic Device Access API

The Generic Device Access API (GDA) exposes a high-level, protocol agnostic API towards the Gateway Data Handling and Gateway Device Management. GDA uses service schemas which are XML-files that describe the supported resources, i.e. the application profiles. This schema based approach makes it possible to cover a wide range of applications spanning from home automation, to media, to health care.

The GDA defines two main data structures:

  • Device: it represents the sensor/actuator,
  • Service: it represents a set of functionalities provided by the Device.

The GDA main methods, which has to be used by the Gateway Data Handling and Gateway Device Management are:

  • device.getService(<name of service>) – used to get the services associated to a specific device,
  • service.getProperties() – used to get the list of properties (i.e. attributes) implemented by a specific service implementation,
  • service.getAction(<name of action>) – used to get a single action (i.e. command) implemented by a specific service implementation.

Gateway Data Handling and Gateway Device Management can get sensor data or configure a device by reading/writing a Service property, and can command an actuator by calling a Service action.

Main Interactions

Figure 3 shows an example of device and resource discovery, and how to subscribe to resources using the Protocol Adapter GE. The Device Management GE and Protocol Adapter register listeners for new devices with the gateway framework (OSGi service bus). When the basedriver finds a new device in the network it will register this device in the framework which in turn notifies the listening Protocol Adapter. The Protocol Adapter can now query the device for resources which are then mapped to a service schema. These resources are then made available to the Generic Device Management GE.

Subscriptions are also registered in the framework which then triggers the Protocol Adapter to start a subscription to the requested resource. A new update (e.g. change in sensor value) will send an update to the Generic Device Management GE.

Figure 3: Device discovery and subscribe

Moreover the Protocol Adapter GE is an NGSI compliant Event Producer towards the Data Handling GE. In the IoT Service Enablement architecture, the Protocol Adapter GE publishes device events and data towards the Data Handling GE. In this setup, the Protocol Adapter GE registers itself as an NGSI Context Provider, by calling the NGSI-9 registerContext method exposed by the Data Handling GE. After this context registration, the Protocol Adapter GE sends events, related to the connected devices, by calling the NGSI-10 updateContext method of the Data Handling GE.

Basic Design Principles

Projects deciding to implement support for additional protocols should make sure that their implementations provide the following functionality:

  • Device discovery
  • Device measurement update
  • Device actuation
  • Device events and data support

Re-utilised Technologies/Specifications

The Gateway Protocol Adpater GE is based on RESTful Design Principles. The technologies and specifications used in this GE are:

  • RESTful web services
  • HTTP/1.1 (RFC2616)
  • XML data serialization format.

Terms and definitions

This section comprises a summary of terms and definitions introduced during the previous sections. It intends to establish a vocabulary that will be help to carry out discussions internally and with third parties (e.g., Use Case projects in the EU FP7 Future Internet PPP). For a summary of terms and definitions managed at overall FI-WARE level, please refer to FIWARE Global Terms and Definitions

  • Thing. One instance of a physical object, living organism, person or concept interesting to a person or an application from the perspective of a FI-WARE instance, one particular usage area or to several usage areas. Examples of physical objects are: building, table, bridge (classes), the Kreml, the tennis table from John’s garden, the Tower bridge (instances). Examples of living organisms are: frog, tree, person (classes), the green frog from the garden, the oak tree in front of this building, Dr. Green.
  • Class of thing. Defines the type of a thing in the style of object-oriented programming: a construct that is used as a blueprint to create instances, defining constituent members which enable class instances to have state and behavior. An example of class of thing is “person”, whereas an instance of a thing is “Dr. Green”, with all the static/dynamically changing properties of this particular person.
  • Group of things. A physical/logical group of things. Examples are all office buildings from Munich, all bridges above the Thames, all screws from a drawer, the planes of Lufthansa currently above Germany, all cars inside a traffic jam driven by a female driver, the trees from the Amazonian forest, the squids from the Mediterranean see the mushrooms from Alice’s garden, all the fish from the aquarium of John., the soccer team of Manchester, the colleagues from OrangeLabs currently working abroad (from the perspective of France), all patients above 60 years of age of Dr. Green, the traffic jams from Budapest, the wheat crop in France in the year 2011, the Research and Development Department of the company Telefónica.
  • Device. Hardware entity, component or system that may be in a relationship with a thing or a group of things called association. A device has the means either to measure properties of a thing/group of things and convert it to an analog or digital signal that can be read by a program or user or to potentially influence the properties of a thing/group of things or both to measure/influence. In case when it can only measure the properties, then we call it a sensor. In case when it can potentially influence the properties of a thing, we call it an actuator. Sensors and actuators may be elementary or composed from a set of elementary sensors/actuators. The simplest elementary sensor is a piece of hardware measuring a simple quantity, such as speed of the wind, and displaying it in a mechanical fashion. Sensors may be the combination of software and hardware components, such as a vehicle on-board unit, that consists of simple sensors measuring various quantities such as the speed of the car, fuel consumption etc and a wireless module transmitting the measurement result to an application platform. The simplest elementary actuator is a light switch. We have emphasized potentially because as a result of the light switch being switched on it is not sure that the effect will be that light bulb goes on: only an associated sensor will be able to determine whether it went on or not. Other examples of devices are smart meters, mobile POS devices. More sophisticated devices may have a unique identifier, embedded computing capabilities and local data storage utilities, as well as embedded communication capabilities over short and/or long distances to communicate with IoT backend. Simple devices may not have all these capabilities and they can for instance only disclose the measurement results via mechanical means. In this latter case the further disclosure of the measurement result towards IoT backend requires another kind of device, called IoT Gateway.
  • Association. It is a physical/logical relationship between a device and a thing or a device and a group of things or a group of devices and a group of things from the perspective of a FI-WARE instance, an application within a usage area project or other stakeholder. A device is associated with a thing if it can sense or (potentially) influence at least one property of the thing, property capturing an aspect of the thing interesting to a person or an application from the perspective of a FI-WARE instance, one particular usage area or to several usage areas. Devices are associated with things in fully dynamic or mainly static or fully static manner. The association may have several different embodiments: physical attachment, physical embedding, physical neighborhood, logical relation etc. Physical attachment means that the device is physically attached to the thing in order to monitor and interact with it, enabling the thing to be connected to the Internet. An example is the on-board device installed inside the vehicle to allow sending sensor data from the car to the FI-WARE instances. Physical embedding means that the device is deeply built inside the thing or almost part of the thing. An example of physical embedding is the GPS sensor inside a mobile phone. Physical neighborhood means that the device is in the physical neighborhood of the thing, but not in physical contact with it. An example of physical neighborhood is the association of the mobile phone of a subscriber who is caught in a traffic jam with the traffic jam itself: the mobile phone is the device, the traffic jam is the thing and the association means that the mobile phone is in the physical neighborhood of the area inside which the traffic jam is constrained (e.g. within 100 m from the region where the average speed of cars is below 5 km/h). Logical association means that there is a relationship between the device and the thing which is neither fully physical in the sense of attachment or embedding, nor fully physical proximity related. An example of logical association is between the car and the garage door opener of the garage where the car usually parks during the night.
  • IoT gateway. A device that additionally to or instead of sensing/actuating provides inter-networking and protocol conversion functionalities between devices and IoT backend potentially in any combination of these hosts a number of features of one or several Generic Enablers of the IoT Service Enablement. It is usually located at proximity of the devices to be connected. An example of an IoT gateway is a home gateway that may represent an aggregation point for all the sensors/actuators inside a smart home. The IoT gateway will support all the IoT backend features, taking into consideration the local constraints of devices such as the available computing, power, storage and energy consumption. The level of functional split between the IoT backend and the IoT gateway will also depend on the available resources on the IoT gateway, the cost and quality of connectivity and the desired level for the distribution of intelligence and service abstraction.
  • IoT resource. Computational elements (software) that provide the technical means to perform sensing and/or actuation on the device. There may be one-to-one or one-to-many relationship between a device and its IoT resource. Actuation capabilities exposed by the IoT resource may comprise configuration of the management/application features of the device, such as connectivity, access control, information, while sensing may comprise the gathering of faults, performance metrics, accounting/administration data from the device, as well as application data about the properties of the thing with which the device is associated. The resource is usually hosted on the device.
  • Management service. It is the feature of the IoT resource providing programmatic access to readable and/or writable data belonging to the functioning of the device, comprising a subset of the FCAPS categories, that is, configuration management, fault management, accounting /access management/administration, performance management/provisioning and security management. The extent of the subset depends on the usage area. Example of configuration management data is the IP endpoint of the IoT backend instance to which the device communicates. Example of fault management is an error given as a result of the overheating of the device because of extensive exposure to the sun. Example of accounting/administration is setting the link quota for applications using data from a certain sensor. Example of security management is the provisioning of a list of device ID-s of peer devices with which the device may directly communicate.
  • Application service. It is the feature of the IoT resource providing programmatic access to readable or writable data in connection with the thing which is associated with the device hosting the resource. The application service exchanges application data with another device (including IoT gateway) and/or the IoT backend. Measured sensory data are example of application data flowing from devices to sensors. Setting the steering angle of a security camera or sending a “start wetting” command to the irrigation system are examples of application data flowing from the application towards the sensor.
  • Event. An event can be defined as an activity that happens, occurs in a device, gateway, IoT backend or is created by a software component inside the IoT service enablement. The digital representation of this activity in a device, IoT resource, IoT gateway or IoT backend instance, or more generally, in a FI-WARE instance, is also called an event. Events may be simple and complex. A simple event is an event that is not an abstraction or composition of other events. An example of a simple event is that “smart meter X got broken”. A complex event is an abstraction of other events called member events. For example a stock market crash or a cellular network blackout is an abstraction denoting many thousand of member events. In many cases a complex event references the set of its members, the implication being that the event contains a reference. For example, the cellular network blackout may be caused by a power failure of the air conditioning in the operator’s data center. In other cases such a reference may not exist. For example there is no accepted agreement as to which events are members of a stock market crash complex event. Complex events may be created of simple events or other complex events by an IoT resource or the IoT backend instance.
  • IoT Backend. Provides management functionalities for the devices and IoT domain-specific support for the applications. Integrant component of FI-WARE instances.
  • IoT application. An application that uses the application programming interface of the IoT service enablement component. May have parts running on one/set of devices, one/set of IoT gateways and one/set of IoT backends.
  • Virtual thing. It is the digital representation of a thing inside the IoT service enablement component. Consists of a set of properties which are interesting to a person or an application from the perspective of a FI-WARE instance, one particular usage area or to several usage areas. Classes of things have the same set of properties, only the value of the properties change from instance to instance.
Personal tools
Create a book