1 Abstract—Advances in device miniaturization and wireless technologies are stimulating novel kinds of networks (Mobile Ad hoc NETworks - MANET) capable of autonomous peer-to-peer organization without the need of a statically deployed support infrastructure. MANET are specifically characterized by high mobility of network nodes and frequent changes of direct visibility. High dynamicity affects the design and implementation of distributed applications by significantly increasing their complexity, to consider not only routing and node configuration issues, but also the possible mobility of software components and the loss of direct connectivity during service provisioning. The paper proposes a highly dynamic and flexible middleware to support service continuity over MANET, i.e., to enable the continuous provisioning of a service, based on the client/server model of interaction, even if clients/servers move at runtime. The middleware is based on application-transparent proxies that act as decoupling intermediaries between the moving clients and servers. The proxy role is assigned dynamically in a completely decentralized way. Proxies exploit code mobility to install only when and where needed. The paper aims to show how the middleware facilitates the development of applications with service continuity, by describing the design and implementation of a file transfer case study. First experimental results demonstrate the feasibility and effectiveness of our approach at the application level and point out the suitability of mobile code programming paradigms in highly dynamic MANET environments. Index Terms—Middleware, Mobile Ad Hoc Networks, Mobile Code, Proxy, Service Continuity. I. INTRODUCTION IRELESS systems have recently become more and more popular, mainly because of their offered capability of supporting continuous mobility while accessing services. The spreading of wireless solutions is significantly changing also the way to conceive and design distributed services. On the one hand, the new features introduced by the Manuscript received May 14, 2003. P. Bellavista is with the Dipartimento di Elettronica, Informatica e Sistemistica (DEIS), Bologna, IT (phone: 039-0512093866; fax: 039- 0512093073; e-mail: pbellavista@deis.unibo.it ). A. Corradi is with the Dipartimento di Elettronica, Informatica e Sistemistica (DEIS), Bologna, IT (e-mail: acorradi@deis.unibo.it ). E. Magistretti collaborates with the Dipartimento di Elettronica, Informatica e Sistemistica (DEIS), Bologna, IT (e-mail: emagistretti@deis.unibo.it ). wireless network infrastructure suggest application developers to create location-aware services [1]. On the other hand, the necessity of rapid, flexible and temporary connections between heterogeneous wireless devices is motivating the research for Mobile Ad hoc Networks (MANET). Any node in a MANET can move at any time; therefore, topological variations force the continuous reorganization of the network, which must occur in an autonomous, spontaneous and transparent way [2]. MANET are capable of operating without infrastructure support, because each node is autonomous and can collaborate with the others to enable information delivery. Designing and implementing distributed applications for MANET is significantly more complex than for traditional fixed network environments. In particular, MANET high dynamicity forces service developers to face both issues introduced by the novel network properties: infrastructure lack and terminal mobility. Because of these two characteristics, even the client/server model should be reexamined in the MANET deployment scenario. In fact, the infrastructure lack requires reconsidering issues such as routing, loss of connectivity, and connection reliability, typically delegated and (at least partially) solved by the network infrastructure. In addition, frequent terminal mobility requires clients to perform continuous discovery operations to update the list of devices/services in network visibility, and to operate the needed client-to-server rebinding accordingly. Let us note that most available solutions for device/service discovery are based on a quite static infrastructure, for instance of lookup servers hosted in fixed network nodes, and are not designed to deal with the usual movement of clients/servers during both service discovery and provisioning. Given above the motivations, we have designed and implemented a highly dynamic and flexible middleware to support service continuity over MANET. The middleware should enable the same continuous service provisioning provided by the traditional client/server model of interaction, even for mobile clients/server. The middleware operates at the application level, to achieve high flexibility and full portability over different MANET implementation solutions, from heterogeneous wireless connectivity technologies (IEEE 802.11, Bluetooth, …) to different multi-hop routing protocols. The paper claims that the application level is the most suitable one to provide flexible solutions to crucial mobility issues, such as security and interoperability; application-level middlewares can relevantly benefit from the availability of standard mechanisms, solutions, and tools at Proxy-based Middleware for Service Continuity in Mobile Ad Hoc Networks Paolo Bellavista, Antonio Corradi, Eugenio Magistretti W