CoSP2P: A Component-Based Service Model for Peer-to-Peer Systems C´ andido Alcaide, Manuel D´ ıaz, Luis Llopis, Antonio M´ arquez, Bartolom´ e Rubio and Enrique Soler Abstract— The increasing complexity of software development based on peer to peer networks makes necessary the creation of new frameworks in order to simplify the developer’s task. Additionally, some applications, e.g. fire detection or security alarms may require real-time constraints and the high level definition of these features eases the application development. In this paper, a service model based on a component model with real-time features is proposed. The high-level model will abstract developers from implementation tasks, such as discovery, communication, security or real-time requirements. The model is oriented to deploy services on small mobile devices, such as sensors, mobile phones and PDAs, where the computation is light-weight. Services can be composed among them by means of the port concept to form complex ad-hoc systems and their implementation is carried out using a component language called UM-RTCOM. In order to apply our proposals a fire detection application is described. Keywords— Peer-to-peer, mobile systems, real-time, Service- Oriented Architecture. I. I NTRODUCTION P EER-TO-PEER (P2P) systems [1] represent a new chal- lenge in the development of software for distributed systems and an interesting alternative to centralized and client- servers models. Each node in the P2P network is symmetrical and the mechanisms of communications are based on dynamic ad- hoc networks among peers. The P2P approach can be ported to mobile systems, which are composed of a set of nodes intended to cooperate, while they are entering/leaving the net- work continuously. Some mixed approaches keep a minimum part of the infrastructure and central control, but our proposal is focussed on pure ad-hoc systems. Examples of this type of system are the sensor networks [2], consisting of spatially distributed autonomous devices using sensors to cooperatively monitor physical or environmental conditions; and MANET (Mobile Ad-hoc NETworks) [3], a self-configuring network of mobile devices such as PDAs and mobile phones connected by wireless links. Due to the increasing complexity of the development of applications based on the P2P architecture, new high level programming models are necessary in order to simplify the developer’s task. This paper presents a component-based ser- vice model to enable developers to specify p2p applications. This work is supported by the EU funded project FP6 IST-5-033563 and the Spanish project TIN2005-09405-C02-01. C. Alcaide, M. D´ ıaz, L. Llopis, A. M´ arquez, B. Rubio and E. Soler are with the Department of Languages and Computer Science, M´ alaga University, 29071, Spain. C. Alcaide is the corresponding author to provide phone: +34 952 137147; fax: +34 952 131397. Authors e-mail: {calcaide, mdr, luisll, amarquez, tolo, esc}@lcc.uma.es. The model allows us to define the services that peers can provide or require in the network. The access points to the peer services are the ports which define the commands and events that other peers require. P2P applications may need to define real-time requirements, for example, the establishment of a priority order to attend service queries. In this sense, the model allows us to include real-time constraints in the ports, that is, developers can assign characteristics such as service periods, priorities or deadlines to commands and events. This way, two services could be required simultaneously in the peer and priority would establish a ordered delivery. Additionally, the period would allow us to receive events without carrying out the invocation. The proposed model is platform independent and tools can be defined in order to map the specification to the necessary implementation, for example using Windows P2P Networking [4] on Windows platforms or JXTA [5] on Java platforms. The service implementation is carried out using the component based paradigm by means of the component language UM-RTCOM [6]. It proposes a distributed model based on light-weight component composition with real-time features. The UM-RTCOM specification is also platform in- dependent and includes the possibility of defining real-time requirements. The Service-Oriented Architecture (SOA) has been success- fully applied in a lot of infrastructure-based and client-server model based distributed systems, being Web Services the best known standard [7]. Recently, some work based on the SOA paradigm oriented to P2P systems has appeared. The following list shows some related work. They mainly differ from our approach because either they do not provide a high level abstraction model that facilities the application programmer task or they are focused on infrastructure based systems: • The JXTA plaform, is a set of simple, open source P2P protocols that enable any device in the network to com- municate, collaborate, and share resources. It is a useful tool for implementing P2P systems but can be difficult to apply in complex systems without an abstraction model. It is a good platform to support a service model. • JMobiPeer [8], developed in the University of Cata- nia, proposes an alternative to JXTA more oriented to MANETs. It tries to solve the faults existing in the JXME version of JXTA at the time of development. However, it does not offer an abstraction model. • DeEvolve [9] approaches the problem giving a flexible notation for the composition of services including the handling of exceptions such as failure of peers. It is based on JXTA and offers an exception handling mechanism to World Academy of Science, Engineering and Technology 27 2007 77