ALFred Documentation

ALFred Internal Design

ALFred Parser (inria.alfred.parser.Tool)

The ALFred parser is based upon two parsers implemented in Java, automatically generated using ANTLR . The ANTLR (formerly PCCTS) language tool provides a framework for constructing LL(k) parsers from grammatical descriptions containing C, C++, or Java actions. We have given our grammatical descriptions in the files "strl.g" and "alfred.g".

These two parsers take the esterel specification of the application as input and are called in sequence. The first one collects the data interface from the esterel specification: types, output signals, sensors, functions, procedures in order to generated the data interface skeleton. It also collects input signals to feed the second parser that will add some instructions in the application specification. This concerns principaly the specification for removing the adus when they are retreived from the environment; for example the esterel instruction present x(val:ADU) will be transformed into present x(val:ADU) then emit RemoveADU(Val); end present

All the files generated by the ALFred tool, using the information collected by the first parser, are described in the implementation steps section.

The graphical interface to enter QoS parameters is also managed by the ALFred parser. According to the values selected, the correct Esterel modules are put in parallel in a file that contains the protocol specification.

Adding a new QoS parameters

To add a new QoS parameter in ALFred you have to describe it in the interface but you also have to inform the ALFred Service manager of the ALFred library (inria.alfred.lib.AlfredService). To achieve this correspondance with the QoS information of the application you have to:

  1. Define some constants in inria.alfred.lib.QoSParameters.java to handle your new parameter.
  2. Include this parameter in the generation of the file: "QoSsetting.java".
  3. Provide an initialization of this parameter when generating the "init" method in the file "AlfAppliRun.java".
  4. Add effectively the initialization method in the file "inria/alfred/lib/AlfredService.java".

ALFred library (documentation under development)

The ALFred java library (inria.alfred.lib) contains the top level execution environment and the data interface to protocol mechanisms described in Esterel. The set of Esterel modules for protocol mechanisms are gathered in the file "inria/alfred/strl/Communication.strl".

The inheritance tree of the ALFred library (documentation not finished)

AlfAutoInterface.java   
AlfredService.java      
RecvWindow.java
AppliHandler.java       
RtoTimer.java
Run.java
PROFILES.java           
SlidingWindow.java
TimerMng.java
QoSParameters.java

 ----------------   ----------------     -----     -----------
/ALFPEventHandler/ /RTPEventHandler/    / ADU/    / ADUwrapper/
-----------------  -----------------    -----     -----------
   |                |   --------------
   |  -----------------|AlfredHandler |--------------------------------------- ....
   |  |             |   --------------                  |                 |
   |  |             |          |                        |                 |
   |  |             |          |                        |
  -------------     |   --------------             ----------------
 | ALFPHandler |    |--|   RTPHandler |           | RMDPRLCHandler |    ........
  -------------         --------------             ----------------
     -------------          -------------
    | ALFPCommon |         |   RTPCommon |
     -------------          -------------
       /     \                 /    \
   -----   -----            -----   -----
  |ALFP | |ALFCP|          | RTP | | RTCP|
   -----   -----            -----   -----   

The ADU interfaces

Two java interfaces are used to derive ADU types: ADU and ADUwrapper. If our ADUs are structured we will implement ADU and if we just need to send a byte arrays on the network we will implement ADUwrapper. To make the difference we proceed as follows:

The client pool

One instance of AppliHandler is created for each client and one instance for each handlers per client. To manage the pool of clients we store all of these threads in AlfredService.

The Protocol handlers

Every protocol handler is a son of AlfredHandler and manages the flows of Application Data Unit and Control Data Unit.

The AlfredHandler contains the reception, emission, and application queues. The reception and emission are implemented by a hashtable associating a key (unique sequence number) and an ADU.

Most of the handlers that are currently implemented interface the network with UDP but it could be something else if needed.

Adding a new protocol mechanism

To add a new protocol mechanism in ALFred you have to:

  1. Describe the mechanism in an Esterel module and add it to the file "inria/alfred/strl/Communication.strl".
  2. Describe the data interface in Java and add it to the interface to protocol automata: "inria/alfred/lib/AlfAutoInterface.java".
  3. Write a new handler "inria/alfred/lib/" to implement the interaction between the new protocol automaton and the network.
  4. Add the new parameters relevant to this new protocol in the user interface managed by the parser in the file "inria/alfred/parser/Tool.java".