Download doc, 33kb

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Library (computing) wikipedia , lookup

Structured programming wikipedia , lookup

Go (programming language) wikipedia , lookup

Program optimization wikipedia , lookup

C Sharp (programming language) wikipedia , lookup

History of compiler construction wikipedia , lookup

Compiler wikipedia , lookup

Interpreter (computing) wikipedia , lookup

Transcript
Programming Active Network in PLAN-P
Gilles MULLER
COMPOSE group, http://www.irisa.fr/compose IRISA/INRIA, Campus de Beaulieu, 35042
Rennes Cedex
Abstract. PLAN-P is a safe and efficient language aimed at programming active networks. Safety is enforced by
restricting the programmer to constructs for which it is possible to prove properties statically. Efficiency is provided by
dynamic compilation on routers and kernel-level execution. This paper present the PLAN-P language, its run-time
system and some of the experiments.
The full version of this paper can be found on the World-Wide Web at http://www.irisa.fr/compose/plan-p
1. PLAN-P Overview
PLAN-P [3, 4] is a Domain Specific Language (DSL) aimed at programming active networks in
a safe and efficient manner. PLAN-P programs can be used to build applications based on IP,
UDP, or TCP. PLAN-P programs are downloaded into the IP layer on the end-host machines and
any number of routers in the network. The PLAN-P system does not require any changes to
existing packet formats, and thus, PLAN-P routers operate seamlessly within existing networks.
The PLAN-P language is based on PLAN [2]. While PLAN-P retains most of the syntax of
PLAN, the semantics are significantly different. PLAN is an agent-like language where every
packet in PLAN is a mobile program. In contrast, PLAN-P programs describe protocols that are
downloaded into routers and remain on the router treating all relevant packets.
2. Safety and Security
One of the most important advantages of using a DSL for extensible systems such as an active
network is the possibility of automatic verification for safety and security. This is particularly
important for router software that operates at kernel level. Security is important because routers
are shared resources. Safety is important because of the difficulty of debugging code within the
kernel. Also, in the case of PLAN-P, protocols are distributed, further increasing the difficulty of
debugging.
PLAN-P programs can automatically be checked to guarantee that: (i) local packet treatment
terminates, (ii) packets do not cycle within the network, (iii) all packets are delivered, and (iv)
packet duplication is non-exponential. Each of these properties can be automatically checked due
to certain restrictions or domain-specific attributes of the language. In a general-purpose
language (e.g. C or Java), such properties cannot be proved automatically.
The cost of this safety is expressiveness. For example, in order to ensure the termination of
local packet treatments, PLAN-P does not include general purpose loops. However, PLAN-P
provides a loop construct that iterates over list elements. This proved to be sufficient in the
various experiments that we have conducted [3, 4].
3. Efficient Execution via Run-time Specialisation
While the use of a DSL can allow the automatic verification of important program properties, the
corresponding analyses require the program source at run time in order to check the program
(late checking). Downloading the source requires that PLAN-P programs be interpreted, which is
too slow, or compiled, which is too costly. Of course, one can imagine developing forms of justin-time (JIT) compilers for PLAN-P. However, regardless of the compilation technology, an
additional problem with this approach has to do with the heterogeneous nature of the network
which requires a compiler to be available for each architecture.
To solve the conflict between late program checking and performance, we propose to use runtime program specialisation [1]. Program specialisation is a program transformation that
specialises a program with respect to some known inputs by computing expressions that only
depend on these inputs. We have implemented a PLAN-P interpreter which is written in C to be
portable on all routers. However, our interpreter is specialised with respect to a PLAN-P
program in order to eliminate the interpretive overhead. Because the program is not available
until run time, a run-time form of program specialisation is used. Our approach relies on a
program specialiser for C called Tempo which is able to specialise programs at run time [1], thus
providing the functionality of a JIT compiler.
Tempo performs run-time code generation by assembling and patching machine code
templates at run time. These templates, and the program that assembles and patches them are
automatically generated and compiled off-line. This approach is very portable because the
machine code templates are generated using a standard C compiler (i.e., gcc). This approach is
also very efficient since it only requires to assemble and to patch templates at run time. For
instance, the time required for generating machine code for the PLAN-P programs used in our
experiments is between 6 to 53 ms.
3. Experiments and Assessments
The PLAN-P run-time system has been implemented as a Solaris loadable kernel module. We
have used it to conduct various applications such as an Ethernet learning bridge, an extensible
HTTP server with load-balancing facilities, the broadcast of audio streams with a per-segment
bandwidth adaptation and a multipoint MPEG server derived from a point-to-point server with
intelligent traffic duplication [3, 4].
On high throughput-demanding applications such as the Ethernet bridge or the extensible
HTTP server, our measurements have shown that PLAN-P programs could be as efficient as the
equivalent program written in C. Also, PLAN-P programs are in average 3 times smaller than
their C versions.
Finally, experiments such as audio and MPEG broadcasting have shown that active networks
can successfully be used to implement original solutions for the adaptation of multipoint
applications with both bandwidth preservation and a rapid reaction to environment changes.
4. Conclusion
The high level of abstraction provided by PLAN-P improves program readability and
maintainability. This allows the active network programmer to easily develop and test new
policies without compromising safety. Thanks to run-time specialisation efficiency is achieved
while preserving portability.
Availability
PLAN-P and our experiments are available at http://www.irisa.fr/compose/plan-p
References
[1]C. Consel, L. Hornof, J. Lawall, R. Marlet, G. Muller, J. Noy'e, S. Thibault, and N. Volanschi. Tempo: Specializing
systems applications and beyond. ACM Computing Surveys, Symposium on Partial Evaluation, 30(3), 1998.
[2] Michael Hicks, Pankaj Kakkar, Jonathan T. Moore, Carl A. Gunter, and Scott Nettles. PLAN: A Packet Language
for Active Networks. In Proceedings of the Third ACM SIGPLAN International Conference on Functional
Programming Languages, volume 34(1) of ACM SIGPLAN Notices, pages 86-93. ACM, June 1998.
[3] S. Thibault, C. Consel, and G. Muller. Safe and efficient active network programming. In 17th IEEE Symposium
on Reliable Distributed Systems, pages 135-143, West Lafayette, Indiana, October 1998.
[4] S. Thibault, J. Marant, and G. Muller. Adapting distributed applications using extensible networks. In Proceedings
of the 19th International Conference on Distributed Computing Systems, pages 234- 243, Austin, Texas, May 1999.
IEEE Computer Society Press.