Pervasive computing environments consist of many independent collaborating electronic devices, including sensors and actuators. Ad-Hoc extendibility of such systems is desirable but the current network technologies use the concept of a central coordinator device in the network or define application profiles which are not easy to extend and maintain. The distributed architecture proposed in this paper allows these devices to organize themselves automatically to execute some pervasive system application without the intervention of a central controlling device. The knowledge that defines interactions between these devices is derived from an ontological model of a particular domain. This knowledge is distributed over the devices such that every...