Recently, networks have grown dramatically in scale, heterogeneity and the diversity of applications and services they support. Following this trend, the complexity of network environments increases rapidly, making network programming more and more complex. The lack of a high level programming abstraction becomes a fundamental barrier to their development. The Declarative programming approach appears to be one of the most promising avenues for dealing with the complexity of network programming, allowing to specify “expected results”instead of “how to compute them”. This thesis is devoted to the implementation and optimization of a declarative programming language, Netlog, with the purpose of making network programming easier, thus improving the productivity of programmers. The main contributions are: 1. More declarative programming. Different routing, organization and overlay protocols have been implemented with Netlog and tested over different platforms. The size of the programs in Netlog are two orders of magnitude smaller than the corresponding programs in imperative languages. We propose an automatic code generation method to further improve the declarativity of Netlog programs. This method automatically generates code for common network issues (such as data update, message handling), which allows developers to write programs in a more declarative manner. Communication protocols have been developed with the help of these rewriting algorithms. The ratio of code in these programs related to low level network issues is reduced by three quaters. 2. Virtual machine for Netlog programs. We propose a model for the evaluation of Netlog, the Netquest Virtual Machine (NVM in short). Netlog programs are compiled to SQL. The NVM executes Netlog programs by invoking a DBMS to execute corresponding SQL queries, taking advantage of the functionalities of the DBMS. A bottom-up evaluation algorithm is used to further improve the efficiency. This algorithm follows the principles of the seminaive method that optimizes the evaluation by avoiding redundant recomputation on the same data. Relying on a DBMS for the evaluation makes the NVM easy to implement and port on platforms with an embedded DBMS, even on small sensor nodes. This allows Netlog programs to run on almost any device. The NVM has been implemented and tested on various platforms, including network simulators and mobile devices. 3. Fast prototyping made easy. We present the QuestMonitor, a network simu...
修改评论