MagEl: A Magneto-Electric Effect-Inspired Approach for Web Service Composition

Web service composition is the art of combining multiple platform independent and modular pieces of software with varied configurations, to achieve an efficient solution for a complex business process. Though, web service composition has been an important area of research in the last decade, however the issue is expected to exacerbate in the 'Future Internet', as it is expected to house billions of services, with thousands offering the same functionality. In this context, maintaining an operational and solid set of Web service configurations will be a challenging task. Moreover, a centralized solution for Web service composition in the Future Internet scenario would be another issue. In this paper, we present a technique inspired from ElectroMagnetism in physics to create an environment which facilitates the selection of a service from a set of similar services. The proposed model achieves service composition in a decentralized environment without involving a centralized orchestrator. To validate the proposed technique in-silico experiments were conducted whose results demonstrate good performance in terms of completion time and load balancing. Further, the proposed technique is validated in-house (within our Institute's Intranet and with real users) by deploying real Web services on decentralized nodes. The results obtained via simulation are verified through a prototype based on the proposed model. We present, discuss and compare the effectiveness of the proposed work in the results section.


I. INTRODUCTION
The success of Service Oriented Architecture (SOA) is driven by loose coupling, platform independence and efficient composition of distributed autonomous Web services at runtime.Utilizing these concepts, SOA is now a multipurpose paradigm, aiding business processes and helping scientific investigations based on compute-intensive applications [4].Dynamic Web service composition is a temporal collaboration of Web services that provide the illusion of having a dedicated application available for execution anytime and anywhere.The success is hugely helped by the advances in the field of cloud computing.However, this computing paradigm hugely relies on a centralized architecture for orchestrating the tasks of a workflow and hosting services.In this setup, the composition orchestrator as well as composed services are single points of failure that suffer from several problems related to security, fault tolerance and reliability.This issue is evident by the failure of Amazon in 2011, 2012 and again in 2013.Moreover, HealthCare.gov deployed on Verizon's Terremark cloud service also went down in 2013.The failure of these services highlight the weakness in a centralized architecture.
Such non-trivial issues often raises the question, "Why do organizations depend on a single data center?"1.A si s evident today, the Internet is continuously evolving towards the Future Internet, which is a "federation of service and self-aware networks that provide built-in and integrated capabilities such as: service support, contextualization, mobility, security, reliability, robustness, and self-management of communication resources and services" [1].Hence, a centralized approach towards business process execution in the Future Internet is a slippery slope.
One of the constituents of the Future Internet (FI) -Internet of Services (IoS), provides us with several interaction mechanisms that will shape how services are provided and executed in the Internet.In the Internet of Services, services are composed into advanced business processes.Further, they can interoperate with other services to support business processes spanning across organizational boundaries [5].Therefore, keeping this fact in mind one can say that service choreography is an ideal candidate.However, to realize service choreography, interaction mechanisms are required which not only facilitates the selection of a Web service by another service, but also resolves control and data dependencies that exists in a workflow.Moreover, as user centric computation is one of the visions by the semantic web, one has to keep in mind the quality of experience of a user too (Customer/user experience is a valuable asset in the service industry).
As is evident today, the service sector faces a lot of challenges.In the future, the challenges are expected to be exacerbated to a whole new level.[1] highlights some of the challenges that will be faced by the service industry of tomorrow.A brief overview is given below: 1) Service Description: Since the Future Internet will be an extremely complex environment, therefore one need to move from the traditional ways of describing services towards a more ontology based approach toward service description.2) Service Discovery: To meet the challenges of the Future Internet, a centralized approach, for e.g.UDDI, towards service discovery is undesirable.This is evident by the fact that the scalability of such a centralized approach is thoroughly tested now.Such an approach towards service discovery is not designed to nor scalable to the challenges concerning mobility, security, heterogeneity and an ultra large scale of the Future Internet.3) Service Access: The ultra large scale of the Future Internet will require a strong base in Middleware technology laid on the foundations of Cloud Computing.4) Service Composition: The success of service composition (either orchestration or choreography) is well established in both academia and industry.But as pointed out before, the search for an effective QoS, privacy and complexity-aware service composition is far from over.In the Future Internet, challenges are related to service composition design and execution.Keeping the above issues in mind, we focus on Service Composition for the Future Internet in this paper.We have adopted a nature-inspired approach to achieve service composition in a decentralized deployment framework.We propose a technique, MagEl, customized from the behavior of a charged particle travelling in an electro-magnetic field to achieve service execution and composition in a decentralized environment.We utilize the principles of 'message based service choreography' to construct a greedy model that can select and execute services efficiently.The proposed model relies on event driven architecture for parameter and information exchange (due to less load on the underlying network, hence ideal for future internet related applications).Via rigorous simulation and experimentation it is found that the proposed technique outperforms it's predecessors.As a proof of concept, Web services are deployed in the real world.Efficient service composition and selection in the real world is accomplished via the proposed methodology.We present and discuss the results concerning the proposed technique in the later sections.
The rest of the Paper is organized as follows: Section II explains the electromagnetic theory behind service composition.Results are presented in Section III.Related work is discussed in Section IV.Finally, we conclude with the future work in Section V.For the purpose of clarification, Web services are referred to as service nodes or nodes in the service domain.A level in a service domain is sometimes called a layer.

II. THE PROPOSED TECHNIQUE
In the previous works [2], [3] we have used the notion of service domain (Figure 1) to model service composition.Wada et al. states "when a service-oriented application operates, it is instantiated as a workflow instance that deploys each service in the application as one or more service instances" [6].A service domain is a decentralized deployment framework executing a workflow in a topdown manner.More specifically, a service domain is divided into a set of levels, with each level corresponding to unit functionality for the composite application.Each level is instantiated with a set of services capable of executing the specified functionality.To execute a 'workitem', only one service from a level must be selected to participate in the operational flow.The services are invoked in a top-down manner.The service domain is designed, while keeping in mind the availability of alternate services in case of a service level agreement violation.In the service domain, the services are capable of communicating and interacting with each other with-out involving a central authority.A sample service domain is shown in Figure 1 (An example of a Service Domain is available in the previous work [3]).The dotted lines denotes the coupling between two services at successive levels.Coupling is a dimensionless factor that denotes the likelihood of a service at the current level to select a service at the subsequent level.The higher the value of the coupling, the higher is the likelihood of selection.The selection of a service from a level is based on QoS attributes.In this paper, our objective is to discuss one such selection methodology.The electromagnetic force is the interaction responsible for almost every aspect of daily life2 .In the current text, we limit the discussion of electromagnetism to the behavior of charged particles only.Whenever a charged particle, e.g. an electron, moves in an electric and magnetic field it experiences an electro-magnetic force.The particle undergoes acceleration (purely electric) and experiences a deflection from the original direction of motion (electric and magnetic both).The phenomenon is explained in Figure 2. Whenever, the fields are perpendicular to each other, the particle drifts perpendicular to both the electric and magnetic fields with a fixed velocity.The particle travelling in an electromagnetic field experiences an electromagnetic force.The Lorentz's (or electromagnetic force) force experienced by a charged particle is shown in Equation (1).
where, F is the Force experienced by a charged particle, E is the Electric Field, B is the Magnetic Field, q and v are the charge and velocity of the particle respectively.In MagEl, it is assumed that the electric field is responsible for accelerating the charged particle and the magnetic field gives it an initial direction.In the proposed model, each service (or service node) offers both electric and magnetic fields, consequently each node offers an electromagnetic force to the next incoming service request.Next, we construct the definitions of electric and magnetic fields, and then show how to integrate them together to make the dynamic service selection decision.
In MagEl, the Electric Field is utilized to avoid services with a large waiting time, hence it forms one of the important parameters in our model.The Magnetic Field is responsible for providing a weighted QoS function that assists a human in the service selection process based on his/her preferences.In the proposed work, we have modeled the analogy between the physical domain and the services domain as follows: • The control flow between Web services with the charged particles, The direction of control flow due to network and service bandwidth restrictions with forces on the charge as the electric field, and The direction of control flow due to user preferences with forces on the charge as the magnetic field.We begin the discussion of the proposed technique with the defintion of the Electric Field.

A. Electric Field
In order to formulate the definition of electric field, we have used the principle of potential gradient.In classical physics, electric field is the electrical potential gradient, defined as the rate of change of potential with respect to displacement [7].
where, dV is the change in Electric Potential and dx represents the change in displacement, E is the electric field.The electric potential is the amount of work done to transfer a unit positive electric charge from one position to another position.In the proposed work, same principles are utilized for formulating the definition of the Electric Field.
In MagEl, considering a service request to be a charged particle, the Electric Potential difference is defined as where, tw x (i) and tw y (i +1 ) are the waiting time experienced at services x and y at i th and (i+1) th level respectively.td(x(i),y(i+1)) is the data transfer time defined as "the amount of time required to pass all the parameters and control from a service at a particular level to a service at the subsequent level".In the Future Internet, we envision scientific computations and Big Data processing to be done via Service Oriented Architecture deployed on a Cloud based infrastructure.Therefore, the parameter data transfer time will become an important criteria.The flow time will depend on the conditions of latency, bandwidth availability, geographical distribution, uptime etc.It can be seen from the above equation that the waiting time and data transfer time parameters are in a ratio, therefore a constant ξ is added to compensate for the loss in dimensionality (Since Magnetic Field is not dimensionless).
It can be deduced, that the difference between displacement of two individual nodes is unity.Since, a node is only a 'hop' away from either the successor or the predecessor node.Hence, the 'dx' term in equation ( 2) is considered unity.Therefore, the Electric Field offered by a node is: In MagEl, the service requests move from a node at the i th level to a node at the subsequent level if it has a high Electric Field value.This field is significant in avoiding a 'hotspot' identified by a huge amount of waiting time and data transfer time.It can be deduced, that driven by this field the service request(s) will bypass the hotspots and move towards a more underloaded node.

B. Magnetic Field
From the discussion in the previous sub-section, it can be deduced that the Electric Field is not user-centered and depends on runtime parameters.However, owing to the visions envisaged for the Internet, user-centric computation is also an important criteria.In MagEl, this vision is given due importance while selecting a service.As stated in previous sub-section, Magnetic Field is considered to give an initial direction to the next service request.Therefore, Magnetic Field is the component that uses the intuition of a user in service selection.
It is a common observation that human beings have a varied sense of understanding and perception.Sometimes a perceived image is not as accurate as it is in reality.In the discipline of services computing, it can be said that human beings exhibit a 'biased' behavior favoring certain QoS attributes (This fact is confirmed in the results section).Therefore, to select a service purely from an intuitive point of view should not be the sole criteria of any system.A service must be selected based on conscious reasoning as well.In other words, a subjective approach towards service composition must be complemented by an objective approach.These elementary principles are utilized in MagEl to formulate the definition of the Magnetic Field.
In MagEl, the Magnetic Field is a preference and QoS based selection function incorporating both the subjective and the objective behavior.An ideal candidate to merge both the two choices is the subjective-objective weighted approach.Hence, the definition of Magnetic Field is as follows where, Q is a matrix containing QoS attributes's values.w, w' are the subjective-objective weight matrices respectively.β is bias parameter in the range [0,1].The QoS attributes chosen for weight calculation and the purpose of experimentation are shown in Table 1.The method used to calculate weights was taken from [9].

C. Coalition of Electric and Magnetic Fields
So far we have defined Electric and Magnetic Fields for MagEl.It can be deduced that MagEl depends on both static and runtime Quality of Service attributes.The main focus of attention in the proposed model is the Electric Field, it is able to balance load equitably among similar services.Moreover, it maintains a uniform quality of experience for a user.Leitner et al. states "The user needs quality metrics which describe the quality of the business transactions in an end-to-end fashion" [10].We strongly believe waiting time is one such metric.
In order to combine the two fields, there are two broad categories: Linear and Non-Linear.For reasons of Figure 3. Generic Rules simplicity and computational efficiency, we have chosen a linear combination strategy.In the proposed model, the ElectroMagnetic Force (EMF) a node y at level (i+1) offers to the next service request coming from a node x at level i is defined as: where, α is a parameter in the range of [0,1] representing biasness towards either the Electric Field or the Magnetic Field.In MagEl, a node is chosen iff it has the maximum ElectroMagnetic Force at that level.In general terms, a service request is passed to a lower level node if it offers the maximum amount of ElectroMagnetic Force i.e.

∀s ∈ S
where S is a set of all services at a particular level i, s' is the chosen service at the same level.In MagEl, the selection of a service is done by another service, thereby eliminating the need of a centralized authority.Hence, our proposed model overcomes the problem of the 'singlepoint of failure'.Since, MagEl achieves service composition in a decentralized framework, therefore the EMF values must be exchanged among the participating services.In MagEl, the exchange mechanism is based on the notion of event based updates.Since, the success of event based publishsubscribe mechanism is well appreciated in both academia and industry, we also utilize this mechanism for EMF value exchange.The logic behind such a mechanism is shown in Figure 3.The mechanism illustrates an implementation level procedure utilized in MagEl.This strategy is employed while conducting the experiments, both real-World and simulation.
In this method, if a service y at level (i) want to invoke a service at level (i+1), then it (y) calls the In-vokeService procedure.The lower level services receiving this procedure call, invokes the SendEMF procedure.This procedure calculates and sends the EMF value a node is offering.It should be noted here, that each individual service has to invoke the SendEMF procedure separately.Finally, F v is the vector containing EMF value all the service nodes are offering.The calling service (y) extracts the index of the service with maximum EMF value via the PrepareService procedure.Finally, the chosen service is executed by service y using the Execute procedure.The parameters are passed in the 'withparam' function.Next, it could also happen that a service does not return the EMF value even after being called, it implies that the service is dead i.e. there are reliability issues.It should be noted here that due to the availability of multiple services, the execution flow does not halt.Therefore, the mechanism not only aids in detecting reliability problems, but also applies dynamic adaptations on the fly.

D. Observations in MagEl
Observation 1: Suppose service S a ∈ S i and ∀ bS b ∈ S i ;b = a, where S a and ∀ bS b are services belonging to the Service set S at level i.If service S a has to selected among all the service nodes at level i by a service node Proof: Suppose service S a and ∀ bS b ∈ Level i;b = a.Then, in order to select S a as the next chosen service to the next incoming request, it must have the maximum EMF value i.e.
Therefore, in MagEl the selection of a service node is dependent not only on the Electric and Magnetic Fields, but on the coefficient of their combination as well.In the results section, the importance of the α parameter is demonstrated.

III. RESULTS
The service domain shown in Figure 4 is chosen for conducting experiments.The values for all the parameters were chosen randomly using Apache Math Library 3 .Though the value of coupling is different for [3] and [2], our motive here is to show the efficacy of MagEl.

A. Simulation Setup
In the experiments, multiple events were allowed to happen rapidly at a fixed rate.4,000 events were allowed to happen, out of which a slice of events is chosen for the purpose of analysis.An event here is considered as the arrival of a new composite application request at the topmost node.The progress is tracked as follows: An application request arrives at the top most node.As soon as 3 http://commons.apache.org/proper/commons-maththis node processes a part of the application, it passes the request to the service at the subsequent level.The receiving node processes the incoming request if it is idle or adds it the pending queue, if it is already tending to some other request.The decision to select a service at a level is on the basis of Equation (8).The request moves from level to level until it exits the lowermost node.A request exiting from the lowermost level implies that an application has been composed for a user.The completion time, the waiting time, the request arrival rate and the queue size of each service node was tracked.Since, there is an absence of an orchestrator, therefore the tracking was done for every node.Based on the data collected, we discuss the behavior of MagEl in the next subsections.We have compared the proposed model with two similar techniques viz [2] and [3].The two techniques are the most closest in literature utilizing the waiting criteria in service composition.However, the two techniques focus on only a few parameters while selecting services(Queue Size, waiting time and latency only).This assumption is rather unrealistic, MagEl selects services based on attributes commonly found in existing works.

B. Behavior of waiting time and completion time
Since Standard Deviation (Std.Dev) gives a measure of the amount of dispersion in the data, we have chosen this metric for analysis.In Figure 5 This implies the requests are arriving evenly, thereby all the events experience less waiting time.This observation confirms, MagEl is able to achieve efficient load balancing while composing service together in a decentralized environment.In Figure 6, we have shown the application completion times of the compositerequest for all the three techniques (x and y axes demonstrate Event ID and completion time respectively).As visible, MagEl outperforms the other two techniques.It can also be seen from the figure, that there are situations where MagEl produces a high completion time (for a few events).However, it is noteworthy that the average completion time for MagEl is far less than the two techniques.Figure 7 shows the average completion time for events shown in Figure 6.As visible, a low average completion time indicates MagEl composes an application quickly while maintaining a good Quality of Experience for a user.

C. Impact of α
In Observation 1, it was specified that the selection of a service at a level is dependent on the Electric & Magnetic Fields, and on the coefficient of combination.In this section, we demonstrate the role 'α' plays in service selection.Due to space constraints, in the following subsections we have chosen a random level to demonstrate the observed results.
In Figure 8, we have shown the Std.Dev for a random level chosen from Figure 4.As visible, when α is zero the selection is based on Magnetic Field only, therefore the Std.Dev is large.It was observed, the Std.Dev kept increasing with this particular value of α.This behavior is theoretically expected owing to the absence of the Electric Field to balance load among similar service offerings.Figure 8 demonstrates the variation in Std.Dev for a level with different values of α (with a step size of 0.2).In Figure 9, we have shown the average completion time of events with different values of α (here 'a' is considered as α).We expected a low average completion time when α is equal to 1. But, the results showed a low value when α is 0.2.This behavior is due to the fact that both Magnetic and Electric Fields are considered when making a selection decision.Moreover, data transfer time also plays an important role in service selection.Therefore, an optimal value of α is obtained only after examination and experimentation.Similar to the variations in α, experiments were conducted with variations in β.The variation though is quite erratic.Multiple configurations were tested, but the pattern was not visible.However, it was noticed that a low average completion time is obtained when preference is given to the objective approach.This behavior strongly supports the fact that when selecting services, an objective approach is better than the subjective approach.The average completion time for events with various values of β is shown in Figure 11.The Std. Dev at a random level is shown in Figure 10.

E. Impact of Human Behavior
In addition to exploring different variations in the values of the QoS parameters, α, β etc., we explored the impact of 'real human behavior' in service selection, request completion and the waiting time.We asked graduate students of the Institute to provide their feedback on QoS parameters specified in Table 1

F. Real World Prototype Deployment
As a proof of concept, a prototype based on MagEl demonstrating the viability in actual deployment was also developed.Web services were deployed on multiple nodes inside the Computing Lab of the Institute.The configuration of each node is Intel i5 Processor with 4 GB RAM.Multiple Web services were developed with different execution times.While configuring the values, it was observed the service time of each service and the flow time between each pair of service was very less.Therefore, to simulate different execution time, the invoking thread was made to sleep for random amount of time.For space reasons, we don't discuss the experimental setup (XML schema used, event based publish-subscribe model, etc.) and the results in detail.

IV. RELATED WORK
In this section we discuss some of the related work in the field of service composition.Very close to our work are the two techniques [3] and [2].These techniques also focus on the parameter of the waiting time.[3] is a technique based on queuing theory where concepts are customized to cater to the requirements of service composition.The technique enabled a rough estimation of the waiting time expected at a Web service.Similar to [3], is a model presented in [2].Here, a technique borrowed and customized from real world friction is presented.The technique also accomodated the parameter of waiting time.However, it was shown in the results section that the proposed model, MagEl, outperforms both the two predecessors.Moreover, in this paper real world experiments were conducted taking into account real human test subjects and real world Web services.Very close to [3] is a technique presented in [11].The authors calculated the expected waiting time in a composition scenario.They observed the behavior of Web services for some time, but, measuring arrival rate for 'some time' in a dynamic environment has its drawbacks.They further assumed that the request arrivalrate is always smaller than the service completion-rate, which is not always true.In MagEl, rather than assuming request arrival-rate to be less, we focus on the actual arrival rate of Web service requests.A methodological framework based on Labelled Transition Systems with "on-off" state is presented in [12].Specifying a constrained set on local response time, a method to compose services is presented.They further try to approximate the global response time.Similar to our work, the authors have focused on local time constraints for dynamic analysis of each state for a composite service.
Nature inspired metaphors have recently caught some attention in the services sector.Inspired from such metaphors techniques are presented in [4], [14], [8].Similar to our physics metaphor, the author in the papers focus achieving a distributed workflow management strategy.They utilized a chemistry metaphor coupled with fundamentals behind the Gamma Programming model to achieve decentralized workflow execution.However, they do not focus on balancing load among similar services and selecting a service from a set of services.

V. C ONCLUSION AND FUTURE WORK
In this paper a technique customized from Electro-Magnetic behavior of a charged particle was presented.It was shown how MagEl aided in service selection and service composition in a decentralized environment.It was shown that the proposed model, MagEl, achieved better results in terms of variation in waiting time and request completion time.Since we achieved a decentralized execution of Web services, therefore an efficient decentralized SLA monitoring methodology is required.Moreover, verification and testing of the decentralized execution mechanism make further room for future work.

Figure 1 .
Figure 1.The Service Domain

Figure 2 .
Figure 2. Behavior of Charged Particle in Electro-Magnetic Field

Figure 4 .
Figure 4. Service Domain for Experimentation , we have shown the Std.Dev. of the waiting time experienced at each level (The x and y axes demonstrate Event ID and Std Deviation respectively).As visible in Fig 5, MagEl outperforms the two techniques by having a low Std.Dev value.

Figure 5 .
Figure 5.Standard Deviation Waiting Time

Figure 10 .Figure 11 .
Figure 10.Standard Deviation Different β . 6 volunteers were asked to provide their pairwise comparison matrix D =[d kj ] n * n i.e. the Saaty's Matrix[9] (The scale was 0-1).We conducted experiments with the obtained weight matrices.The results for Std.Dev in the waiting time for two volunteers (only two are chosen due to visual clarification issues) is shown in Figure13(The two test subjects were chosen at random).A difference in average completion time for the two test subjects is also shown in Figure12.As seen from the two figures, a subjective preference towards QoS does indeed play an important role in service composition.It can be seen that Test Subject number 1 has a low value of Std.Dev at Levels 1 & 2. The same test subject also experienced a low completion time.

Figure 12 .
Figure 12.Average Completion Time Human 1 vs Human 2