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.
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.
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.
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.
Set the frequency (in seconds) of the diagnostic and statistical summary.
In combination with -s and -z,
cumulative statistics may be periodically reported.
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.
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.
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.
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).
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, ....
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.
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.
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.
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.
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.