BlueHoc Simulator  
  BlueHoc Manual
  Email us

BlueHoc: Bluetooth Performance Evaluation Tool

BlueHoc Manual

BlueHoc simulator provides a Bluetooth extension for Network Simulator (ver 2.1b6). BlueHoc is available for download under IBM Public License (IPL) from IBM developerWorks . It requires ns-2.1b6 which can be obtained from Network Simulator site.

Graphical Interface

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:

  • Starttime (sec): Typically 0.
  • NumResponses (sec): Number of reponses required from inquiry, typically it should be <= the number of slaves.
  • InqTimeout (sec): Inquiry timeout, typically 10.24.
For the slave node:
  • Starttime (sec): Typically slaves are started after masters.
  • InqScanOffset (sec): Typically a value between 0 and 2.56.

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.

One of the following applications needs to be selected for each link:

  • FTP
  • Telnet
  • Voice (uses Application/Traffic/Exponential traffic generator of ns)

Configuring the simulator

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.

  • In the Configure Menu select the simulation time.
  • Then click on the Scenario button.
This will create a canvas. On the bottom of the window will be instructions to create a master and upto 7 slaves. The location of devices and the distance from master is visible on the bottom left corner of the window. The devices will appear as circles with all the slaves connected to the master as shown in Figure 3. After you are finished creating devices, select a device by clicking on it and double click to configure it. The same is true for links between devices. You can start by configuring the master first.

Figure 3: Configuring a master

  • Set the master parameters to some reasonable values as discussed above.
  • Select each slave in turn and configure the required parameters.
  • Select a link and double click on it to configure.
  • Click on the Application button and select one of the three applications: FTP, Telnet, voice. The transport layer to be used is automatically taken care of. The Other option, has not been implemented yet.

After you are finished configuring all links, you can do the optional configurations:

  • On the Output menu select the optional traces and graphs you want. The interface will ask you the names of output files for nam and BTTraces if you click them on.
  • After you have made these optional configurations, select the File menu and click on Save As.

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.

Trace Support

There are two types of traces supported which can be turned ON as explained in the previous section. These traces are:

  • Nam Traces
  • BTTraces (Bluetooth specific traces)

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.


  1. The Bluetooth Specification
  2. ns manual:
  3. BlueHoc Presentation
  4. Jaap C Haarsten, "The Bluetooth Radio System" IEEE Personal Communications, Feb 2000.
  5. Network Animator Back

    BlueHoc is supported by India Research Lab
    Apurva Kumar IBM Corporation