1558-1748 (c) 2019 IEEE. Personal use is permitted, but republication/redistribution requires IEEE permission. See http://www.ieee.org/publications_standards/publications/rights/index.html for more information. This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI 10.1109/JSEN.2019.2930589, IEEE Sensors Journal JOURNAL OF L A T E X CLASS FILES, VOL. 14, NO. 8, AUGUST 2015 1 ADSDA: Adaptive Distributed Service Discovery Algorithm for Internet of Things based Mobile Wireless Sensor Networks Walid Osamy a,d , Ahmed M. Khedr b,c , and Ahmed Salim c,d a Computer Science Department, Faculty of Computers and Informatics, Benha University, Benha, Egypt.(walid.osamy@fci.bu.edu.eg) b Computer Science Dept., University of Sharjah, Sharjah 27272, UAE. (akhedr@sharjah.ac.ae) c Mathematics Dept., Zagazig University, Zagazig, Egypt. (amkhedr,a.salim@zu.edu.eg) d Qassim University, Buridah, Saudi Arabia. (w.elsherif, a.salem@qu.edu.sa) Abstract—Emerging technologies and applications in the In- ternet of Things (IoT) domain require highly dynamic sensor network infrastructure. Discovering service available on such dynamic networks is a fundamental but challenging problem that needs to be addressed. In this paper, we present a new adaptive distributed service discovery algorithm (ADSDA) that allows service discovery (SD) and selection of services for IoT based highly dynamic sensor network environments. The proposed lightweight context-aware service discovery architecture provides an effective infrastructure to facilitate environment-aware and user-centric SD. The performance of the proposed ADSDA is analyzed through extensive simulation. The evaluation and comparison of results with the existing baseline approaches prove the effectiveness of our proposed ADSDA in terms of query success rate, number of transmission messages and transmission cost per query. Index Terms—Internet of Things, Mobile Wireless Sensor Network, Service Discovery Protocol, Location-based Services, Success rate, Transmission messages, Cost per query. I. I NTRODUCTION Emerging applications such as IoT and location-based ser- vices (LBS) are receiving considerable attention from research and industry sectors [1]–[3]. Presently, WSNs are one of the essential enablers for IoT applications which decrease the delay time of SD. Mobile WSN as it is, hold many restrictions such as fast topology change, limited memory size, energy constraint and low computation speed, that hinders the design of efficient management protocols for WSNs as well as the integration of WSN into IoT [2], [4]. IoT paradigm depends on the discovery and utilization of a large number of diverse internet connected physical and virtual objects, it paves the way for new innovations that will create a new kind of interaction between things and humans, enabling services to improve the quality of life and resources utilization [5]. The low-powered, miniature sized, inexpensive WSN sen- sors and components makes it convenient to integrate even smaller objects installed in any type of surrounding envi- ronment into IoT. Integration of these objects into IoT will be a major evolution of WSNs, leading to an unpredictable benefits in several areas, including manufacturing, smart cities, crop management, logistics, trade, retail, and green/sustainable applications, as well as in other sectors [6]–[8]. The implementation of IoT in different daily life aspects of citizens creates the Smart City vision that supports multiuser access on a multi-application platform, where each individual thing is part of a metropolitan network of things, that con- tribute significantly on improving the life quality of people [9], [10]. The applications of real-time IoT analytics, that deliver optimized IoT services through control instructions, performance enhancement of IoT applications or innovative IoT business services by analyzing the massively collected IoT data using related analytics, are becoming more important in various domains such as smart home/city, industrial IoT, dis- aster management, smart grid, healthcare, and transportation [11]. Mobile WSNs (MWSNs) form the backbone of these emerging applications e.g., [12], where the functionalities of the sensor nodes are encapsulated as real-world services that can be discovered based on some lookup mechanism. This look up mechanism for locating services in the network is referred to as a service discovery protocol (SDP). Essentially, an SDP is a network protocol that plays a key role in wired and wireless networks by enabling interested entities to discover specific services of interest offered by the service-oriented infrastructure. The need for efficient SDPs for emerging applications have increasingly become apparent [13], [14]. Although SDP is a core middleware for wide-scale adoption in IoT, the development of an efficient SDP for dynamic WSN-based service provisioning infrastructures is a challenge. Many of the emerging applications require sensor node mobility [15], leading to a highly dynamic environment that in turn calls for stateless and scalable SDP that are able to cope with network dynamics. Although SDPs for emerging applications play an important role in WSNs [13], current SDPs such as [16]–[21] are mainly developed for Mobile Ad-hoc Network (MANET) making them more resource intensive to be applied directly to dynamic WSNs [22]. Moreover, existing SD solutions do not consider characteristics of the mobile WSN environments, and thereby