cnet v3.1.1

home
FAQ

cmdline options
topology files
attributes

datatypes
core API
support API

download/install

Downloading and installing cnet

Download the most recent public release of cnet  from here  (9th May 2008).

The full distribution (about 2.9MB) includes all source code, Makefiles, documentation, and a few representative protocol examples.

cnet's version number changes when a change to its source code affects cnet's execution semantics. The version number does not change if cosmetic changes are made to the source code, or if the documentation changes.

NOTE: on a multi-user Linux or Unix system cnet only needs to be installed once. Students on such systems do not need to install their own copies unless they wish to modify and experiment with the cnet implementation itself.

cnet is supported (i.e. known to have seen recent success) only on the following platforms:

Linux (kernel 2.x, ELF only), and Apple Mac-OSX (10.3 onwards).

In particular, cnet does not run on Windows. Please do not ask for this to happen.

Previous versions of cnet compiled and ran successfully on:

Solaris 2.x, FreeBSD, NetBSD (1.5 onwards), DEC-OSF/1 (v4.0), SunOS 4.1.x (welcome to the 21st century), and SGI IRIX (Rel. 5 or 6),

so you may have some success with this current version of cnet. Please let me know.

Please appreciate that there are thousands of students worldwide using cnet. I am unable to respond to individual questions about cnet, unless they are from students enrolled in a course that I'm presenting. In particular, I will not answer homework or assignment questions. Please ask your professor or instructor.

If you find these instructions confusing, but eventually get cnet installed, please email chris@csse.uwa.edu.au with any suggestions on how the instructions could be clearer.


The cnet network simulator (v3.1.1)
© Copyright (C) 1992-onwards, Chris McDonald

This program 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.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.


Linux BSD NetBSD Solaris Linux/Unix installation requirements

To install cnet on a Linux/Unix system you should be prepared and able to:
  • Be able to create a publicly-accessible directory (for a shared installation) or a private directory (for a private installation). The recommended publicly-accessible locations are places like /usr/local/lib/cnet or /usr/lib/cnet.

  • Know the full pathname of your system's C compiler and standard linker.
    If your system has the preferred gcc, use gcc for both compiling and linking.

  • On Linux(ELF) systems, the freely-available libelf package is required. Most Linux(ELF) systems (with at least version 2.x kernels) now provide a copy of libelf "out-of-the-box". Do not install a "new" libelf if your system already has one. If you do need to install libelf, it greatly simplifies things if you can install libelf globally (as root) on your system.

  • Have Tcl/Tk version 8.4 or later correctly installed and know where its header files and libraries are installed.

    Note that you'll need both the Tcl/Tk runtime facilities (i.e. their shared libraries), and the Tcl/Tk development facilities (i.e. their C header files). Most "out-of-the-box" Linux distributions have the runtime facilities installed, but do not install the development facilities. If installing on a Linux machine using RPMs, you'll require both the runtime RPM and the development RPM for both Tcl and Tk.


Mac OS-X Mac OS-X installation requirements

To install cnet on a Mac OS-X system, 10.4(Tiger) or 10.3(Panther), you should be prepared and able to:
  • Install the Apple Developer Tools (providing the gcc C compiler). The Developer Tools are distributed on the CD/DVD media of recent Mac OS-X releases, or may be downloaded from www.apple.com/macosx/developertools/.

  • If running Mac-OSX v10.4, or later, you will need to manually download and install a recent version of the Tcl/Tk frameworks from www.tcl.tk/software/tcltk/8.5.html. Note that the version of Tcl/Tk provided in recent versions of Apple's XCode (v8.4.16) does not work correctly on Leopard.


Installation

  1. To begin installation, download the distribution file and unpack it with the command:

    tar zxvpf cnet-3.1.1.tgz
  2. Change to the newly created cnet-3.1.1 directory.
  3. Edit the top-level Makefile to change the following constants to suit your system:
    PREFIX, BINDIR, LIBDIR, and WWWDIR.
  4. Read and modify the C #defines in src/preferences.h, such as the full pathname of the C compiler and linker on your system.

    In particular, ensure that the value given to LIBDIR in the top-level Makefile (step 3) is recorded in the string constant CNETPATH.

  5. Type make to compile and link cnet for your system (it should compile and link without any errors).
  6. Type make install (perhaps as root) to copy the cnet binary and supporting files to their required locations.
  7. To ever re-build it all, type make clean && make && make install.
  8. To install the web-based documentation on your system, type make web.


Removal

  • From the directory where you built cnet, type  make uninstall


Testing

There are some introductory examples (such as may be used as student introductions to cnet) in the examples directory. A few of these examples are described in detail by making a walkthrough of the code. These are the sort of things an academic staff member may set as introductory exercises, or to assist students to "get up to speed" quickly. You should now be able to execute these examples from the command-line with the commands:

    cnet TICKTOCK
    cnet CLICK
    cnet ETHERTEST
    cnet STOPANDWAIT
    cnet FLOODING1

Each example has its own topology file defining the network to be simulated, for example CLICK and FLOODING1.

When cnet appears to work, the example files such as {TICKTOCK + ticktock.c}, {CLICK + click.c}, {KEYBOARD + keyboard.c}, {ETHERTEST + ethertest.c}, {LINKSTATE + linkstate.c}, and {STOPANDWAIT + stopandwait.c} in the examples directory should all be placed in a system-wide directory for everyone to copy and run.

cnet was written and is maintained by Chris McDonald (chris@csse.uwa.edu.au).

cnet development has been supported by an ACM-SIGCSE Special Project Grant, and an Australian Apple University Consortium Scholarship.