Poisson Traffic Model

493 views
Skip to first unread message

Niranjan Vedamurthy

unread,
Jun 10, 2015, 3:49:02 AM6/10/15
to ns-3-...@googlegroups.com
Hi,
I went through examples. I am trying to model a poisson traffic source.  I realized that making the arrival time exponential is one of the ways to implement model. I am trying to run this code. But I am a bit confused, about how this code might work. When I run both the on and off times with constant random variable, it generates packets. But when I run with exponential it gives me error.

OnOffHelper clientHelper1 ("ns3::TcpSocketFactory", Address ());
      clientHelper1.SetAttribute ("OnTime", StringValue ("ns3::ConstantRandomVariable[Constant=0.001]"));
      clientHelper1.SetAttribute ("OffTime", StringValue ("ns3::ExponentialRandomVariable[Mean=0.001|Bound=1]"));
      clientHelper1.SetAttribute ("DataRate", DataRateValue (DataRate ("10Mb/s")));
      clientHelper1.SetAttribute ("PacketSize", UintegerValue (1000));

Tommaso Pecorella

unread,
Jun 10, 2015, 4:01:35 AM6/10/15
to ns-3-...@googlegroups.com
Hi,

please state the error and the ns-3 version you are using. Without these informations the only thing I can say is that you are stating that there's an error (which may or may not be true).

T.

Niranjan Vedamurthy

unread,
Jun 10, 2015, 4:13:41 AM6/10/15
to ns-3-...@googlegroups.com
assert failed. cond="uid <= m_information.size () && uid != 0", file=../src/core/model/type-id.cc, line=230
terminate called without an active exception
Command ['/home/darsh/ns-allinone-3.21/ns-3.21/build/scratch/red-tests'] terminated with signal SIGIOT. Run it under a debugger to get more information (./waf --run <program> --command-template="gdb --args %s <args>").
This was the error which i was getting. I wanted to understand how this might execute when compared to Constant Random Variable.

--
You received this message because you are subscribed to a topic in the Google Groups "ns-3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-3-users/QZ65CgCXQJY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.
To post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at http://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.

Tommaso Pecorella

unread,
Jun 10, 2015, 7:52:33 AM6/10/15
to ns-3-...@googlegroups.com
Hi,

tested in 3.23. It seems to work.
Please:
1) double check that you didn't change the ns-3 sources. In case triple check your changes
2) upgrade to 3.23 (ow to upgrade is well known and you should be able to do it by yourself)
3) check if the error persists if you use Constant Random Variable
4) use a debugger ?

T.

Niranjan Vedamurthy

unread,
Jun 10, 2015, 2:32:45 PM6/10/15
to ns-3-...@googlegroups.com
Hi Tom,
Thanks for the suggestions. I am very sure I have not changed the source code. I tried doing with NS 3.23. It started giving me a new error. I would show the error below. And one more thing which I wanted to mention is if I again change back to ConstantRandomVariable it keeps giving me the previous error which I posted. I am pretty new to NS3 and C++. So the way I have understood is if I use ConstantRandomVariable[Constant = 4] for ON time, it sends packets for a time equal to 4. Is this right? Thank You.

The error which I am getting now is this one: I am sure I did not change anything there,
../scratch/nin.cc: In function ‘void BuildAppsTest(uint32_t)’:
../scratch/nin.cc:120:31: error: ‘sink_start_time’ was not declared in this scope
       sinkApp.Start (Seconds (sink_start_time));
                               ^
../scratch/nin.cc: In function ‘int main(int, char**)’:
../scratch/nin.cc:186:3: error: ‘sink_start_time’ was not declared in this scope
   sink_start_time = global_start_time;
   ^
Waf: Leaving directory `/home/niranjan/Old ns-allinone-3.21/ns-3.21/build'
Build failed
 -> task in 'nin' failed (exit status 1): 
{task 140166818254736: cxx nin.cc -> nin.cc.6.o}
['/usr/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', '-Wno-error=deprecated-declarations', '-fstrict-aliasing', '-Wstrict-aliasing', '-pthread', '-I.', '-I..', '-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE', '-DHAVE_SYS_IOCTL_H=1', '-DHAVE_IF_NETS_H=1', '-DHAVE_NET_ETHERNET_H=1', '-DHAVE_PACKET_H=1', '-DHAVE_IF_TUN_H=1', '../scratch/nin.cc', '-c', '-o', 'scratch/nin.cc.6.o']
I tried doing with NS 3.23 it gives me the same error. Thank you.

Tommaso Pecorella

unread,
Jun 11, 2015, 12:53:01 AM6/11/15
to ns-3-...@googlegroups.com
Hi,
Without the script it's hard to say where exactly the problem is. Check again the variables definitions.
It's also a good idea to use a good IDE like Eclipse or NetBeans, they'll highlight the errors

T.

hy zhao

unread,
Sep 4, 2017, 4:41:57 AM9/4/17
to ns-3-users
Hi ,

Did you solve it? I have the same error.

在 2015年6月10日星期三 UTC+8下午7:52:33,Tommaso Pecorella写道:
Reply all
Reply to author
Forward
0 new messages