76d3fb1df7e7368540826d05d8ee18024c3a04f8
[nepi.git] / doc / user_manual / introduction.tex
1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2 %
3 %    NEPI, a framework to manage network experiments
4 %    Copyright (C) 2013 INRIA
5 %
6 %    This program is free software: you can redistribute it and/or modify
7 %    it under the terms of the GNU General Public License as published by
8 %    the Free Software Foundation, either version 3 of the License, or
9 %    (at your option) any later version.
10 %
11 %    This program is distributed in the hope that it will be useful,
12 %    but WITHOUT ANY WARRANTY; without even the implied warranty of
13 %    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 %    GNU General Public License for more details.
15 %
16 %    You should have received a copy of the GNU General Public License
17 %    along with this program.  If not, see <http://www.gnu.org/licenses/>.
18 %
19 % Author: Alina Quereilhac <alina.quereilhac@inria.fr>
20 %
21 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
22
23 % Motivation
24 During the past decades, a wide variety of platforms to conduct network
25 experiments, including simulators, emulators and live testbeds,
26 have been made available to the research community.
27 Some of these platforms are tailored for very specific use cases (e.g.
28 PlanetLab for very realistic Internet application level scenarios), 
29 while others support more generic ones (e.g. ns-3 for controllable 
30 and repeatable experimentation). Nevertheless, no single platform is 
31 able to satisfy all possible scenarios, and so researchers often rely 
32 on different platforms to evaluate their ideas.
33
34 Given the huge diversity of available platforms, it is to be expected a
35 big disparity in the way to carry out an experiment between one platform and 
36 another. Indeed, different platforms provide their own mechanisms to 
37 access resources and different tools to conduct experiments. 
38 These tools vary widely, for instance, to run a ns-3 simulation it is 
39 necessary to write a C++ program, while to conduct an experiment using
40 PlanetLab nodes, one must first provision resources through a special web
41 service, and then connect to the nodes using SSH to launch any applications
42 involved in the experiment.
43
44 Mastering such diversity of tools can be a daunting task, 
45 but the complexity of conducting network experiments is not only limited 
46 to having to master different tools and services.
47 Designing and implementing the programs and scripts to run an experiment
48 can be a time consuming and difficult task, specially if distributed
49 resources need to be synchronised to perform the right action at the
50 right time. Detecting and handling possible errors during experiment
51 execution also posses a challenge, even more when dealing with large size
52 experiments. Additionally, difficulties related to instrumenting the 
53 experiment and gathering the results must also be considered.
54
55 % Challenge
56 In this context, the challenges that NEPI addresses are manifold. 
57 Firstly, to simplify the complexity of running network experiments. 
58 Secondly, to simplify the use of different experimentation platforms, 
59 allowing to easily switch from one to another. 
60 Thirdly, to simplify the
61 use of resources from different platforms at the same time in 
62 a single experiment.
63
64 % How?
65 The approach proposed by NEPI consists on exposing a generic API
66 that researchers can use to \emph{program} experiments, and 
67 providing the libraries that can execute those experiments on 
68 target network experimentation platforms. The API abstracts the
69 researchers from the details required to actually run an experiment
70 on a given platform, while the libraries provide the code to 
71 automatically perform the steps necessary to deploy the experiment 
72 and manage resources.
73
74 The API is generic enough to allow describing potentially any 
75 type of experiment, while the architecture of the libraries was 
76 designed to be extensible to support arbitrary platforms.
77 A consequence of this is that any new platform can be supported in 
78 NEPI without changing the API, in a way that is transparent 
79 to the users.
80
81
82 \section{Experiment Description}
83
84 NEPI represents experiments as graphs of interconnected resources.
85 A resource is an abstraction of any component that takes part of an 
86 experiment and that can be controlled by NEPI. 
87 It can be a software or hardware component, it could be a virtual 
88 machine, a switch, a remote application process, a sensor node, etc.
89
90 Resources in NEPI are described by a set of attributes, traces and 
91 connections. The attributes define the configuration of the resource,
92 the traces represent the results that can be collected for that resource
93 during the experiment and the connections represent how a resource relates
94 to other resources in the experiment.
95
96 \begin{figure}[h]
97   \centering
98   \includegraphics[width=0.5\textwidth]{intro_resource}
99   \caption{Properties of a resource of type LinuxApplication}
100   \label{fig:intro_resources}
101 \end{figure}
102
103 Examples of attributes are a linux hostname, an IP address to be 
104 assigned to a network interface, a command to run as a remote application.
105 Examples of traces are the standard output or standard error of a
106 running application, a tcpdump on a network interface, etc.
107
108 Resources are also associated to a type (e.g. a Linux host, 
109 a Tap device on PlanetLab, an application running on a Linux host, etc).
110 Different types of resources expose different attributes and traces
111 and can be connected to other specific types (e.g. A resource representing
112 a wireless channel can have an attribute SSID and be connected to a 
113 Linux interface but not directly to a Linux host resource)
114 Figure \ref{fig:intro_resources} exemplifies this concept.
115
116 There are two different types of connections between resources, the 
117 first one is used to define the \emph{topology graph} of the experiment.
118 This graph provides information about which resources will interact
119 with which other resources during the experiment
120 (e.g. application A should run in host B, and host B will be connected
121 to wireless channel D through a network interface C).
122 Figure \ref{fig:intro_topo_graph} shows a representation of the concept of
123 topology graph to describe the an experiment.
124
125 \begin{figure}[h]
126   \centering
127   \includegraphics[width=0.8\textwidth]{intro_topo_graph}
128   \caption{A topology graph representation of an abstract experiment}
129   \label{fig:intro_topo_graph}
130 \end{figure}
131
132 The second type of connections (called conditions to differentiate them 
133 from the first type) specifies the \emph{dependencies graph}. 
134 This graph is optional and imposes constraints on the experiment 
135 workflow, that is the order in which different events occur during the 
136 experiment. For instance, as depicted in Figure \ref{fig:intro_dependencies_graph}
137 a condition on the experiment could specify that
138 a server application has to start before a client application does, or that
139 an network interface needs to be stopped (go down) at a certain time after
140 the beginning of the experiment. 
141
142 \begin{figure}[h]
143   \centering
144   \includegraphics[width=0.8\textwidth]{intro_dependencies_graph}
145   \caption{A dependencies graph representation involving two applications 
146     resources in an experiment}
147   \label{fig:intro_dependencies_graph}
148 \end{figure}
149
150 It is important to note, that the \emph{topology graph} also defines 
151 implicit and compulsory workflow constraints
152 (e.g. if an application is \emph{topologically} connected to a host,
153 the host will always need to be up and running before an application 
154 can run on it). 
155 The difference is that the \emph{dependency graph} adds complementary
156 constraints specified by the user, related to the behavior of the 
157 experiment.
158
159 This technique for modeling experiments is generic enough that can be used 
160 to describe experiments involving resources from any experimentation 
161 environment (i.e. testbed, simulator, emulator, etc). However, it
162 does not provide by itself any information about how to actually deploy
163 and run an experiment using concrete resources. 
164
165
166 \section{Experiment Life Cycle}
167
168 The Experiment Description by itself is not enough to conduct an experiment.
169 In order to run an experiment it is necessary to translate the description 
170 into concrete actions and to perform these actions on the specific resources
171 taking part of the experiment. NEPI does this for the user in an automated
172 manner.
173
174 \begin{figure}[h]
175   \centering
176   \includegraphics[width=0.8\textwidth]{intro_life_cycle}
177   \caption{Common stages of a network experiment life cycle}
178   \label{fig:intro_life_cycle}
179 \end{figure}
180
181 Given that different resources will require performing actions in 
182 different ways (e.g. deploying an application on 
183 a Linux machine is different than deploying a mobile wireless robot), 
184 NEPI abstracts the life cycle of resources into common stages associated
185 to generic actions, and allows to plug-in different implementation of 
186 these actions for different types of resources.
187 Figure \ref{fig:intro_life_cycle} shows the three
188 main stages of the network experiment life cycle, \emph{Deployment}, 
189 \emph{Control} and \emph{Result (collection)}, and the actions that are 
190 involved in each of them. 
191
192 \begin{figure}[h]
193   \centering
194   \includegraphics[width=\textwidth]{intro_state_transitions}
195   \caption{Resources state transitions}
196   \label{fig:intro_state_transitions}
197 \end{figure}
198
199 In order to be able to control different types of resources in 
200 a uniform way, NEPI assigns a generic state to each of these
201 actions and expects all resources to follow the same set of
202 state transitions during the experiment life. The states and
203 state transitions are depicted in Figure 
204 \ref{fig:intro_state_transitions}.
205
206 It is important to note that NEPI does not require these states
207 to be globally synchronized for all resources (e.g. resources
208 are not required to be all ready or started at the same time).
209 NEPI does not even require all resources to be declared and known 
210 at the beginning of the experiment, making it possible to use 
211 an \emph{interactive deployment} mode, where new resources can de 
212 declared and deployed on the fly, according to the experiment needs.
213 This interactive mode can be useful to run experiments with the 
214 purpose of exploring a new technology, or to use NEPI as an adaptive
215 experimentation tool, that could change an experiment according to
216 external conditions or measurements. 
217
218 \section{Resource Management: The EC \& The RMs}
219
220 The Experiment Controller (EC) is the entity that is responsible for 
221 translating the Experiment Description into a running experiment.
222 It holds the \emph{topology} and \emph{dependencies} graphs, and it 
223 exposes a generic experiment control API that the user can 
224 invoke to deploy experiments, control resources and collect results. 
225
226 \begin{figure}[h]
227   \centering
228   \includegraphics[width=\textwidth]{intro_ec}
229   \caption{User interacting with the Experiment Controller}
230   \label{fig:intro_ec}
231 \end{figure}
232
233 As shown in Figure \ref{fig:intro_ec}, the user declares the resources and
234 their dependencies directly with the EC. 
235 When the user requests the EC to deploy a certain resource or a
236 group of resources, the EC will take care of performing all the necessary 
237 actions without further user intervention, including the sequencing of 
238 actions to respect user defined and topology specific dependencies, 
239 through internal scheduling mechanisms. 
240
241 The EC is a generic entity responsible for the global orchestration of
242 the experiment. As such, it abstracts itself from the details of how to
243 control concrete resources and relies on other entities called Resource Managers 
244 (RM)s to perform resource specific actions. 
245
246 For each resource that the user registers in the \emph{topology graph}, the EC
247 will instantiate a RM of a corresponding type. A RM is a resource specific
248 controller and different types of resources require different type of
249 RMs, specifically adapted to manage them.
250
251 The EC communicates with the RMs through a well defined API that exposes
252 the necessary methods (actions) to achieve all the state transitions defined by the
253 common resource life-cycle. Each type of RM must provide a specific implementation
254 for each action and ensure that the correct state transition has been achieved
255 for the resource (e.g. upon invocation of the START action, the RM must take 
256 the necessary steps to start the resource and set itself to state STARTED).
257 This decoupling between the EC and the RMs makes it possible to extend the 
258 control capabilities of NEPI to arbitrary resources, as long as a RM can be 
259 implemented to support it.
260
261 As an example, a testbed \emph{X} could allow to control host resources using a 
262 certain API X, which could be accessed via HTTP, XMLRPC, or via any other protocol.
263 In order to allow NEPI to run experiments using this type of resource, it would
264 suffice to create a new RM of type host X, which extends the common RM API, and
265 implements the API X to manage the resources.
266
267 Figure \ref{fig:intro_resource_management} illustrates how the user, the EC, 
268 the RMs and the resources collaborate together to run an experiment.
269
270 \begin{figure}[h]
271   \centering
272   \includegraphics[width=\textwidth]{intro_resource_management}
273   \caption{Resource management in NEPI}
274   \label{fig:intro_resource_management}
275 \end{figure}