Configuration and Environment Map file formats for SENS (Sensor, Environment & Network Simulator) Sameer Sundresh (sundresh@uiuc.edu) ==== Section 1: Configuration files ==== Configuration files consist of lines beginning with "environment," "node_type" or "node": environment ( arguments ) - where is the name of a C++ class derived from Environment, - arguments are specific to that class, - arguments are OPTIONAL, - and parentheses must be surrounded by spaces -- (arg) will not parse correctly. node_type ( args ) ( args ) ( args ) - where <*Comp> are names of appropriate C++ classes, - arguments follow the same rules as for environment, - and is a string not containing whitespace - and all three components are MANDATORY node - where is as above, - is an integer uniquely identifying this node, - and and are floating-point coordinates of the node in the environment - all arguments are MANDATORY As mentioned above, components may accept a sequence of arguments. For example, SimpleEnvironment accepts grid_spacing, speed_of_sound and sound_radius arguments, so we might give it arguments like this: ( sound_radius 200 speed_of_sound 33000 ) Since grid_spacing is optional, we omitted it; moreover, the order of the arguments is not important, although each argument idenifier (such as sound_radius) must be followed by its value(s) (in this case, 200). For example, the Applications/Ranging component accepts an (optional) anchor argument with several values: ( anchor 7.1 3.2 0.8 1.1 ) The arguments accepted by the various components included with the simulator are described below. Arguments are marked as either OPTIONAL or MANDATORY -- for example, the map file name is mandatory for a TiledEnvironment. Arguments for specific components: Applications Ranging anchor - where (, ) is the position to beacon, - is the time at which to start beaconing, - and is how often to beacon - non-anchor nodes do not specify the anchor argument - OPTIONAL, by default nodes are not anchors Environments SimpleEnvironment grid_spacing - the side length of the square grid cells tiling the environment. this affects performance, because a very small number results in many grid cells which must be iterated over to find all nodes within a certain radius, while a very large number means each cell covers a large area, so only a small fraction of the nodes in the cell may actually be within the desired radius. - OPTIONAL, default is 1.0 speed_of_sound - s is in cm/s - OPTIONAL, default is 34300cm/s (air at STP) sound_radius - maximum distance in cm at which a sound can be heard (beep messages are broadcast to all messages within this distance) - OPTIONAL, default is 50cm - note that beeps are sent with a received volume of sender_volume / (distance+1)2 whereas sound_radius just specifies the hard cutoff distance beyond which not to send any beep messages at all. TiledEnvironment tile_map - the name of the map file for the environment (see description of map files in section 2) - MANDATORY Currently TiledEnvironment uses the following hard-coded constants: speed_of_sound 343.0 m/s sound_radius 28.0 m radio_radius 100 m Networks SimpleNetwork send_delay - d is the delay between when an Application requests to send a message and when it is actually transmitted - OPTIONAL, default is 0.10s recv_delay - d is the delay between when a message is transmitted and when it is received by an Application - OPTIONAL, default is 0.0s ProbLossyNetwork send_delay - (same as for SimpleNetwork) - d is the delay between when an Application requests to send a message and when it is actually transmitted - OPTIONAL, default is 0.10s recv_delay - (same as for SimpleNetwork) - d is the delay between when a message is transmitted and when it is received by an Application - OPTIONAL, default is 0.0s util_threshold - network utilization threshold where packet loss begins to occur (see description below) - OPTIONAL, default is 8 messages/s interval_size - the size of buckets to use to calculate recent message traffic rate. we use two buckets to store history, so the actual history length varies over time as: ISZ + (t mod ISZ) this can be visualized as a sawtooth wave with period ISZ and slopes 1 and -infinity. - OPTIONAL, default is 0.25s (so history is 0.25 ~ 0.5s) What ProbLossyNetwork does: When an Application requests to send a message, we choose float X uniformly at random in the range [0,1]. If X >= the transmission power level specified by the Application, the message is sent to all nodes within radio radius (not just intended recipients). Recipients then log messages heard by incrementing a variable representing the traffic during the current time interval of size ISZ. The recipient then calculates the message density within the current partial interval and the previous full interval, MD: messages during [t - ISZ - (t mod ISZ), t] MD = ------------------------------------------ ISZ + (t mod ISZ) Finally, the recipient chooses float Y uniformly at random in the range [0,1], and delivers the message to the application only if THR/MD >= Y. (note that MD is always at least 1/(2*ISZ) whenever we divide THR/MD). CollisionLossyNetwork send_delay - (same as for SimpleNetwork) - d is the delay between when an Application requests to send a message and when it is actually transmitted - OPTIONAL, default is 0.10s recv_delay - (same as for SimpleNetwork) - d is the delay between when a message is transmitted and when it is received by an Application - OPTIONAL, default is 0.0s noise_threshold - ratio of noise/signal amplitude where errors begin to occur (i.e. 1/minimum_snr). For each message, all messages sent during overlapping time intervals are considered as potentially interfering noise. If the combined signal strength of all the noise divided by the signal strength of this message is greater than NTHR, the message is dropped at the recipient (not forwarded to the application). - OPTIONAL, default is 0.1 Note that as with ProbLossyNetwork, to adequately calculate interference, messages are sent to all nodes within radio range, not just the intended recipients. CollisionLossyNetwork only sends messages to nodes which will recieve the message with signal strength at least 1.0. Physicals SimplePhysical delta - only used when moving a node. specifies a small amount of time between when a node is moved and when it recalculates its radio neighbor set (to ensure causality). - OPTIONAL, default is 0.00001s radio_radius - used to calculate a power level such that all nodes within distance r will receive radio messages with signal strength at least 1. - OPTIONAL power_level - power level at which radio messages are sent; signal strength at recipient varies with distance^-2. - OPTIONAL, default is 100 ==== Section 2: Environment map files ==== The map file specifies an environment as a 2-dimensional array of tiles of different types -- concrete, grass, x-wall or y-wall: Tile environment[width][height]; Note that coordinates are zero-based. The different tile types exhibit different propagation properties for sound and radio waves. The map file starts off with two integers, width and height in terms of number of tiles: Then it has a sequence of "tile" or "default_tile" lines. The last default_tile line occuring in the file specifies the properties of all tiles for which no tile line was specified. It takes the form: default_tile Where is one of {concrete, grass, x-wall, y-wall}. You can also have properties specifying a different type for specific tiles: tile This means that the tile at coordinate (x,y) -- i.e., environment[x][y] has the characteristics of , which, again, is one of {concrete grass, x-wall, y-wall}. Types of tiles: concrete no dampening or echoes grass sound is dampened/muffled by 5% per tile x-wall/y-wall 70% of the sound continues along its original path after taking a 6.2m detour (corresponding to a delay of 0.0188s at STP) depending on propagation direction, up to 30% of the sound is reflected as an echo; an x-wall acts as a reflective surface running parallel to the x-axis direction, while a y-wall in the y direction. radio signals are dampened/muffled by 20% per tile Example map file: 2 2 default_tile grass tile x-wall 0 0 default_tile concrete tile grass 1 1 This file specifies a 2x2 tiled environment, with tile coordinates from the set [0,1]x[0,1]. Tiles (0,0) and (1,1) have the specified types, while tiles (0,1) and (1,0) have the default type -- concrete. The line "default_tile concrete" overrides the line "default_tile grass". Notice how default_tile and tile lines can be aribtrarily intermixed, but the dimensions "2 2" must occur at the beginning.