User Tools

Site Tools


uf:totam

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
uf:totam [2010/10/20 16:26]
elisag adding
uf:totam [2021/09/24 10:49] (current)
elisag [Creating a tuplespace and tuples]
Line 1: Line 1:
-===== Tuples on the Ambient (TOTAM) =====+====== Scoped Tuples for the Ambient (TOTAM) ======
  
-TOTAM is an extension to the TOTA tuple space model which introduces a scoping mechanism to delimit the physical transportation of tuples.+TOTAM is tuple space model geared towards mobile ad hoc networks which provides dynamic scoping mechanism that limits the transportation of tuples
 +TOTAM adopts features of both federated tuple spaces and replication-based approaches: it combines replication of tuples for read operations while guaranteeing atomicity for remove operations. 
 +In TOTAM, tuple spaces are annotated with tuple space descriptors used to determine the scope of a tuple. 
 +The novelty of our approach lies in the use of these tuple space descriptors to determine that a tuple should be propagated before it is transmitted. This enhances privacy and decreases the burden on the network traffic in a wide range of applications.
  
-==== Design ====+===== Motivation =====
  
-The original idea was to build a framework similar to [[http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.19.9742|TOTA]] to be able to exchange and percolate guanotes. TOTA is one of the most dynamic tuple-based solutions for coordination in mobile networks. It relies on tuples which hop from location to location to coordinate distributed application nodes. Rather than merging local tuple spaces upon network connection as other tuple-based approaches like LIME, tuples themselves decide how to propagate from a tuple space to another. This means that tuples are injected in the network and can autonomously propagate according to application-specific propagation rules expressed in the tuples themselves. +[[http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.19.9742|TOTA]] is one of the most dynamic tuple-based solutions for coordination in mobile networks. It relies on tuples which hop from location to location to coordinate distributed application nodes. Rather than merging local tuple spaces upon network connection as other tuple-based approaches like LIME, tuples themselves decide how to propagate from a tuple space to another. This means that tuples are injected in the network with and can autonomously propagate according to application-specific propagation rules expressed in the tuples themselves.  
 +These propagation rules are crucial to provide programmers with a flexible mechanism to achieve context-awareness based not only on connectivity but also on semantic information
  
-However, in TOTA tuples are sent to all communication partners in range. Upon arrival at the receiver side, the tuple itself decides whether it has to be stored in that tuple space. By transmitting tuples potential malicious or non-intended users are provided with sensitive information. Not only does sending all tuples blindly to all communication partners in range raise privacy issues, it also creates a network traffic overhead. +However, in TOTA tuples are sent to all communication partners in range. Upon arrival at the receiver side, the tuple itself decides whether it has to be stored in that tuple space. As all devices can potentially access all information, information cannot be hidden or scoped. By transmitting tuples potential malicious or non-intended users are provided with sensitive information. Not only does sending all tuples blindly to all communication partners in range may be unacceptable for certain applications, it also creates a network traffic overhead and has performance repercussions on mobile devices which are likely to have scarce resources, such as limited battery life
  
-To solve this issues, we extended TOTA with dynamically scoped tuples resulting in the TOTAM ("Tuples on the Ambient") framework. TOTAM provides the programmer with means to scope the tuples themselves, i.e the tuples can dynamically adjust their scope as they hop from location to location. By means of tuple space descriptors, programmers can scope their tuples preventing them to be propagated to unwanted locations. This scope is determined before the tuple is transmitted, thus allowing the programmer to prevent the physical transportation of tuples to devices which are not targeted. Scoped tuples have a number of benefits: tuples carry the definition of the target tuple spaces enhancing privacy and avoiding unnecessary exchange of tuples. +===== Scoped Tuples for the Ambient =====
  
-Another goal was to implement TOTAM as a general framework so that we can then instantiate our TOTAM with guanote objects for the [[:uf:guanotes|Guanotes]] applicationA guanote actually extends a tuple object of TOTAM with some flockr-dependent behaviourSince TOTAM has been designed to be independent from service discovery[[:uf:guanotes|Guanotes]]  implements some glue code to plug in the discovery mechanism of Urbiflock (via Flockr).+TOTAM provides the programmer with means to scope the tuples themselves, i.e the tuples can dynamically adjust their scope as they hop from location to locationBy means of tuple space descriptors, programmers can scope their tuples preventing them to be propagated to unwanted locations. This scope is determined before the tuple is transmittedthus allowing the programmer to prevent the physical transportation of tuples to devices which are not targeted
  
-==== API ====+{{:research:totamspace.jpg?481x150|:research:totamspace.jpg}}
  
-Here comes the public interface to interact with an AmbientTota framework:+Figure above illustrates how a scoped tuple is propagated through the TOTAM network. It depicts two types of locations, the blue and red locations corresponding to two teams of a multi-player game scenario where users (blue team) can use their PDA’s to chase dangerous (virtual) gangsters (red team) in the outdoors. The scope of the propagated tuple has been limited to blue locations. Figure (a) illustrates that a tuple is injected from the location with a star. This location is connected to four blue locations and one red location. As the scope of the tuple is limited to blue locations the tuple is only sent to the four blue locations. From those four locations the tuple is transitively propagated obeying the scope of the tuple until all connected blue locations are reached without being transmitted to a red location. Note that one blue location is not transitively connected to the sending device and thus does not receive the tuple. Figure (b) illustrates that a blue location moved into the range of the isolated blue location and thus, transmits the tuple to it. Again the tuple is not transmitted to nearby red locations. It is important to note from this operational sketch that the first isolated location receives a tuple without being connected at any time with the start location in which the tuple was originally inserted. 
 + 
 + 
 + 
 + 
 + 
 +===== API ===== 
 + 
 +TOTAM has been implemented in AmbientTalk. The system library shipped with AmbientTalk contains the TOTAM implementation under at/lang/totam.at. 
 + 
 +==== Creating a Tuplespace and Tuples ==== 
 + 
 +In order to use TOTAM, you need to load the library and create a TOTAM tuple space as follows:
  
 <code> <code>
-makeTupleSpace() +import /.at.lang.totam; 
-makeTuple(tupleID+def myTupleSpace := makeTupleSpace(); 
-extendTuple: tuple with: closure+</code>  
 + 
 +A description can be passed in the ''makeTupleSpace'' operation in order to activate the scoping mechanism (as we will explain later).   
 + 
 +To create a tuple or a template (i.e. a tuple with wildcards or "holes"), the 'tuple:' operation can be used as follows: 
 +<code>  
 +// a “hallo” message tuple from wolf. 
 +def halloTuple := tuple: ["Message", “wolf”, “hallo”]; 
 +// a template for message tuples from wolf. 
 +def wolfTuples := tuple: ["Message", “wolf”, var: `content]; 
 +// a template for any message tuples. 
 +def msgTuples := tuple: ["Message", var: `from, var`content];
 </code> </code>
  
-A tuple space (ts) in AmbientTota basically consists of a local ts, an ambient ts (to inject tuples in the ambient). The public interface of an ts is the following:+ 
 +==== Adding and Reading Tuples ==== 
 + 
 +TOTAM provides operations to add and read tuples from the tuple space as follows:
  
 <code> <code>
-// tota operations to manage a local ts +// add tuple to tuple space 
-def add(tuple+myTupleSpace.out(halloTuple)
-def delete(template-> vector with the deleted tuples  +// get a Message tuple 
-matching the template +def aMessageTuple := myTupleSpace.rdp(msgTuples)
-def read(template-vector with the matching tuples+// get all Message tuples. 
 +def messageTuples := myTupleSpace.rdg(msgTuples)
 +</code>
  
-//publishes a tuple into the ambient ( ~ inject in TOTA) +The ''rdp(template)'' and ''rdg(template)'' operations return a tuple or all tuples matching the template in the tuple space if present (without removing), respectively. Note that if no tuple is present matching the template, ''nil'' is given back. 
-def inject(tuple) -> subscription object to cancel the injection+
  
-// places a listener on to the local TS ( ~ subscribe in TOTA) +In the original Linda model, read and in operations were provided to return a copy of the tuple and remove the tuple from the tuple, respectively. Those operations where blockingTOTAM, inspired by Lime, offers non-blocking variants of these operations:
-// it returns a publication object to be able to unsusbscribe  +
-when: template matches:{ | tuple +
- // code   +
-+
-//Templates are currently boolean expressions on tuples +
-Example of template applied to guanotes: +
-{ |guanote|  guanote.flock == "KK" }+
  
-//methods belonging to the propagation protocol+<code> 
 +def msgTuples := tuple: [Message, var: `from, var: `content]; 
 +myTupleSpace.whenever: msgTuples read:{ 
 +  system.println(“Got message: “ + content + “ from: ” + from); 
 +};
  
-// notifies the discovery of a remote ts +myTupleSpace.whenever: wolfTuples in:{   
-// and starts the propagation protocol (send side+  system.println(“ “ + from + “ says: “ + content); 
-def notifyTSDiscovered(ts) +};
-// notifies the arrival of tuples from a ts  +
-// receive side of the propagation protocol +
-def receiveTyples(tuples)+
 </code> </code>
  
-tuple in our system is just the object contained in a local TS offering the following API to propagate itself+The ''whenever:read:'' operation takes as parameter a template and a block closure which is asynchronously applied each time a tuple matching the template is added to the tuple space. The ''whenever:in:'' operation works similarly but it also removes the tuple matching the template. Following Linda's in semantics, if several ''whenever:in:'' operations could be triggered for one tuple, //only// one of them will succeed. Variables specified in the template are bound in the body of the block closure to the concrete value of the tuple that matched the template. Both operations return a subscription object which understands a ''cancel'' message to stop the interest in tuples matching the template. Note also that both operations have ''when:'' variant which only triggers once the block closure for the first tuple that matches the template. 
 + 
 +The ''out(tuple)'' operation actually inserts a private tuple in the tuple space. In order for applications to insert a public tuple, thereby making it available to other collocated TOTAM systems, the'' inject:'' operation is provided.
  
 <code> <code>
-// called in every tuple at pass()  +myTupleSpace.goOnline();  
-def decidePropagation() -> boolean +myTupleSpace.inject: halloTuple;
-// specifies operations on the local TS +
-def doAction (); +
-// specifies operations on the tuple itself  +
-def changeTupleContent() -> tuple +
-// if true -> note gets added to local TS +
-def decideStore () -> boolean +
-// if true -> tuple gets unexported and deleted from local TS. +
-//new operation not in TOTA +
-def decideSleep() -> boolean +
 </code> </code>
  
-Ideas:+Note that the network facilities are disabled by default, so before injecting something in the network, the ''goOnline()'' method must be called on the tuple space. 
 + 
 +==== Tuple's Propagation Protocol ==== 
 + 
 +Similar to TOTA, public tuples are replicated and shared amongst devices when devices come into communication range. We thus say that tuple are propagated into the //TOTAM network//, i.e. a logical network formed by all devices which host a TOTAM tuple space. The spread of tuples into the TOTAM network can be controlled by means of a propagation protocol. Each tuple injected into the network carries a propagation protocol that can be customized by developers. What follows shows the default propagation protocol: 
 + 
 +<code> 
 +def defaultPropagationProtocol(){ 
 +  isolate: { 
 +    //receiver-side protocol 
 +    def decideEnter(ts) { true }; 
 +    def doAction(ts){}; 
 +    def changeTupleContent(ts){self}; 
 +    def decideStore(ts) {true}; 
 +    //sender-side protocol 
 +    def inScope(senderDescriptor,receiverDescriptor){ true }; 
 +    def decideDie(ts){false}; 
 +  }; 
 +}; 
 +</code> 
 + 
 +Custom propagation protocols can be created and attached to a tuple before being injected in the network as follows: 
 + 
 +<code> 
 +//define a new propagation protocol 
 +def blueProtocol := propagationProtocol:
 +  def inScope(senderDescriptor,receiverDescriptor) {  
 +    receiverDescriptor.team == "blue" }; 
 +}; 
 +// attach the protocol to a tuple 
 +def aBlueTuple := tuple: ["Message", "hallo"]  
 +withPropagationProtocol: blueProtocol; 
 +// inject the tuple to the network 
 +def publication := inject: aBlueTuple; 
 +</code> 
 + 
 +The ''propagationProtocol:'' operation creates a propagation protocol object which extends the default propagation protocol object with other semantics. this sample code shows a protocol based on the operational sketch figure that checks whether the receiver of the tuple is part of the blue team. This is attached to the tuple by means of the ''tuple:withPropagationProtocol:'' operation which is then injected into the network. The ''inject:'' operation returns a publication object which understands two methods:  
 + 
 + 
 +<code> 
 +// cancels the propagation of the tuple to new devices in the TOTAM network. 
 +publication.cancel(); 
 +// sends an antituple to notify the removal of this tuple in devices which carry a copy. 
 +publication.retract(); 
 +</code> 
 + 
 +Upon a ''cancel'' operation, TOTAM stops the injection of the tuple into newly discovered devices in the TOTAM network.  
 +Upon a ''retract'' operation, TOTAM injects in the TOTAM network an antituple for the removed tuple. For every tuple, there is (conceptually) a unique antituple with the same format and content, but with a different sign. All tuples injected by an application have a positive sign while their antituples have a negative sign. Whenever a tuple and its antituple are stored in the same tuple space, they immediately annihilate one another, i.e. they both get removed from the tuple space. By means of antituples, TOTAM can “unsend” tuples injected into the network. 
 + 
 + 
 +<note> 
 +Note that ''retract'' is meant to be used by the creator of a tuple to stop the propagation of a tuple and remove it from the network. This is useful in cases that tuples injected carry outdate information. However, this operation should **not** be confused with the ''when:in:'' operation which allows applications to read and remove a tuple matching a template from the TOTAM network.  
 +</note> 
 + 
 + 
 + 
 + 
 + 
 + 
 +===== Further Reading =====
  
-TOTA could be combined with the RETE engine we built for the characteristic functionsin the future to reason about multiple tuples+**TOTAM: Scoped Tuples for the Ambient**C. Scholliers, E. Gonzalez Boix, W. De Meuter. Proceedings of the Second International DisCoTec Workshop on Context-aware Adaptation Mechanisms for Pervasive and Ubiquitous Services (CAMPUS 2009), from Electronic Communications of the EASST, eds. 2009.  
 +([[ http://prog.vub.ac.be/Publications/2009/vub-prog-tr-09-07.pdf | pdf]])
  
-decideSleep() is there for discontinuous decidePropagation functions. for example, tuples that should be only propagated every Tuesday could not implemented with TOTA because the propagation protocol only gets called once. We change this by providing decideSleep() that gets called when you decide not to propagate. Like this a tuple can still be propagate at a later point in time, despite the fact that the decidePropagation function has evaluated to false at a certain moment.+<note>The paper above and this webpage may have slightly differ in the syntax for TOTAM. This webpage has been updated to fit the current implementation of TOTAM. 
 +</note>
uf/totam.1287584787.txt.gz · Last modified: 2010/10/20 16:28 (external edit)