The Common Node (CN) configuration presents the greater number of parameter to be set. Since a CN has an application, a processing module and a data generation module used to simulate sensing tasks.
Sensor node creation is equal to Access Point node creation. Just put in the tradicional node-config structure the -sensorNode ON command.
Next step is to create common node functionality modules including a transport protocol, an sensor application, a processing and a data generator. The data generator module is the difference between a Cluster Head and a Common Node configuration. In the example box presented bellow an UDP transport protocol, an AggregateProcessing processing module, a TemperatureDataGenerator data generator module and a CommonNodeApplication application module were used.
set node_($counter) [$ns_ node] set udp_($counter) [new Agent/UDP] set processing_($counter) [new Processing/AggregateProcessing] set gen_($counter) [new DataGenerator/TemperatureDataGenerator] set app_($counter) [new Application/SensorBaseApp/CommonNodeApp]
Common node application parameters include dissemination interval and type (PERIODIC - 0, CONTINUOUS - 1, ON_DEMAND - 2 and EVENT_DRIVEN - 3), sent messages destination address. The attachements list is bigger including sensor node, transport protocol, processing and data generator module (see example box following).
$app_($counter) set destination_id_ 0; $app_($counter) set dissemination_type 0; $app_($counter) set dissemination_interval 30.0; $app_($counter) node $node_($counter); $app_($counter) attach-agent $udp_($counter) $app_($counter) attach_data_generator $gen_($counter) $app_($counter) attach-processing $processing_($counter)
Sensor node configuration is also similar to the one used for Cluster Head nodes, the addition of energy spent during the sensing task is the only difference as can be seen in the box. IMPORTANT: when attaching the transport protocol to an CN the port value used must be the same of all network elements (common nodes, cluster heads, etc).
$node_($counter) random-motion 0 $node_($counter) set X_ 5.0 $node_($counter) set Y_ 5.0 $node_($counter) set Z_ 0.0 $node_($counter) add-app $app_($counter) $node_($counter) attach $udp_($counter) $val(port) Node/MobileNode/SensorNode set sensingPower_ 0.015 Node/MobileNode/SensorNode set processingPower_ 0.024 Node/MobileNode/SensorNode set instructionsPerSecond_ 8000000
Configuring the data generator is simple too. The user should define sensing interval and type (PERIODIC - 0, CONTINUOUS - 1, ON_DEMAND - 2 and EVENT_DRIVEN - 3). Three parameters concerning the generated data should also be set: avg_measure representing the average value in the