The Smart Service Proxy (SSP) - A Middlebox for a Semantic Web of Things
Oliver Kleine
-
University of Lübeck, Germany
-
Institute of Telematics
-
Email:
[email protected]
Preliminary: Semantic Web of Things Semantic Web of Things:
Constrained devices and smartphones run (CoAP) Web Servers to provide access to RDF representations of their resources
Issues:
Proposed Solutions:
• Frequently changing IP addresses for mobile Internet hosts • CoAP [1] not (yet?) available on many Web Clients • No direct access to (constrained) Web Servers (NAT and/or Duty Cycling)
• CoAP Endpoint ID to deal with IP address changes [2] • Unied access to resources via HTTP (see I.) [3] • Comprehensive and up-to-date caching of resources states (see II.)
I. Proxy and Cache
HTTP Web Client
SSP Cache
SSP Protocol Converter
CoAP Web Server
HTTP GET /proxy?uri=coap://example.org/path
Lookup resource alt
Scalability Considerations:
[Status found in cache]
Single SSP is both, → bottleneck → single point of failure Issue:
HTTP 200 OK
[Status not found in cache]
forward(HttpRequest)
COAP GET //example.org/path COAP ACK 2.05
B long response times (see II. for solution)!
Multiple SSPs → share a distributed cache [4] and by this means → enable Web Clients to freely choose any SSP for access to any (cached) ressource Solution:
Convert HTTP to CoAP
Convert CoAP to HTTP forward(HttpResponse)
Cache Resource Status
HTTP 200 OK
II. Advanced Directory Service
III. Creation of Virtual Sensors
Provides Registration (similar to [5]) and Observation [6] of new CoAP Resources:
Step 1 - Self Description:
SSP Cache
SSP Observer
SSP Registry
RDF based on SSN Ontology [7]
CoAP Web Server
NON POST /registry CON GET /.well-known/core forward(List)
loop
[for each URI in List] forward(Status)
ACK 2.05 (List of n Resources)
GET [observe] /resource-i ACK 2.05 (Status)
Cache Status loop
[innite] forward(Status)
NON 2.05 (Status Update of Resource x (1 ≤ x ≤ n)
Cache Status
References
[1] Z. Shelby, K. Hartke, and C. Bormann. Constrained Application Protocol (2014). RFC 7252 URL: https://datatracker.ietf.org/doc/rfc7252/. [2] O. Kleine. CoAP Endpoint Identication (2014). IETF draft (Work in Progress), URL: https://tools.ietf.org/html/draft-kleine-core-coap-endpoint-id. [3] A. Castellani et al. Guidelines for HTTP-CoAP Mapping Implementations (2014). IETF Draft (Work in Progress), URL: https://tools.ietf.org/html/draft-ietf-core-http-mapping. [4] R. Mietz, S. Groppe, O. Kleine, D. Bimschas, S. Fischer, K. Römer, and D. Psterer. A P2P Semantic Query Framework for the Internet of Things. Praxis der Informationsverarb. und Kommunikation, 2013. [5] Z. Shelby and C. Bormann. CoRE Resource Directory (2014). IETF draft (Work in Progress), URL: https://tools.ietf.org/html/draft-ietf-core-resource-directory. [6] K. Hartke. Observing Resources in CoAP (2014). IETF draft (Work in Progress), URL: https://datatracker.ietf.org/doc/draft-ietf-core-observe/. [7] M. Compton, P. Barnaghi, L. Bermudez, et al. The SSN Ontology of the W3C Semantic Sensor Network Incubator Group. Web Semantics: Science, Services and Agents on the World Wide Web, 2012.
Result of a SPARQL query (to be regularly executed) that aggregates (real) sensor values from cache, e.g. average noise within a certain triangle area: Step 2 - Sensor Value:
PREFIX exp : < http :// example . org /# > PREFIX geo : < http :// www . opengis . net / ont / geosparql #> PREFIX geof : < http :// www . opengis . net / def / function / geosparql /> SELECT ( AVG (? noise ) AS ? aggVal ) WHERE { ? noise exp : hasPosition ? pos . ? pos geo : asWKT ? wktPos .
}
FILTER ( geof : sfWithin ( ? wktPos , "< http :// www . opengis . net / def / crs / OGC /1.3/ CRS84 > Polygon (( 10.679460565545495 53.86603911820543 , 10.679453165480746 53.865950218205434 , 10.679441167600807 53.865902243475745 , 10.679460565545495 53.86603911820543 )) "^^ geo : wktLiteral ))
Note: Query is simplied for the sake of clarity (no restriction to noise sensors).