## 1 Introduction  
Advances in wireless networking have set new paradigms in computing, including pervasive computing based on a large-scale wireless sensor network. A wireless sensor network, a type of _ad hoc_ network (MANets), is designed to be an infrastructure-less, unattended, and rapidly-deployable network. A fundamental issue in wireless sensor network environments is the efficient location of the required service in the network. The service location protocol is imperative to the design of a wireless sensor network because each network node lacks prior knowledge of the service available in the network [1-7].  
Service location in wireless sensor networks is a challenging problem for several reasons. First, due to a lack of infrastructure, there are no well-known servers in a pre-defined network structure. Second, energy scarcity in a network node in a wireless network necessitates the design of new service location protocols that are qualitatively different from those designed for the wired network. Third, in many cases, wireless networks may scale up to thousands of nodes, rendering the location problem even more challenging [8-20].  
In pervasive computing, users receive information regarding the environment in real-time; therefore, the sensor network, which is the foundation of pervasive computing, should enable real-time access. In particular, service information is very time critical in pervasive computing; therefore, the service location protocol for the wireless sensor network should provide high accessibility to service information [21-23]. The easiest way to provide high accessibility is to periodically broadcast (flood) service information to the entire network. This method entails major energy consumption, but it is simple and some protocols use this approach.  
To reduce the overhead associated with broadcasting, some protocols restrict the flooding area by forwarding packets in a specific direction, as cross shape or restricted regions. These schemes could reduce the broadcasting overhead but still require unnecessary replications if the service information is not popular. Load scalability is the ease with which a distributed system can expand and contract its resource pool to accommodate heavier or lighter loads; it is the ease with which a system or component can be modified, added, or removed to accommodate a changing load. Service location protocols should rapidly provide service information with a large number of users. Therefore, load scalability is an important metric for a service location protocol [24-40].  
In this paper, we propose an adaptive square-shaped trajectory (ASST)-based service location method, which is a novel self-configuring, scalable, energy efficient, and robust service location protocol. ASST is based on Geographic Hash Table (GHT) and Trajectory Based Forwarding (TBF). GHT maps the geographic position of a sensor network field to a hash table. In GHT, the sensor node closest to the position where is computed by hash function is responsible for a set of key and data [6,8,9,11]. ASST stores service information in groups of sensor nodes, called a trajectory. A node wishing to publish (advertise) service information obtains a position through the hash function, and it then uses geographic-aided routing such as GPSR (Greedy Perimeter Stateless Routing) to store service information to the trajectory surrounding the hashed position, as in GHT [6,7]. ASST uses TBF to form a trajectory storing the service information. Replication between nodes in the trajectory reduces the network load on a node because queries from users are distributed to several nodes in the trajectory. To further distribute the network load, ASST adjusts the range and size of the trajectory in proportion to the frequency of user queries. In the next section, we review related work. Section 3 describes ASST, and Section 4 provides performance evaluation. We conclude the paper in Section 5.