This paper proposes efficient replacement algorithms for managing bundles or services in home gateways. Memory management has been studied extensively in operating system field. Here two algorithms have been proposed. The first one is an extension of Knapsack problem which finds the optimal solution in a polynomial time. The second one is a heuristic that spans the dependency graph and tries to free the required amount of memory while minimizing the number of terminated services. Memory management for software bundles executed in home gateways differs from traditional memory management techniques. Proposed algorithm is implemented as a part of the framework to provide memory management. The gateway can download the corresponding bundles (that correspond to specific services) when it becomes necessary. The gateway tends to terminate the victim service rather than suspending it.
2. Kanupriya, Samreen Eram and Ashish Chauhan
http://www.iaeme.com/IJECET/index.asp 12 editor@iaeme.com
washers (Ishiharaetal.2006;Ryu2006;King etal.2006),and other remote services, such as remote patient
monitoring.
Figure 1 A typical smart home network environment.
Remote medical diagnosis, remote configuration and control of home appliances are some of the most
attractive applications. In the entertainment field, there are several interesting applications, such as
downloading movies on demand and an Electronic Programming Guide (EPG). Electric power companies
are also keeping an eye on home networking because it will allow them to provide value-added services,
such as energy management ,telemetry (remote measurement),and better power balance that reduces the
likelihood of blackouts. These efforts lead towards the so-called “Internet of Things,” which is forecast to
grow vastly larger than the current Internet. In smart home systems, building facilities and networked
appliances communicate and operate with the others to perform the home services. Generally, these
services are invisible and contain a series of diverse functions handled by separated devices. In fact, smart
home can be regarded as a „smarter‟ version of home automation system by adding context ware ability.
Ma et al. (2005) defines „smart space‟ as a space that must have some kinds of levels of abilities of
perception, cognition, analysis, reasoning and anticipation about a user’s existence and surroundings, on
which it can accordingly take proper actions.
2. OSGI FRAMEWORK
Recently there have been a lot of interests to provide new applications for smart homes. Multiple home
network protocols like UPnP, Jini are expected to coexist in the home and inter-operate through the home
gateway. The gateway also acts as a single point of connection between the home and outside world. Open
Service Gateway initiative (OSGi) (The OSGi Service Platform Release 4Core
Specificationversion4.22009; Binstock2006) is a consortium of companies that are working to define
common specifications for the home gateway. According to the OSGi model, the gateway can host
services to control and operate home appliances. In the OSGi model, services are implemented in
software bundles (or modules) that can be downloaded from the Internet and executed in the gateway.
Bundles communicate and collaborate with each other through OSGi middleware and, therefore, some
bundles may depend on other bundles. For example, a home security bundle uses an HTTP bundle to
provide external connectivity. We discusses the memory management in gateways and prioritizing the
memory use to maximize the number of services running simultaneously in the home gateway. We propose
new algorithms for efficient management of service bundles. Due to different architecture, memory
management for software bundles executed in home gateways differs from traditional memory
management techniques.
3. Naive Approach for Memory Management in Smart Home Gateways
http://www.iaeme.com/IJECET/index.asp 13 editor@iaeme.com
The main contribution of the work are:
• Identifying the difference between memory management in home gateway and traditional memory
management problem in a general computing environment (addressed in operating systems
literature).
• Introducing a model for the service replacement in home gateways using a directed dependency
graph.
• Introducing SD(service dependency) optimal algorithm which can work as a benchmark to
compare different algorithms.
• Introducing SD Heuristic algorithm that performs significantly better than traditional memory
management algorithms and close to the optimal solution based on Knapsack problem.
First, we compared the performance of the different algorithms in terms of the number of removed
services to verify our new proposed algorithms. And then evaluate the algorithm execution time to show
that the SD heuristic is practical in a home gateway.
3. PRIOR WORK
Memory management has been discussed extensively in the operating systems literature. Due to
the different architectures, one of the main differences between memory management for smart
home applications and general computer applications is that the former takes into account the
dependencies among different services or bundles, as explained later. To our best knowledge, there
is no study related to the memory management in the context of smart home applications. Vidal et
al. (2006) addressed qos in home gateway. They proposed a flexible architecture for managing
bandwidth inside the home. However, they have not addressed memory management in home
gateways. Alietal. (2005) proposed architecture based on osgi for wireless sensor networks, where
data is processed in distributed fashion. They showed how to execute simple database queries like
selection and join in a distributed fashion. Bottaroetal. (2007) addressed protocol heterogeneity
and interface fragmentation when connecting several devices to osgi-based gateway at home.
4. METHODOLOGY
Generating electrical energy from natural resources and their utilization schemes for feeding the apparatus
are implemented in the system as to promote contributing to alternate energy resources and to reduce the
cost constraints of energy consumption. These schemes are designed to extract maximum solar and wind
energy and used to feed selected appliances of the residential flat. In the absence of sun and wind energy
the power system lines supplying electricity to the flat would take care of powering the selected
appliances. Furthermore, as an additional security concern, an intruder detection system is installed in the
system which when detects an intruder would dial automatically a sequence of digits programmed in the
system as to give remote intimation for the intrusion found. As internet and telephone communication are
quite popularly used nowadays, remote control schemes of selected appliances in flat are also included in
the system as to serve the day to day urgent needs and also for security concerns. This scheme facilitates
the control of appliances distributed in the flat by operating from any other room. Furthermore, a home
Assistant software installed in the system refers the home data base every morning and brings the list of
activities to be performed on that day to screen as to alert the user to be ready for solving the issues of the
day. The software cannot be accessed by any unknown person due to password requirement. Necessary
firewall is incorporated in the web server as to avoid further interruptions due to unauthorized interruption
and to block viruses.
In this section we presents ever algorithms for solving service replacement problem in home gateway.
The first three algorithms are direct adaptation of the well-known first-fit, best-fit and worst-fit algorithms
which select the service(s) to be replaced based on the amount of memory that might become available.
The other two algorithms take into account not only the memory size but also the service dependencies. SD
(Size-Dependency) heuristic is a simple heuristic that runs in O(nh) time and requires linear space, where h
4. Kanupriya, Samreen Eram and Ashish Chauhan
http://www.iaeme.com/IJECET/index.asp 14 editor@iaeme.com
is the height of the forest. Finally SD Optimal algorithm computes an optimal solution in O(n2
) time and
O(nh) space.
4.1. The Simple Algorithm
These traditional techniques make selection based on the amount of memory used and ignore the
dependencies.
First Fit: choose the first service s in the list S={s1,...,sn} such that total memory M(T(s)) occupied by its
sub-tree is at least the requested amount Mt:
K min {1≤ j≤ n |M(T(sj))≥Mt } s sk
If no such node exists(k=∞), pick the node with largest M(T(s)):
S argmax {M(T(s)):s ÎS}
Where argmax {... } denotes a maximum of a given function.
Best Fit: choose the service sÎS with the smallest total memory that is≥ Mt:
S argmax {M (T(s)): sÎS, M(T(s))≥ Mt }
Where argmax {... } denotes a maximum of a given function. If no such node exists (k=∞), pick the node
with largest M (T(s).
Worst Fit: choose the service sÎS with the largest total memory:
S ßargmax {M(T(s)):s ÎS} If no such node exists (k=∞), pick the node with largest M(T(s).
4.2. SD heuristic
Different from the simple algorithms discussed above, our proposed heuristic greedily tries to pick, as a
victim for deletion, the service instance whose removal will free the minimum amount of memory larger
than Mt and, at the same time, it has the smallest number of dependents. Towards this end, the heuristic
will pick for deletion the service instances which maximizes the ratio of the total memory to the number of
dependents:
S argmax {M(T(s))/|T(s)| :s ÎS}
4.3. SD Optimal
We shall consider incrementally the sets S1={s1},S2={s1,s2},S3={s1,s2, s3},...,computing for each set the
maximum amount of memory that can be achieved by deleting a subset of nodes. In order to compute these
maxima, we will need to compute for each node si, the largest index k Î {1,...,i−1}such that sk is not a
descendant of si. Let L(si) denotes such an index.
5. RESULTS
5.1. Problem
In this problem, there are two applications, first application with two dependent services called S1 and S2
are and in second application, there are two dependent services namely S3 and S4, for dependent service
S4 there is an another dependent service S5.It is complex problem so we didn‟t keep any special name for
application and services, for the sake of our convenience we keep as application 1, application 2 for
5. Naive Approach
http://www.iaeme.com/IJECET/index.asp
applications and for services we keep as S1, S2………..etc. And the number in bracket represents the
memory of the corresponding service.
Figure
Now according to SD Heuristic algorithm
which maximizes the ratio of the total memo
s argmax {M(T(s))/|T(s)| : s
Here the ratio M(s*)/|s*| for the different service instances are as follows:
For application 1 is = ((30 +20 +10) / 3) = 20
For application 2 is = ((20 +20 +10 +10) / 4) =15
For service S4 is = ((10 +10) / 2) = 10
There are 3 services which have maximum ratio 20 units, but removal of any service with 20 units,
does not give enough memory to start the new service (requiring 30 memory units). So According to SD
Heuristic there will be no solution.
SD Optimal 1 algorithm works as follows for this example:
service is 30 units. First of all according to SD optimal algorithm we make the dynamic table for
and for .
Approach for Memory Management in Smart Home Gateways
http://www.iaeme.com/IJECET/index.asp 15
applications and for services we keep as S1, S2………..etc. And the number in bracket represents the
corresponding service.
Figure 2 A home gateway with two applications.
SD Heuristic algorithm, the heuristic will pick for deletion
which maximizes the ratio of the total memory to the number of dependents:
s S}.
*| for the different service instances are as follows:
For application 1 is = ((30 +20 +10) / 3) = 20
For application 2 is = ((20 +20 +10 +10) / 4) =15
is = ((10 +10) / 2) = 10
There are 3 services which have maximum ratio 20 units, but removal of any service with 20 units,
does not give enough memory to start the new service (requiring 30 memory units). So According to SD
tion.
works as follows for this example: Let the required memory for incoming
First of all according to SD optimal algorithm we make the dynamic table for
Table 1 A (i,k)
Table 2 B (i,k)
for Memory Management in Smart Home Gateways
editor@iaeme.com
applications and for services we keep as S1, S2………..etc. And the number in bracket represents the
euristic will pick for deletion the service instance s
There are 3 services which have maximum ratio 20 units, but removal of any service with 20 units,
does not give enough memory to start the new service (requiring 30 memory units). So According to SD
Let the required memory for incoming
First of all according to SD optimal algorithm we make the dynamic table for
6. Kanupriya, Samreen Eram and Ashish Chauhan
http://www.iaeme.com/IJECET/index.asp
So after calculating by SD optimal algorithm for the requirement of 30 memory units we get service S3
having 20 memory units and service S2 having 20 memory units to be deleted. So, total 40 memory units
will be deleted. So the new dependenc
after deleting a set of services whose total memory is at least 30 u.
Figure 3 New dependence forest, describing the dependence among the bundles remaining after deleting a set of
6. MODIFIED SD OPTIMAL
In SD Optimal 1algorithm we delete the nodes on concept of first fit algorithm but in modified SD Optimal
1 algorithm we use the concept of best fit in dynamic programming. Now we state
Optimal 1 algorithm:
Modified SD optimal 1 algorithm works as follows for
.
Figure 4
Kanupriya, Samreen Eram and Ashish Chauhan
http://www.iaeme.com/IJECET/index.asp 16
So after calculating by SD optimal algorithm for the requirement of 30 memory units we get service S3
having 20 memory units and service S2 having 20 memory units to be deleted. So, total 40 memory units
will be deleted. So the new dependence forest, describing the dependence among the bundles remaining
after deleting a set of services whose total memory is at least 30 u.
New dependence forest, describing the dependence among the bundles remaining after deleting a set of
services in SD optimal algorithm1.
MODIFIED SD OPTIMAL 1 ALGORITHM
In SD Optimal 1algorithm we delete the nodes on concept of first fit algorithm but in modified SD Optimal
1 algorithm we use the concept of best fit in dynamic programming. Now we state
algorithm works as follows for above problem:
Figure 4 Modified SD optimal 1 algorithm
editor@iaeme.com
So after calculating by SD optimal algorithm for the requirement of 30 memory units we get service S3
having 20 memory units and service S2 having 20 memory units to be deleted. So, total 40 memory units
e forest, describing the dependence among the bundles remaining
New dependence forest, describing the dependence among the bundles remaining after deleting a set of
In SD Optimal 1algorithm we delete the nodes on concept of first fit algorithm but in modified SD Optimal
1 algorithm we use the concept of best fit in dynamic programming. Now we state the modified SD
7. Naive Approach
http://www.iaeme.com/IJECET/index.asp
Figure 5 New dependence forests
7. CONCLUSION
In this paper, we have considered the problem of managing services and bundles in home gateways with
limited amount of main memory. Because of the different
the traditional computer architecture, a key difference between our problem and the traditional memory
management is that the dependencies among different services have to be taken into consideration for a
higher customers‟ satisfaction. We use a dependency graph to model the relationship among services.
This chapter proposes two algorithms. The first one
optimal solution in a polynomial time. The second one i
tries to free the required amount of memory while minimizing the number of terminated services. We
compared the proposed techniques with the traditional memory management algorithms such as the best fit
and worst fit. Our experimental results indicate that SD (service dependency) heuristic is a good candidate
for use in practical environments, as its performance is close to the optimal solution in terms of the number
of stopped services. SD heuristic perform
techniques.
REFERENCES
[1] Maples, D., & Kriends, P. (2001).The open services gateway initiative: An
Communication Magazine, 39(12),110
[2] Ali, M., Aref , W.,Bose,
phenomenon detection and tracking framework for data stream management systems. In Proceedings of
the Very Large Data Bases Conference, August.
[3] Prasad. S. G, Dr Siva Yellampalli and Naveen. V, Design and Development of Memory Management
Unit for MIL-STD-1750 Processor,
Engineering & Technology
[4] Bottaro, A., Gérodolle, A.,& Lalan
Proceedings of the 21st
Applications, Niagara Falls, Canada, May.
[5] Helal , A., Mann, W., El
House: A programmable pervasive space.IEEEComputer,38(3),50
[6] R. Revathi S. Sinthuja Dr. N. Manoharan and N. Rajendiran , Allocation of Power in Relay Networks
for Secured Communication,
Technology, 6 (8), 2015, pp. 135
[7] Ishihara, T.(2006).Home Gateway architecture enabling secure appliance control service. In Proceedings
of the 10th International Conference on Intel
Approach for Memory Management in Smart Home Gateways
http://www.iaeme.com/IJECET/index.asp 17
ew dependence forests, after deleting a set of services in Modified SD Optimal 1 algorithm
In this paper, we have considered the problem of managing services and bundles in home gateways with
limited amount of main memory. Because of the different architecture of home gateway using OSGi from
the traditional computer architecture, a key difference between our problem and the traditional memory
management is that the dependencies among different services have to be taken into consideration for a
satisfaction. We use a dependency graph to model the relationship among services.
This chapter proposes two algorithms. The first one is an extension of Knapsack problem whi
solution in a polynomial time. The second one is a heuristic that spans the dependency graph and
tries to free the required amount of memory while minimizing the number of terminated services. We
compared the proposed techniques with the traditional memory management algorithms such as the best fit
worst fit. Our experimental results indicate that SD (service dependency) heuristic is a good candidate
for use in practical environments, as its performance is close to the optimal solution in terms of the number
of stopped services. SD heuristic performs much better than the traditional memory management
Maples, D., & Kriends, P. (2001).The open services gateway initiative: An
Communication Magazine, 39(12),110–114.
R., Elmagarmid, A., Helal, A., Kamel, I.,& Mokbel, M.(2005).NILE
phenomenon detection and tracking framework for data stream management systems. In Proceedings of
the Very Large Data Bases Conference, August.
Prasad. S. G, Dr Siva Yellampalli and Naveen. V, Design and Development of Memory Management
1750 Processor, International Journal of Electronics and Communication
Engineering & Technology, 7 (3), 2016, pp. 46–52
Bottaro, A., Gérodolle, A.,& Lalanda, P.(2007).Pervasive service composition in the home network. In
International IEEE Conference on Advanced Information Networking and
Applications, Niagara Falls, Canada, May.
Helal , A., Mann, W., El-zabadani, H., King, J., Kaddoura, Y., &Jansen, E.(2005).Gator Tech Smart
House: A programmable pervasive space.IEEEComputer,38(3),50–60.
R. Revathi S. Sinthuja Dr. N. Manoharan and N. Rajendiran , Allocation of Power in Relay Networks
for Secured Communication, International Journal of Advanced Research in Engineering &
, 6 (8), 2015, pp. 135–144.
Ishihara, T.(2006).Home Gateway architecture enabling secure appliance control service. In Proceedings
of the 10th International Conference on Intelligence in Network (ICIN‟06).
for Memory Management in Smart Home Gateways
editor@iaeme.com
Optimal 1 algorithm
In this paper, we have considered the problem of managing services and bundles in home gateways with
architecture of home gateway using OSGi from
the traditional computer architecture, a key difference between our problem and the traditional memory
management is that the dependencies among different services have to be taken into consideration for a
satisfaction. We use a dependency graph to model the relationship among services.
is an extension of Knapsack problem which finds the
s a heuristic that spans the dependency graph and
tries to free the required amount of memory while minimizing the number of terminated services. We
compared the proposed techniques with the traditional memory management algorithms such as the best fit
worst fit. Our experimental results indicate that SD (service dependency) heuristic is a good candidate
for use in practical environments, as its performance is close to the optimal solution in terms of the number
s much better than the traditional memory management
Maples, D., & Kriends, P. (2001).The open services gateway initiative: An introductory overview. IEEE
I.,& Mokbel, M.(2005).NILE- PDT: A
phenomenon detection and tracking framework for data stream management systems. In Proceedings of
Prasad. S. G, Dr Siva Yellampalli and Naveen. V, Design and Development of Memory Management
International Journal of Electronics and Communication
da, P.(2007).Pervasive service composition in the home network. In
International IEEE Conference on Advanced Information Networking and
ura, Y., &Jansen, E.(2005).Gator Tech Smart
R. Revathi S. Sinthuja Dr. N. Manoharan and N. Rajendiran , Allocation of Power in Relay Networks
International Journal of Advanced Research in Engineering &
Ishihara, T.(2006).Home Gateway architecture enabling secure appliance control service. In Proceedings
‟06).