The cnet network simulator - options
Keywords: network simulator simulation protocol undergraduate teaching

### cnet's many command line options

cnet supports a number of options which should be presented before the name of the topology file or a request for a random topology. Specifying all of -M mins, -S seed, and -T enables a simulation to be replayed.

-A string
  Specify a compilation string which declares a new application layer to be used. If -A is not provided, a default (internal) application layer is used. The eventual application layer is used as the source and sink of all messages.
-c
  Normally the `time_of_day` clocks in each node are initially different (and protocols could be developed to synchronize the clocks). If -c is specified, the clocks in all nodes will initially be synchronized.
-C string
  Specify a compilation string which declares each node's "internal" layers to be used. If -C is not provided, the string ``protocol.c'' is assumed.
-d
  Provide some diagnostic/monitoring information while cnet is running.
-e
  Normally, corruption errors on links are not reported by the Physical Layer and must be detected by the receiver. If -e is specified, function `CNET_read_physical` will detect and report corruption errors by returning `-1` and setting `cnet_errno` to `ER_CORRUPTDATA`.
-E nevents
  Request that cnet only run for the indicated number of events.
-f secs
  Set the frequency (in seconds) of the diagnostic and statistical summary. In combination with -s and -z, cumulative statistics may be periodically reported.
-F filename
  If cnet has been compiled for TclTk, the indicated file will be sourced by the Tcl interpreter. If the file cannot be found directly, CNETPATH will be searched to locate the file.
-g
  Commence execution (go) as soon as the main window appears (under X-windows); implied by -X.
-k
  Use ``old'' Kernighan and Ritchie (K&R) C to compile the user supplied source files for the application layer (-A), the ``central'' protocol layers (-C), and the physical layer (-P). The default is to use the ANSI-C compiler, gcc.
-m mins
  To prevent runaway processes choking our teaching machines, a 3 minute time limit is silently imposed on cnet execution. The -m option overrides this limit.
-M mins
  Limit the length of the simulation to -M minutes of 'simulated time' when used in combination with -T.
-n
  Simply parse the topology file, compile and link all necessary C source files and then exit.
-N
  Provide the number of nodes in the network in the C variable `NNODES`. Surprisingly, the default is that each node does not know how many nodes the network contains (`NNODES = 0`).
-o file_prefix
  Copy the output of each node's `printf(), puts()` and `putchar()` to a file with the indicated prefix. For example, the use of -o output will typically create and write to the files output.node0, output.node1, output.node2, ....
-O
  Open all node windows on startup (unless overridden by the `winopen` attribute).
-p
  After building and checking the network topology, simply print it out and exit cnet.
-P string
  Specify a compilation string which declares a new physical layer to be used. If -P is not provided, a default (internal) physical layer is used. The eventual physical layer is used to deliver and possibly corrupt and lose data frames.
-q
  Execute quietly (and more quickly) - all output requested with `printf(), puts()` and `putchar()` will not appear in the output windows. All output produced during an `EV_DEBUG?` event (a button press) will still appear, as will all output ``mirrored'' in logging files.
-r nnodes
  Request that a random network be generated, consisting of nnodes. The topology is guaranteed to be connected. The -r option may be used instead of providing a topology file.
-R function_name
  Use `function_name()` as the function to first invoke when rebooting each node. By default, the function `reboot_node()` will be invoked.
-s
  Print a summary of the network's activity just before cnet exits.
-S seed
  Provide the seed for random number generation (for message generation and frame corruption).
-t
  Trace all events delivered to each network node. A description of all cnet function calls, arguments and return and `cnet_errno` values is reported via standard error. Any output requested with `CNET_trace` will also appear on standard error.
-T
  By default, cnet runs in ``wall-clock'' time, that is, the simulation performs one second of network-work in one second of ``wall-clock'' time. This works well for up to about 20 nodes beyond which cnet ``gets behind''. Using -T forces cnet to ignore the ``wall-clock'' time and to execute as a true discrete-event simulator.
-v
  Be very verbose reporting cnet's actions.
-X
  Disable support for X-windows (the default for ASCII terminals!).
-z
  Display statistics and event summaries even if they are zero (implies -s).

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