cnet Changelog

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

Version 3.3 - from June 2013

  • v3.3.3 - Corrected a bug in compile.c which prevented correct parsing of compilation string.
    Changed calls to abs() to fabs(), in lan.c
  • v3.3.2 - Corrected a bug in which AL errors were not updated on the GUI.
    Added -G command-line option, equivalent to -WTgqz.
  • v3.3.1 - Added compile-time support for XQuartz under OS-X.
    Corrected use of Tcl_SetObjResult() to report errors.
  • v3.3.0 - The x,y,z fields of CnetPosition are now of type double to better support mapping.
    Added the functions CNET_Wflag(), CNET_vflag(), CNET_get_mapmargin(), and TCLTK_interp().
    Support added for global- and per-node variables in topology files, accessed from protocols using the new CNET_getvar() function.
    Added the CNET_unused_timer_event() and CNET_unused_debug_event() functions.
    Changes made to Tcl/Tk code to correctly use Tcl_GetStringResult() and Tcl_EvalEx().

Version 3.2 - from September 2009 (no longer supported)

  • v3.2.4 - Removed the ability (gimmick) to set a node's operating system type and icon. Added -Q command-line option to (silently) ignore out-of-sequence errors in the Application Layer. Changed code to enable clean compilations on Ubuntu Linux, where -Wunused-but-set-variable is set by default.
  • v3.2.3 - wish I'd kept this up-to-date
  • v3.2.2 - wish I'd kept this up-to-date
  • v3.2.1 - Correction made to gathering of LAN statistics. The -S command-line option now correctly replaces (overrides) the seed parameter to CNET_srand() and CNET_newrand().
  • v3.2.0 - Support added for 64-bit Mac-OSX. Support added for Tcl/Tk v8.5 (now preferred). Support added for Ubuntu Linux (return value of write() captured). Documentation rewritten, providing Unix-manual-like pages for each function.

Version 3.1 - from October 2007 (no longer supported)

  • v3.1.4 - Added the CNET_shmem2() function.
  • v3.1.3 - Corrected memory allocation for WLAN nodes. Refactored some Tcl/Tk for event and statistics updates. Corrected the information provided by CNET_get_wlanstate. New documentation for core data structures nodeinfo and linkinfo.
  • v3.1.2 - Corrected a bug processing the -D, -U, and -I command-line options. Corrected a bug in CNET_write_physical which caused a crash when scheduling frame collisions. The -z command-line option now implies -s. The buffer and message parameters of CNET_read_physical, CNET_write_physical, CNET_write_physical_reliable, CNET_write_direct, CNET_read_application, and CNET_write_application are now of type void * or const void * (were char * or const char *). The icons of mobile nodes are now always raised on the map. Simplified handling of fonts in Tc/Tk. Corrected some of the map layout to correctly honour map-scaling.
  • v3.1.1 - Added the CNET_get_mapscale function. Modified the calculation of distance between two (mobile) nodes. Included memory alignment in the calculation of per-node data segment size for Mac OS-X. Corrected Makefile for make uninstall.

Version 3.0 - from November 2004 (no longer supported)

  • v3.0.20 - Supported on 64-bit Linux distributions. Signal-strength "bars" added to the popup windows of nodes with WLANs. The CnetColour type is now just a C string. Random number generation functions renamed to CNET_srand, CNET_rand, CNET_newrand, and CNET_nextrand.
  • v3.0.19 - Corrections made to link bandwidth calculations.
  • v3.0.18 - Support for vectors of data added to the support API.
  • v3.0.17 - Correction to calculation of frame collision statistics. Correction to a rare problem where sleeping LT_WLAN links could receive frames.
  • v3.0.16 - <cnet.h> now includes <math.h>, and the standard C mathematics library (-lm) is now linked in by default. Added simple macros to convert between dBm and mW. Corrected a bug in the hashtable_new() support function. Added one-button support for Mac-OSX (thanks to Michael Rogers, Tennessee Tech.Univ.).
  • v3.0.15 - Improved collision handling for LT_WLAN links.
  • v3.0.14 - Added the positionerror global attribute. Corrected image scaling and node positioning on the simulation map.
  • v3.0.13 - Added the <cnetsupport.h> header file, the support source directory, automatic linking against the libcnetsupport.a library, and its associated documentation. Each node's outputfile attribute may now be formatted like the icontitle attribute. Corrected a bug causing events to be lost when the simulation was paused from the GUI.
  • v3.0.12 - Added the EVENT_HANDLER macro to <cnet.h>. Changed the data type of many function paramters describing length from int or unsigned int to size_t. New functions CNET_printf, CNET_puts, and CNET_putchar introduced to overcome Darwin's prebinding of shared libraries. These functions are not traced.
  • v3.0.11 - The dataframes on any number of LT_WAN links may are now drawn on their own canvas. You may view a LT_WAN link's frames by clicking the right mouse button (control-click on Macintoshes) on the link. An internal default event handler for the EV_DRAWFRAME is provided. Added the jitter attribute to all linktypes.
  • v3.0.10 - Datatypes WLANRESULT and WLANSIGNAL, and the function CNET_set_wlan_model, introduced. Datatype CnetPosition introduced, and functions CNET_get_position and CNET_get_position modified to receive their parameters of this type. ER_CORRUPTDATA renamed to ER_CORRUPTFRAME. Two new events - EV_PERIODIC and EV_UPDATEGUI. Introduced the -x option and support for extension modules. Corrected handling of -N option.
  • v3.0.9 - Two new error values introduced: ER_DUPLICATEMSG and ER_MISSINGMSG. These replace ER_OUTOFSEQ. New enumerated type CnetColour introduced. Function CNET_set_LED added. Tracing of Application and Physical Layer functions improved. Scheduling of EV_DEBUG events corrected.
  • v3.0.8 - Each WLAN's signal strength "circle" expands so as to reach all nodes that hear its signal. Tcl/Tk scripting improved for Mac OS-X.
  • v3.0.7 - New files scheduler.h and queuing.c support Calendar queuing of pending events, supporting much faster simulations with several hundred, or several thousand, pending events. Uses the POSIX getopt function to parse arguments, so we can now use:
    cnet -gsT -u100s FLOODING
    Event tracing now appears in an additional popup window, and highlights API calls that fail.
  • v3.0.6 - Transmissions with CNET_write_physical on LT_WLAN links now 'cause' collisions at the destination(s) if two or more overlapping-in-time signals arrive. Transmissions with CNET_write_physical_reliable on LT_WLAN links do not 'cause' collisions. New function CNET_carrier_sense indicates if a LT_LAN or LT_WLAN link can sense any arriving signal. Nodes and NICs that are sleeping "remember" that a signal is passing them, so that when they awaken they may not immediately be able to transmit successfully. The new -B command-line option disables buffering on LT_LAN or LT_WLAN links - you cannot transmit a new frame while one is still being sent. Each link type accepts a new Boolean attribute in the topology file, such as wlan-buffered = false to indicate if it's buffering. The new -i command-line option now reports instantaneous statistics (existing -s option reports cumulative statistics). The new -J command-line option permits you to just compile the indicated *.c files to their *.o files (to support pre-compiled libraries/layers for students). If the topology file name is "-", it will be read from standard input. The scheduler now detects/warns if there are no more (non-interactive) events scheduled. The first parameter passed to CNET_read_physical may be NULL if you don't require the link number of the arriving frame. New topology file attributes: bgcolour, bghex, drawnodes, and drawlinks.

  • major changes:
  • cnet's own code, and the protocols that cnet executes are now written in ISO-C99 (no longer just ANSI-C89). This provides native 64-bit integers and the bool data type.
  • First attempt at working under Mac-OSX (v10.3 onwards), still using Tcl/Tk.
  • Much rewriting of cnet's own code to support mobile and wireless network simulations.
  • The MT19937 (Mersenne Twister) pseudo-random number generator is now used internally in place of the slower and less portable rand48 family of functions.

  • new and changed datatypes and constants (via cnet.h):
  • All times are measured in microseconds and use the new CnetTime datatype, which is the 64-bit integer type int64_t in ISO-C99.
  • The CnetData type is now guaranteed long enough to hold integer and pointer values.
  • The new CnetRandom type introduced.
  • The CnetTimer type is renamed to CnetTimerID.
  • The transmitbufsize field of the CnetLinkinfo datatype, has been renamed mtu (maximum transmit unit).
  • The constant LT_POINT2POINT has been renamed LT_WAN, the constant LT_ETHERNET has been renamed LT_LAN, and the new constant LT_WLAN introduced.
  • Timer events now range from EV_TIMER0..EV_TIMER9 (no longer 1..10), and debug events now range from EV_DEBUG0..EV_DEBUG4 (no longer 1..5).
  • Two new nodetypes, NT_MOBILE and NT_ACCESSPOINT have been added to support mobile and wireless network simulations.

  • new and changed APIs:
  • All functions accepting lengths (e.g. number of bytes in a frame) are now of type size_t.
  • Several new functions make multiple MT19937 sequences available in each node: CNET_srand, CNET_rand, CNET_newrand, and CNET_nextrand.
  • Several new functions supporting wireless LANs introduced: CNET_get_position, CNET_set_position, CNET_wlan_arrival, CNET_get_wlaninfo, and CNET_set_wlaninfo.
  • The functions CNET_shmem and CNET_check_version introduced.
  • Checksum and CRC functions have been renamed: checksum_crc16 -> CNET_crc16, checksum_crc32 -> CNET_crc32, checksum_ccitt -> CNET_ccitt, and checksum_internet -> CNET_IP_checksum.

  • changes to the Tcl/Tk windowing:
  • The speed of the simulation may now be controlled from the main window (under Tcl/Tk).
  • The single-step button now correctly increments the simulation time.
  • The main statistics window now displays instantaneous as well as total statistics.
  • The current simulation time is now displayed on the main window.

  • deprecated:
  • Everything previously requiring the CnetInt64 datatype and the int64_* API has been replaced by the 64-bit integer type int64_t in ISO-C99.
  • The CNET_set_promiscuous function.
  • The -P option (which specified the source code files for a Physical Layer) is now longer supported.
  • The -k option (which compiled protocols with an "old" Kernighan and Ritchie (K&R) C compiler) is no longer supported.
  • Each of the very old CNET_set_cursor, CNET_get_cursor, CNET_clear_to_eos and CNET_clear_to_eoln functions are no longer recognized.

Version 2.0 - from February 2002 (no longer supported)

  • v2.0.10 - many modifications to source code to provide clean compilation of cnet and examples with new, more rigorous, versions of gcc.
  • v2.0.9 - another attempt to correct a bug which permitted events to be delivered after a node had crashed.
  • v2.0.8 - corrected a bug in the <cnet64bits.h> header file which permitted only constants to be passed as arguments to int64_INIT. Corrected a bug which permitted timer events to still expire after a node had crashed. Improved installation on FreeBSD (5.1-RELEASE) - thanks to Rohan Joyce <joycer01(at)> for submitting a patch. Corrected the detection of PowerPC architectures.
  • v2.0.7 - corrected the detection of SPARC architectures and some compiler warnings when using gcc and ANSI-C - thanks to Peter Neubert <neubert(at)> for reporting the problem.
  • v2.0.6 - fixed an off-by-one error in handling changing linkstates (re)reported by Donald Gordon.
  • v2.0.5 - added facility for a short string to be drawn on animated frames - thanks to Alex Feldman <alex(at)> for the suggestion.
  • v2.0.4 - compilations with gcc now have the -Werror flag added by default. Improved the CHECK() macro in <cnet.h>. Improvements to installation scripts - thanks to John Murdie <john(at)> for these. Fixed an off-by-one error in handling changing linkstates - thanks to Donald Gordon <Donald.Gordon(at)> for this.
  • v2.0.3 - small change to the scheduling of Ethernet segments - thanks to Klaus Doerrscheidt <kdoerrscheidt(at)> for this.
  • v2.0.2 - small event scheduler problem corrected.
  • Support for 10Mbps IEEE 802.3 Ethernet segments has been added; physical links are now each of the new type CnetLinkType.
  • Network Interface Cards (NICs) connect nodes to Ethernet segments; the new datatype CnetNICaddr provides support for each NIC's hardware address. The address may be set with the new function CNET_set_nicaddr, and the new functions CNET_parse_nicaddr and CNET_format_nicaddr convert between character strings and the CnetNICaddr datatype.
    NICs may be set into promiscuous mode with the new function CNET_set_promiscuous.
  • 64-bit integers are now used to store all times (now in microseconds) and large statistics. A new datatype, CnetInt64, and a number of arithmetic, conversion, and I/O routines are defined in the new header file <cnet64bits.h>. The new header file is included by the standard header file <cnet.h>.
  • The values of nodeinfo.messagerate, nodeinfo.time_in_usec, and linkinfo[i].propagationdelay are now of type CnetInt64.
  • The 2nd argument of CNET_start_timer is now of type CnetInt64 and requests a time in microseconds, not milliseconds.
  • Three new constants, HAVE_LONG_LONG, SIZEOF_INT, and SIZEOF_LONG must now be specified in the config.h file.
  • Nodes are now provided with command-line arguments when they reboot.
  • The Application Layer is now consulted to check that user-requested message sizes are neither too big nor too small.
  • Documentation extended, including some much-requested protocol walkthroughs.
  • Tcl/Tk scripts corrected to capture WM_DELETE_WINDOW messages for all top-level windows.
  • Corrected the values displayed on each node's Tcl/Tk radiobuttons used to modify the node's attributes at run-time.
  • Output via stdio functions (to Tcl/Tk windows) simplified and improved so that scrollbars do not "jump back" to bottom of the window on every output.
  • All statistics are now "flushed" via a single Tcl/Tk periodic event, rather than via cnet's main scheduler.
  • Statistics windows are now only updated if they have changed values.
  • Improved documentation.

Version 1.7 - August 2001 (no longer supported)

  • The data-link frames of 2-node simulations may now be animated. A new EV_DRAWFRAME event provides the user's protocol code with the opportunity to specify how the each individual data-Link frame is to be drawn. The protocols themselves do not need to provide any special windowing/drawing code. Up to 6 fields of each frame may be drawn in colours specified in the standard header file <cnet.h>.
  • Event tracing now appears in a separate scrollable Tcl/Tk window under the main map window (rather than just to stderr). A separate file may also be specified via the new global attribute tracefile (specified in the topology file), to receive a full copy of the simulation's trace.
  • The link attributes of costperframe or costperbyte may now be drawn on each link on the topology map by setting the new Boolean attributes costperframe or costperbyte to true in the topology file. costperframe is shown in preference to costperbyte.
  • Added facility for protocol source and object files to be specified with full pathnames.
  • Physical Layer corruption now only modifies two bytes of a frame to guarantee detection by the provided checksum functions.
  • The Physical Layer may now to asked to corrupt frames by truncating them, by setting MAY_TRUNCATE_FRAMES in config.h.
  • A background image (GIF) may now be displayed on the toplogy map under Tcl/Tk by specifying the new bgimage attribute in the topology file.
  • Support added for the FreeBSD platform - thanks to Jordan Hubbard <jkh(at)> and Michael Haro <mharo(at)>
  • Support added for the NetBSD platform - thanks to Mark Davies, <mark(at)>
  • Corrected a bug where any output to a node's window produced by an EV_DEBUG? event handler did not appear if using the -q comand-line option.
  • Each node's statistics' window is now only updated if that window if displayed.
  • The values of CnetTimerID returned by CNET_start_timer, are now an independent property of each node.
  • A number of internal global variables consolidated into the gattr structure.
  • Each node's name, in nodeinfo.nodename, is now stored in a fixed sized array of MAX_NODENAME_LEN (=32) bytes, rather than via a character pointer.
  • Improved documentation.

Version 1.6 - May 2000 (no longer supported)

  • The cnet functions CNET_set_cursor, CNET_get_cursor, CNET_clear_to_eoln, and CNET_clear_to_eos are no longer supported.
  • When tracing events, arbitrary addresses/variables may now be traced by name (instead of their hexadecimal addresses) by calling CNET_trace_name at the top of an event's handler.
  • The link attributes of propagationdelay and bandwidth may no longer be changed at run-time via the windowing interface.
  • A new function, CNET_timer_data, enables a protocol to retrieve a timer's user-data before the timer expires. This permits a protocol to retrive and deallocate dynamically allocated storage before it calls CNET_stop_timer.
  • No "raw" X-window API functions called. All windowing, mouse tracking, fonts etc, are provided by Tcl/Tk. No special support provided for monochrome-only displays.
  • All windowing for statistics, etc, "pushed" into the Tck/Tk code.
  • Support added for Tcl/Tk v8.0 and beyond.
  • A warning message is porduced if a provided topology file is not connected. Random topologies, requested via the -r nnodes command-line option, are now guaranteed to be connected.
  • Node icons are now located in a directory via the value of CNETPATH, rather than as statically-compiled XPM structures. XPM operating system support is no longer required.
  • Both recieve and interupt now recognized spelling errors.
  • Improved documentation.

Version 1.5 - April 1999 (no longer supported)

  • Support for Linux a.out format dropped (now only ELF format).
  • Support for Motif and XView windowing dropped (now only Tcl/Tk).
  • Improved documentation.

Version 1.4 - February 1997 (no longer supported)

Version 1.3 - July 1996 (no longer supported)

Version 0.1 - June 1991 (no longer supported)

 cnet v3.3.3, written by
 Last modified: Tue Oct 13 1:07PM 2015