Need to create a exponential random ON off Traffic

1,108 views
Skip to first unread message

Bibek Luitel

unread,
Oct 18, 2014, 9:54:14 AM10/18/14
to ns-3-...@googlegroups.com
I am trying to  convert creaate a onOff Application with exponential random variable which was previously created on version  before  ns-3.14like this ..

  oo.SetAttribute("OnTime",RandomVariableValue(ExponentialVariable(1)));  

I have tried all the  examples in ns-3.20/examples 

but  am not able to start the application with exponential random variable

 oo.SetAttribute("OnTime",StringValue ("ns3::ExponentialRandomVariable[mean=1|Bound=1]"));  
oo.SetAttribute("OffTime",StringValue ("ns3::ExponentialRandomVariable[mean=1|Bound=1]"))

but my application is not starting .. what should i do to create a exponential random  traffic  on Off application

Tommaso Pecorella

unread,
Oct 19, 2014, 12:17:25 PM10/19/14
to ns-3-...@googlegroups.com
Hi,

it should work. What do you mean by "is not starting" ?

T.

Visali

unread,
Oct 9, 2015, 7:39:09 AM10/9/15
to ns-3-users
Hi,
          The same error occurred to me also. The client is not generating the packets when i gave the exponential random variable for Off Time. Please tell me how to solve this.

OnOffHelper clientHelper ("ns3::UdpSocketFactory", InetSocketAddress(Ipv4Address (), remotePort));
    clientHelper.SetAttribute("PacketSize", UintegerValue(packetSize));
    clientHelper.SetAttribute("OffTime", StringValue ("ns3::ExponentialRandomVariable[Mean=0.001|Bound=1]"));
   
    clientHelper.SetAttribute("OnTime",StringValue ("ns3::ConstantRandomVariable[Constant=0.001]"));
   
    clientHelper.SetAttribute("DataRate", StringValue ("10Mbps"));

Regards

Konstantinos

unread,
Oct 9, 2015, 8:18:04 AM10/9/15
to ns-3-users
Hi Visali,

Tommaso's question apply also to your case. 
What do you mean it is not generating packets? Are you tracing the OnOffApplication/Tx or using NS_LOG to confirm that? 

Regards,
K.

Visali

unread,
Oct 12, 2015, 12:53:45 AM10/12/15
to ns-3-users
Hii Konstantinos,

I am using flow monitor to check the packet flow, but there are no transmit or receive bytes. Also I used NS_LOG SeqTsHeader to check the UDP start times, but there is no flow. Please help.

Regards,
Visali

Konstantinos

unread,
Oct 12, 2015, 3:55:53 AM10/12/15
to ns-3-users
Hi,

Please provide full script to check if there is a bug in NS-3 or in your code.

Regards
K.

Konstantinos

unread,
Oct 12, 2015, 6:55:50 AM10/12/15
to ns-3-users
I just checked your code more carefully, and you have not configured the client properly.

OnOffHelper clientHelper ("ns3::UdpSocketFactory", InetSocketAddress(Ipv4Address (), remotePort));

You need to specify the address of the remote host. Currently you do not give any.


On Monday, October 12, 2015 at 5:53:45 AM UTC+1, Visali wrote:

Visali

unread,
Oct 13, 2015, 7:59:52 AM10/13/15
to ns-3-users
Thank you Konstantinos. Got the ouput

Regards,
Visali

xavier ashish

unread,
Jun 7, 2019, 6:42:16 AM6/7/19
to ns-3-users
hi
i am also trying to use OnOffApplication with on time set as constant random variable and off time set as exponential random variable
and applied all the necessary requirement for OnOff application but still its not working and showing error.

ApplicationContainer cbrApps;
  uint16_t cbrPort = 12345;
  OnOffHelper onOffHelper1 ("ns3::UdpSocketFactory", InetSocketAddress (Ipv4Address ("10.1.1.50"), cbrPort));
  onOffHelper1.SetAttribute ("PacketSize", UintegerValue (1024));
  onOffHelper1.SetAttribute ("OnTime",  StringValue ("ns3::ConstantRandomVariable[Constant=1.0]"));
  onOffHelper1.SetAttribute ("OffTime", DoubleValue ("ns3::ExponentialRandomVariable[mean=1|Bound=0]"));

kindly help
thankyou

Jared Dulmage

unread,
Jun 7, 2019, 10:40:14 AM6/7/19
to ns-3-users
Xavier,

It seems you have your "OffTime" attribute set to a DoubleValue which prob won't parse that TypeId string.  Why not do what you did with "OnTime" and pass a StringValue.  Also the attribute names in ExponentialRandomVariable are "Mean" and "Bound" (note the caps).

Hope that helps,
Jared.

xavier ashish

unread,
Jun 10, 2019, 10:13:28 AM6/10/19
to ns-3-...@googlegroups.com
thanks Jared Dulmage
just got the output
> --
> Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
> ---
> You received this message because you are subscribed to the Google Groups "ns-3-users" group.
> To unsubscribe from this group and stop receiving emails from it, 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 https://groups.google.com/group/ns-3-users.
> To view this discussion on the web visit https://groups.google.com/d/msgid/ns-3-users/b5491915-6b12-4ca6-9f38-4bc75cfa881e%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Ashish Xavier Das
Reply all
Reply to author
Forward
0 new messages