[ns] (null) - invalid packet type (exp) - HELP!!!!
justin lipman
justin@snrc.uow.edu.au
Wed, 07 Feb 2001 17:58:58 +1100
--------------3D05AF0B249C75DA7332652D
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
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
--------------3D05AF0B249C75DA7332652D
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Hi Mattos,
<p>I just had a similar problem and the solution was quite simple.
<br>Thanks to Vikram Kanodia for pointing it out.
<p>Simple go and edit the cmu-trace.cc and cmu-trace.h files
<p>You need to do three things:
<br>1) Add your packet type in CMUTRACE::format(Packet *p, const char *why)
<br>For example I added PT_PING AND PT_IA as follows:
<p> ....
<br> case PT_CBR:
<br> format_rtp(p, offset);
<br> break;
<br> case PT_PING:
<br> format_ping(p, offset);
<br> break;
<br> case PT_IA:
<br> format_ia(p, offset);
<br> break;
<br> case PT_DIFF:
<br> break;
<br> ...
<p>2) create the above functions I just copied the CMUTrace::format_ip(...)
<p>void CMUTrace::format_ping(Packet *p, int offset) {
<p> if (newtrace_) {
<br>
...
<br> }
<br> else {
<br>
...
<br> }
<p>}
<p>3) make sure you update cmu-trace.h to reflect your changes
<p>This seems to work for me... and I imagine its the right way to
do it...
<p>Cheerio,
<br>Justin
<pre>--
Telecommunications Research Centre
<A HREF="http://www.titr.uow.edu.au">http://www.titr.uow.edu.au</A></pre>
<p>
<br>
<p>"Mattos, Leonardo" wrote:
<blockquote TYPE=CITE>Hi all,
<p>I am having problems in simulating a exponential application on top
of udp
<br>for wireless communications.
<br>I saw similar questions in the mailing list, but no solutions for the
<br>problem so far.
<br>My traffic pattern seems to be ok, because I checked for a wired network
and
<br>it worked fine.
<br>So, my question is: which files should I change in order to make exponential
<br>apps also work for wireless?
<p>Here is a sample of my traffic file:
<p>set udp_(0) [new Agent/UDP]
<br>$ns_ attach-agent $node_(2) $udp_(0)
<br>set null_(0) [new Agent/Null]
<br>$ns_ attach-agent $node_(3) $null_(0)
<br>$ns_ connect $udp_(0) $null_(0)
<br>set e_(0) [new Application/Traffic/Exponential]
<br>$e_(0) set packetSize_ 512
<br>$e_(0) set burst_time_ 500ms
<br>$e_(0) set idle_time_ 500ms
<br>$e_(0) set rate_ 100k
<br>$e_(0) attach-agent $udp_(0)
<br>$ns_ at 40.557023746220864 "$e_(0) start"
<p>Here is the error message I am having:
<br>Loading connection pattern...
<br>Loading scenario file...
<br>Starting Simulation...
<br>(null) - invalid packet type (exp).
<p>I appreciate any help!!!
<br>Thanks!!
<p>Leo</blockquote>
<br> </html>
--------------3D05AF0B249C75DA7332652D--