You are on page 1of 7

International Journal of Electronics and Communication Engineering and Technology (IJECET)

Volume 8, Issue 1, January - February 2017, pp. 1117, Article ID: IJECET_08_01_002
Available online at
http://www.iaeme.com/IJECET/issues.asp?JType=IJECET&VType=8&IType=1
ISSN Print: 0976-6464 and ISSN Online: 0976-6472
IAEME Publication

NAIVE APPROACH FOR MEMORY MANAGEMENT IN


SMART HOME GATEWAYS
Kanupriya
M.Tech Scholar, Department of Wireless and Mobile Communication,
GRDIMT, UKTU, Dehradun, India

Samreen Eram
Head of Department, Department of Wireless and Mobile Communication,
GRDIMT, UKTU, Dehradun, India

Ashish Chauhan
Head of Department, Department of Computer Science and Engineering,
Shri Ram Group of Colleges, Muzaffarnagar, Uttar Pradesh, India

ABSTRACT
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.
Key words: Memory Management, OSGi, Internet of Things, Gateway, Bundles
Cite this Article: Kanupriya, Samreen Eram and Ashish Chauhan, Naive Approach for Memory
Management in Smart Home Gateways, International Journal of Electronics and Communication
Engineering and Technology, 8(1), 2017, pp. 1117.
http://www.iaeme.com/IJECET/issues.asp?JType=IJECET&VType=8&IType=1

1. INTRODUCTION
With the trend of making house-hold appliances network-enabled and the wide spread use of the
broadband connections to homes, Internet services are increasingly finding their way to home applications
and gradually changing the traditional lifestyles. Using a home gateway, previously isolated home devices
such as digital camera, air conditioner, monitoring system, etc., can be integrated into a smart home
system. As opposed to connecting traditional computing devices such as PCs, laptops, and PDAs, the
Internet is increasingly used for home appliances such as television sets ,refrigerators ,air conditioners and

http://www.iaeme.com/IJECET/index.asp 11 editor@iaeme.com
Kanupriya, Samreen Eram and Ashish Chauhan

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 users 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.

http://www.iaeme.com/IJECET/index.asp 12 editor@iaeme.com
Naive Approach for Memory Management in Smart Home Gateways

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

http://www.iaeme.com/IJECET/index.asp 13 editor@iaeme.com
Kanupriya, Samreen Eram and Ashish Chauhan

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 sS with the smallest total memory that is Mt:
S argmax {M (T(s)): sS, 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 sS 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,...,i1}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 didnt keep any special name for
application and services, for the sake of our convenience we keep as application 1, application 2 for

http://www.iaeme.com/IJECET/index.asp 14 editor@iaeme.com
Naive Approach for Memory Management in Smart Home Gateways

applications and for services we keep as S1, S2..etc. And the number in bracket represents the
memory of the corresponding service.

Figure 2 A home gateway with two applications.


Now according to SD Heuristic algorithm,
algorithm the heuristic
euristic will pick for deletion the service instance s
which maximizes the ratio of the total memory
memo to the number of dependents:
s argmax {M(T(s))/|T(s)| : 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.
tion.
SD Optimal 1 algorithm works as follows for this example: Let the required memory for incoming
service is 30 units. First of all according to SD optimal algorithm we make the dynamic table for
and for .
Table 1 A (i,k)

Table 2 B (i,k)

http://www.iaeme.com/IJECET/index.asp 15 editor@iaeme.com
Kanupriya, Samreen Eram and Ashish Chauhan

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
dependence forest, describing the dependence among the bundles remaining
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
services in SD optimal algorithm1.

6. 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 the modified SD
Optimal 1 algorithm:
Modified SD optimal 1 algorithm works as follows for above problem:

Figure 4 Modified SD optimal 1 algorithm

http://www.iaeme.com/IJECET/index.asp 16 editor@iaeme.com
Naive Approach for Memory Management in Smart Home Gateways

Figure 5 New
ew dependence forests,
forests after deleting a set of services in Modified SD Optimal 1 algorithm

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 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
higher customers 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 which whi finds the
optimal solution in a polynomial time. The second one is 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
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 performs
performs much better than the traditional memory management
techniques.

REFERENCES
[1] Maples, D., & Kriends, P. (2001).The open services gateway initiative: An introductory overview. IEEE
Communication Magazine, 39(12),110114.
39(12),110
[2] Ali, M., Aref , W.,Bose, R., Elmagarmid, A., Helal, A., Kamel, I.,& Mokbel, M.(2005).NILE-
M.(2005).NILE PDT: A
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-17501750 Processor, International Journal of Electronics and Communication
Technology 7 (3), 2016, pp. 4652
Engineering & Technology,
[4] Bottaro, A., Grodolle, A.,& Lalanda,
Lalanda, P.(2007).Pervasive service composition in the home network. In
st
Proceedings of the 21 International IEEE Conference on Advanced Information Networking and
Applications, Niagara Falls, Canada, May.
[5] Helal , A., Mann, W., El-zabadani,
El H., King, J., Kaddoura,
ura, Y., &Jansen, E.(2005).Gator Tech Smart
House: A programmable pervasive space.IEEEComputer,38(3),5060.
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, International Journal of Advanced Research in Engineering &
Technology,, 6 (8), 2015, pp. 135144.
135
[7] Ishihara, T.(2006).Home Gateway architecture enabling secure appliance control service. In Proceedings
of the 10th International Conference on Intelligence
Intel in Network (ICIN06).
06).

http://www.iaeme.com/IJECET/index.asp 17 editor@iaeme.com

You might also like