• 沒有找到結果。

Comparison of Analytical Models of TPSN and TSS

Chapter 2 Related Work 5

3.3 Comparison of Analytical Models of TPSN and TSS

The internal clock drift error (Eint) is caused by the clock drift of the sink node between the arrival time of a data packet (e.g., Data2 packet) and the arrival time of the previous data packet (e.g., Data1 packet) carrying the accumulative hop-by-hop delay of the previous packet (e.g., Data1 packet). This clock drift error is internal in the sense that the error is contributed solely by the sink node's local clock. Denote the average inter-arrival time of a packet stream as P. The amount of clock drift from the packet inter-arrival times can be derived as follows.

Eint =r · P (3.12)

The aggregate synchronization error for TSS (Etss) is the sum of these three error compo-nents. Combining Equations 3.10, 3.11, and 3.12 gives the following equation for Etsss.

Etss=l(u + r · d) + r · P (3.13)

3.3 Comparison of Analytical Models of TPSN and TSS

In the analytical models of TPSN and TSS, we have found that they both have three identical error components. The rst one is the protocol-specic hop delay estimation error (Esync). In TPSN, this comes from the asymmetry of packet exchange between two nodes. In TSS, this is the propagation delay of an acknowledgement packet.

The second component is the clock skews (Eext) over the end-to-end delay. When the sync message propagates through the network, the time that this information stays on each intermediate node would contribute some errors from the clock skews. In TSS, this is the end-to-end delay of each data packet from a source node to a sink node. In TPSN, it is the end-to-end delay of each sync message from the root node to a target node.

The third component is the amount of local clock drift (Eint) over the last synchro-nization point. In TPSN, synchrosynchro-nization is done periodically, so the amount of local

18 CHAPTER 3. MECHANISMS AND ANALYTICAL MODELS

clock drift is proportional to how fast the network is re-synchronized. Interestingly, this error also shows up in TSS. Because the clocks in TSS are synchronized by the acknowl-edgement packets, there are also time intervals between the times when the clocks are synchronized and when the local clocks are being used. If the source nodes send data packets in a constant rate, this time interval will basically be the interval of sending data.

Chapter 4 Simulation

TPSN and TSS were implemented on the ns-2 simulator [5]. We describe the details for the simulation setup, evaluation metrics (error and overhead), and evaluation variables (network size, node mobility level, and trafc volume). Based on the analytical models derived in Chapter 3, we analyze the impacts of changing these evaluation variables on the evaluation metrics. We also veried the analytical model by the simulation results.

4.1 Simulation Setup

In all simulations, the sensor nodes are placed on a predened grid in a uniformly random fashion. The data sink is xed in one corner of the grid, while other nodes are randomly chosen as data sources. The communication range of all nodes is set to be 40 meters. Each node has a constant clock skew rate selected from 0.5 × 106 to 1.5 × 106. Other setup aspects include directed diffusion [11], a well-known data-centric routing mechanism, and IEEE 802.11, a popular wireless link technology. The simulation time is 400 seconds. The data used are restricted to those collected after 100 seconds simulation time. This avoids taking the start-up time instability into the simulation results.

19

20 CHAPTER 4. SIMULATION

For all of the evaluation parameters, the base case is dened to have 40 nodes on an 80 × 80 m2grid, and 10 of these sensor nodes are data sources. Each source sends a 100 bytes data packet every 5 seconds. Unless specied otherwise, these are the default values for the parameters.

An uncertain CPU processing delay before transmitting time-sync messages con-tributes errors in TPSN and TSS. We however do not to simulate this uncertainty in the simulations for two reasons: (1) the uncertainty is hardware dependent, and there is no model proposed yet to simulate it in a simulator; and (2) omitting CPU processing time is applied to both TPSN and TSS, making it a fair comparison. Omission of CPU processing delay makes the forward and reverse link delay in TPSN perfectly symmetric. In addition, it also reduces the hop-delay estimation error in TSS.

4.2 Evaluation Metrics

In order to evaluate the performance of event synchronization and clock synchronization, the following two metrics are investigated:

Synchronization Error: This represents the difference between actual data genera-tion time and estimated data generagenera-tion time. The correctness of the estimated data generation time is important, because it is used to infer temporal relation and order of detected events. Inaccurate temporal information can cause incorrect application semantics.

Overhead: This represents the trafc produced due to the synchronization mecha-nisms in proportion to the total data trafc. Lower synchronization overhead im-plies higher throughput and efciency of the network.

4.3. EVALUATION VARIABLES 21

4.3 Evaluation Variables

To compare the error and overhead of the two time synchronization mechanisms, scenar-ios are simulated with varying network sizes, node mobility levels, and data rates.

Network Sizes: To vary the network sizes, the number of nodes is changed from 20 to 140 with incremental steps of 20 nodes. In order to x the network density with increasing number of nodes, the grid size is varied accordingly.

Node Mobility Levels: In the node mobility model, each node has a randomly gen-erated target location and moves to that location with a random speed (maximum speed 10 m/s). To change the levels of node mobility, the pause time between the target locations is adjusted from 0 to 400 seconds. A smaller pause time means higher mobility.

Data Rates: To vary the data rates, we adjust the packet sending rates at the source nodes, from a xed-size packet every 4 (22) seconds to every 0.015625 (26) sec-ond. A higher data rate means a higher trafc volume.

4.4 Simulation Results

We report our simulation results in the order of evaluation variables listed above: (1) the effects of varying network sizes on accuracy and overhead of the clock-sync (TPSN) and event-sync (TSS) mechanisms, (2) the effects of varying node mobility levels, and (3) the effects of varying data rates. For each simulation scenario, we generate ten random cases, in which each case represents a different network topology and pairs of source-sink nodes. The synchronization error and overhead are obtained by running both the clock-sync (TPSN) and event-clock-sync (TSS) on the same ten random cases per scenario. Each data

22 CHAPTER 4. SIMULATION

point in the simulation results shows the average values of these ten random cases in each scenario.

To verify that the analytical model (described in Chapter 3) is consistent with the sim-ulation result, we check how well the actual synchronization error measured from the simulation matches with the expected synchronization error derived from our analytical models. If they match well, simulation results validate our analytical models. In order to compute the expected synchronization error from the analytical models, it requires plug-ging in the correct values for parameters (u,l,P,T, and d) in Equations 3.6 and 3.13. The correct values for these parameters: u (the average hop delay estimation error) and r (the average clock skew rate) can be obtained directly from the network topology and trafc volume settings in our simulation scenarios. The correct values for the parameters: l (the average node level in TPSN or the average path length in TSS), d (the average elapsed time for pair-wise synchronization), T (the synchronization period in TPSN), and P (the average packet inter-arrival time in TSS) can be observed during simulation. For example, to compute TPSN's Eext, the values for l and d are collected during the simulation, and then multiplied with r (set to be 106) to compute Eext. Then, we can plug-in these para-metric values into the analytical models to compute three individual error components Esync, Eint, and Eext. Furthermore, we can sum these three error components to compute expected overall errors (Et psn)0and (Etss)0.

Figure 4.1 & 4.2, 4.4 & 4.5 and 4.7 & 4.8 shows the synchronization error decomposed into three individual error components for the TPSN and TSS under different network sizes, node mobility levels, and data rates. Each plot contains the following ve lines:

Line (1) shows the actual simulation results of Et psnand Etss;

Lines (2)-(4) show the expected Esync, Eint, and Eext obtained by applying the sim-ulation's values to Equations 3.3 ∼ 3.5 and 3.10 ∼ 3.12 in the analytical models;

4.4. SIMULATION RESULTS 23

and

Line (5) shows the expected synchronization errors (Et psn)0and (Etss)0as the sums of the above three error components. Note that they are expected values different from the actual values (Et psn and Etss) measured in the simulation.

By observing the similar trends and magnitudes between lines (1) and (5) in Figure 4.1 &

4.2, 4.4 & 4.5 and 4.7 & 4.8, we can check if the analytical models are consistent with the simulation results for both TPSN and TSS. Note that there will be small discrepancies be-tween these two lines because (Et psn)0 and (Etss)0are the expected synchronization error computed from analytical model, whereas Et psn and Etss are the actual synchronization error from simulation.

4.4.1 Impact of Network Size on Accuracy and Overhead

Figure 4.1 shows the synchronization error of TPSN under different network sizes. The actual synchronization error from the simulation is shown as line (1), and it exhibits a growing trend as the network size increases. This is expected given that a larger network size implies a higher level of the clock synchronization hierarchy, therefore, lengthens the path for a sync message to travel from the root node to a target node. The expected synchronization error derived from the analytical model is shown as line (5), and it also exhibits the same growing trend as the actual synchronization error from the simulation.

Close similarity between lines (1) and (5) shows that simulation results are consistent with our TPSN analytical model. To gain better understanding on how network size affects TPSN's synchronization error, we analyze the changes in these three error components (Esync, Eint, and Eext) under different network sizes. Esync is shown as line (2) in Figure 4.1. It is a zero line for reasons given at Section 4.1: i.e., the simulator is congured such that the forward link delay and the reverse link delay are perfectly symmetric, making

24 CHAPTER 4. SIMULATION

Figure 4.1: [Simulation] Synchronization errors for TPSN under different network sizes.

(u = 0). Eext is shown as line (3) in Figure 4.1. It also exhibits a growing trend with increasing network size. This is in accordance with Equation 3.4 – since a larger network size increases the depth of TPSN tree hierarchy (l), this also leads to higher Eext. Eint is shown as line (4) in Figure 4.1. It also exhibits a growing trend with increasing network size. This is somehow unexpected by our analytical models. Given that the clock skew rate (r) and synchronization period (T) are xed in the simulation setup, Equation 3.5 says that Eint should not change with increasing network size. After analyzing the sim-ulation results, we have found an interesting relation between the network size and the synchronization period (T). This relation provides an explanation for the growing Eint. This relation can be explained as follows: (1) a larger network increases the average syn-chronization path length between the root node and other nodes down the hierarchy, (2) a longer path length leads to a higher probability of lost sync messages on that path, and (3) missing sync messages has the same effect as increasing the synchronization period (T).

4.4. SIMULATION RESULTS 25

Given the presence of this relation, we can derive the adjusted synchronization period (T0) as a function of the message lost probability p (which is a function of the hierarchy level l) and original synchronization period (T):

T0∝ 1

1 − p(l)·T (4.1)

Figure 4.2: [Simulation] Synchronization errors for TSS under different network sizes.

Figure 4.2 shows the synchronization errors of TSS under different network sizes. The actual synchronization error from the simulation, shown as line (1), matches well with the model's expected synchronized error, shown as line (5). In other words, simulation results are consistent with our TSS analytical model. Next, we analyze the changes in three error components (Esync, Eint, and Eext) under different network sizes. Esync and Eext shown as lines (2) and (3) exhibit a growing trend, while Eint shown as line (4) is at. This is in accordance with Equations 3.10 and 3.11, which say that Esync and Eext are affected by the length of data path from the source node to the sink node (l), which grows with

26 CHAPTER 4. SIMULATION

increasing network sizes. On the other hand, Eint is not affected by the changing network sizes, because the network size has no effect on any factors in Equation 3.12. Although both Esyncand Eextgrow with increasing network size, their scales (< 0.1µs) are one order of magnitude smaller than Eint (2 ∼ 3µs). As a result, the overall TSS error is dominated by the at Eint.

Figure 4.3: [Simulation] Protocol overhead of TPSN and TSS under different network sizes.

Figure 4.3 shows the protocol overhead ratios of TSS and TPSN under different net-work sizes. The overhead ratio is dened as the ratio between the amount of protocol overhead and the amount of data payload transfer. The overhead ratio of TSS increases only slightly with increasing network size, because TSS needs additional state establish-ment packets with longer data path. On the other hand, the overhead ratio of TPSN in-creases more dramatically than that of TSS. As the network size inin-creases, the amount of synchronization packets in TPSN increases more rapidly than the amount of data packets.

4.4. SIMULATION RESULTS 27

Simulation results and analytical models have shown that TSS has smaller synchro-nization error, lower protocol overhead, and better scalability than TPSN under increasing network size.

4.4.2 Impact of Node Mobility Level on Accuracy and Overhead

Figure 4.4: [Simulation] Synchronization errors for TPSN under different node mobil-ity levels.

Figure 4.4 shows the synchronization error of TPSN under different node mobility levels. Node mobility levels are adjusted by changing the amount of pause time (from 0 ∼ 400 seconds) in the simulation. The actual synchronization error from simulation, shown as line (1), exhibits a growing trend as node mobility level increases. This is expected given that higher node mobility brings about more rapid change in the TPSN synchronization hierarchy. Before a new hierarchy is re-discovered by the mobile nodes that have moved away from their old neighbor nodes, they may not receive any

synchro-28 CHAPTER 4. SIMULATION

nization messages. As a result, their local clocks may continue to drift out-of-sync. Next, we apply the analytical models to help explain the effects of different node mobility levels on TPSN's synchronization error. We decompose the overall synchronization error into three error components (Esync, Eint, and Eext) shown in Figure 4.4. For the reason given at the end of Section 4.1, Esync , shown as line (1), is a zero line. Eext shown as line (3) exhibits a relatively at line. This is expected given that a higher level of node mobility does not change the size of the synchronization hierarchy l. Eintshown as line (4) exhibits a growing trend with increasing levels of node mobility. This is also expected given the following reasoning: higher node mobility implies higher probability of broken hierar-chy, which in turn leads to higher probability that nodes may fail to be synchronized with upper level nodes. This has the same effect as raising the average synchronization time interval T, causing higher synchronization error. An interesting phenomenon in TPSN is that when the node mobility level moves to the high end of the extreme (pause times = 50 ∼ 0 seconds), the synchronization error actually falls. This phenomenon can be ex-plained as follows: since high mobility enables the root node to encounter more one-hop neighbor nodes over the course of its movements (high mobility in non-root nodes also increases the probability that they will encounter the root node); therefore, mobility helps to spread the root node's global clock to a larger number of level-1 neighbor nodes. This is an example where mobility can sometimes be a positive factor.

Figure 4.5 shows the synchronization error of TSS under different node mobility lev-els. The actual synchronization error from simulation is shown as line (1). It exhibits a two-step behavior - a at line under low node mobility, but changes to a steep line under high node mobility. This two-step behavior can be explained by decomposing the overall synchronization into three error components (Esync, Eint, and Eext) and analyzing them.

Esyncshown as line (2), exhibits a decreasing trend with increasing node mobility levels.

The reason is the restriction on the routing mechanism - when the network is dynamic

un-4.4. SIMULATION RESULTS 29

Figure 4.5: [Simulation] Synchronization errors for TSS under different node mobility levels.

der high node mobility, data is more likely to be dropped before reaching the sink node.

Therefore, the average data path length (counting dropped packets) will decrease. Sim-ulation results conrm this observation. Eext shown as line (3), exhibits a slight growing trend with increasing node mobility. This is in accordance with Equation 3.11, which says that the positive factor inuencing Eextis the hop delay (d). The increase of Eext is mainly due to a larger d induced in a dynamic network. This is due to data packets spending more time waiting on intermediate nodes that are searching for the next hop to forward the data packets. Simulation results conrm this observation. In addition it shows that the effect of a larger d, which raises Eext, dominates the effect of shorter l, which lowers Eext. As a result, Eext exhibits a growing trend. Eint also exhibits a growing trend with increasing node mobility. This growth is mainly due to a larger data packet inter-arrival time (P). The rise in packet inter-arrival time is caused by frequent switching of routing

30 CHAPTER 4. SIMULATION

paths. Switching of routing paths is a result of intermediate nodes repeatedly moving in and out of routing paths, making use of previously established time-sync states on nodes.

Since Eint is the dominant factor, the overall sync error exhibits the growing trend.

Figure 4.6: [Simulation] Protocol overhead of TPSN and TSS under different network sizes.

Figure 4.6 shows the protocol overhead ratios of TSS and TPSN under different lev-els of node mobility. Since higher node mobility results in higher frequency of topology changes, extra packets are sent to reconstruct the new TPSN hierarchy. As a result, the protocol overhead is raised. In contrast, TSS does not maintain any synchronization hier-archy. TSS has to re-establish time-sync states on the new routing paths when intermedi-ate nodes move out of the routing paths. However, the amount of overhead increased in TSS is not as signicant as TPSN.

Simulation results and analytical models have shown that TSS has smaller synchro-nization error and lower protocol overhead than TPSN under increasing network

dynam-4.4. SIMULATION RESULTS 31

ics. Although TSS has smaller synchronization error than TPSN, TSS's synchronization error grows steeper than TPSN under high node mobility, making TSS less scalable than TPSN.

4.4.3 Impact of Date Rate on Accuracy and Overhead

Figure 4.7: [Simulation] Synchronization errors for TPSN under different data rates.

Figure 4.7 shows the synchronization error of TPSN under different data rates. Data rates are adjusted by changing the data packet sending rates at source nodes. The actual synchronization error from the simulation, shown as line (1), exhibits a two-step behavior.

These two steps can be explained as follows. High trafc volume eventually leads to network congestion and packet loss. In the simulation scenario, this congestion point is the point connecting these two steps (i.e., the packet sending interval is approximately 23second). If the lost packets contain sync messages, nodes will miss synchronization rounds. Missing synchronization rounds has the same effect as increasing the sync period

32 CHAPTER 4. SIMULATION

(T). Equation 3.6 says that increasing T leads to higher synchronization error. Next, we decompose the overall synchronization error into three error components (Esync, Eint, and Eext) shown in Figure 4.7. Again Esync is a zero line for the reason given at the end of

(T). Equation 3.6 says that increasing T leads to higher synchronization error. Next, we decompose the overall synchronization error into three error components (Esync, Eint, and Eext) shown in Figure 4.7. Again Esync is a zero line for the reason given at the end of

相關文件