/* * FlexiTP : Flexible-schedule-based TDMA Protocol for wireless sensor networks * author : Winnie Louis Lee * * * Copyright (C) 2007 by the University of Western Australia * * The FlexiTP source is free software; you can redistribute it * and/or modify it under the terms of the GNU General Public License, * version 2, as published by the Free Software Foundation. * * FlexiTP source is distributed in the hope that it will be useful, * but without any warranty; without even the implied warranty of * merchantability or fitness for particular purpose. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License along * with this software; if not, write to the Free Software Foundation, Inc., */ FlexiTP Overview ------------------ FlexiTP is a TDMA protocol that offers a synchronized and loose slot structure. Nodes in the network can build, modify, or extend their scheduled number of slots during execution, based on their local information. Nodes wake up for their scheduled slots, otherwise switch into power-saving sleep mode. In FlexiTP, initially, all nodes in a network build their data gathering schedules. After this initial global one-off setup phase, all repair operations are local. Changes in ns-2 --------------- FlexiTP is implemented on ns-2 version 2.30. I have made modifications to several ns-2 files that can be found in "changesInNs2" folder. FlexiTP Simulation Parameters ----------------------------- Most of the parameters are specified on the command line and simFlexiTP.tcl file, however several variables are set by the user in the flexiTP.h file. For example are: #define MAX_NODES 501 #define MAX_NBR 201 #define MAX_CHILDREN 200 To run a simulation, simFlexiTP.tcl requires three user inputs with the following format: ns simFlexiTP.tcl numNodes scenarioNo simulationTime FlexiTP Simulation Inputs ------------------------- By default, FlexiTP looks for a network topology file in "./topoDir" with the following format: scen-NumNodes-ComRange-MapX-MapY-ScenarioNum.tcl For example, a network of 100 nodes with communication range of 60 m in a network area of 300 x 300 m should be named as follow: scen-100-60-300-300-1.tcl FlexiTP Simulation Outputs -------------------------- By default, FlexiTP prints its simulation outputs to "./stat" with the following subfolders: ./stat/NodeTable -> Node properties and schedule lookup table: 1) parent 2) level (hop-count) 3) global highest slot 4) a list of children 5) a list of direct (first-level) neighbors 6) receive slot list 7) transmit slot list 8) conflict slot list 9) transmit multi-function slot 10) receive multi-function slot 11) average node initial network setup cost for idle listening, sleeping, transmiting, receiving, and radio switching 12) average node initial network setup cost for idle listening 13) average node initial network setup cost for sleeping 14) average node initial network setup cost for transmitting 15) average node initial network setup cost for receiving ./stat/PerformanceStat -> FlexiTP performance in terms of: 1) network scenario number 2) simulation time for collecting statistics of data gathering 3) total packet received at the base station 4) average packet delay 5) average packet latency 6) average node energy consumption for idle listening, sleeping, transmiting, receiving, and radio switching 7) average node energy consumption for idle listening 8) average node energy consumption for sleeping 9) average node energy consumption for transmitting 10) average node energy consumption for receiving 11) average node energy consumption for transmiting and receiving 12) average node energy consumption for idle listening, transmiting, and receiving ./stat/SimResult -> FlexiTP performance per data gathering cycle (frame) in terms of: 1) slot reuse ratio 2) packet delay 3) packet latency 4) total packet received by each node 5) node energy consumption ./stat/SimStatus -> FlexiTP debug messages for: 1) tree construction phase the user has to set "trace_treeConstruction_on" in simFlexiTP.tcl to YES or NO 2) neighbor discovery phase the user has to set "trace_nghDiscovery_on" in simFlexiTP.tcl to YES or NO 3) data gathering slot assignment phase the user has to set "trace_DGSAssign_on" in simFlexiTP.tcl to YES or NO 4) multi-function slot assignment phase the user has to set "trace_MFSAssign_on" in simFlexiTP.tcl to YES or NO 5) global-highest slot assignment phase the user has to set "trace_GHSAssign_on" in simFlexiTP.tcl to YES or NO 6) data gathering phase the user has to set "trace_frame_on" in simFlexiTP.tcl to YES or NO ./stat/StatFTSummary -> Statistics on FlexiTP local repair: 1) network scenario number 2) average node energy consumption for idle listening, sleeping, transmiting, receiving, and radio switching 3) average node energy consumption for idle listening 4) average node energy consumption for transmiting 5) average node energy consumption for receiving 6) total orphan nodes in a network 7) total orphan nodes that are re-connected to a network 8) network connectivity ratio 9) local repair latency in terms of the number of FTS cycles ./stat/StatSummary -> Summary of FlexiTP statistics: 1) network scenario number 2) total network slot with slot reuse 3) global highest slot 4) slot reuse ratio 5) average energy consumption per node during the initial network setup phase 6) initial network setup period in seconds 7) average energy consumption per node during the time slot assignment phase 8) time slot assignment period in seconds 9) average packet delay per data gathering cycle 10) average packet latency per data gathering cycle 11) total lost per data gathering cycle 12) average node energy consumption per data gathering cycle 13) average node energy consumption for idle listening per data gathering cycle 14) average node energy consumption for sleeping per data gathering cycle 15) average node energy consumption for transmiting per data gathering cycle 16) average node energy consumption for receiving per data gathering cycle 17) average node energy consumption for transmiting and receiving per data gathering cycle 18) average node energy consumption for idle listening, transmiting and receiving per data gathering cycle