Subscribe

Subscribe

Future Generation Computer Systems ( ) – Contents lists available at ScienceDirect Future Generation Computer Systems journal homepage: www.elsevi...

2MB Sizes 5 Downloads 55 Views

Future Generation Computer Systems (

)



Contents lists available at ScienceDirect

Future Generation Computer Systems journal homepage: www.elsevier.com/locate/fgcs

DTA: Dynamic topology algorithms in content-based Publish/Subscribe Xia Xie ∗ , Hongguang Wang, Hai Jin, Feng Zhao, Xijiang Ke, Laurence Tianruo Yang Services Computing Technology and System Lab, Cluster and Grid Computing Lab, School of Computer Science and Technology, Huazhong University of Science and Technology, Wuhan, 430074, China

article

info

Article history: Received 28 September 2014 Received in revised form 19 December 2014 Accepted 19 January 2015 Available online xxxx Keywords: Publish/Subscribe Content-based CYCLIC Real time

abstract Publish/Subscribe (Pub/Sub) has been used in many large-scale distributed systems owing to its scalability and loose coupling, and most of the existing Pub/Sub systems are built on the basis of the acyclic topology because the routing algorithm can be simplified. However, the flexibility is limited and the robustness is also a big problem. This paper proposes a dynamic topology algorithm to facilitate the adaptation to the dynamic change of the network conditions, which is composed of two parts: Topology Generation Algorithm (TGA) and Topology Transformation Algorithm (TTA). The topology can switch between cyclic topology and acyclic topology automatically, and the advantages of both the cyclic topology and the acyclic topology can thus be exploited. In addition, the efficiency and scalability can also be guaranteed when the topology changes. The topology of a Pub/Sub system will be transformed into a cyclic one to enhance robustness when the network condition gets worse, while into the acyclic pattern when the network condition is getting better. Experiments show that average number of edges in the topology reduces by 12% and subscription notification delivery time improves by 20%. © 2015 Elsevier B.V. All rights reserved.

1. Introduction With the rapid development of social networks and mobile Internet, numerous new systems have been built in these fields. In order to make these applications or systems more flexible and scalable, a decoupled, scalable, and dynamic communication scheme is required, such as the Pub/Sub paradigm that is widely used as a powerful messaging paradigm. Due to its loose coupling [1], simple interface, and inherent scalability, Pub/Sub has been attracting a number of companies and research institutes. In recent years, the effort of designing the Pub/Sub system has been made by researchers from the academy and industry [2–4]. For the researchers from academy, they focused on the enhancement of the system expression capacity (e.g., content-based routing algorithms and semantic [5,6]) and the compatibility with the new application environments (e.g. P2P network [7,8]). In industry, practical applicability is one of the main concerns, including the robustness [9], security [10], and efficiency [11]. A number of large-scale distributed applications (e.g., stock-market monitoring engines, RSS feeds, and workflow management) have been built upon the Pub/Sub paradigm [12].



Corresponding author. E-mail address: [email protected] (X. Xie).

http://dx.doi.org/10.1016/j.future.2015.01.010 0167-739X/© 2015 Elsevier B.V. All rights reserved.

In general, there are two types of Pub/Sub, namely topic-based and content-based Pub/Sub systems [13,14]. Topic-based Pub/Sub uses the notion of topics (or subjects), and extends the concept of the channel that connects two communication peers. Users can publish events and subscribe to individual topics that are identified by keywords. The communication channels in Content-based Pub/Sub are specified through a collection of attributes that could be arbitrary data types. Unlike the topic-based Pub/Sub variant that is a static scheme and offers the limited expressiveness, the content-based Pub/Sub introduces a subscription scheme according to the actual content of the considered events. At present, the content-based pub/sub has been used in many areas due to its expressiveness, filtering abilities, distributed event correlation, and complex event process capabilities. In this paper, a content-based Pub/Sub system is taken into consideration. For a Pub/Sub paradigm, it is composed of brokers that are responsible for disseminating messages. The topology of a Pub/Sub can be classified into two categories: the cyclic topology with at least one cycle and the acyclic topology with no cycle. Most of the existing Pub/Sub systems have been so far built on the basis of the acyclic topology. This is because the routing algorithm can be simplified when an acyclic topology is used. In an acyclic topology based system, any two peers are connected via one unique path in a Pub/Sub overlay network. The flexibility of this kind of system, however, is still limited when the network conditions change

2

X. Xie et al. / Future Generation Computer Systems (

dynamically. Moreover, the robustness is a big problem. Once some accidental situations (e.g., the broker failure and failure recovery) occur, the systems cannot deal with it very well. Although these problems cannot occur in cyclic topology based systems, using cyclic topology means more brokers required to be configured and more paths between brokers in the overlay network. Moreover, in order to maintain the overlay topology, each node need continuously monitor the availability of its neighbors, which will lead to high cost [15]. Therefore, it is of importance for a Pub/Sub system to adapt to complicated network conditions. However, the previous work supports only one kind of topology, which cannot meet the requirement of the adaption. To the end, this paper proposes a dynamic topology algorithm to facilitate the adaptation to the dynamic change of the network conditions. The topology can switch between cyclic topology and acyclic topology automatically, and the advantages of both the cyclic topology and the acyclic topology can thus be exploited. In addition, the efficiency and scalability can also be guaranteed when the topology changes. The topology of a Pub/Sub system will be transformed into a cyclic one to enhance robustness when the network condition gets worse, while into the acyclic pattern when the network condition is getting better. The dynamic topology algorithm is composed of two parts: Topology Generation Algorithm (TGA) and Topology Transformation Algorithm (TTA). These two algorithms are responsible for dealing with the topology transformation problem in Pub/Sub systems on the basis of relative operations, such as the monitoring and analysis. TGA is used to construct the initial topology based on the original network conditions, and TTA is used for detecting and transforming the topology in the Pub/Sub system. In particular, because the content-based Pub/Sub can process complex events and provide the expressiveness on distributed event correlation, these features are exploited by both TGA and TTA to simplify the two algorithms. Extensive experiment results show that the performance is significantly improved. The paper is organized as follows. The system structure is described in Section 2 and our topology strategy is presented in Section 3. Section 4 shows our topology algorithms in detail and Section 5 shows our experiments results and the discussions. Finally, the paper is concluded, and the future wok is provided.

)



Fig. 1. System structure diagram.

2.2. System core components As mentioned above, the second layer consists of several modules, including Topology Controller, Detector, and Analyzer. They deal with specific tasks, respectively. These modules cooperate with each other. After the overlay network is deployed, owing to the dynamic network conditions, the network structure needs to be detected, analyzed and adjusted continuously. Detector module is used for collecting the detection results, generating the detection data, and sending the detection signal. Analyzer module is used to process the detected results and then analyze them to get the statistics characteristics that will be used in the future. Topology Controller module is of importance because it is involved in many operations, such as the overlay initialization, the detector controlling, the analyzer controlling, topology transformation, and error processing. In the meanwhile, Data Storage module stores the test data to be processed by Data Processor.

2. System structure

2.3. Routers

The content-based Pub/Sub system consists of four layers as shown in Fig. 1. The first layer is the user interface that is composed of two components: the client and the monitor. The second layer, the core level of a Pub/Sub system, is responsible for interacting with, controlling, and managing other parts of the system. It includes the topology controller, detector and analyzer. The following is the router layer that controls and adjusts all the incoming and outgoing information. The last layer is the broker layer that provides the infrastructure.

The router is mainly responsible for information transmission. Routers are divided into two parts based on their locations around brokers. Some routers lie in brokers to route the messages that enter brokers while other routers are active outside the brokers for the purpose of keeping track of the broker states and routing the controlling messages. Besides delivering messages to the right destinations, the routers in the system can also adapt themselves to the network topology of the brokers. It means that the routers can update their routing table and immediately adjust their message matching strategy when the network topology changes. In this paper, a special routing strategy is proposed to make routers more flexibly adapt to the network topology change, which will be discussed in detail in Section 4.

2.1. User interface Clients connect with the specific brokers to transmit all the messages. Due to the flexible and efficient deployment, clients are also used to complete some tests by attaching them to the target brokers. In the system, according to the test results obtained by the analysis, the system design is possibly adjusted, and the algorithm may also be modified. In addition, Monitor module not only processes the display and presentation of the running work but also handles some of the configuration task.

2.4. Brokers The broker is the fundamental element in the system, and is used to build the infrastructure. It contains some necessary subcomponents, such as the message queue, the communication interface, and the matching engine. Firstly, the network topology is mainly consisted of brokers. Participators, the publishers or subscribers, are able to connect to the topology by connecting with

X. Xie et al. / Future Generation Computer Systems (

)



3

the specific brokers. Furthermore, the messages and events produced by these participators can be transferred between brokers. As is mentioned in Section 3.3, when some routers run in brokers, these brokers could be able to match and route incoming messages in the network. Because all the messages need to be transferred through brokers, the stability of the topology should be guaranteed. As the system performance is directly affected by the stability of the network topology, the connectivity between one broker and the neighbors and the flexibility of the network topology are very important. While the topology in our system is continuously evolving and transforming along with the change of the network topology, brokers are able to dynamically adjust in order for the prompt adaptation to the new environment. 3. Dynamic topology strategy This section will discuss the dynamic topology strategy that deals with the topology transformation problem when the network conditions change, such as ups and downs of network speed. The strategy is flexible so as to meet the requirement and plays a very important role. 3.1. Strategy description Dynamic topology strategy proposed in this paper consists of the initialization phase and real-time transform phase. In initialization phase, the topology that contains all brokers is generated according to initialization configuration information. Then every connection between brokers is detected by detector module to calculate the connectivity data. Analyzer module will analyze these data and the topology will be re-initialized based on analysis result. On the other hand, in real-time transform phase, each broker in topology is periodically detected. However, because the topology is used by the system in this phase to transfer messages, it cannot be modified drastically, only necessary adjustments can be made based on the analysis result towards detect data. Detection and adjustments will not stop until the topology is compatible with system running environment and then the system is relatively stable. 3.2. Initialization phase The network topology needs to be initialized at first. First, brokers are generated according to the initialization broker matrix. Second, the topology controller calls Detector module to detect the connectivity of every two brokers, and then classify all the edges that connect the detected brokers based on the given marginal value that could be changed during the real-time transformation process. Based on the connectivity, the edges can be classified into three classes, namely complete-connection, medium-connection, and none-connection. Third, the topology controller calls Analyzer module to calculate the ratio of the amount of complete-connected to the amount of medium-connected edges. At the same time, the topology controller constructs an acyclic graph using wellconnected edges. Finally, with the consideration of both the connectivity ratio and the number of edges the acyclic graph contains Analyzer module will determine which topology will well suit the current network condition. Finally, the ratio, the amount of the connected nodes, and other related data that will be used for future decision are stored in the data storage module. The connectivity can be inferred by the time a message transmits between two brokers. The edge between two brokers is detected several times for the need of average value computed during the initialization process and the detection value each time is recorded, and used by the initialization program. The initialization program is used to process detection values including deleting abnormal or error data,

Fig. 2. Flow diagram of real-time transform.

ruling out maximum or minimum data, and calculating the average value that will guarantee the detection accuracy. After the ratio of the number of complete-connected edges to the number of medium-connected edges is calculated, it will be compared to the standard value and the result will be obtained. The result is mainly used to determine whether the topology of the brokers should be reconstructed. Algorithm 1 in Section 4 shows all the steps of the procedure of initialization phase. 3.3. Topology real-time transform technique When the system is running, the topology changes due to the dynamic network condition. In the initialization phase, the preliminary tests and necessary adjustments have been completed; thus the topology is basically stable at the moment. As the system runs continuously, some nodes may not work well or the running environment changes. Due to the existence of these uncertain factors, the system has to flexibly adapt to the dynamic network topology change, which means the nodes in the network should be able to adjust themselves according to any new network conditions. The flow diagram of the connectivity detection and the topology transformation is shown in Fig. 2. Similar to the initialization phase, each effective node needs to detect the connectivity (step a) with its neighbors, and all the detection result will be saved. The detection frequency is determined by the stability of the current topology, and the total detection time at a time is relative to the long-term records of the detected node. The detection will not stop

4

X. Xie et al. / Future Generation Computer Systems (

until the system is shut down or the times that the network topology remains unchanged during a period reaches a specific value (step k). For each node, all the results generated after the detection are stored in the data storage module (step b). Data procession module in the node reprocesses these generated data to make them more usable. The reprocessing method consists of the cleaning and correction of the error data, the deletion of the invalid data, and the elimination of the data that has maximal or minimal value (step c). At the same time, each node also sends some of the reprocessed data to Analyzer module where all the significant results will be converged for the further analysis that will subsequently derive the network topology (step d). Then Analyzer module calls the analysis function according to our proposed analysis algorithm to analyze the collected test data (step e). The parameters needed by the node analysis function contain the historical analysis data, the current detection data, the location information of the current node in the topology etc. After an analysis process, the computing function is subsequently executed through using the analysis outcomes at step e and come up with the ratio value R set. The value indicates whether to adjust the corresponding node (step f). The standard ratio value σ is set firstly, which is used to decide whether the topology needs to be transformed through comparing with the ratio value R (step g). Actually, the standard ratio can be modified based on the current and historical ratio records. If R is larger than σ , it means the topology does not need to change. In this case, the value is added to the variable UNCHANGED that indicates the number of the continuous unchanging (step h). Then variable UNCHANGED is compared with the maximal detection value DET_MAX (step k). If variable UNCHANGED is larger than DET_MAX, the whole process is ended, else go back to step 1 to continue the detection process. If R is less than σ , the adjustment of the topology will be made, to transform it into another form (step i), set UNCHANGED to zero (step j), and then go to step a. In summary, once the standard connection delay value and the ratio are set up, the detection will be made to check each node’s state, including each node’s connectivity with its neighbors, the historical detection data, and the test results in the analyzer module. The analyzer module will calculate the current ratio results, and then the controller module decides whether to adjust the topology or not. The specific algorithm will be presented in Algorithm 2 in Section 5. 3.4. Configuration management Besides the key components like brokers and routers, there are some other components that are responsible for controlling, managing, and monitoring the running system. Before the system is initialized, some specific parameters, such as the amount of nodes, original topology matrix, and the detection marginal value, need to be set. The Broker Processor module is a component that is responsible for handling the test data and messages from brokers, including the calculation of the connectivity between two brokers during a single detection and data converting. All detection data has to get through the data processor module that is used for cleaning, classifying the data and doing statistic of the detection value. Other handler component is designed to deal with all the errors or unexpected outcomes. 4. Algorithms This section presents the topology generation and transformation algorithms used in the system. Algorithm 1, namely the topology generation algorithm, shows the steps that are used to generate a topology in the initialization phase. Firstly, we set up all the nodes in the topology as brokers, and then we connect these

)



nodes using edges that initialization matrix indicates. The topology that our initialization matrix forms is cyclic. Steps 3–6 of Algorithm 1 calculate the message deliver delay on each edge by sending a detection message between two nodes that this edge connects. Get the ratio of slow edges and then compare the ratio to the standard value to determine whether to change the edges. Steps 13–17 eliminate slow edges and rebuild the topology. We use the greedy algorithm to cut the slow edge just like step 14. Algorithm 1 Topology Generation Algorithm for Initialization Phase (TGA) 1: V ← Set of all nodes 2: G(V , E ) ← Complete cyclic graph on V based on initialization matrix M 3: for {u, v} ∈ E do 4: Get message deliver delay from node u to node v and in reverse, and then calculate average value of delay value da {u, v} d{u, v} ← da {u, v} 5: end for 6: NumberOfSlowEdges ← 0 7: for {u, v} ∈ E do 8: if d{u, v} is greater than standard delay α 9: NumberOfSlowEdges ← NumberOfSlowEdges +1 10: end for 11: r ← NumberOfSlowEdges/NumberOfAllNodes 12: if r is less than standard slow edge ratio δ then 13: while topology of G(V , E ) is cyclic do 14: find the max-delayed edge e on G(V , E , d) 15: E ←E−e 16: end while 17: re-initialize G based on E 18: return G(V , E ) Three loops exist in Algorithm 1: the first loop is used to detect the delivery delay over each edge and this process will be completed in O(|V |) time; the second loop counts the total amount of slow edges in O(|V |); the third loop is designed to modify the topology by deleting those slow edges, and then re-initialize the network topology based on the left edges. At each iteration of the while loophole, the edge which has the maximal delay value is found out and alimented from the cyclic topology until it is acyclic. At each iteration of the third loop, finding the maximumdelayed edge costs O(|V |) time and the whole while will finish in O(|V |2 ) [16]. In summary, Algorithm 1 takes O(|V |) time if slow edge ratio r is not less than the standard ratio, otherwise it terminates in O(|V |2) time. O (|V |)2 ,

r ≥δ

O (|V |) ,

r < δ.

 T1 =

Algorithm 2 represents the steps of the topology transformation when system is running. It starts with the overlay G(V , E ) after the initialization phase. Steps 1–5 set Detect Result Number 0 and Detect Results Set empty for each node, and then send the detect signal to each node. At steps 6–10, all nodes in the overlay detect the deliver delay between any one node and its neighbors, and put detection results in Detect Results Set until Detect Result Number reaches a specific value. At Steps 11–15, Detect Results Set is processed and analyzed at each node, and adjusts the node according to the analysis result while sending average detection value to the analyzer module. At last, the collected detection data is processed and analyzed in the analyzer module, and then the network topology is adjusted based on the analysis result. The adjustment mentioned above is also about modifying edges between nodes, which is similar to steps 12–17 in Algorithm 1.

X. Xie et al. / Future Generation Computer Systems (

However, unlike the re-initialization, we just remove or add edges, and do not interrupt the running system. For step 5 in Algorithm 1, there are two methods to deliver the detection signal, namely the flooding way and one-to-one way. When using flooding way, a signal is sent to one node, this node duplicates the signal and then sends copies to its neighbors. In a topology with N nodes, if the average degree of all nodes is E, the time that the detection signal travels through one edge is t, processing time after a signal arrives at one node is ϕ . The total time of sending signals is T = N ϕ + NEt + λ,

(1)

where λ in this equation is the time for adjusting the node’s state. When using parallel processing that allows sending the detection signals originally from n nodes, total time is Tn =

N ϕ + NEt n

+ λ.

5

Table 1 Configuration and environment. Operating system Processor RAM Java version

Windows server 2008 Dual-Core CPU 2.5 GHz 2.00 GB 1.6

For the three loops in Algorithm 2, each of them has O(|V |) iterations, but the adjustment at step 12 needs to consider not only the node but also its connections with neighbors and its location in the whole topology. In each iteration, the cost time will be O(|V |) which make Algorithm 2 finish in O(|V | |V |) = O(|V |2 ), namely: T2 = O |V |2 .





5. Experiments

(3)

where λs is the extra time during the sending process. To complete the signal sending process, the space that flooding method or oneto-one method needs is S = NSn + NSl



(2)

On the other hand, when one-to-one signal sending method is used, the detection signal is directly sent to each node without any help. With this method, if the time spent from the single to send and a response to receive is θ , the total signal sending time is Ts = θ N + λs ,

)

(4)

where Sn is the space each node needs to process and deliver the signal, Sl is the space used to mark the node that received signal. It is obvious that Tn depends on the degree of parity, and it means that more extra is spent for avoiding redundancy of signal sending if the flooding method is used. The time spent when the one-to-one sending method is used only depends on the number of nodes. In this paper, the one-to-one method is used to send the detection signal in Algorithm 2. Algorithm 2 Topology Transformation Algorithm for Real-time Phase (TTA) 1: for n ∈ V (in graph G(V , E )) do 2: NumberOfDetectResults ← 0 3: DetectResultSet(n) ← Φ 4: end for 5: Send the detection signal to all nodes 6: For every node n, while NumberOfDetectResults < MaxDetectNumber do 7: detect the message deliver delay d between e and one of its neighbor nodes 8: DetectResultSet(n) ← d 9: NumberOfDetectResults ← NumberOfDetectResults +1 10: end while 11: for n ∈ V do 12: process and analysis DetectResultSet(n), adjust node n’s connections with its neighbors according to the analysis result 13: calculate the average delay value da , sent da to the analyzer module 14: end for 15: process and analysis the collected detection data in the analyzer module 16: adjust the whole topology according to the analysis result 17: return G(V , E )

This section demonstrates the performance of the proposed algorithms by some extensive experiments. The performance of the proposed algorithms is shown in three folds: (1) the performance comparison between the two systems with/without the proposed algorithms; (2) the performance comparison between the system with the proposed algorithms and the system with the DPR (Dynamic Publication Routing) algorithm [17]; (3) the robustness and stability of the proposed system are tested when it is running. In addition, when the proposed algorithms are compared with DPR, the end-to-end notification delay is also compared. All experiments are performed in a single machine. Table 1 shows the configuration of the machine and the software used in the running environment. 5.1. Comparison to the system without any algorithms Firstly, it is necessary to explain the phrase ‘‘standard delay time’’ which will be used a few times in the following analysis. Standard delay time (SDT) is the threshold value which is used to judge the connectivity of an edge or a node by comparing the time value that indicates connectivity to SDT. Standard delay α in step 8 of Algorithm TGA is SDT and it is also used in step 15 of Algorithm TTA. Because of the differences of environments that the system is running in, SDT is not a constant value and should be a proper value according to the situation of environment. We test and verify proposed algorithms by calculating and recording the average number of edges and average time delay of subscription notification delivery in systems within proposed algorithms and without any topology optimization algorithms, then we show these test data in the form of chart and all the following comparisons and analyses will be made against these charts. In order to make the test results of the experiments more accurate, the SDT value is set to 3.0 ms when comparing two systems with/without the proposed algorithms and is set to 2.5 ms when comparing the proposed algorithms with DPR algorithm. At the same time, to make the results for number of edges more obvious, we set the original topology cyclic which is generated in initialization phase. In the next section, the comparison will be expanded more. After long time testing, recording and organizing, we draw these following charts. Among them, Fig. 3 shows the results with 3.0 ms SDT. As Fig. 3 shows, average number of edges of system with TGA–TTA is less than that with no algorithms by nearly 30%, and average delivery time delay is less by 1.8 ms. Because most of the delivery delays during detection in TTA are less than SDT which is 3.0 ms, our topology algorithms decide the connections between nodes are good enough so the whole topology does not need to be cyclic. This leads to the situation that the topology almost always stays acyclic which explains why the average number of edges can be 30% less than the original number in Fig. 3(a).

6

X. Xie et al. / Future Generation Computer Systems (

(a) SDT = 3.0 ms.

(b) SDT = 3.0 ms.

Fig. 3. Edge number and delivery time delay with 3.0 ms standard delay time.

(a) SDT = 3.0 ms (after modification).

(b) SDT = 3.0 ms (after modification).

Fig. 4. Edge number and delivery time delay (SDT = 3.0 ms, after modification).

However, because we emulate our system in a single machine and all the nodes are generated in one Java VM, these nodes are well-connected which makes the topology always remain the same after first several transforms. In order to verify the effectiveness of TGA–TTA better in various conditions of network, we modify the original test program by increasing the number of slow edges when detect delay value approximates SDT within a certain interval. Fig. 4 shows the results after the modification of test program. By modifying the test program, the chance that the system is running in a relatively bad condition of network is higher and this means the chance that ratio of bad edges is smaller than standard slow edge ratio is higher. In this case, we make this probability up to 35%. We can notice from Fig. 4(a) that the average number of edges is bigger than the value in Fig. 3(a) before test program is modified and the number is added by 33% which can be shown intuitively by the maximum values we mark in Figs. 3(a) and 4(a). At the same time, the delay time values in Fig. 4(b) are more similar to the values which show in Fig. 3(b). It means the topology remains cyclic more often because of the test program modification which makes the network environment worse than before. All these data in Figs. 3 and 4 prove that our TGA–TTA algorithms take effect after test program is changed and also prove that our algorithms are suited for multiple scenarios. 5.2. Comparison to the system with algorithm DPR In the last part, we verify our algorithms and compare the system with them with the system without them. In this part, we would like to compare the system with our algorithms with the system with another algorithm. Among all the current researches on topology in Pub/Sub system, some are about Pub/Sub routing [17–20] and some are about content-based matching [21–23]. We choose one algorithm in [17] called dynamic publication routing (we call it DPR for short) which is also suitable for cyclic or acyclic topology. Just like the experiments we did in the last part, firstly we run the original test program in a normal condition of network to compare our algorithms and DPR algorithm which can support general topology in Pub/Sub system. In order to adapt to the features of DPR

)



(a) SDT = 2.5 ms.

(b) SDT = 2.5 ms.

Fig. 5. Edge number and delivery time delay compared to DPR.

(a) SDT = 2.5 ms (after modification).

(b) SDT = 2.5 ms (after modification).

Fig. 6. Edge number and delivery time delay compared to DPR (SDT = 2.5 ms, after modification).

algorithms and proposed algorithms, we set SDT to 2.5 ms. In this case, we can infer that the average number results and time delay results of our algorithms are the same with that in Fig. 3 but the time delay values of DPR algorithm are less than the values with no algorithms in Fig. 3(b) because of the affection of DPR for cyclic topology. At the same time, our algorithms are better than DPR in time delay. We show the test results in detail in Fig. 5. In Fig. 5, we can notice that results of average number of edges in chart (a) is almost the same as the results in Fig. 3(a) as expected due to good connections between nodes, meanwhile in chart (b), the average time delay of TGA–TTA is less than DPR by 16% thanks to our dynamic topology algorithms. Correspondingly, we use the modified test program to test our algorithms and DPR algorithm, and the results are shown in Fig. 6. Similar to the results in Fig. 4, the average number of edges is bigger. In Fig. 6, chart (a) is almost the same with Fig. 4(a) and average time delay of DPR in chart (b) is a little bit less than the value of no algorithms in Fig. 4(b). From Fig. 6, we can see that the results of average number of edges are similar to those in Fig. 4 due to the modification of the test program. Our analysis also shows the edge number of TGA–TTA is smaller than that of DPR by 12%. On the other hand, the results of TGA–TTA’s delay time are more close than all the results above because the network condition that new test program created makes topology of our system converted into cyclic pattern more often, but still lower than DPR by 9%. In summary, our algorithms are more suitable for changeable environment. In addition, we compare our algorithms with DPR while system has multiple publishers and subscribers. For each kind of algorithm, we perform the experiment in a 15 broker topology with 10 publishers and 15 subscribers and monitor CPU and memory usage. We set the publication rate 600 msg/min and after the number of publish messages reaches 5000, we stop all the experiments and monitoring. By comparing Fig. 7(a) and (b), we can see that the average end to end notification delay of TGA–TTA algorithm (17.99 ms) is less than that of DPR algorithm (18.49 ms). This means our algorithms could deal with network traffic better. At the same time CPU and memory usage with our system are still lower than DPR.

X. Xie et al. / Future Generation Computer Systems (

(a) Delay with DPR algorithm. .

)



7

(b) Delay with TGA–TTA algorithm. .

(c) CPU and memory usage with DPR.

(d) CPU and memory usage with TGA–TTA. Fig. 7. Experiment results of end to end notification delay with multiple publishers and subscribers.

(a) 10 nodes.

(b) 15 nodes. (a) 10 nodes.

(b) 15 nodes. Fig. 9. Robustness test results (SDT = 2.5 ms).

Table 2 Robustness test statistical results.

(c) 20 nodes.

(d) 25 nodes. Fig. 8. Robustness test results (SDT = 3.0 ms).

Number of nodes

Min

Max

Average

10 15 20 25

4 4 5 6

10 17 15 17

5.13 5.10 6.47 8.40

5.3. Robustness In order to prove the system that uses our algorithms has good robustness, we design a robust test program which allows it to remove the connections from the whole topology between specific nodes. In our case, the test program removes connections half the number of nodes within 5 min and record one time delay data every 2 s. We view the fluctuation of all the delay data to see the robustness of our system. Fig. 8 shows the results of robustness test for the topology which has 10, 15, 20 and 25 nodes while SDT is 3.0 ms. From Fig. 8, we can see that most of the results of 10 nodes and 15 nodes are between 4 and 5 ms and results of 20 nodes and 25 nodes are between 6 and 7 ms. All the time delay values in these four charts in Fig. 8 are relatively stable during the test process and the peak values are a lot less than the stable ones. We already mark some obvious peaks values in Fig. 8 including the maximum

values and we can see clearly that these marked values appear not more than five times. More accurate statistical data is shown in Table 2. As a contrast, we use the same robust test routine to test the topology of 10 and 15 nodes with 2.5 ms SDT value and we collect all the time delay data to form result charts like we did in Fig. 8 and we expect the outcome to be the same. Fig. 9 shows the result charts in this case. When SDT value is 2.5 ms, the topology changes more compared with when SDT is 3.0 ms. In addition, the edges are being removed, so these two factors cause that the time delay value rises and falls more often. Even in this situation, the number of stable values covers about half of the whole number. All the charts in Figs. 8 and 9 indicate that topology in the system with our algorithm has good robustness and the fewer times when topology transform occurs, the better robustness is.

8

X. Xie et al. / Future Generation Computer Systems (

5.4. Stability The topology of the system that is built and maintained by our algorithms can function smoothly and stably in various environments including bad network conditions. Only one socket error occurred during the whole experiment process and this error was caused by the lack of memory after long time system running. We believe the system with our algorithms could run for a long time correctly and steadily if the hardware is strong enough or the system is deployed in a real distributed environment. Moreover, the system did not crash even the number of nodes is up to 30 and more which indicates the system can take enough pressure that comes from the nodes. On the other hand, about our algorithms themselves, once the detector in the system finds condition of environment is changing little, the topology remains the same constantly. All these facts mentioned above show the great stability of the system that our algorithms construct and manage. 6. Conclusion and future work We designed some algorithms to make topology in Publish/Subscribe system be able to transfer itself adaptively into a form that is more suitable for the environment. By performing several experiments, we show that the average number of edges in topology which uses our algorithms is smaller than that does not use any topology algorithm more than by 12% and average publish notification delay time is less by more than 20%. At the same time, adaptability, flexibility, robustness and stability can be guaranteed due to the effectiveness of our algorithms. One direction of future work is to develop an algorithm that makes topology can transfer itself according to the subscriptions that have been made. On the other hand, the experiments that we describe above are all performed in a single machine. To verify our algorithms better, we will deploy our system to multiple machines and make a comparison with the current results that have been made. References [1] P.T. Eugster, P.A. Felber, R. Guerraoui, A.-M. Kermarrec, The many faces of publish/subscribe, ACM Comput. Surv. 35 (2003) 114–131. [2] Y. Huang, H. Garcia-Molina, Publish/subscribe in a mobile environment, Wirel. Netw. 10 (2004) 643–652. [3] G. Cugola, H. Jacobsen, Using publish/subscribe middleware for mobile systems, in: Mobile Computing and Communications Review, SIGMOBILE, vol. 6, 2002, pp. 25–33. [4] V. Sourlas, G.S. Paschos, P. Flegkas, L.R. Tassiulas, Mobility support through caching in content-based publish/subscribe networks, in: Proc. 10th IEEE/ACM International Conference on Cluster, Cloud and Grid Computing, CCGrid 2010, IEEE Press, 2010, pp. 715–720. [5] M.I. Ashraf, L. Goratti, J. Haapola, C.A. Pomalaza-Ráez, Distributed semantic algorithm for power constrained publish/subscribe routing, in: Proc. Sixth International Conference on Intelligent Sensors, Sensor Networks and Information Processing, ISSNIP 2010, IEEE Press, 2010, pp. 91–96. [6] D. Preuveneers, Y. Berbers, Towards energy-aware semantic publish/subscribe for wireless embedded systems, ICST Trans. Ubiquitous Environ. 12 (10–12) (2012) e1. [7] S. Zhang, J. Wang, R. Shen, J. Xu, Towards building efficient contentbased publish/subscribe systems over structured P2P overlays, in: Proc. 39th International Conference on Parallel Processing, ICPP 2010, IEEE Press, 2010, pp. 258–266. [8] S. Gao, G. Li, P. Zhao, Marshmallow: A content-based publish–subscribe system over structured P2P networks, in: Proc. Seventh International Conference on Computational Intelligence and Security, CIS 2011, IEEE Press, 2011, pp. 290–294. [9] T.R. Mayer, L. Brunie, D. Coquil, H. Kosch, Evaluating the robustness of publish/subscribe systems, in: Proc. International Conference on P2P, Parallel, Grid, Cloud and Internet Computing, 3PGCIC, IEEE Press, 2011, pp. 75–82. [10] M. Srivatsa, L. Liu, Secure event dissemination in publish–subscribe networks, in: Pro. 27th IEEE International Conference on Distributed Computing Systems, ICDCS 2007, IEEE Press, 2007, p. 22.

)



[11] G. Chockler, R. Melamed, Y. Tock, SpiderCast: A scalable interest-aware overlay for topic-based Pub/Sub communication, in: Proc. the 2007 Inaugural International Conference on Distributed Event-Based Systems, DEBS 2007, ACM Press, 2007, pp. 14–25. [12] A. Demers, J. Gehrke, M. Hong, M. Riedewald, W. White, Towards expressive publish/subscribe systems, in: Proc. Advances in Database Technology—EDBT 2006, Springer Press, 2006, pp. 627–644. [13] Shehnaaz Yusuf, Survey of Publish Subscribe Communication System, 2004–2012. http://medianet.kent.edu/surveys/IAD04F-pubsubnet-shennaaz/ Survey2.html. [14] Y. Liu, B. Plale, Survey of Publish Subscribe Event Systems, Technical Report, TR-574, Indiana University Computer Science, 2003. [15] G. Chockler, R. Melamed, Y. Tock, R. Vitenberg, Constructing scalable overlays for Pub-Sub with many topics, in: Proc. the 26th ACM Symp. on Principles of Distributed Computing (PODC), ACM Press, 2007, pp. 109–118. [16] http://en.wikipedia.org/wiki/Prim_algorithm. [17] G. Li, V. Muthusamy, H. Jacobsen, Adaptive content-based routing in general overlay topologies, in: Proc. International Conference on Distributed Systems Platforms and Open Distributed Processing/Open Distributed Processing— Middleware, ODP, Springer Press, 2008, pp. 1–21. [18] A. Majumder, N. Shrivastava, R. Rastogi, A. Srinivasan, Scalable contentbased routing in Pub/Sub systems, in: Proc. INFOCOM 2009, IEEE Press, 2009, pp. 567–575. [19] F. Cao, J.P. Singh, Efficient event routing in content-based publish–subscribe service networks, in: Proc. the 23rd Annual Joint Conference of the IEEE Computer and Communications Societies, INFOCOM 2004, IEEE Press, 2004, pp. 929–940. [20] A. Zahemszky, A. Császár, P. Nikander, C.E. Rothenberg, Exploring the Pub/Sub routing & forwarding space, in: Proc. IEEE International Conference on Communications Workshops, ICC Workshops 2009, IEEE Press, 2009, pp. 1–6. [21] Z. Shen, S. Tirthapura, Faster event forwarding in a content-based publish–subscribe system through lookup reuse, in: Proc. Fifth IEEE International Symposium on Network Computing and Applications, NCA 2006, IEEE Press, 2006, pp. 77–84. [22] S. Hasan, Sean. O’Riain, E. Curry, Approximate semantic matching of heterogeneous events, in: Proc. the 6th ACM International Conference on Distributed Event-Based Systems, DEBS‘12, ACM Press, 2012, pp. 252–263. [23] W. Rao, L. Chen, A.W.C. Fu, H. Chen, F. Zou, On efficient content matching in distributed Pub/Sub systems, in: Proc. INFOCOM 2009, IEEE Press, 2009, pp. 756–764.

Xia Xie is an Associate Professor at Huazhong University of Science and Technology (HUST) in China. She received her Ph.D. in computer architecture from HUST in 2006. Her research interests include performance evaluation and data mining. Contact her at [email protected].

Hongguang Wang is a graduate student at Huazhong University of Science and Technology (HUST) in China. His major is Technology of Computer Application. He focuses on research in data mining. Contact him at [email protected].

Hai Jin is a Cheung Kung Scholars Chair Professor of computer science and engineering at Huazhong University of Science and Technology (HUST) in China. He is now Dean of the School of Computer Science and Technology at HUST. Jin received his Ph.D. in computer engineering from HUST in 1994. In 1996, he was awarded a German Academic Exchange Service fellowship to visit the Technical University of Chemnitz in Germany. Jin worked at The University of Hong Kong between 1998 and 2000, and as a visiting scholar at the University of Southern California between 1999 and 2000. He was awarded Excellent Youth Award from the National Science Foundation of China in 2001. Jin is the chief scientist of ChinaGrid, the largest grid computing project in China, and the chief scientists of National 973 Basic Research Program Project of Virtualization Technology of Computing System, and Cloud Security. Jin is a senior member of the IEEE and a member of the ACM. He has co-authored 15 books and published over 500 research papers. His research interests include

X. Xie et al. / Future Generation Computer Systems ( computer architecture, virtualization technology, cluster computing and cloud computing, peer-to-peer computing, network storage, and network security. Jin is the steering committee chair of International Conference on Green, Pervasive and Cloud Computing (GPC), Asia-Pacific Services Computing Conference (APSCC), International Conference on Frontier of Computer Science and Technology (FCST), and Annual ChinaGrid Conference. Jin is a member of the steering committee of the IEEE/ACM International Symposium on Cluster Computing and the Grid (CCGrid), the IFIP International Conference on Network and Parallel Computing (NPC), and the International Conference on Grid and Cooperative Computing (GCC), International Conference on Autonomic and Trusted Computing (ATC), International Conference on Ubiquitous Intelligence and Computing (UIC).

Feng Zhao is currently an Associate Professor of computer science, Huazhong University of Science and Technology, China. He received his Ph.D. degree in computer science from Huazhong University of Science and Technology in 2006. His research interests include information retrieval, data mining, security and distributed computing.

)



9

Xijiang Ke is a Ph.D. candidate at Huazhong University of Science and Technology (HUST) in China. His research interests include data mining and performance evaluation. Contact him at [email protected].

Laurence T. Yang received the BE degree in Computer Science and Technology from Tsinghua University, China and the Ph.D. degree in Computer Science from University of Victoria, Canada. He is a professor in the School of Computer Science and Technology at Huazhong University of Science and Technology, China, and in the Department of Computer Science, St. Francis Xavier University, Canada. His research interests include parallel and distributed computing, embedded and ubiquitous/pervasive computing. His research has been supported by the National Sciences and Engineering Research Council, and the Canada Foundation for Innovation.