Tamanoir Users' guide
Table of Contents
- Functioning of Tamanoir
- Requirements
- Installation
- How to compile Tamanoir
- How to run a Tamanoir active node
- How to test Tamanoir
- Going further...
- How to build your own Tamanoir Active Service or collection of service?
- Developping with Eclipse (IDE)
- Current limitations
Functioning of Tamanoir
The main component of the Tamanoir project is the TAN (Tamanoir Active Node). One or several TANs can be deployed in the current Internet. When several TANs are deployed we talk about a TANs cloud (see Fig.1). To access this cloud you need to know the internet address of one of those TAN. Then, you will use this TAN, called proxyTAN, as a gateway. Notice that a proxyTAN and a classic TAN does not differ.
Applications able to receive and transmit an active stream (by following the ANEP protocol) must be binded to a proxyTAN to access the TANs cloud and take advantage of the active network technology.
__ TAN ___ TAN _____ / / \ / / \ client1 ----- proxyTAN _______ TAN ____________ proxyTAN ----- client2 \ / \ | \___ TAN ___/ | \ | | client3 |<----------- TANs cloud ---------->| Fig. 1: Three clients connected to the Tamanoir active network cloud via proxyTANs.
The current version of the Tamanoir project use a static routing table (stored in a text file).
A TAN (or proxyTAN) is a multi-threaded server waiting for connections from active client applications or some other TANs. Let client1 choose to send data to client2, and data be processed by a given active service S (choosed by the user or the application running on client1). Data will cross each TAN (and proxyTAN) and the service S will be applied to it.
Requirements
- JVM:
To run Tamanoir you need a Java Runtime Environment (JRE) or a Java Development Kit (JDK) if you (probably) plan to recompile the Tamanoir project. We currently use the SUN JVM version 1.4.2 (Standard Edition). - JMF:
You also need to install the SUN Java Media Framework. We currently use the JMF-2.1.1e.
Installation
Tamanoir is now available on LipForge (i.e SourceForge of the LIP laboratory). To get the sources you must first set and export the following environment variables.
CVS_RSH=ssh CVSROOT=:ext:[your_login]@lipforge.ens-lyon.fr:/local/chroot/cvsroot/tamanoir export CVS_RSH CVSROOTAnd run the checkout command:
cvs co tamanoir/src/tamanoirSource tree description:
- services:
The services directory contains all the Tamanoir active services sources written by the RESO team members. Feel free to use another directory for your own services (see section How to build a new Tamanoir Active service). - tan:
The tan directory contains namely the Tamanoir sources (100% pure java). The main method is available in the TAMANOIRd.java file. - tools:
The tools directory contains some useful tools to test deployed Tamanoir Active Node (TAN). For example, Pingtan will allow to test the status of a given TAN.
chmod u+x *.shTo build Tamanoir please read the following section.
How to compile Tamanoir
(and build jar files)
First, you need to edit the configuration file called tamanoir.conf to set the
JMF variable which is the absolute path of the jmf.jar file.
Next, you can run the buildtamanoir.sh script which compiles source class
files and builds the jar files tamanoir.jar and
tamanoir.services.jar.
The temporary directory ./classes (created by buildtamanoir.sh) can be removed.
It contains the class files now archived in the jar files.
About the jar files:
The first jar file tamanoir.jar contains all the classes required to run a
Tamanoir Active Node (TAN) on your system. In addition, tamanoir.jar contains
some useful tools to test a TAN (e.g Pingtan).
The second jar file tamanoir.services.jar contains only the active services
developped by our research team (RESO/LIP) (e.g FwdS, GzipS, PingS, etc.)
To compile tamanoir and build jar files you can also use your favorite IDE
(e.g Eclipse, NetBeans,...) which is definitely more efficient than the
buildtamanoir.sh script, when you choose to develop new services or improve
the Tamanoir code.
How to run a Tamanoir active node
Here, we suppose you successfully (re)compiled the Tamanoir project and hold,
at least, two jar files. Let's say tamanoir.jar which contains Tamanoir
classes and some useful tools, and tamanoir.services.jar which contains active
service classes designed by the RESO team and which contains basic active services.
First, you must edit the configuration file and set the ADDR_TAN variable (ex:
ADDR_TAN=localhost).
Finally, you only need to run the following command with no parameters:
./tam.shThis command runs a Tamanoir Active Node on the local system and bind it to the internet address (ADDR_TAN) specified in the configuration file (tamanoir.config). Then, you should see on screen something like this.
Starting Tamanoir node on localhost... *-------------------* | TAMANOIRd - v 0.3 | *-------------------* Java version = 1.4.2_06 System = Linux 2.6.8-1-686-smp/i386 TANd_raw (25493): ready ... TANd_tcp : ready ...At this point you have a Tamanoir node up and running waiting for connections on port 5432 (default active port) and 25493 (used by our team for special current experiments).
How to test Tamanoir
The minimal test we propose is to "ping" an active node. First, you must
edit the configuration file and set the ADDR_TAN variable (ex:
ADDR_TAN=localhost). Next, you run a TAN (see section above). Next, from
another node (or from the same node in another terminal window) run the pingtan
command with the same value of ADDR_TAN variable as parameter.
Example on one system:
term1: ./tan.sh # launch tamanoir with ADDR_TAN=localhost (see tamanoir.c onfig) term2: ./pingtan.sh localhost # ping indefinitely the TAN running on localhost Service Name : tamanoir.services.PingS Service Broker : http://111.111.111.111 Delay : 500 proxy TAN : localhost port TAN : 5432 target : localhost Protocole : TCP Payload size : 4096 Timeout (ms) : 1000 net.srcId = 127.0.0.1 Pingtan : #1 round-trip min/max = 69.0/69.0 ms time= 69.0 ms Pingtan : #2 round-trip min/max = 41.0/69.0 ms time= 41.0 ms Pingtan : #3 round-trip min/max = 41.0/69.0 ms time= 42.0 ms ...In this particular case of configuration we ping the very first TAN accessible, also called proxyTAN.
What happened:
A ping packet is sent by the PingTan application to the TAN running on localhost. The TAN's demultiplexer extract from the active packet the service name (PingS) to apply to the data, available in the same packet, also called payload, . In this particular case no process is applied to the paylod, however the header is processed by the active service (PingS) to check if the active packet reach the node to ping. If not, packet is forwarded to the next TAN (in function of the routing table), if yes, sender and receiver address are swapped, and the packet is sent back to the transmitter.
Notice, we never use the ICMP protocol commonly used by a real ping application. Everything is processed in a thread ran by the Java Virtual Machine.
Going further...
Service deployment:
In the previous example, services are dynamically loaded in memory from the
tamanoir.services.jar file available on the local disk. However, if the
required service is not available locally, the TAN can send a request to a tamanoir
active service repository (which is actually a web server serving jar files).
In the configuration file you can set up the internet address of a tamanoir
active service repository.
How to build your own Tamanoir Active Service or collection of service?
(follow this link for more information about the programming interface and Tamanoir implementation in general).
Make a directory with the name of your company or institute (or whatever) and a subdirectory called services.
$mkdir mycompany $mkdir mycompany/services $cd mycompany/servicesPut all your Java sources in this directory and start your service code with:
package mycompany.services;Do not forget to import the super class Service because every Tamanoir active service must be hinerited from this java class.
import tamanoir.tan.Service; Then, you can start to write your own active service... public class MyServiceS extends Service { public MyServiceS() { ... } public void run() { name = "MyService"; institution = "MyCompany"; author = "me"; date = "2038"; comment = "A simple test service."; serviceRepository ="localhost"; ... } ... }Feel free to read existing services to write your own. Finally, you will need to compile your classes and build a jar file holding all your tamanoir active services.
To compile your Java classes:
mkdir classes javac -d classes -classpath tamanoir.jar mycompany/services/*.javaAnd build the JAR file:
jar cf mycompany.services.jar -C classes mycompany/servicesTo test your own service you need now to write applications generating data streams encapsulated in ANEP packets with the service name header's field set with your service name (mycompany.services.MyServiceS). See source code of tamanoir/tools/SendPackets.java (used in sendpackets.sh) for some hints.
Developping with Eclipse (IDE)
(TODO)
Current limitations
- static routing table
- only one service can be applied per packet, however one service can call all the classes available in the jar file.