Posts Tagged ‘trace file’

Problem ‘undefined’ Protocol in Trace File

March 4, 2011

After I’ve ported & installed my new protocol into NS-2.34 on my Ubuntu 10.4, I’ve got something unusual in my trace file. It should be my protocol showed in trace file, but my trace file looks like this:
…..
…..
f -t 100.617533225 -Hs 9 -Hd 0 -Ni 9 -Nx 216.96 -Ny 129.62 -Nz 0.00 -Ne -1.000000 -Nl RTR -Nw — -Ma 0 -Md 0 -Ms 0 -Mt 0 -Is 12582914.255 -Id -1.255 -It undefined -Il 44 -If 0 -Ii 1949 -Iv 4
s -t 100.617708225 -Hs 9 -Hd 0 -Ni 9 -Nx 216.96 -Ny 129.62 -Nz 0.00 -Ne -1.000000 -Nl MAC -Nw — -Ma 0 -Md ffffffff -Ms 5 -Mt 800 -Is 12582914.255 -Id -1.255 -It undefined -Il 102 -If 0 -Ii 1949 -Iv 4
r -t 100.618524510 -Hs 5 -Hd 0 -Ni 5 -Nx 300.00 -Ny 150.00 -Nz 0.00 -Ne -1.000000 -Nl MAC -Nw — -Ma 0 -Md ffffffff -Ms 5 -Mt 800 -Is 12582914.255 -Id -1.255 -It undefined -Il 44 -If 0 -Ii 1949 -Iv 4
….
….
Almost 2 weeks I’ve been stuck in this problem. And, Alhamdulillah (*Thanks God*), now it’s SOLVED. The problem is I have to modified the packet.h file. Since NS-2.33 changed with adding support for dynamic libraries. The packet_t is changed from enum to unsigned int in order to allow dynamic definition of new packet types within dynamic libraries. Pre-defined packet types are implemented as static constanta.

And the packet.h file will added line as follows:

// PT_MYPROTO; ———————————> Changed!
static const packet_t PT_MYPROTO = 62;

// insert new packet types here
static packet_t PT_NTYPE = 63; // This MUST be the LAST. The original value is 62.

And add “type == PT_MYPROTO” on line 260.
static packetClass classify(packet_t type) {
if (type == PT_DSR ||
type == PT_MESSAGE ||
type == PT_TORA ||
type == PT_AODV ||
type == PT_MYPROTO)
return ROUTING;


Problem 'undefined' Protocol in Trace File

March 4, 2011

After I’ve ported & installed my new protocol into NS-2.34 on my Ubuntu 10.4, I’ve got something unusual in my trace file. It should be my protocol showed in trace file, but my trace file looks like this:
…..
…..
f -t 100.617533225 -Hs 9 -Hd 0 -Ni 9 -Nx 216.96 -Ny 129.62 -Nz 0.00 -Ne -1.000000 -Nl RTR -Nw — -Ma 0 -Md 0 -Ms 0 -Mt 0 -Is 12582914.255 -Id -1.255 -It undefined -Il 44 -If 0 -Ii 1949 -Iv 4
s -t 100.617708225 -Hs 9 -Hd 0 -Ni 9 -Nx 216.96 -Ny 129.62 -Nz 0.00 -Ne -1.000000 -Nl MAC -Nw — -Ma 0 -Md ffffffff -Ms 5 -Mt 800 -Is 12582914.255 -Id -1.255 -It undefined -Il 102 -If 0 -Ii 1949 -Iv 4
r -t 100.618524510 -Hs 5 -Hd 0 -Ni 5 -Nx 300.00 -Ny 150.00 -Nz 0.00 -Ne -1.000000 -Nl MAC -Nw — -Ma 0 -Md ffffffff -Ms 5 -Mt 800 -Is 12582914.255 -Id -1.255 -It undefined -Il 44 -If 0 -Ii 1949 -Iv 4
….
….
Almost 2 weeks I’ve been stuck in this problem. And, Alhamdulillah (*Thanks God*), now it’s SOLVED. The problem is I have to modified the packet.h file. Since NS-2.33 changed with adding support for dynamic libraries. The packet_t is changed from enum to unsigned int in order to allow dynamic definition of new packet types within dynamic libraries. Pre-defined packet types are implemented as static constanta.

And the packet.h file will added line as follows:

// PT_MYPROTO; ———————————> Changed!
static const packet_t PT_MYPROTO = 62;

// insert new packet types here
static packet_t PT_NTYPE = 63; // This MUST be the LAST. The original value is 62.

And add “type == PT_MYPROTO” on line 260.
static packetClass classify(packet_t type) {
if (type == PT_DSR ||
type == PT_MESSAGE ||
type == PT_TORA ||
type == PT_AODV ||
type == PT_MYPROTO)
return ROUTING;


Gnuplot Tutorial

January 18, 2011

gnuplot

This tutorial comes from Gnuplot home page.

1 GNUPLOT – version 4.0

Gnuplot is a free, command-driven,interactive, function and data plotting program. Pre-compiled, executeables and source code for Gnuplot 4.0 may be downloaded for Windows, OS2, DOS, and Linux.
The important enhancements provided by version 4.0 are described here.

On Unix/Linux systems start Gnuplot by simply typing:

 gnuplot

(more…)

Analyze Output Trace File Using Perl

January 10, 2011

Here is my script for analyze output trace file in NS-2 using Perl. This script is modified from Elmurod website

#!/usr/bin/perl
$tracefile=$ARGV[0];
$granularity=$ARGV[1];

 (more...)