FILE: CCF/CCFcctl/README CCF Collaborative Computing Frameworks Emory University Atlanta, GA, USA June 1999 CCF is a software system that supports collaborative, distributed, computer-based problem solving in the natural sciences, business, government, and in educational environments. The goal is to evolve a virtual environment for distributed computation that supports integrated human AV communication, high performance heterogeneous computing and distributed data management facilities. CCF is a research project at Emory University involving the Math/Computer Science and Chemistry departments. Recently, the Computer Science department of the University of Reading (UK) has joined the project. DISCLAIMER: This is alpha release 2.00 of CCF -- Collaborative Computing Frameworks. This software is provided as is with no warranty expressed or implied. We hope you find it useful, but we won't be held responsible for any damage that may occur from reading, compiling, installing, using, or even thinking about it. LICENSE: CCF is Copyright (C) 1996 by Emory University except for the code in directories GSM, LPC, LPC10 in the CCFaudio directory and is distributed under the terms of GNU General Public License (GPL) and the GNU Library General Public License (LPGL). The files COPYING and COPYING.LIB in each directory will tell exact licensing restrictions. This package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the license, or (at your option) any later version. CREDITS: CCF was created by Vaidy Sunderam, Injong Rhee, Alan Krantz, Shun Yan Cheung, Julie Sult, Soeren Olesen, Paul Gray, Phil Hutto, Sarah Chodrow, Michael Hirsch, Ted Goddard, Mic Grigni, N. Balaguru, Jim Nettles, Luigi Marzilli, Sue Onuschak, Scott Childs, Kevin Williams. The project is internationaly collaborating with Roger Loader and James Pascoe of the department of Computer Science at The University of Reading (UK). The CCF project is sponsored by the U.S. National Science Foundation under the multidisciplinary challenges initiative. CCF currently supports ten platforms: Mandrake Linux 6.5, Red Hat 6.0 and 6.2, SuSe Linux 6.4, TurboLinux 6.0, SunOS-5.7, SunOS-5.6, SunOS-5.5.1 and IRIX 6.2. The SunOS-5.7 version is the most thoroughly tested. OVERVIEW: CCTL is the CCF multicast transport layer. It provides a reliable multicast service offering a variety of qualities of service (totally ordered, reliable, unreliable, etc.). CCTL is used by ccsm and ccfx and all CCF tools. COMMON PROBLEMS: DEVELOPER NOTES: %% edited 8/1/00 by James Pascoe The new distribution of the CCF comes with a much improved version of CCTL. In the first instance, fault tolerance has been incorporated which handles arbitrary non session owner member crashes. Furthermore, the leave protocols have been improved and now session members are able to join and leave sessions in a much cleaner fashion. Note also that cctlwp and ccfsns are much more synchronised with the system and are themseleves much more resiliant. We have also fixed a number of other bugs. CCTL can not at present deal with a session owner crash (although the session owner is able to leav at any time). Furthermore, partitioning and remerging is not supported. This is something we are currently working on. For more information on the fault tolerance mechanisms in CCTL, see CCF/doc/README.ft. %% edited 8/19/96 by Injong Rhee The new CCTL API is in /aux/10/ccf/cctl/include/cctl.h. It contains some descriptions of each function call. Basically as of today, it supports various type of QOS include ATOMIC multicast. However, this version does not handle virtual synchrony yet so the dynamic joining and leaving may give you some problem. I am debugging the version with virtual synchrony, but have not gotten around to fix all the bugs yet. But it is expected to be released next week or so. Right now, we need some documentation on how to use all these calls, so I am going to jot down some basic stuffs here and if you need to know more about them, please feel free to see me and we can have a little chat. The first thing you need to do is to set an environment variable "CCTL_WP_HOST_NAME" if you would like to use your own white page server for your testing purpose, and then start cctl/bin/cctlwp in the machine specified in CCTL_WP_HOST_NAME. Note that if someone is already running wp in the machine, then you don't need to start your own wp. If you don't set CCTL_WP_HOST_NAME, then it will defaultly connect to wp in ccf.mathcs, which I will be crashing all the time :). The good thing about this version of cctl is that you don't have to mess up with cctl daemon which is completely invisible and comes_ and_goes_away as your session. Every thing is done automatically. To use cctl, in your process (you should do this for every process that joins a session), each process shoudl call cctl_init before it does any thing with cctl. cctl_init(); Next, you create or join a session using the following fn call. Say you want to join a session called "red" -- vss's favorite session :). ret = cctl_create_session("red",0,NULL); ret will have zero if it is successful. If not, it will return a negative error code (you can look up the meaning of each code in . This call automatically gives the process a default channel of which id is 0, and qos is reliable. So you can not send a message to the channel using the following fn. To open another reliable message channel (other than the default channel) called "test", you can now call ret = cctl_create_channel("test", CCTL_RELIABLE,NULL); This call create a new channel test if the channel does not exist in the session, and joins existing channel called test. The qos can be one of the following: CCTL_RELIABLE, CCTL_ATOMIC and CCTL_UNRELIABLE. CCTL_RELIABLE guarantees that messages are delivered to every process in FIFO order in the channel to which the messages are sent as long as the prcess is reachable and non-faulty. CCTL_ATOMIC guarantees that messages are gloabally ordered with respect to every message sent by every process in the channel regardless of who sent the messages. It also guarantees FIFO. But it does not handle message fragmentation so you cannot send more than 8000 bytes of information. CCTL_UNRELIABLE guarantees that messages are received in FIFO (not necessary consecutive order). But the messages can be lost. cctl_create_channel returns a (positive) number which we call channel id if the call is successful. If not, it returns an error. To send a message "msg" of size "sz" to every proc in a channel with channel id chid, and the process wants to wait until a message is delivered, you call ret = cctl_send(chid, CCTL_ALL, sz, msg, CCTL_SYNC, 0); ret will return 0 if it is successful, and if not, it returns an error code. The actual API for send is the following: int cctl_send(int chid,int dest,int msg_size, char *msg, int mode, int tag) chid is channel id. Details about each arg can be found in . Coversely, to receive a message, ret = cctl_recv(chid, &srcid, sz, msg, CCTL_ASYNC,0); ret will return the size of message received in "msg", and sz is the size (number of bytes) of msg. Currently, I have not implemented "src" and "tag" filtering yet, which I will next week. If you need filtering, you might want to wait until next week or use own filtering scheme. If you need more information, please see me and I don't mind any question you have about cctl. Enjoy, Injong ------------------- Update (10/9/96): int cctl_recv(int chid, int *src, /* sender id */ char *msg, /* msg buffer */ int bufLen,/* size of buffer in bytes */ int *msgLen,/* size of the message returned in bytes */ int flags, /* CCTL_SYNC or CCTL_ASYNC */ int srcTag, /* CCTL_ALL or sender id */ int tag); /* tag */ Now cctl_recv returns either 0 or negative number. A negative number indicates an error. The description about error code can be found in cctl_ecode.h. In the following calls, the msg buffer and the size of buffer are switched their positions. int cctl_send(int chid, int dest, char *msg, int len, int flags, int tag); int cctl_urecv(int chid, int *src, char *msg, int len, int flags); int cctl_usend(int chid, int dest, char *msg, int len, int flags); --------------------- Update (10/23/96) The api's for cctl_select, cctl_create_session and cctl_create_channel has been changed. A new function call "cctl_get_ch_mbrship" is implemented to return the number of mebers in a channel and membership bit vectors. 1. CCTL_SELECT int cctl_select(int nfds, /* max fd */ fd_set *fdset, /* tcp or udp socket descriptor sets */ int nchids, /* max chid */ cctl_chid_set *chids, /* channel id sets */ struct timeval *timeout); /* timeout */ fdset and nfds are the same parameters being passed to a unix select call. To set fdset, you use FD_SET, FD_ZERO, FD_CLR, etc. "nfd" contains the maximum socket descriptor that you listen to those in fdset. chids is the set of channel ids that you listen to. chids can be set by CHID_SET, CHID_ZERO and CHID_CLR. nchids is the maximum channel id in chids. cctl_select returns the number of sockets and channels that are currently having messages to be received. When cctl_select returns, fdset and chids contain the bit vectors for the sockets and channels with messages to be read. To see whether a socket has a message, use FD_ISSET. Likewise, to see whether a channel has a message, use CHID_ISSET. The following example program shows the usage of cctl_select. fd_set fdset; cctl_chid_set chidset; /* I want to wait for a std input */ FD_SET(0,&fdset); /* assume that "number_of_channels" contains the number of channels that you want to listen to, and "chids" is an array of those channels. */ if ( number_of_channels > 0 ) printf( "waiting on channel(s):" ); for ( i=0; i 0 ) printf( "\n" ); result = cctl_select( STDIN_FILENO+1,&fdset,max,&chidset, NULL ); printf( "after select result=%d\n", result ); if ( number_of_channels > 0 ) printf( "getMsg in channel(s):" ); for ( i=0; i