UPnP-based Smart Home Networks
3. All Pervasive Services can be successfully activated eventually and each Worker Node participates in at least one Pervasive Service: The purpose
4.4 Reducing the Heartbeat Traffic
4.5.1 Communication Complexity
Table 4.3, 4.4, 4.5 and 4.6 summarize the traffic reductions of several protocols after applying the proposed techniques. Note that the details of calculating message counts of these protocols have been mentioned in Section 4.2, Section 4.3, and Section 4.4.
This sub-section focuses only on calculating the TRRs of the proposed techniques.
Presence Announcement and leave Announcement From Table 4.3, it is obvi-ous that the messages sent by original PA protocol are reduced by 34, since 1−r/4r·r = 34. Similarly, the ratio of replicated messages between P Aorig (4.5) and P Anew (4.8) are
r· n(S)
4· r · (n(W ) + n(S)).
From (4.4), we can substitute n(W ) by λℓ¯¯· n(S), thus we have 1
4· (¯ℓ/¯λ + 1). The TRR of replicated messages is therefore
1− 1
4· (¯ℓ/¯λ + 1).
Since larger ¯ℓ or smaller ¯λ both cause TRR to be larger, the advantage of the enhanced protocol (P Anew) is greater when the average length of Pervasive Services (¯ℓ) increases and when the average contribution (¯λ) decreases. Empirically, ¯ℓ ranges from 3 to 5, and ¯λ is close to 1. Hence, we can expect that the traffic reductions ranges from 161 to 241. In the worst case, where n(S) = n(W ) = ¯λ = 1, P Anew still reduces the replicated messages by 18. Note that the proposed approach and the analysis results also applies to the leave announcement protocol.
Node Searching Based on Table 4.4, in respect of sending messages, the TRR between N Dorig (4.9) and N Dnew (4.10) is:
1− r
· ¯ℓ= ℓ¯− 1
¯ .
Table 4.3: Traffic Reductions after applying the Decomposing Multicast Traffic
P Aorig P Anew TRR
Sent 4· r r 34
Replicated 4· r · (n(W ) + n(S)) r · n(S) 1 −4·(¯ℓ/¯λ+1)1
Table 4.4: Traffic Reductions after applying Service-based Node Searching
N Sorig N Snew TRR
Sent r· ¯ℓ r ¯ℓ−1ℓ¯
Replicated r· ¯ℓ· (n(W ) + n(S)) r · n(W ) ¯ℓ+¯ℓ+¯¯λ−1λ
On the other hand, the number of replicated messages is reduced by:
r· n(W )
r· ¯ℓ· (n(W ) + n(S)),
which can be further reduced by substituting n(W ) with λ¯¯ℓ · n(S):
n(W )
ℓ¯· (n(W ) + n(S)) = n(S)· ¯ℓ/¯λ
ℓ¯· (n(S) · ¯ℓ/¯λ + n(S)) = 1 ℓ + ¯¯ λ. As a result, the TRR for replicated messages is:
1− 1 ℓ + ¯¯ λ =
ℓ + ¯¯ λ− 1 ℓ + ¯¯ λ .
Again, the advantage of SNS is greater both when ¯ℓ increases or when ¯λ increases, since larger ¯ℓ or smaller ¯λ both cause TRR to be larger. For instance, if ¯ℓ = 4 and λ = 1, then we can expect to reduce the replicated message count by¯ 45. In the worst case, that is, (n(S) = n(W ) = ¯ℓ = 1) and ¯λ = 1, N Snew still reduces the message count of replicated messages by 12.
Heartbeat According to the strategy proposed in Section 4.4, ODH is used when λ <¯ √
n(S) and DMTH is used otherwise. Table 4.5 and Table 4.6 summarize the
analysis results of ODH and DMTH, respectively. So far as the messages sent by Worker Nodes are concerned, the TRR of ODH is -1 since it performs worse than the SSDP for ¯λ times. It is trivial that ODH reduces replicated messages by 1−n(W )+n(S)¯λ . Observe that since lower n(W )+n(S)¯λ implies higher TRR, the smaller ¯λ is, the better ODH performs. It is important to point out that since ODH is unicast-based, the message count of ODH is invariant to the service length (¯ℓ), and thus the equation (4.4) is not applicable to ODH.
On the other hand, DMTH does not produce additional traffic when it sends mes-sages. Thus the TRR is zero. The TRR for the replicated messages are
r· n(S) r· (n(W ) + n(S)).
Again, from (4.4), we can substitute n(W ) by ¯λ¯ℓ · n(S), thus we have 1
ℓ/¯¯ λ + 1. The TRR of replicated messages is therefore
1− 1
ℓ/¯¯ λ + 1 = ℓ¯ ℓ + ¯¯ λ.
Similar to P Anew, the superiority of DMTH over HBorig is greater when ¯ℓ increases and when ¯λ decreases. Since 1 ≤ ¯λ ≤ n(S), so that in the extreme case mentioned in Section 4.4, where ¯λ = n(S) and 2· n(S) = n(W ), from Table 4.6 we know that the message counts are saved by 23. On the contrary, when ¯λ = 1, where ODH is used, the traffic is reduced by n(W )+n(S)n(W )+n(S)−1. On these bases we can conclude that ODH makes the system more scalable when the average contribution is low, since the traffic is greatly reduced by ODH when number of nodes increases. Consequently, the analysis results shown in this sub-section imply a great reduction in network traffic by applying the proposed techniques to UPnP Networks.
Concluding from the above analysis results, there are great reductions in network traffic by applying the proposed techniques to UPnP Networks.
Table 4.5: Traffic Reductions after applying On-Demand Heartbeat
HBorig ODH TRR
Sent r r· ¯λ 1− ¯λ
Replicated r· (n(W ) + n(S)) r · ¯λ 1− n(W )+n(S)¯λ
Table 4.6: Traffic Reductions after applying the Heartbeat by Decomposing Multicast Traffic
HBorig DM T H TRR
Sent r r 0
Replicated r· (n(W ) + n(S)) r · n(S) ℓ+¯¯ℓ¯λ
4.5.2 NS-2 Simulations
To investigate the traffic reductions of the proposed techniques, we simulated a typical home network by using the NS-2 network simulator [74] with two extensions, that is, AgentJ [131] and the IGMP extension [34, 66]. AgentJ enables NS-2 to access Java classes; the IGMP (Internet Group Management Protocol) extension to NS-2facilitates IGMP, which is required to realize the proposed techniques. The simulation parameters are set based on typical local area networks. Specifically, the simulated home network adopts a star topology, where every device and host is connected to a IGMP-capable switching device by a 100 megabits per second link with 5 ms delay. The sizes of packets are normally distributed from 200 to 450 bytes. Drop-Tail is used for queue management. The total simulation time is 120 time units for each scenario. The simulated protocols are implemented as Java classes, which can be accessed via AgentJ wrapper interfaces.
0 50 100 150 200
Figure 4.4: Traffic generated by presence announcement, before and after applying DMT (¯λ = 1 and ¯ℓ = 4)
Figure 4.5: Traffic reductions of presence announcement after applying DMT
0 50 100 150 200 0
1 2 3 4 5 6x 106
Number of Worker Nodes
Traffic (Messages)
Original node searching After applying SNS and DMT
Figure 4.6: Traffic generated by the node discovery protocol, before and after applying SNS and DMT (¯λ = 1 and ¯ℓ = 4)
0 50 100 150 200
70 75 80 85
Number of Worker Nodes
Traffic Reduction Ratio (%)
83.33%
80%
75%
Avg. Service Length = 5 Avg. Service Length = 4 Avg. Service Length = 3
Figure 4.7: Traffic reductions of node discovery after applying SNS and DMT
0 50 100 150 200
Figure 4.8: Heartbeat traffic in a light-loaded system, before and after applying ODH (¯λ = 1 and ¯ℓ = 4)
Presence Announcement and Leave Announcement Figure 4.4 shows the traf-fic generated by SSDP-based PA and by applying DMT when ¯λ = 1 and ¯ℓ = 4. The results show that traffic can be greatly reduced after applying DMT. Similar results can be obtained when ¯ℓ equals to 3 or 5, and when DMT is applied to leave announcement.
All simulations were performed under varying numbers of Worker Nodes, and then we calculated the message counts from the traces generated by NS-2. The numbers of PSMs are determined by the average service length (n(S) = n(W )/¯ℓ). Hence, if n(W ) is fixed in each round of simulation, then n(S) decreases when ¯ℓ increases. The traffic reductions of replicated messages after applying DMT to PA under different service lengths are depicted in Figure 4.5, from which we can observe that more than 90% of replicated messages can be saved. The dotted lines in Figure 4.5 indicate the expected TRRs under different service lengths. Note that the analysis and the simulation results
0 50 100 150 200
Figure 4.9: Heartbeat traffic in a light-loaded system, before and after applying DMTH (¯λ = 1 and ¯ℓ = 4)
are quite consistent. The results are more consistent with the analysis results when n(W ) is greater, since we introduce randomness to the message departure time. Similar consistencies can be perceived for the TRRs of sent messages when ¯ℓ = 3, 4 and 5, which are all approaching 75%.
Node Searching In a similar fashion, we set up simulations for evaluating the en-hancements after applying SNS to the node searching. As mentioned in Section 4.3, DMT is also used after aggregating messages. We can perceive from Figure 4.6 and from Figure 4.7 that the traffic can be reduced by more than 70% after applying the proposed techniques. In Figure 4.7, the dotted lines indicate the expected TRRs under different service lengths. The results are more consistent with analysis results when n(W ) is greater then 50. As for the TRRs of sent messages, the TRRs approach 66%, 75%, and 80% when ¯ℓ equals to 3, 4 and 5, respectively.
0 50 100 150 200
Figure 4.10: Heartbeat traffic in a heavy-loaded system, before and after applying ODH (¯λ = n(S) and ¯ℓ = 4)
Heartbeat Two sets of simulations are conducted to evaluate traffic reductions of HB. Because of 1≤ ¯λ ≤ n(S), ¯λ was set to 1 for the first set of simulations and was set to n(S) for another set. Two proposed heartbeat efficiency enhancement techniques, that is, ODH and DMTH, were both applied to the original heartbeat protocol under different ¯λ values. By comparing Figure 4.8 and Figure 4.9, we can observe that in a light-loaded system (¯λ = 1), DTH performed much better than DMTH. On the contrary, in a heavy-loaded system, where ¯λ = n(S), ODH performs worse than the original protocol (see Figure 4.10), whereas DMTH was still capable of reducing traffic by approximately 50% (see Figure 4.11). As mentioned in Section 4.4, the reason is that ODH sent additional messages when ¯λ > 1. Based on these results we can conclude that ODH is more suitable when ¯λ is low and DMTH is more suitable for high ¯λ, which is consistent with the analysis presented in Section 4.5.1.
0 50 100 150 200
Figure 4.11: Heartbeat traffic in a heavy-loaded system, before and after applying DMTH (¯λ = ¯ℓ = n(S) = n(W ))
Figure 4.12: Traffic reductions of heartbeat after applying ODH when ¯ℓ = 4 and ¯λ = 1
0 50 100 150 200
Figure 4.13: Traffic reductions of heartbeat after applying DMTH when ¯λ = ¯ℓ = n(S) = n(W )
Figure 4.12 depicts the TRRs of message counts after applying ODH. In these experiments, we set ¯ℓ = 4 and ¯λ = 1, similar results were obtained when ¯ℓ = 3 and ℓ = 5. The traffic can be reduced by more than 95% after number of nodes exceeds 50.¯ The dotted lines indicate the expected values of TRR obtained by analysis. Unlike in PA/LA and in ND, the expected TRRs in these simulations are fixed. The expected values of TRR increase when the number of nodes in the system grows. Figure 4.12 also reveals that the expected results are consistent with simulated results.
According to (4.16), the heartbeat protocol switches to DMTH when ¯λ is greater than √
n(S). Hence, we set ¯λ = ¯ℓ = n(S) = n(W ) to ensure that DMTH is chosen.
Figure 4.13 shows the TRRs after applying DMTH. The results show that even the system was heavy-loaded, the traffic was still reduced by more than 47%. These results are also consistent with the analysis results, and they are more coherent when n(W )
10 20 30 40 50 60 70 80 90 100 0
1 2 3 4 5 6 7 8x 104
Node Mobility (%)
Traffic (Messages)
Original PA/LA
Original PA/LA (without background traffic) After applying DMT
After applying DMT (without background traffic)
Figure 4.14: Evaluating the proposed schemes in a real home network, where ¯λ = 1 and ¯ℓ = 2, when only PA and LA are enabled.
is greater then 100.
4.5.3 Experiments
To investigate the effectiveness of the proposed approaches when deploying in a real en-vironment, we conducted prototype-based experiments in a small-scale switched home network. In these experiments, the original and proposed schemes are implemented and integrated. Then, we evaluate these protocols under different node mobility, that is, the frequency of leaving and joining the network, in a home network.
The home network consists of two PSMs and four Worker Nodes. Each PSM is installed on an IBM X61 notebook with Intel Core 2 Duo 1.8 GHz CPU and 2G RAM, whereas each Worker Node is installed on an IBM X31 notebook with Intel Pentium-M 1.6 GHz CPU and 512MB RAM. The machines are interconnected by an IGMP-capable
10 20 30 40 50 60 70 80 90 100
Original PA/LA and node searching (without background traffic) Afger applying SNS and DMT
Afger applying SNS and DMT (without background traffic)
Figure 4.15: Evaluating the proposed schemes in a real home network, where ¯λ = 1 and ¯ℓ = 2, after enabling PA, LA and node searching.
switch (D-Link DES-3526), and are able to access the internet via a router (DrayTek Voyger 2104). On each machine, an instance of Wireshark packet sniffer1 is installed in order to capture and analyze the network traffic. In addition, to facilitate all nodes to start execution at approximately the same time and to dispatch the parameters to each node more efficiently, each PerNode is instrumented so that it receives multicast control messages sent by a centralized experiment controller. The experimental environment is configured so that there are two Pervasive Services and each of them is with r = 1, ℓ = 2, and λ = 1. After being executed, a Worker Node runs for 120 time units, which is equal to the heartbeat period. According to the assigned value of node mobility, an action vector that indicates when a node should join or leave the network is generated.
For example, 50% mobility causes a node to leave and then to re-join the network in 60 time units, which are randomly distributed over 120 time units. In addition, the
1The Wireshark packet sniffer, available at http://www.wireshark.org
10 20 30 40 50 60 70 80 90 100
Figure 4.16: Evaluating the proposed schemes in a real home network, where ¯λ = 1 and ¯ℓ = 2, after enabling all protocol capabilities.
heartbeat process is implemented as a separate thread in order to prevent the heartbeat periods from being interfered by the main process.
Figure 4.14, Figure 4.15, and Figure 4.16 depict the message counts when the node mobility increases. In the first experiment (Fig. 4.14), the heartbeat and node searching capabilities are turned off. The results show that even in a small scale network, the PA/LA traffic can still be greatly reduced by applying DMT. Also note that the PA/LA message count increases when the node mobility is higher, since a node performs PA/LA whenever it joins/leaves the network. In Fig. 4.15, the node searching capability is turned on, so that the network traffic slightly increases. Again, higher node mobility increases the message counts of node searching, since when PA/LA messages are observed, a PSM either finds that one of its affiliating Worker Node leaves or some nodes re-join the network. In either case, the PSM will re-compose the service
by performing node searching. Thus, the message count of node searching is roughly in proportion to the node mobility. In Fig. 4.15, the traffic does not increase much since the size of network is small. In the third experiment (Fig. 4.16), all capabilities are enabled, so that the traffic is greatly increased. In this experiment, the re-joining time is relatively short due to the scale of the network. As a result, the message counts of heartbeat are less sensitive to node mobility. On the other hand, the traffic of heartbeats decreases when the average time to re-join the network of a node is too long, since an absent node does not send any heartbeat message.
4.5.4 Discussion
This sub-section discusses costs and limitations of the techniques we have proposed so far. Currently, the proposed techniques are tightly coupled with UPnP networks.
However, the core ideas of these techniques are still applicable to other service models.
Specifically, DMT is useful when the protocol is based on single IP multicast channel and some unbalanced communication patterns can be observed. When information is known in advance, it is helpful to aggregate several search requests into one as long as the package size is less than a unit of transportation (theoretical size of an UDP packet is 65527 bytes). Finally, the comparisons of ODH and DMTH give us the insight that as a heartbeat mechanism, unicast is much more efficient than multicast when the number of monitors/managers are related much fewer than the number of service entities (i.e. Worker Nodes in PerSAM).
As mentioned in 4.3, when applying SNS, the size of an aggregated message can exceed MTU or even the maximum size of an UDP when ¯ℓ is too large. As a result, SNS may not work properly when the size of an aggregated message exceeds the UDP packet limit (65527 bytes). From (4.11) we can obtain the theoretical upper bound of the ¯ℓ, which is approximately 652. In other words, the theoretical limitation for
applying SNS is when the average service length is smaller than 652.
Mobility is one of the most important issues in a pervasive network, since nodes can join or leave the network at anytime. While this issue has been addressed in Chapter 3, we assume that all nodes are always available in the analysis to simplify and clarify the presentation. In a highly dynamic network, where n(W ) and n(S) change drastically, one has to add an additional time parameter, and then performs a summation over a time period. On the other hand, if n(W ) and n(S) are relatively stable, where the number of nodes does not change significantly, then the analysis results are still good approximations of the message reductions. In these cases, given that the advertising and searching messages are emitted constantly, DMT and SNS are still able to reduce more message counts. However, the TRR (see Definition 10) is not affected. Likewise, to make the network more sensitive to the mobility, one has to increase the heartbeat rate and therefore the heartbeat traffic. As a result, DMTH and ODH are able to reduce more messages while TRR does not affected.
Compatibility can also be an issue, since the proposed approaches are extensions of UPnP/SSDP. According to the UPnP specification, UPnP Devices do not process the headers other than ”ssdp:”. So that we can avoid the interferences between legacy UPnP devices and PerNodes by introducing additional headers in SSDP MAN header.
More specifically, PSMP uses an unique ”psmp:” header to distinguish from ”ssdp:”
headers used by SSDP. As a result, PerSAM nodes and traditional UPnP Devices are able to co-exist in the same network without interfering with one another.
Observe that the DMT technique is only effective when the router or home gate-way supports IGMP[34]. Otherwise, the routers broadcast packets to all endpoints instead of sending packets only to the listeners of multicast addresses. Recently we notice that there is an increasing number of low-end IGMP-capable routers available in the consumer markets. To name a few, D-Link DES-1228 and DrayTek Vigor 2110
are examples of IGMP-capable routers, for which the prices are less than 200 USD.
Therefore, we believe that the proposed techniques will be realizable in most home networks in the near future. If there are more than one switch in the network, it will result in greatest traffic reduction if each switch is IGMP-capable. If only a few IGMP-capable switches are available, then the one with the highest performance and being IGMP-capable should be deployed at the root of the tree.
Finally, the correctness of the analysis results can be interfered when the system suffered from extremely high loads, where the message arrival rate is larger than the message consumption rate. The Worker Node starts dropping messages when the size of un-processed messages exceeds the buffer size, causing the accuracy of analysis results being affected. However, in an MOM-based pervasive system, it is reasonable to assume short data processing time since most of the tasks are I/O bound and MOM-based I/O is asynchronous (fire-and-forget). Besides, since the average service length ¯ℓ is used throughout the analysis process, the accuracy can be interfered when the variation of service lengths is large. This is because the service length affects the message count of node searching. As mentioned earlier, the service lengths typically range from 3 to 5 in practice so that the variation of ¯ℓ is limited. Likewise, the average contribution λ is used in the analysis. λ has great impact to the traffic of heartbeat. Therefore, it¯ can be difficult to determine whether to use ODH or DMTH when the variation of λ is significant. In this case, DMTH is a better choice, since it does not cause negative effect, as discussed in Section 4.4.
4.6 Summary
Many popular service management protocols uses broadcast-based or multicast-based group communication mechanisms, which, if not carefully designed, tend to flood the network with unnecessary messages. Therefore, a compact service management
pro-tocol should be designed to minimize the downtime of a system while maintaining low message counts. In this chapter, we present the design, analysis, simulations, and experiments of several techniques for boosting the network efficiency - Decomposing Multicast Traffic, Service-based Node Searching, Heartbeat by Decomposing Multicast Traffic and On-Demand Heartbeat - based on PerSAM and PSMP. Both analysis re-sults and simulation rere-sults reveal that the proposed approaches can reduce message counts of presence and leave announcement, node searching, and heartbeat by more
pro-tocol should be designed to minimize the downtime of a system while maintaining low message counts. In this chapter, we present the design, analysis, simulations, and experiments of several techniques for boosting the network efficiency - Decomposing Multicast Traffic, Service-based Node Searching, Heartbeat by Decomposing Multicast Traffic and On-Demand Heartbeat - based on PerSAM and PSMP. Both analysis re-sults and simulation rere-sults reveal that the proposed approaches can reduce message counts of presence and leave announcement, node searching, and heartbeat by more