Stefan Bosse - Fusion of Distributed Sensor Tuple Spaces and Agents

Fusion of Distributed Sensor Tuple Spaces and Agents using Broadcast Radio Communication for Mobile Networks

Challenges and Pitfalls

PD Dr. Stefan Bosse

sbosse@uni-bremen.de

University of Bremen, Dept. Mathematics and Computer Science, Bremen, Germany

1 / 35

Introduction Stefan Bosse - Fusion of Distributed Sensor Tuple Spaces and Agents

Introduction

2 / 35

Introduction Stefan Bosse - Fusion of Distributed Sensor Tuple Spaces and Agents

Ubiquitous and Pervasive computing

Ubiquitous and pervasive computing introduces a big amount of visible and non-visible low-resource and mobile devices with an exponentially increasing number of deployed embedded systems.

3 / 35

Introduction Stefan Bosse - Fusion of Distributed Sensor Tuple Spaces and Agents

Ubiquitous and Pervasive computing

Ubiquitous and pervasive computing introduces a big amount of visible and non-visible low-resource and mobile devices with an exponentially increasing number of deployed embedded systems.

  • Short-time and short-range device-to-device and device-to-service communication in ad-hoc mobile networks is still a challenge.

  • Most Internet-of-Things (IoT) devices and smart sensors are connected via the Internet.

    • Using IP communication (UDP/TCP/HTTP)
    • Data exchange with dedicated servers that collects sensor information periodically or event-based.
4 / 35

Introduction Stefan Bosse - Fusion of Distributed Sensor Tuple Spaces and Agents

Data taxonomy in Ubiquitous and Pervasive computing

  • IoT and smart sensor devices typically are sources of spatially distributed and time-dependent small-data chunks:
  • Sensor data size about 1-100 bytes per single data atom
  • Sensor update frequency about 1-3 - 1Hz
  • Sensor data has a limited lifetime (temporary data), typically 1-1000s
  • Sensor data stream classes: Event-based versa periodic versa sporadic
  • Sensor data with spatial context and spatial range, accuracy about 1-1000m
  • Sensor density about 10 sensors / m2
5 / 35

Introduction Stefan Bosse - Fusion of Distributed Sensor Tuple Spaces and Agents

Heterogeneous Data Sources

www.libelium.com/libeliumworld Different data sources and sinks in smart world and city environments - different temporal and spatial scales, different spatial ranges

6 / 35

Introduction Stefan Bosse - Fusion of Distributed Sensor Tuple Spaces and Agents

Internet-of-Things and beyond

Dieter Uckelmann et al, 2011 IoT and pervasive/ubiq. computing is closely coupled to humans! Scalability is closely coupled to pervasiveness! Communication is the central issue!

7 / 35

Introduction Stefan Bosse - Fusion of Distributed Sensor Tuple Spaces and Agents

Disadvantages of Internet-based communication

  • Not always and everywhere available
  • Unique device IP addresses required →
  • Address-based Communication versa data-based
  • Limited scalability
  • External organisation services (DNS) required
  • Energy (mobile Internet via cell networks)
  • Loss of spatial context (proximity of devices)
  • Security issues (devices can be accessed from everywhere)
  • Even UDP is not optimised for small data transmissions (1 Byte)
  • Routing with routing tables required
8 / 35

Introduction Stefan Bosse - Fusion of Distributed Sensor Tuple Spaces and Agents

Small Data Chunks and Data Fusion

DaCosta, Francis, 2013 Chirps are typically collected within propagator nodes, bundled and pruned as necessary for transmission, and then typically forwarded over the traditional Internet

9 / 35

Introduction Stefan Bosse - Fusion of Distributed Sensor Tuple Spaces and Agents

Novelty of this work

  • Data-based versa address-based communication
  • Broadcast versa unicast message communication
  • Communication preserves spatial context
    • Short-range by using Bluetooth broadcast communication technologies
    • Mid-range by using UDP-IP broadcast communication
    • Local processing
  • Communication is controlled and managed by simple event-based agents
  • Data is organised and stored in Tuple Spaces
  • Tuple spaces provide generative data-driven device interaction
  • Looseley distributed tuple spaces are spawned by mobile devices and agents
10 / 35

Distributed Tuple Spaces and Agents Stefan Bosse - Fusion of Distributed Sensor Tuple Spaces and Agents

Distributed Tuple Spaces and Agents

A tuple space is basically a data base containing tuples. A tuple is a poly-typed ordered set of data values. The number of data values specifies the arity of the tuple, i.e., tu=⟨v1,v2,..,vk⟩, |tu|=k.

11 / 35

Distributed Tuple Spaces and Agents Stefan Bosse - Fusion of Distributed Sensor Tuple Spaces and Agents

Distributed Tuple Spaces and Agents

A tuple space is basically a data base containing tuples. A tuple is a poly-typed ordered set of data values. The number of data values specifies the arity of the tuple, i.e., tu=⟨v1,v2,..,vk⟩, |tu|=k.

Each tuple space TS can be divided into independent sub-spaces TS= ts1ts2 ∪ .. ∪ tsn, with tsi holding only tuples of arity i.

12 / 35

Distributed Tuple Spaces and Agents Stefan Bosse - Fusion of Distributed Sensor Tuple Spaces and Agents

Distributed Tuple Spaces and Agents

A tuple space is basically a data base containing tuples. A tuple is a poly-typed ordered set of data values. The number of data values specifies the arity of the tuple, i.e., tu=⟨v1,v2,..,vk⟩, |tu|=k.

Each tuple space TS can be divided into independent sub-spaces TS= ts1ts2 ∪ .. ∪ tsn, with tsi holding only tuples of arity i.

The data type of each element of a tuple can be arbitrary, i.e., any scalar value (float, integer, Boolean), or composed values, i.e., arrays or structures. In this work, the data elements are limited to scalar values, more specifically, float32, int16, and short strings (or data bytes).

13 / 35

Distributed Tuple Spaces and Agents Stefan Bosse - Fusion of Distributed Sensor Tuple Spaces and Agents

Tuple Space Operations

Vitaly Buravlev et al., 2016 There are producer and consumer operations. Consumer uses pattern to find matching tuples. The consumer can be synchronised by blocking until there is a matching tuple

14 / 35

Distributed Tuple Spaces and Agents Stefan Bosse - Fusion of Distributed Sensor Tuple Spaces and Agents

Direct-access Programming Interface

var ts1 = TS('udp');
│ ts1.start()
│ ts1.listen(['ALARM','LIGHT',null],function (t,source,rssi) {
console.log('ALARM',t,source,rssi,t[2])
│ ts1.notify(['IAMHERE']);
│ ts1.rd(['SENSOR','LIGHT',null],function (t) { ... });
└ })
var ts2 = TS('ble',{keys:{private:'cloud1'}});
│ ts2.start()
│ ts2.listen(['SENSOR','LIGHT',null],function (t,source,rssi) {
if (t[2]>500) ts1.out(['ALARM','LIGHT',t[2]]);
│ })
│ ts2.notify(['IAMHERE']);
│ ts2.rd(['SENSOR','LIGHT',null],function (t) { ... });
│ ts2.host.out(['SENSOR','LIGHT',1000]); // local op
└ ts2.out(['SENSOR','LIGHT',1000]); // remote op
Different tupls space RPC services but with the same set of direct access operations
15 / 35

Distributed Tuple Spaces and Agents Stefan Bosse - Fusion of Distributed Sensor Tuple Spaces and Agents

Agents

  • Agents are simple functional units providing event handlers, i.e.:

    • Agents are functional code that listen to incoming tuple requests.
  • There can be more than one agent. Communication between agents is established via the tuple space, too.

  • There are agents acting as a bridge between the communication back-end and the tuple space.

  • They can

    • filter incoming messages and decide to reply immediately,
    • access the tuple space, or
    • discard the message.
16 / 35

Distributed Tuple Spaces and Agents Stefan Bosse - Fusion of Distributed Sensor Tuple Spaces and Agents

Agents and Tuple Routing

Tuple exchange between BLE and UDP tuple spaces is provided by a customisable router controlled by agents. The routers connect local spaces and compose organised global spaces.

Agents create a bridge between tuple spaces with multiple communication devices (Red: Message event agent, Blue: Timer agent, Green: Router agent).

17 / 35

Distributed Tuple Spaces and Agents Stefan Bosse - Fusion of Distributed Sensor Tuple Spaces and Agents

Agent Programming Interface

var agent = {
┌ x : 0,
│ y : 0,
└ ..
┌ on : {
'ts.udp:(TIME,?)': function (ev) {
│ ts.ble.notify(ev.tuple);
return consumed?;
│ },
'ts.ble:(SENSOR,?,?,?)':function (ev) {
│ log(ev.tuple,ev.from,ev.rssi)
│ ts.udp.out(['EVENT',JSON.stringify(ev.tuple),ev.from,ev.time]);
return consumed?;
│ },
│ init : function () {
this.x=random(1,1000);
│ },
'sensor.light:abs(sensor-sensor0)>50': function (ev) {
if (ev.sensor>500) ts.ble.notify(['ALARM','LIGHT','HIGH']);
│ }
└ },
}
Agent.create(agent);
Basic agent template in JavaScript with private body variables and event handlers
18 / 35

Distributed Tuple Spaces and Agents Stefan Bosse - Fusion of Distributed Sensor Tuple Spaces and Agents

Security

  • Symmetric two-way encryption with a private and a public key pair is used.
  • The messages are encrypted using the private key (only known by trusted devices and users) and decrypted in the receiving device.
  • But due to the hard data size constraints, only Format-preserving encryption (FPE) can be applied.

19 / 35

Communication Technology and Protocols Stefan Bosse - Fusion of Distributed Sensor Tuple Spaces and Agents

Communication Technology and Protocols

Methodologies

20 / 35

Communication Technology and Protocols Stefan Bosse - Fusion of Distributed Sensor Tuple Spaces and Agents

Communication Technology and Protocols

Methodologies

BLE: Short-range Bluetooth Low-energy Communication

21 / 35

Communication Technology and Protocols Stefan Bosse - Fusion of Distributed Sensor Tuple Spaces and Agents

Communication Technology and Protocols

Methodologies

BLE: Short-range Bluetooth Low-energy Communication

UDP: Mid-range UDP-IP Communication

22 / 35

Communication Technology and Protocols Stefan Bosse - Fusion of Distributed Sensor Tuple Spaces and Agents

Communication Technology and Protocols

Methodologies

BLE: Short-range Bluetooth Low-energy Communication

UDP: Mid-range UDP-IP Communication

BLE/UDP: Broadcast Messaging of Packed Tuple Operations

23 / 35

Communication Technology and Protocols Stefan Bosse - Fusion of Distributed Sensor Tuple Spaces and Agents

BLE-based Broadcast Communication

  • Both advertisment and scanning modes are used (requires BLE > 4.0)

  • Data tuples are transferred with advertisment packets

    • data paylod is limited to 272 bits
    • encoded in local name and serviceUUID fields
    • fixed size tuples with up to four elements given by a type signature
    • element data types: integer-16, float-32, string, formal parameter (pattern)
┌─────┬────┬───────────┬────────┐ Op = IAMHERE | WHEREIS |
│ 4 │ 4 │ 8 │ 32*8 │ OUT | INP | RD │ TEST |
│ Seq │ Op │ Signature │ Data │ TUPLE | NOTIFY │ UPDATE
└─────┴────┴───────────┴────────┘
  • Short-range communication and reachability in the range of 1-10m, typically covering single rooms or floors
24 / 35

Communication Technology and Protocols Stefan Bosse - Fusion of Distributed Sensor Tuple Spaces and Agents

BLE-based Broadcast Communication

  • A message is sent multiple times within an advertisement interval
  • A message can be received zero, one, or more times. To recognise duplicates, an ordered sequence number is used.

Principle BLE-based broadcast communication using advertisement packets. The sender and receiver switch their radio channels randomly and periodically. A packet m containing a tuple space request is sent multiple times in t ∈ [ts,te].

25 / 35

Communication Technology and Protocols Stefan Bosse - Fusion of Distributed Sensor Tuple Spaces and Agents

UDP-based Broadcast Communication

  • UDP broadcasting is used to propagate tuple messages in local intra-networks

  • UDP is basically used to distribute tuples in a larger spatial range, typically covering entire buildings

UDP broadcasting requires wired connections. UDP broadcast packets are not forwarded by WLAN access points (AP) consistently and reliable! This is a result of star-based secured P2P communication in WLAN networks.

  • Broadcast UDP packets from a wireless device is forwarded by the AP on wired network by not vice versa.
26 / 35

Communication Technology and Protocols Stefan Bosse - Fusion of Distributed Sensor Tuple Spaces and Agents

Hybrid Architecture

The hybrid network architecture using BLE and UDP-IP broadcast communication; n: stationary node, b: Stationary beacon, m: Mobile node, TS: Tuple space, R: Rule-based router

27 / 35

Use-case Evaluation Stefan Bosse - Fusion of Distributed Sensor Tuple Spaces and Agents

Use-case Evaluation

Proof-of-concept use-case: Decentralised light control in buildings based on user perception and negotiation.

28 / 35

Use-case Evaluation Stefan Bosse - Fusion of Distributed Sensor Tuple Spaces and Agents

Use-case Evaluation

Proof-of-concept use-case: Decentralised light control in buildings based on user perception and negotiation.

Ingredentients: Smartphones (mobile devices), Raspberry PI Zero/3 (stationary beacons), servers, WLAN-WiFi AP(s).

29 / 35

Use-case Evaluation Stefan Bosse - Fusion of Distributed Sensor Tuple Spaces and Agents

Distributed and self-organised Light Control

  • Different agents negotiate light control in different areas of a building

  • Agents perform sensing (light intensity, crowd flows, user activity) and mobile surveys via a small chat application

  • Goal: Optimisation of light illumination with respect to user satisfaction and energy reduction!

30 / 35

Use-case Evaluation Stefan Bosse - Fusion of Distributed Sensor Tuple Spaces and Agents

Communication Architecture

Experimental Set-up; s: Central server, b: beacon (Raspberry PI 3), m: Mobile device; Central server and beacons communicate via WLAN or LAN

31 / 35

Use-case Evaluation Stefan Bosse - Fusion of Distributed Sensor Tuple Spaces and Agents

Results

  1. Using the light sensors, the mobility assessment using the accelerometer and gyroscope sensors of the mobile devices, and the performed micro-surveys providing user feed-back (satisfaction assessment):

    • the illumination conditions could be optimised with respect to the user demands and energy consumption of about 30% without negative user feed-back and dissatisfaction.
  2. BLE: An average tuple loss of 10% can be achieved within a radius of about 2m, 30% in 5m radius. Some nodes can communicate over larger distances up to 10m.

    • Device density: 2/m2
  3. The tuple message sending time interval has no significant impact on the loss rate within time interval [500s,2000s] and with this (small) set-up. When the number of nodes within the radio range will be increased, the loss rate will increase, too.

  4. Broadcasting from LAN to WLAN did not work reliable (loss up to 50%), and even unicast UDP communication was not reliable via WLAN.

32 / 35

Use-case Evaluation Stefan Bosse - Fusion of Distributed Sensor Tuple Spaces and Agents

Results

Average receptions rate of a sensor tuple (4 elements) in dependence of the distance between sender and receiver (SRD ) and the tuple time interval ∆t . Configuration: 4 beacons at different spatial positions and 4 mobile devices located at the same spatial position

33 / 35

Summary Stefan Bosse - Fusion of Distributed Sensor Tuple Spaces and Agents

Summary

  • Distributed tuple spaces were used to exchange data between devices providing a spatial context.

  • Smart devices access the tuple spaces by tuple message communication.

  • The communication is connectionless and ad-hoc by using low-energy Bluetooth broadcasting

  • Mobile devices act as tuple carriers that can carry tuples between different locations. Additionally, UDP-based Intranet communication can be used to connect tuple spaces.

  • The Bluetooth Low Energy Tuple Space (BeeTS) service enables opportunistic, ad-hoc and loosely coupled device communication with spatial context. Typical loss-rate < 20%!

34 / 35

Summary Stefan Bosse - Fusion of Distributed Sensor Tuple Spaces and Agents

Questions and Comments are welcome!

Fusion of Distributed Sensor Tuple Spaces and Agents using Broadcast Radio Communication for Mobile Networks

Challenges and Pitfalls

PD Dr. Stefan Bosse

sbosse@uni-bremen.de

University of Bremen, Dept. Mathematics and Computer Science, Bremen, Germany

35 / 35