Bluehoc Simulator
Kevin Curran, Computer Lecturer - Magee College
With more than a handful of configuration settings for each of the maximum eight devices in a piconet a graphical interface for configuring BlueHoc proves useful. The interface is still going through some improvements (there is hardly any error checking in-built and errors are caught by Tk interpreter rather than the script). Also there are no default values to fall back upon. We will rectify this very soon, but in the meantime the user has to be careful about supplying all the required values.
The minimum required values are:
For the master node:
Simulation time:
There are 5 options 10, 20, 30, 40, 50 sec. We do not provide an entry field here because if the trace options are ON, then having arbitrary simulation times could generate trace files which are huge. The user can make minor adjustments required to replace the check-button widgets with an entry field.
Applications:
One of the following applications needs to be selected for each link:
The graphical interface requires the Tk windowing shell wish to be installed. After installing the simulator, change directory to ~ns/run and execute "wish bluehoc.tcl". This will bring a up a window entitled "Bluehoc configuration". In the following we describe how to configure BlueHoc. Though the order in which you configure various parameters is not important, but following the sequence below you will be sure not to miss out any of the mimimum required configuration above.
After you are finished configuring all links, you can do the optional configurations:
You will be prompted for a filename. The configuration parameters are dumped into this file. This file also includes the two helper tcl scripts for running the simulation. The simulation starts executing as soon as you save the file. If you have chosen options for plotting graphs, the xgraph windows with these graphs should come up. If not, you can wait for the simulation to get over, and check the output trace files if traces were enabled. The filename you selected in "Save As", is the simulation script. You can run the simulation using the command "../bthoc <filename> > <output_file>" to redirect the Bluetooth traces into "output_file". Bluetooth traces are explained in the next section.
There are two types of traces supported which can be turned ON as explained in the previous section. These traces are:
The nam traces are in the format which is understood by the "Network animator" program which is available with ns distribution. The dumps generated by BlueHoc have the 'hop' and 'node' events. These are responsible for showing packets travelling across links, changing node labels (which represent states) and changing node colors. Please see Network Animator [5] site for further details on the nam trace format.
Bluetooth traces are dumps for each packet received during inquiry and paging procedures. The dumps also include successful reception of LMP messages and L2CAP signaling. In connection state the dumps are for the L2CA_dataWrite and L2CA_dataRead. The lines with 'DELAY' are very useful for obtaining throughput and delay distribution after post-processing. The trace format for this line is:
BD_ADDR <bd_addr> DELAY <end_to_end_delay> SIZE <size_in_bytes> clock <simulation_time>This line corresponds to the L2CA_dataRead primitive and is printed each time L2CAP has a complete packet to send to the upper layer. bd_addr is the Bluetooth address of the receiving device, end_to_end_delay is the delay since L2CA_dataWrite primitive was called for the packet on a remote device. size_in_bytes is the higher layer packet size (after stripping L2CAP header) and clock is the simulation time. This provides all data necessary for calculating throughput and delay distribution. In ~ns/run/bluehoc.tcl this line is processed for plotting thrroughput and delay graphs.
BlueHoc is supported by India Research Lab
Please note that most of this text was taken from here.Thanks again to A. Kapurva, [email protected] for this article.