[brite-users] Output format for NS-2 when cppgen is used?

tk424 tk424 at umr.edu
Tue Jul 10 12:11:59 EDT 2007


Dear BRITE users:

I would like to use BRITE in the console mode (cppgen) and generate the output file in the NS format AUTOMATICALLY. I can't generate the output file automatically in the NS format.
It is possible to convert the format manually. 

* However, I was wondering if automatic conversion is supported for cppgen.*
* What should I do to fix it? *

I recently installed BRITE and used the GUI mode ($ brite &).
My target is to generate random topologies for NS-2.
Therefore, the output format needs to be written in the NS-2 file format. The GUI mode supports the NS output file format. On the other hand, the console mode (cppgen) does not support the NS output format. (Actually, there are bugs in the GUI mode and I had to modify the java source codes.)

It is likely the console mode command cppgen does not support the NS output format. Even if the config file, e.g. RTWaxman20.conf, provides an option to select the NS file format, cppgen DOES NOT automatically generate the NS output file at all. That is, use of the following options does not generate any output file. 

BeginOutput 			#**Atleast one of these options should have value 1**
	BRITE = 0		#0 = Do not save as BRITE, 1 = save as BRITE.  
	OTTER = 0		#0 = Do not visualize with Otter, 1 = Visualize
	DML = 0			#1/0=enable/disable output to SSFNet's DML format 
	NS = 1			#1/0=enable/disable output to NS-2
	Javasim = 0		#1/0=enable/disable output to Javasim
EndOutput

An alternate solution is to generate the output file in the BRITE format, first, and then convert it to the NS format.
cppgen DOES creates the output file in the BRITE format.
So, changing the option to BRITE will create the output file, say test.brite.

BeginOutput 			#**Atleast one of these options should have value 1**
	BRITE = 1		#0 = Do not save as BRITE, 1 = save as BRITE.  
	OTTER = 0		#0 = Do not visualize with Otter, 1 = Visualize
	DML = 0			#1/0=enable/disable output to SSFNet's DML format 
	NS = 0			#1/0=enable/disable output to NS-2
	Javasim = 0		#1/0=enable/disable output to Javasim
EndOutput

"brite2ns" in directory bin supports manual conversion.
It converts the file format from brite to ns ONLY IF it is run in directory bin.

tk424 at wunsch-linux:~/ADPNetSim/ver_1_2/brite-2.1b/bin$ ./brite2ns test.brite test.tcl
[MESSAGE]: Creating topology from input file.
[MESSAGE]: Parsing BRITE format file
[MESSAGE]: Producing export file for ns
[MESSAGE]: ... DONE.

It gives an error message if it's run in the parent directory.

tk424 at wunsch-linux:~/ADPNetSim/ver_1_2/brite-2.1b$ bin/brite2ns test.brite test.tcl
Exception in thread "main" java.lang.NoClassDefFoundError: Export/NSExport

The reason is this script brite2ns refers to the file "relatively." 
In the original code, Export.NSExport that converts BRITE format to NS format is refered by ../Java/:../:. 

#!/bin/sh

   briteFile=$1;
   rtoras=$2;

   java -classpath ../Java/:../:. Export.NSExport $briteFile $rtoras

I made a slight modification.
I gave an absolute path to the file so that brite2ns can be run anywhere.
After this modification, the error was fixed.

#!/bin/sh

DIR_ROOT_BRITE="/home/tk424/ADPNetSim/ver_1_2/brite-2.1b";
briteFile=$1;
rtoras=$2;

#java -classpath ../Java/:../:. Export.NSExport $briteFile $rtoras
java -classpath $DIR_ROOT_BRITE/Java/:../:. Export.NSExport $briteFile $rtoras

Well, I can write a bash script to run cppgen and brite2ns one after another.
However, it's the best to use the option in the config file if possible.
Does anyone know this?

Thank you in advance!!!

Yours truly,
Tae-hyung Kim

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  Friends are angels who lift us to our feet when  
  our wing have trouble remembering how to fly.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Phone (O): +1-573-341-4532
Phone (C): +1-573-201-7977
Fax: +1-573-341-4532
Email: tk424 at umr.edu or phil4u_kor at hotmail.com
Address:
University of Missouri, Rolla
Applied Computational Intelligence Laboratory
G11 Emerson Electric Co. Hall
1870 Miner Circle Rolla, MO 65409-0040



More information about the brite-users mailing list