Global attribute | Datatype | Meaning | Examples |
---|---|---|---|
bgimage | string | provides the name of a GIF-format image file to be centered on the simulation's main window. The image file is sought via the CNETPATH environment variable if necessary | bgimage = "australia1.gif" |
drawframes | Boolean | The global drawframes attribute requests that frames traversing the Physcial Layer be drawn under certain conditions. By specifying a special event handler, Data Link Layer protocols in a 2-node network may request that their frames be drawn using different colours and lengths. | drawframes = true |
showcostperbyte | Boolean | requests that each link's costperbyte attribute value be displayed on the simulation's main window over each link. The use of showcostperframe overrides that of showcostperbyte. | showcostperbyte = false |
showcostperframe | Boolean | requests that each link's costperframe attribute value be displayed on the simulation's main window over each link. The use of showcostperframe overrides that of showcostperbyte. | showcostperframe = true |
tracefile | string | requests that the trace of execution be mirrored in the named file when the -t option is given. Warning - trace files can grow very large (to several megabytes), very quickly. | tracefile = "appl-trace" |
Node attribute | Datatype | Meaning | Examples |
---|---|---|---|
address | integer | the unique network address of each node | address = 238 |
compile | string | a compilation string to declare the sourcefile names containing the protocols for each node (locally overrides the -C option) | compile = "protocol.c stats.c -lm" |
messagerate | time | the rate at which the Application Layer can generate new messages for delivery | messagerate = 100ms messagerate = 2s |
minmessagesize | bytes | the minimum size of messages generated by the Application Layer | minmessagesize = 100bytes minmessagesize = 4KB |
maxmessagesize | bytes | the maximum size of messages generated by the Application Layer (bounded by MAX_MESSAGE_SIZE | maxmessagesize = 200bytes maxmessagesize = 8KB |
nodemtbf | time | the expected time between node hardware failures | nodemtbf = 600000ms nodemtbf = 1000s |
nodemttr | time | the expected time taken to repair a hardware failure | nodemttr = 5000ms nodemttr = 100s |
ostype | string | the name of the operating system that runs on the node (only used to set the node's icon). Possible values are bsd, hurd, irix, linux, macintosh, nextstep, os2, solaris, or winnt. Gimmick. | ostype = "linux" |
outputfile | string | the output file for each node. When used as a global attribute, outputfile is used as a filename prefix (as with the -o option). When used locally, outputfile indicates the complete filename | outputfile = "output" |
rebootnode | string | the ANSI-C function to call when the node reboots (locally overrides the -R option) | rebootnode = "reboot_function" |
trace | Boolean | a Boolean indicating if event tracing is required (overrides the -t option) | trace = true |
winopen | Boolean | Boolean attribute requesting that a node's window be opened on startup | winopen = false |
winx, winy | integer | screen coordinates of the node's window under Tcl/Tk | winx = 100, winy = 200 |
x, y | integer | coordinates of the node's icon on the main window | x = 80, y = 120 |
The compile attribute indicates which C source files are to be compiled and executed by cnet. In the example topology file, above, an instance of the source code in the single file stopandwait.c will be executed by each of Perth and Melbourne. Each node will have its own copy of all variables declared in the file stopandwait.c (globals, static globals, locals and static locals).
When executing, each node's protocol code (in C) has access to its own CnetNodeinfo structure describing the node's attributes. This structure is best considered read-only as its contents are ``refreshed'' as each node is scheduled for execution.
|
Link attribute | Datatype | Meaning | Examples |
---|---|---|---|
bandwidth | datarate | the bandwidth along a link | bandwidth = 1000000bps bandwidth = 56Kbps |
costperbyte | cents | the cost per byte along this link | costperbyte = 1c |
costperframe | cents | the cost per frame along this link | costperframe = 5c |
linkmtbf | time | the expected time between link hardware failures | linkmtbf = 600000ms linkmtbf = 1000s |
linkmttr | time | the expected time taken to repair a link hardware failure | linkmttr = 5000ms linkmttr = 100s |
probframecorrupt | probability | the probability that a frame on this link will be corrupted | probframecorrupt = 3 /* 1 in 8 */ |
probframeloss | probability | the probability that a frame on this link will be lost altogether | probframecorrupt = 4 /* 1 in 16 */ |
propagationdelay | time | the propagation delay along a link | propagationdelay = 20ms propagationdelay = 1s |
When executing, each node's protocol code (in C) has access to its own CnetLinkinfo structure describing the link's attributes. This structure is best considered read-only as its contents are ``refreshed'' as each node is scheduled for execution. The global variable linkinfo is a vector of CnetLinkinfo structures. linkinfo[0] maintains attributes of the pseudo LOOPBACK link, linkinfo[1] maintains attributes of the first true physical link, and so on.
|
All times are stored internally in milliseconds though in the topology file their integral values may be followed by suffixes such as ms and s.
All data sizes are stored internally in bytes though in the topology file their integral values may be followed by suffixes such as bytes, Kbytes, KB, and MB.
Link bandwidths are stored internally in bits-per-second though in the topology file their integral values may be followed by suffixes such as bps, Kbps, and Mbps.
Boolean attributes may take on the values true, false, and toggle.
Strings are enclosed within double quotes.
Probabilities specify a uniform distribution, with their value being the log-base-2 of the chance of failure (yes, this is ugly). In a typical topology file, the global probframecorrupt attribute may declare that a frame will be corrupted with probability of 1 in 8 (2 to the power 3) while the link from Melbourne to Perth will lose (on average) every fourth frame. A probability of 0 (the default) means that no errors will be introduced.
cnet was written and is maintained by Chris McDonald (chris@cs.uwa.edu.au) | ![]() |