270 likes | 409 Views
Applying Design Patterns to Wireless Sensor Network. References. [1] S.O. Amin and C.S. Hong, “On Design Patterns for Sensor Networks,” The 27TH KIPS Spring Conference , 2007.
E N D
Applying Design Patterns to Wireless Sensor Network AmirKabir University of Technology, Department of Computer Engineering & Information Technology Advanced design pattern Course Fall 2010
References [1] S.O. Amin and C.S. Hong, “On Design Patterns for Sensor Networks,” The 27TH KIPS Spring Conference, 2007. [2] K. Tei, Y. Fukazawa, and S. Honiden, “Applying design patterns to wireless sensor network programming,” Computer Communications and Networks, 2007. ICCCN 2007. Proceedings of 16th International Conference on, 2007, pp. 1099–1104. AmirKabir University of Technology, Department of Computer Engineering & Information Technology Advanced design pattern Course Fall 2010
Apply Design Patterns of other Domains in Sensor Networks • sensor representation • ‘Object’ of OOP • sensing the environment and responding it • ‘methods’ of an object • Sensor states • ‘attributes’ of an OOP object • Modeling sensors as an OOP objects • Enhancement in the management of sensor networks • good sensor network design AmirKabir University of Technology, Department of Computer Engineering & Information Technology Advanced design pattern Course Fall 2010
Apply Design Patterns of other Domains in Sensor Networks • Design patterns for Sensor Networks: • Mediator • Façade • Chain of responsibility • Watchdog AmirKabir University of Technology, Department of Computer Engineering & Information Technology Advanced design pattern Course Fall 2010
Mediator in WSN • Intent • Encapsulates objects interactions • Promotes loose coupling • Lets you vary their interaction independently • Decouples many peers AmirKabir University of Technology, Department of Computer Engineering & Information Technology Advanced design pattern Course Fall 2010
Mediator in WSN • Motivation • Multi agent system • Agent decomposition to enhance reusability • Distribution of behavior results in many interconnections • Solution is encapsulating collective behavior in a separate mediator module AmirKabir University of Technology, Department of Computer Engineering & Information Technology Advanced design pattern Course Fall 2010
Mediator in WSN • Motivation (example) • in smart ubiquitous environment, mediator contains the control logic • adding a new smart appliance requires only modification of the mediator • decouples all the appliances within the system from each other AmirKabir University of Technology, Department of Computer Engineering & Information Technology Advanced design pattern Course Fall 2010
Mediator in WSN • Structure AmirKabir University of Technology, Department of Computer Engineering & Information Technology Advanced design pattern Course Fall 2010
Mediator in WSN • Applicability • When a set of modules communicate in well-defined but complex ways • When it is difficult to reuse a module because it refers to and communicates with many other modules. AmirKabir University of Technology, Department of Computer Engineering & Information Technology Advanced design pattern Course Fall 2010
Mediator in WSN • Consequences • vary and reuse Colleague and Mediator independently • Simplifies the maintenance of the system • New functionality can be added at mediator without affecting colleagues • Simplifies the communication protocol • Mediator can become overly complex AmirKabir University of Technology, Department of Computer Engineering & Information Technology Advanced design pattern Course Fall 2010
Few more Patterns at a glance • Façade • makes subsystem easier to use • Provides simplified view to its users • For example in smart ubiquitous environment, as soon as house owner puts his keychain on Smart key stand many related work such as turning on the lights, switching on the answering machine and so on, can be started as a sub layer. AmirKabir University of Technology, Department of Computer Engineering & Information Technology Advanced design pattern Course Fall 2010
Few more Patterns at a glance • Chain of responsibility • User wants to detect some activity • If one sensor has not detected any action, it can ask the next sensor • Each sensor that detect the activity, it can respond • a vehicle may contain multiple sensors that can accomplish a given task • Provides a way for the sensor to be selectable AmirKabir University of Technology, Department of Computer Engineering & Information Technology Advanced design pattern Course Fall 2010
Applying Design Patterns to Wireless Sensor Network Programming K. Tei, Y. Fukazawa, and S. Honiden, “Applying design patterns to wireless sensor network programming,” Computer Communications and Networks, 2007. ICCCN 2007. Proceedings of 16th International Conference on, 2007, pp. 1099–1104. AmirKabir University of Technology, Department of Computer Engineering & Information Technology Advanced design pattern Course Fall 2010
Applying Design Patterns to Wireless Sensor Network Programming Middleware for WSN abstracts a network as an entity and hides programming difficulties from programmers. Step 1: discuss major middleware languages and compare the capabilities of their primitives. Step 2: extract design patterns from the representative middlewares to cover the missing capabilities identified in the comparison. Step 3: Apply this extract design patterns. AmirKabir University of Technology, Department of Computer Engineering & Information Technology Advanced design pattern Course Fall 2010
Applying Design Patterns to Wireless Sensor Network Programming • Various middlewares have been proposed by reseachers in the WSN community. • Each middleware has different advantages and disadvantages in terms of : • energy efficiency • robustness • number of tasks which a sensor node can hold simultaneously. • Due to the diversity, a WSN administrator can select a middleware best suited for his or her the WSN. AmirKabir University of Technology, Department of Computer Engineering & Information Technology Advanced design pattern Course Fall 2010
Applying Design Patterns to Wireless Sensor Network Programming MIDDLEWARES FOR WSN • TinyDB • EnviroTrack AmirKabir University of Technology, Department of Computer Engineering & Information Technology Advanced design pattern Course Fall 2010
Applying Design Patterns to Wireless Sensor Network Programming The three kinds of tasks are : • Nest • Offline Delivery • Tracking AmirKabir University of Technology, Department of Computer Engineering & Information Technology Advanced design pattern Course Fall 2010
Applying Design Patterns to Wireless Sensor Network Programming • Type of Pattern: • In-network Result Sharing Pattern • Out-network Result Sharing Pattern • In-network Data Repository Pattern • In-network Tracking Pattern • In-network Result Sharing Pattern Nest Task Offline Delivery Task Tracking Task AmirKabir University of Technology, Department of Computer Engineering & Information Technology Advanced design pattern Course Fall 2010
Applying Design Patterns to Wireless Sensor Network Programming Extracting Design Patterns • A pattern consists of the six essential elements: AmirKabir University of Technology, Department of Computer Engineering & Information Technology Advanced design pattern Course Fall 2010
In-network Result Sharing Pattern Design Patterns for Nest • name it the In-network Result Sharing Pattern. AmirKabir University of Technology, Department of Computer Engineering & Information Technology Advanced design pattern Course Fall 2010
In-network Result Sharing Pattern • Tasks can share their results through the in-network data repository • The sub-tasks store their results in the data repository • The main task loads the results from it to execute its own task • This pattern uses an in-network data repository, which is maintained at each sensor node AmirKabir University of Technology, Department of Computer Engineering & Information Technology Advanced design pattern Course Fall 2010
In-network Result Sharing Pattern • Sequence of the In-network Result Sharing Pattern AmirKabir University of Technology, Department of Computer Engineering & Information Technology Advanced design pattern Course Fall 2010
In-network Result Sharing Pattern • Related pattern • The In-network Result Sharing Pattern is strongly related to the In-network Data Repository Pattern • A variation of the In-network Result Sharing Pattern can be conceived, i.e., the Out-network Result Sharing Pattern. AmirKabir University of Technology, Department of Computer Engineering & Information Technology Advanced design pattern Course Fall 2010
Applying Design Patterns • Applying the In-network Result Sharing Pattern • Consider the case that a main task uses a result of a sub-task. • The sub-task is described as follows. AmirKabir University of Technology, Department of Computer Engineering & Information Technology Advanced design pattern Course Fall 2010
Applying Design Patterns • Informally, the main task is described as follows. • Modify the sub-task to store its result in a buffer as follows. AmirKabir University of Technology, Department of Computer Engineering & Information Technology Advanced design pattern Course Fall 2010
Applying Design Patterns • Modify the main task to retrieve a result of the sub-task from the buffer, as follows. • The main task is formal, and can use the result of the sub-task. With this conversion, Nest can be described in TinyDB. AmirKabir University of Technology, Department of Computer Engineering & Information Technology Advanced design pattern Course Fall 2010