home
topology files
command‑line options
the core API
FAQ
download and install
|
Simulation attributes
A large number of attributes
define and constrain the execution of the whole simulation.
Naturally, depending on the types of nodes and links being simulated,
some combinations of nodes, links, and attributes may not be defined because
they make no sense.
|
NT_HOST |
NT_ROUTER |
NT_MOBILE |
NT_ACCESSPOINT |
Has an Application Layer |
|
- |
|
- |
May receive keyboard input |
|
- |
|
- |
May have LT_WAN links |
|
|
- |
- |
May have LT_LAN links |
|
|
- |
|
May have LT_WLAN links |
|
|
|
|
Has a battery power source |
- |
- |
|
- |
May move on simulation map |
- |
- |
|
- |
Calls to cnet's API for inappropriate combinations of nodes and
links, will consistently return the value -1 and set the
value of cnet_errno
to ER_NOTSUPPORTED .
- NOTE:
- A few attribute names have a number of (undocumented) synonyms.
For example, both
rebootargs and rebootargv
specify the same attribute.
Support for these synonyms is simply designed to provide greater
readability of your topology files.
They do not introduce any ambiguity.
Global attributes
Global attributes are defined in the topology file
and define and constrain the execution of the whole simulation.
They may not be redefined on a per-node or per-link basis.
The global attributes are not accessible to the protocol's C code
at runtime.
Global attribute |
datatype |
explanation |
example |
drawlinks |
Boolean |
draw the links and propagation signals on the simulation map. |
drawlinks = false |
drawnodes |
Boolean |
draw the node icons on the simulation map. |
drawnodes = true |
extension |
string |
provides the name of an
extension module
whose code and data will be shared amongst all nodes.
A toplogy file may specify multiple extension modules.
| extension = "statistics.c" |
mapcolour |
string |
provides the name of the background colour of the
simulation's main window.
| mapcolour = "wheat" |
mapgrid |
integer |
provides the lengths of the sides of squares to be drawn on the
simulation's main window.
| mapgrid = 50 |
mapheight |
integer |
specifies the height of the simulation map in metres.
| mapheight = 4.0.4/td>
|
maphex |
integer |
provides the lengths of the sides of hexagons to be drawn on the
simulation's main window.
| maphex = 40 |
mapimage |
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. |
mapimage = "australia.png" |
mapmargin |
integer |
indicates the width and height, in pixels,
surrounding the simulation's main window.
| mapmargin = 20 |
mapscale |
floatingpoint |
indicates how many real-world metres are represented by one pixel on
the simulation's main window.
| mapscale = 0.5 |
maptile |
string |
provides the name of a GIF-format image file to be tiled on the
simulation's main window.
The image file is sought via the CNETPATH
environment variable if necessary. |
maptile = "grass.png" |
mapwidth |
floatingpoint |
specifies the width of the simulation map in metres.
| mapwidth = 600m |
positionerror |
integer |
requests that a error is introduced in a node's reported position
when calling CNET_get_position .
Errors are uniformly distributed in a circle around a node's
true position.
| positionerror = 20m |
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 execution trace 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 = "badtrace.txt" |
Node attributes
Node attributes
may be defined globally,
to define the default attributes of every node,
or defined locally,
within the definition of each node,
to override the default attributes for just that node.
A special type of named node attribute,
preceded by the var keyword,
enables nodes to access
(at runtime, by calling CNET_getvar)
arbitrary string values defined in topology files.
Like all node attributes,
these may be defined globally or within any node's definition.
For example:
var beacon_freq = "1024"
var mobility_style = "Manhattan"
Node attribute |
datatype |
explanation |
example |
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" |
icontitle |
string |
specifies the string to appear under each node's icon on the GUI.
The following formatting substitutions may be requested:
%a | node's address as an integer |
%d | node's number |
%I | node's address in IPv4 dotted-decimal notation |
%n | node's name |
|
icontitle = "%d - %n" |
messagerate |
time |
the rate at which the Application Layer can generate new
messages for delivery |
messagerate = 10000usecs
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 = 60000s
nodemtbf = 1000s |
nodemttr |
time |
the expected time taken to repair a hardware failure |
nodemttr = 5000s
nodemttr = 100s |
outputfile |
string |
a file into which a node's printf output is mirrored.
The following formatting substitutions may be requested:
%a | node's address as an integer |
%d | node's number |
%I | node's address in IPv4 dotted-decimal notation |
%n | node's name |
|
outputfile = "output.%n" |
rebootargs |
string |
provide one or more white-space separated
command-line arguments
to be passed to the node's EV_REBOOT handler.
(locally overrides any arguments passed on
cnet's own command-line) |
rebootargs = "-fast -nostats" |
rebootfunc |
string |
the C function to call when the node reboots
(locally overrides the -R
option) |
rebootfunc = "reboot_function" |
trace |
Boolean |
a Boolean indicating if event tracing is required
(overrides the -t
option on a per-node basis) |
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 |
winx = 100, winy = 200 |
x, y |
integer |
coordinates of either the centre of a node's icon,
or the left-hand end of an Ethernet segment on the main window |
x = 80, y = 120 |
Link attributes
Link attributes
may be defined globally,
to define the default attributes of each link,
or defined locally,
within the definition of each link,
to override the default attributes for just that link.
cnet supports three different types of physical links -
LT_WAN , LT_LAN , and LT_WLAN .
We thus need to specify the link type for which we are setting an attribute.
There are many more link attributes than node attributes -
for example all of
wan-bandwidth ,
lan-bandwidth , and
wlan-bandwidth
are recognized and set the attribute for the appropriate link type.
If an attribute name is not prefixed with one of the link link types,
then a wan- attribute is assumed
(maintaining backwards compatability with older versions of cnet).
While defining attributes locally for a particular link type,
only the attributes appropriate for that link type may be set.
For example, the attribute wan-bandwidth may not appear inside
the definition of a LAN link.
Some link attribute names are only meaningful for specific link types,
and they are explicitly listed in the following table.
Link attribute |
datatype |
explanation |
example |
bandwidth |
integer |
the full-duplex bandwidth along a link |
bandwidth = 10Mbps
bandwidth = 56Kbps |
buffered |
Boolean |
whether the link's NIC buffers frames ready to be transmitted |
buffered = false
|
costperbyte |
integer |
the cost per byte along this link |
costperbyte = 1 |
costperframe |
integer |
the cost per frame along this link |
costperframe = 5 |
jitter |
time |
the random transmission jitter on WAN, LAN, and WLAN links |
wan-jitter = 5usec |
lan-slottime |
time |
the interframe timing gap for LAN links |
lan-slottime = 52usec |
linkmtbf |
time |
the expected time between link hardware failures |
linkmtbf = 60000s
linkmtbf = 1000s |
linkmttr |
time |
the expected time taken to repair a link hardware failure |
linkmttr = 5000s
linkmttr = 100s |
mtu |
integer |
the maximum number of bytes that may be written to the link in a
single write |
mtu = 1000bytes |
probframecorrupt |
probability |
the probability that a frame on this link will be corrupted |
probframecorrupt = 3 |
probframeloss |
probability |
the probability that a frame on this link will be lost
altogether |
probframeloss = 4 |
propagationdelay |
time |
the propagation delay along a link |
propagationdelay = 200usecs
propagationdelay = 1s |
wlan-frequency |
floatingpoint |
the frequency of transmission of this wireless link |
wlan-frequency = 2.4GHz |
wlan-rxantennagain |
floatingpoint |
the power gain of a link's antenna while receiving a signal |
wlan-rxantennagain = 2.8dBm |
wlan-rxcableloss |
floatingpoint |
the power lost by a link while transfering a received signal |
wlan-rxcableloss = 1.0dBm |
wlan-rxsensitivity |
floatingpoint |
the minimum signal strength required so that a link can "hear"
that signal |
wlan-rxsensitivity = -75.0dBm |
wlan-rxsignaltonoise |
floatingpoint |
the ratio of a signal's strength to that of the background noise
required so that a link can separate the signal from the noise |
wlan-rxsignaltonoise = 12.0dBm |
wlan-txantennagain |
floatingpoint |
the power gain of a link's antenna while transmitting a signal |
wlan-txantennagain = 2.8dBm |
wlan-txcableloss |
floatingpoint |
the power lost by a link while transfering a transmitted signal |
wlan-txcableloss = 1.0dBm |
wlan-txpower |
floatingpoint |
the initial power used by a link to transmit a signal |
wlan-txpower = 15.0dBm |
wlan-sleepcurrent |
floatingpoint |
the current drawn by a wireless link in the sleep state |
wlan-sleepcurrent = 20.0mA |
wlan-idlecurrent |
floatingpoint |
the current drawn by a wireless link in idle state |
wlan-idlecurrent = 150.0mA |
wlan-rxcurrent |
floatingpoint |
the current drawn by a wireless link in the receive state |
wlan-rxcurrent = 200.0mA |
wlan-txcurrent |
floatingpoint |
the current drawn by a wireless link in the transmit state |
wlan-txcurrent = 300.0mA |
|