Networking Reference
In-Depth Information
sensor node, a set of nodes, a WSN, or a set of WSNs associated with a gateway must
be accessed via URI. A URI is used to locate a specific gateway, to identify a device
on a network, and to specify a resource provided by a device [ 17 ]. Each node in a
WSN is endowed with a number of sensing units (light, temperature, accelerometer,
etc.), a number of actuators (digital outputs, leds, etc.) and a number of internal
components (radio, battery). All these parts (including the nodes themselves) are the
resources of the REST architecture. Resources are organized in a tree hierarchy and
each of them implements or inherits the four verbs of the HTTP protocol. In the
SmartSensor infrastructure, the URI to access a resource provided by a sensor node
has the general format http://gateway IP address and port/ identification of the type
of the driver/node ID/node resource. The gateway IP address uniquely identifies the
specific gateway in the Web; the driver identification indicates the type of the WSN
platform associated with the gateway that the client wants to access; the identification
of the node indicates the specific device associated with the gateway that is to be
accessed (such node ID can be created locally or be a portion of the MAC address
of the sensor, depending on the WSN platform used); finally, the node resource
specified in the URI indicates which functionality of the node the client wants to
access. For example, the access to the temperature reading from a sensor node of
Sun SPOT platform [ 33 ] whose last four digits of MAC address (used as node ID
in such platform) are “1265” can be done through the URI http://localhost:8888/
spotserver/spot-1265/light where “/light” identifies the required type of the node
resource.
This usage of URI also allows the system to provide links for clients to browse
between sub resources of a resource. For example, a request sent to the following
URL http://localhost:8888/spotserver/spot-1265 returns a list with links to all avail-
able resources in this node (SPOT). These links allow clients to access any specific
resource and also to navigate from the representation of the state of a resource to
other representations of different resources. Furthermore, it is also possible to use
links to guide the client in the various interactions that can be performed with the
resource.
Regarding to the representation of resources, WSN devices connected to the
SmartSensor infrastructure can be represented in XML, HTML and JSON. The
HTML representation was adopted to simplify human interaction with the avail-
able resources, enabling navigation within the structure of resources through links
to sub resources (also called child resources). In response to a Web request via the
provided URI, the gateway may return an HTML page containing a list of the con-
nected devices separated by type. Each device in the list has as associated link that
allows the user to access such device (and its provided services/resources). In most
cases, however, a XML file is returned in response to the HTTP request, allowing
an application-to-application interaction. Finally, JSON format is also available for
representing the resources returned in response to an HTTP request. JSON (Java
Script Object Notation) is a lightweight alternative to the XML as a data interchange
format [ 10 ]. It is a text-based open standard for data client/server data exchange and
it is used whenever it is necessary to decrease the footprint of the application, for
instance, to exchange data among sensor nodes that have an embedded server. For
Search MirCeyron ::




Custom Search