Internal Merge Daemon Documentation

Introduction

When a new flow is created at the node, rcspd launches the merge daemon, and supplies the merge specification as parameters to the Merged. At that time Merged does not receive any data packets from the kernel (concast is in the forwarding state). Only after the second upstream neighbor joins, concast switches to the merging state, and concast kernel starts to forward data messages to the Merged. Merged has to process data packets and build outgoing packets, according to the merge specification.


Installation

Classpath has to be set to the concast package.  Classpath should contain Concast_v2/MERGEd/Java/

Currently LOG_FILE variable in concast.merged.Merged contains the full path to the log file.  It is obtained from LOGFILE_PATH property.

Location of the concast native support library in ConcastSocket is obtained from the LIBCONCAST_PATH property.

Rcspd specifies both properties when it launches the merged.


Launching

Bellow is the format of the command:
    java concast.merged.Merged url spec_class state_class enc_class receiver_ip mode

url should point to the location of spec_class, state_class, and enc_class. url is in the java url format.

spec_class is the implementation of the merge specification. This class must subclass concast.base.MergeSpec. spec_class should contain the full name of the class, including the package (e.g. apps.sum.SumSpec).

state_class is the class that contains all state of the merge specification.  This class must subclass concast.base.MergeState.  It is the only place (expect from flow state), where spec_class can store data.  state_class must also contain the full name of the class, including the package (e.g. apps.sum.SumState).

enc_class is the class that contains the encryption method of the merge specification. This class must subclass concast.base.EncryptMergeSpec. enc_class must also contain the full name of the class, including the package (e.g. apps.sum.SumEnc).

receiver_ip is the IP address of the receiver in "dotted-quad" format.

mode indicates the function of the node in the Concast framework (i.e. whether the node is a SENDER, ROUTER, or RECEIVER).

Examples (java url format):

0. For classes located on the web, url format is
    http://site/path/
    Note:  The slash at the end is important.
    
1. For classes located on the web in a jar file
    http://site/path/file.jar

2. For classes on the local system
    file://full_path, e.g.
    file:///home/leon/ACAST/Concast_v2/MERGEd/Java
 
3. For classes on the local system in a jar file
    file://full_path_to_the_file/file.jar, e.g.
    file:///home/leon/ACAST/Concast_v2/Apps/sum/sum.jar

Note:  spec_class, state_class, and enc_class have to be in the same package. If classes are not located in a jar file, the url argument must point to the package (not the class!) to which the classes belong.
Example: If spec_class is in apps.sum.SumSpec and it is located in http://site.edu/acast/apps/sum/SumSpec.class, then url should be http://site.edu/acast/

In the case of classes located in the jar file, class files inside in a jar file must be located under correct directories.
Example: For spec_class apps.sum.SumSpec, a class file SumSpec.class must be placed under apps/sum/ in the jar file.


Debugging

Boolean variable LOG_OUT in concast.merged.Merged determines if merged should print any debug statements.

Merged and Rcspd have a communication channel for the merged to get information about the upstream neighbor list. This channel is implemented using two unidirectional pipes.  Boolean variable UNL_ON determines if Merged should use this channel (send requests and for responses). f UNL_ON is false, UNL list in the Merged will be empty.