Router Implementation in a Declarative Language

 

 

 

Abstract

 

 

 
The development of modern routers require a significant effort to be designed, built, and verified. While hardware routers are faster, they are difficult to configure and mantain. Software routers, on the other hand, are slower but can easily be configured and mantained. Recently, a modular architecture and software toolkit for building routers and other packet processors has been introduced: the system Click. It includes a specification language with features for declaring and connecting router elements and for designing abstractions. In this work, we propose the use of a declarative multi-paradigm language, Curry, to specify routers. Since Curry is a fully declarative language, router specifications can be transformed, optimized, verified, etc., by using a number of existing formal techniques. Moreover, we will show that the features of Curry are particularly useful to design router components with a high-level of abstraction. Our first experiments point out that the proposed methodology is both useful and practical...
 
 

Click Routers

 
 
Click is a flexible, modular software architecture for creating routers. Click routers are built from fine-grained components; this supports fine-grained extensions throughout the forwarding path. The components are packet processing modules called elements. The basic element interface is narrow, consisting mostly of functions for initialization and packet handoff, but elements can extend it to support other functions (such as reporting queue lengths). To build a router configuration, the user chooses a collection of elements and connects them via ports into a directed graph (see figure below). The graph's edges, which are called connections, represent possible paths for packet handoff. To extend a configuration, the user can write new elements or compose existing elements in new ways.

The figure shows several elements connected into a simple router that counts incoming packets, then throws them all away.

 
 

Structure of a Click Router

 
 

Click Routers are implemented by connecting basic elements. Elements can have one or more inputs and outputs (see figure "Classifier"):

 

Such elements are interconnected in order to develop complex elements that are able to process packets, as for example a complete router. Next figure shows the structure of a Click router by Eddie Kohler:

More information about Click Routers can be found in:

The Click Modular Router Project
 
  Implementation  
 

Here you can download some files with the implementation of Click Elements using the Rose embeded language. We have included two different approaches to the router implementation and a complete example to show that it correctly route packets. The example completely explains how the implemented router works in a concrete example shown in the next figure:


_____________________Previous Approach_____________________
Router Implementation Descargar

 

_______________________Final Approach_______________________

Router Implementation Descargar

 

________________________Applications________________________

Router at Runtime(Complete Example with Simulated Packets)

Descargar
Rose Library Descargar