Installing cnet in your home directory

Revision 1.  Sep 25, 2003



The cnet installation file is a (gnu) zipped tar file (cnet.tar.gz)


Copy this file to your home directory, unzip, and then extract the cnet files from the archive using the tar command.


$ gunzip cnet.tar.gz

$ tar xvf cnet.tar


[ you will see a list of files extracted from the archive ]


When the extraction is complete, you will find a directory named cnet there.  Inside the directory are the following directories:



contains the cnet program file


contains runtime files needed by cnet


html docs for cnet


sample topology and protocol files



To use cnet, you must set the following environment variables:


CNETPATH is location of cnet/cnetlib

PATH must contain the location of the cnet program file (cnet/bin)


Here is an example using my user name as an example:


CNETPATH=~jconron/cnet/cnetlib;export CNETPATH

PATH=$PATH:~jconron/cnet/bin;export PATH



Of course, you MUST replace “jconron” with your login id.


It’s a good idea to add these two commands to your login script.


Once you’ve finished with the installation, you should read the cnet documentation.  It’s available from the class web page or in the cnet/DOC directory that you’ve just installed.  Begin with “index.html”.


To verify that you’ve installed cnet and your environment correctly, try running the provided STOPANDWAIT topology file in cnet/EXAMPLES.


I recommend that you do not work in the EXAMPLES directory.  Instead, create new directory outside of cnet where you will do your cnet work.  For example, create a directory named ~jconron/cnetwork (of course, do NOT use the name “jconron – use your own ID), then copy all of the files in cnet/EXAMPLES to cnetwork.  You can work in cnetwork to edit, compile, and run the examples or your own programs.


To compile and run the STOPANDWAIT program:


cnet –W –T –M 10 –s STOPANDWAIT


If everything goes well, cnet will compile, link, and run a simulation for 10 simulated minutes, reporting all non-zero statistics at the end of the run.


To learn what these command line arguments mean, please read the cnet DOCs.