[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ns] (null) - invalid packet type (exp) - HELP!!!!



Hi Mattos,

I just had a similar problem and the solution was quite simple.
Thanks to Vikram Kanodia for pointing it out.

Simple go and edit the cmu-trace.cc and cmu-trace.h files

You need to do three things:
1) Add your packet type in CMUTRACE::format(Packet *p, const char *why)
For example I added PT_PING AND PT_IA as follows:

 ....
 case PT_CBR:
   format_rtp(p, offset);
   break;
 case PT_PING:
   format_ping(p, offset);
   break;
 case PT_IA:
   format_ia(p, offset);
   break;
 case PT_DIFF:
   break;
 ...

2) create the above functions I just copied the CMUTrace::format_ip(...)

void CMUTrace::format_ping(Packet *p, int offset) {

         if (newtrace_) {
                ...
         }
         else {
                 ...
         }

}

3) make sure you update cmu-trace.h to reflect your changes

This seems to work for me... and I imagine its the right way to do it...

Cheerio,
Justin

-- 
Telecommunications Research Centre
http://www.titr.uow.edu.au
 

 
 

"Mattos, Leonardo" wrote:

Hi all,

I am having problems in simulating a exponential application on top of udp
for wireless communications.
I saw similar questions in the mailing list, but no solutions for the
problem so far.
My traffic pattern seems to be ok, because I checked for a wired network and
it worked fine.
So, my question is: which files should I change in order to make exponential
apps also work for wireless?

Here is a sample of my traffic file:

set udp_(0) [new Agent/UDP]
$ns_ attach-agent $node_(2) $udp_(0)
set null_(0) [new Agent/Null]
$ns_ attach-agent $node_(3) $null_(0)
$ns_ connect $udp_(0) $null_(0)
set e_(0) [new Application/Traffic/Exponential]
$e_(0) set packetSize_ 512
$e_(0) set burst_time_ 500ms
$e_(0) set idle_time_ 500ms
$e_(0) set rate_ 100k
$e_(0) attach-agent $udp_(0)
$ns_ at 40.557023746220864 "$e_(0) start"

Here is the error message I am having:
Loading connection pattern...
Loading scenario file...
Starting Simulation...
(null) - invalid packet type (exp).

I appreciate any help!!!
Thanks!!

Leo