An Evaluation of Mobility Effect on Tiny Service Discovery Protocol for Wireless Sensor Networks

In mobile sensors environment, nodes change their positions this leads to crucially affects service discovery of wireless sensor networks (WSNs). There for the accuracy of most service discovery can be limited to just small area of movement, or demands considerable maintenance efforts in term of neighbornodesallocation. A large waiting time of wireless sensor applications spent in node discovery, as nodes need to periodically advertise their presence and be awake to discover other nodes for services. The optimization of waiting time, which is generally a hard task in static wireless sensor network s, is even harder in mobile wireless sensor networks, where the neighboring nodes also change over time. In this paper, the effect of node mobility on the performance of Tiny Service Discovery Protocol (TinySDP)in WSNs has been analyzed. In order to measure and evaluate the performance of TinySDP in mobileWSNs (MWSN), three major metrics of evaluation has been considered such as, Success ratio, Number oftransmitted messages and Average waiting time. Simulation results show that the success ratio and average waiting time of TinySDP in mobile WSNs decreased and the number of transmitted message increased. Gossip-based discovery [11] is a service discovery protocol for mobile ad-hoc networks. The device collects information about the services on the net, listen to each service announcement, and the demand and responsemessages in the network. Service Registry on any device of local services as well as service s that can bestored by other vendors. Pervasive Discovery Protocol (PDP) [12] concentrates on service discovery in ad-hocnetworks, where mobile devices communicate via wireless links without any fixed infrastructure. It is a fully distributed protocol that uses both push and pull techniques. In PDP, a device announces its service only when other devices request the services. The services in the PDP messages are de fined using a URL scheme similar to the one used in the Service Location Protocol (SLP) [8] and transmitted using UDP or TCP. This introduces too much overhead to implement these protocols on wireless sensor nodes. The simple discoveryof services in terms of service name resolutions mechanism presented based on a name resolution [16], studied in parallel to the normal Internet service DNS SRV discovery [38]. This allows the server IP address and the transport protocol to be used must be resolved to implement the service. The type of transportation service on behalf of the controller [37] is encoded. Demand for service discovery can use this combination without adding significant complexity network built. Tiny Service Discovery Protocol (TinySDP) [6] is alightweight protocol that allows discovery and selection of services in a network. In this paper, we focuson the components of the protocol relevant to my research and analyze TinySDP in mobile WSNs. The protocol allows services to advertise their availability and clients to browse the network, determining in which service sexist and the characteristics of those services. The network nodes need little or no static configuration for discovering services.


INTRODUCTION
The vast advancements in technology in general and in wireless communications specifically have given us the ability to mass-produce small, low-cost sensors that can connect to each other wirelessly. The sensors once deployed, whether in a random or a pre-engineered way will connect to each other and form a wireless sensor networks. WSNs are made of a large number of sensors deployed in a certain area. The sensors would transform physical data into a form that would make it easier for the user to understand. WSNs technology is growing rapidly and becoming cheaper and easier to afford, allowing different kinds of application usage of such networks. WSNs provide the right infrastructure of a large class of applications. WSNs can be used fora wide variety of applications dealing with monitoring (health environments, seismic, etc.), control (object detection and tracking), and surveillance (battlefields surveillance) [41][42][43][44][45][46][47].Recent applications, however, include Mobile Sensor Networks (MSNs) where sensor nodes move freelythroughout the network, carried by people, robots, or vehicles. The mobility of nodes has raised issues in handling dynamic link changes or mobility patterns that have not been considered in conventional sensor networks. In particular, the mobility of the nodes requires related algorithms to be stateless because link states between mobile nodes are valid for only a short duration. In addition, the underlying communication protocols in MSNs need to be scalable and robust to endure dynamic environments. Many technicalchallenges are, therefore, newly addressed in MSNs. Service discovery protocols are network protocols that allow automatic detection of devices and services offered by these devices on a computer network. Clients, the nodes that need a service, perform a discovery step, which typically initiates (limited) flooding of the network to discover nodes offering appropriate services. In some cases, clients may directly seek the needed services themselves; in others, they may contact one or more service catalogs, which maintain directories of available services. A discovery attempt generally classifies the service by type and may optionally include requirements such as a manufacturer, serial number, or other service attributes. Once the service providing node is found, it is important to ensure that the nodes canuse the services efficiently [6].Unfortunately, existing service discovery protocols (such as Service Location Protocol (SLP) [8], Jini [4],Microsoft Universal Plug and Play (UPnP) [3], DEAPspace [36], Gossip-based Discovery [11], and Pervasive Discovery Protocol (PDP) [12]) that used in MANET (Mobile Ad-hoc Network) are too resource intensive to be used in sensor networks.
A sensor node provides services consisting of the sensed information, based on the types of sensors available, along with context, such as location, which makes that information useful. Taking the unified approach, in which a node in the sensor network is viewed as providing a set of location-based services, forms the basis of new location aware service discovery frameworks specifically tailored to sensor networks. The Tiny Service Discovery Protocol (TinySDP) [6], as its name suggests, is a lightweight protocol that allows discovery and selection of services in WSN.In this paper, we analyze the TinySDP protocol with mobile WSN since adding mobility to sensor networks can significantly increase the capability of the sensor network by making it resilient to failures, reactive to events, and able to support disparate missions with a common set of sensors.The rest of the paper is organized as follows: In Section 2, we discuss background studies and related research. In Section3, will describe TinySDP and discuss mobility models. Our problem formulation is covered in Section 4. Insection 5, the experimental simulation posted in details with both network and simulation setup. In Section6, we conclude our work.

RELATED RESEARCH
C. K. Toh [35] has outlined different service discovery architectures for managing service information onMANETs. In terms of service discovery, a MANET node may act as a client (or service requestor) that wants to discover a type of service, a server (or service provider) that wants to make its services available toother MANET nodes, or a service coordinator (SC) that assists with service discovery. SCs are nodes that hold a central repository for caching service descriptions and service bindings. Existing Service DiscoveryProtocols classified into two categories: The commercial scientific researches protocols, which are available in large scales. The focus of researches has been recently on enhancing efficiency and scalability of the existing protocols. Some protocols use peer-to-peer distributed hash table, which can prolonged at least based ona network of city such as in INS/Twine [32] and Superstring [26]. Simple Service Discovery Protocol (SSDP) [3], Toh [35], Jini [4], Service Location Protocol (SLP) [8] are not working properly in all networks. They usually begin with a predetermined network. Toh [35] suggests different service discoveryarchitectures to manage service information on adhoc networks for example, semi-centralized architecture is fully distributed and hybrid. SSDP provides a mechanism for HTTP clients and HTTP resources to discover each other in a local area network. It is used in Microsoft UPnP (Universal Plug and Play) [3] support plug and play to add a service that diabetes under the computers running Windows operating system.
UPnP devices are fully transparent and have standard connection technology and peer-to-peer discovery and configuration. UPnP specification, the Microsoft implementation and sample source code available atWinHEC [3]. Jini is a service discovery technology based on Java [4]. In Jini, lookup services provide catalogs of available services to clients. Up on initialization, Jini services register their availability by uploading proxy objects to one or more of these lookup services. Once a client has contacted a lookup service, it can search for interesting services and then download the corresponding service proxy objects. However, Jini'sdependability on Java makes it unsuitable for sensor networks Service Location Protocol (SLP) [8] is the automatic detection of resources in networks to Internet Protocol. SLP is an independent protocol language. Thus, protocol specification can be implemented in any language, which is based on the detection mechanism of service attributes that rely on different ways of describing the service. SLP infrastructure consists of three types of agents. DEAPspace [36] is a decentralized discovery algorithm targeted at wireless ad-hoc single-hop networks. It uses a pure push-based approach for service discovery. The time is slotted into intervals and service information is broadcast during these intervals. The broadcasts are single-hop and are not transmitted beyond the local transmission range of the device in question. This is not suitable for wireless sensor networks. N o v e m b e r 0 6 , 2 0 1 4 Gossip-based discovery [11] is a service discovery protocol for mobile ad-hoc networks. The device collects information about the services on the net, listen to each service announcement, and the demand and responsemessages in the network. Service Registry on any device of local services as well as service s that can bestored by other vendors. Pervasive Discovery Protocol (PDP) [12] concentrates on service discovery in ad-hocnetworks, where mobile devices communicate via wireless links without any fixed infrastructure. It is a fully distributed protocol that uses both push and pull techniques. In PDP, a device announces its service only when other devices request the services. The services in the PDP messages are de fined using a URL scheme similar to the one used in the Service Location Protocol (SLP) [8] and transmitted using UDP or TCP. This introduces too much overhead to implement these protocols on wireless sensor nodes. The simple discoveryof services in terms of service name resolutions mechanism presented based on a name resolution [16], studied in parallel to the normal Internet service DNS SRV discovery [38]. This allows the server IP address and the transport protocol to be used must be resolved to implement the service. The type of transportation service on behalf of the controller [37] is encoded. Demand for service discovery can use this combination without adding significant complexity network built. Tiny Service Discovery Protocol (TinySDP) [6] is alightweight protocol that allows discovery and selection of services in a network. In this paper, we focuson the components of the protocol relevant to my research and analyze TinySDP in mobile WSNs. The protocol allows services to advertise their availability and clients to browse the network, determining in which service sexist and the characteristics of those services. The network nodes need little or no static configuration for discovering services.

Description of TinySDP
The Tiny Service Discovery Protocol is a lightweight protocol that allows discovery and selection of services in a network [6]. The protocol supports a framework by which clients (or users) needing a service are able to contact those services (see Figure1). The clients are other sensor nodes or mobile devices like PDAs, laptops, etc. The protocol uses a distributed approach in which information is cache in the network rather than in some central server. Any advertisements or requests are sending to the network rather than to a particular node acting as a server. The process of advertising messages distributes the data in the network, increasing its access, thus making it possible to find the data quickly. When the service request reaches a node that has service information in its cache, it forwards the request to the node that provides the service. The service provider then replies directly to the client.
The TinySDP defines a packet size of 29bytes. We have a 15byte application header and 14 bytes of datain our packet. As depicted (see Figure 2), the protocol header carries the basic information about the packet. The packet type specifies whether the packet is an advertisement, request, reply, or acknowledgement. Withan 8-bit field, we can define 256 different packet types. The 16-bit service type field specifies the service whose information the packet is carrying. However, some standardization of the service values is required to ensure that a particular value means the same service to all the nodes. For instance, if we define value310 for temperature then this value will remain the same for every application. Some of these values are for defining standardized service types, leaving the rest for applicationspecific services. For generic message exchanges not concerning any specific service, the protocol requires a service type of zero. Every packet has a hop count (the time-to-live field). When hop count reaches zero, the packet discarded. Limiting the lifetime of a packet using the hop count prevents old packets from moving around in the network. Services grouped together using scopes. A scope is a set of sensors making up an administrative group. It can indicate a group of nodes within a particular location, within an administrative domain, or grouped by some other category. For instance, we may N o v e m b e r 0 6 , 2 0 1 4 want to control the rights of nodes by allowing them access to services on some nodes and not on others. If we want a node to look for services in all domains, we use ascope of zero.

Advertisement of Messages Approaches
To advertise to dedicated nodes that stores a list of all services in the network. However, this scheme has a downside. These servers/directories will need to be equipped with extra resources (power, storage, computation capability) if it works properly for a long time and not to become a bottleneck in the network.For scalability and generality, the assumption of using a central server avoided.

Route Resolution
TinySDP requires a multi-hop routing protocol by making a few assumptions while routing the packets. All nodes know their location relative to the coordinate system [5], the nodes know their neighbors [9], they have a sense of directionality [29] and the source site can find the coordinates of the destinationnode with the location service [20], [34]. The implementation uses the Trajectory Based Forwarding (TBF) [19], (see Figure 3), as a routing protocol. It is a hybrid based on source routing and forwardingCartesian [38].

Service Resolution
Let us now look at the request process. As already mentioned, the client sends out a service request alonga particular path toward the edge s of the network. When a no de receives a service request packet, it checks whether it provides the service or not. There are two variants depending on whether or not it does: 1. If it provides the service, it sends back to service reply to the source/client. If he cannot meet the client requirements completely, then it forwards the service request along its trajectory, but also offers to provide limited service.
For example, if a client is looking for a specific color printer of resolution, it sends a service request specifying these parameters. A node in the network that receives this request can provide a black-and-white printout with the same resolution. This node can forward the service request further, and then itsends back a reply to the client offering its services.

2.
If it does not provide a service, it checks whether it is advertising the service in its cache. Again, there are two possibilities: If it has an entry in the cache, it forwards the service request to the service provider.
If it does not have the cache entry, it checks whether the packet meant for itself. If the packet was destined for the local node, indicating this is the last node along the pathof the request, it sends a negative acknowledgment to the source node. If the packet not meant for the local node, then it forwards the packet along its trajectory.

Data Structures
All nodes store some basic information, including information about nodes services, its neighbors, and advertisements received from other nodes. We have included only the most essential information in the cache entries. Every node uses three data structures for storing information. Two additional tables are required for use with RPC in service discovery: an RPC client table and an RPC server table.

Mobility Models
The Random Waypoint model, which is a very simple mobility model, has been presented in [7] based on pause time between changing direction/speed. Background a random point in the simulation area with a uniformly distributed speed between [minSpeed, maxSpeed]. After arriving to the destination again waits for the same period of time (pausetime) before moving to a new place. In [1] and [18], there are common problems with simulation studies using Random N o v e m b e r 0 6 , 2 0 1 4 Waypoint model due to poor choice of velocity distribution, uniform distribution. If minSpeed is zero, such velocity distribution leads to a situation where average speed approaches zero and at the stationary state each node stops moving. Random Direction and walk nodes change their speed/direction every time slot. In this model, new direction from is chosen randomly between (0, 2 ).The speed chosen from uniform (or Gaussian) distribution. In this model node reaches boundary it bounces back with ( -). The following figure described about the movement behavior of anode in random waypoint mobility model (see Figure 4).

Random Waypoint
It is a real need for developing a deeper understanding of mobility models and their impact on Tiny Service Discovery protocol (TinySDP) performance. The movement pattern of mobile wireless sensor nodesis described by mobility model. The mobility model describes the pattern of movement, location, velocityand acceleration over time. Since mobility patterns may play a significant role in determining the TinySDPperformance, it is desirable for mobility models to emulate the movement pattern of targeted real life applications in a reasonable way. Thus, when evaluating TinySDP, it is necessary to choose the proper underlyingmobility model. It is not appropriate to evaluate the applications where nodes tend to move together usingRandom Waypoint model (RWPM) [7] or whatever else. The Random Waypoint model and its variantsare designed to mimic the movement of mobile wireless sensor nodes in a simplified way. Because of itssimplicity of implementation and analysis, they are widely accepted.

Problem Description
Service discovery in mobile WSN is a challenging issue. The nodes in a WSN offer spontaneous and variableconnectivity. In addition, the proximity of a given service as well as the kind and the number of servicesvary unpredictably with time. The mobile nodes can also provide services that may be of interest to othermobile nodes. Therefore, there is always a need for having a mechanism that can discover and utilize servicesprovided by other devices. The service discovery techniques used for this purpose. Service Description is alsoan important aspect of a service discovery protocol as well as proper descriptions facilitate the searching of aservice. Usually these aspects are an intrinsic part of a service discovery protocol. Restriction applied to thataspect of service discovery that is concerned with finding the location of a particular service in mobile WSN.For that, our aim is to analyze the behavior of TinySDP in mobile WSNs. In order to analyze the results,we first define a few metrics [2]. We denote the total number of nodes as N. The Number of clients which successfully locate the Service as (Nsucc) and the number of Service Advertisement Messages as (Madv).The number of Service Request Messages as (Mreq) and the total number of messages sent as (Mtotal).Each successful client (C)receives message from 1 to m service reply Messages of waiting time (t1, t2, ..., tm).

Success Ratio (SR):
The ratio (Calculated as a Percentage (%)) of the number of nodes that successfully locate the service, over the total client number. It is calculated by the following equation:

Simulation Results
In this section, we discuss the simulator used for paper, the simulation environment and draw conclusions from the results. In this paper, we use TOSSIM [55], the simulator for TinyOS. All simulation had conducted with TinyOS version (1.1.11) and TOSSIM version (1.1) TOSSIM is the TinyOS simulator. TOSSIM captures network behavior at a high fidelity while scaling to thousands of nodes. TOSSIM compiles directly from TinyOS code, and is by default automatically compiled (make pc). It runs the same code that runs on sensor network hardware. TOSSIM uses very simple but surprisingly powerful abstractions for its wireless network. The network is a directed graph, in which each vertex is a node, and each edge has a bit error probability. Each node has a private piece of state representing what it hears on the radio channel. TOSSIM provides an excellent tool to study and analyze the algorithm design by providing a controlled and reproducible environment, and by enabling access to tools such as debuggers. N o v e m b e r 0 6 , 2 0 1 4

Network Setting
First, a network with 50 simulated. Then, we extended number of nodes to 100. The simulation performed in two-state experiment, 50 nodes and 100 nodes. We choose two-state experiment to study modified effect and to highlight on results. All nodes are assumed to have the same resources in terms of power and memory. There are 11 kinds of services offered in the network. We assume that all services follow a uniform distribution. We used a random topology and Random Waypoint Model for the network. We have assumed a convex dense network with MTinySDP. We use a mobile radio model; all nodes have full connectivity to their neighbors. Using a more realistic radio model that includes errors would increase the number of messages that need to be transmitted, but should not alter the relative performance of the various protocols.

Simulation Setting
Simulation has four combinations with respect to number of nodes and network mobility. First trial, weconsidered 50 nodes with TinySDP in static WSN. Second trial, we considered 50 nodes with TinySDP inmobile WSN. These two trails address the effect of mobility in small network. Third trial, we considered 100nodes with TinySDP in static WSN. Forth trial, we considered 100 nodes with TinySDP in mobile WSN.These two trails address the effect of mobility in large network. Each three minutes of the real time of anode, the node starts executing TinySDP. According to metric calculations, advertisements are sent out whenthe network. In first state we have 50 nodes in our network, a few of the service request packets get lost ifall of the 50 nodes start sending out their service request together at network startup. In second state wehave 100 nodes in our network, a large of the service request packets get lost if all of the 100 nodes. In orderto ensure that this does not happen, the nodes send out their advertisement packets only in certain slottedtime intervals each 1 minute. A timer that outputs the collected information into the screen. Simulatorshould run for a time of 100 minutes to get the best reading of sending out request packets. The parametersare listed in (Table 1).

Results Analysis and Discussion
We have to analyze and compare results of TinySDP with static WSN with results of TinySDP with mobileWSN. Since we are assuming a stationary network once and then assuming dynamic network, we compareresults with those results appeared in [6] that assume a nearly stationary and dynamic network. A side-by-side comparison of performance results is as shown in the following (Table 2) once with 50 nodes andanother with 100 nodes. The main result of our experiment has shown that the TinySDP with MWSN haslesser values in performance metrics in terms of the Total Number of Transmitted Messages (Mtotal) andSuccess Ratio (SR) and lesser values in Average Waiting Time (AWT) for discovering service is a measureof the high performance metrics of TinySDP with static WSN. In Static WSN, TinySDP has almost thesame success ratio. This indicates that number of nodes has no effect on the performance in static WSN. Inthe other side, we can see clearly that success ratio directly affected by both mobility of nodes and numberof nodes.  network, but TinySDP with MWSN sent over thatnumber of message s about 600 messages in 50 nodes network and about 1200 total message s in 100 nodesnetwork. In all cases of the both scenario of service requests, total number of messages indicates that lostmessages in WSN because of mobility. In static WSN, Success ratio in both 50 and 100 nodes network hasget high score about 98 present. In the mobile WSN, service discovery has a serious decrease, as number of nodes gets bigger. MWSN with 50 nodes scored about 60 present but with 100 nodes scored 30 present. This present of success ratio is considered very low and is not accepted for service discovery.  In Figure (8 Figure 9), the AWT of TinySDP with MWSN is much better than TinySDP with static WSN. In thecase of the number of nodes in the network less than 50 nodes. However, in the case of exceeding the numbers of the nodes of 50, in the case of TinySDP with static WSN outweigh the MWSN. Therefore, TinySDPwith MWSN, have a direct relationship to the value of the average waiting time with the numberof nodesin the network. almost fixed until number of nodes reaches large number of node. TinySDP has a strange behavior in mobile WSN with large number of nodes. By comparing all metrics first with 50 nodes then with 100 nodes, we concluded that TinySDP is not suitable forMWSN especially with large number of nodes also the step is widely changes towards TinySDP. In addition,in TinySDP with MWSN, the number of successful service discovery has a direct proportionality relationshipwith number of nodes with large number of nodes. This gives us a clear indication of performance drop inTinySDP with MWSN. The suggested modification over the TinySDP based on the principle of multiple behavioral modes of operations. TinySDP should be able to change behavior in different situations in order to improve certain metrics like reducing communication delays, improving deliverability. The suggested modification to TinySDP tackles three general aspects. First, each no de marks its mobility and sends advertisement of about it to targeted neighbor nodes. Second, the awareness of vicinity mobile neighbor nodes and network topology that allows to benefit from both the push and pull mode. Third, new mechanism for sending services advertisement that reduces case of unknown service. By tackling these three aspects, the protocol can change its behavior for the better performance. To be notices, suggested modification ofTinySDP is open to improvement.