Wireless broadcast

84 views
Skip to first unread message

Gabriele maggio

unread,
Jun 1, 2012, 4:35:46 AM6/1/12
to ns-3-users
I have a Vanet scenario in which 451 nodes have to send packet every
0.1 seconds in a broadcast way. The problem is how to generate
broadcast traffic!!! I've tried to use OnOffApplication

for(int i=0; i<1; i++)
{
OnOffHelper onoff ("ns3::UdpSocketFactory",Address
(InetSocketAddress (Ipv4Address ("255.255.255.255"), 80)));
onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable
(1)));
onoff.SetAttribute ("OffTime", RandomVariableValue
(ConstantVariable (0)));

ApplicationContainer app = onoff.Install (wifiNodes.Get(i));
// Start the application
app.Start (Seconds (0.0));
app.Stop (Seconds (1.0));

// Create an optional packet sink to receive these packets
PacketSinkHelper sink ("ns3::UdpSocketFactory",
Address (InetSocketAddress
(Ipv4Address::GetAny (), 80)));
app = sink.Install (wifiNodes.Get(i));
app.Add (sink.Install (wifiNodes.Get(i)));
app.Start (Seconds (0.0));
app.Stop (Seconds (1.0));
}

but even if every node generate packets with the desired rate, I have
no received packets...Probably OnOffApplication is not adapt for this
kind of scenario, but I don't know which could be the right solution
to the problem.

Can anyone help me please?
Thank's

Gabriele maggio

unread,
Jun 4, 2012, 4:10:03 AM6/4/12
to ns-3-users
Is there any problem with broadcast traffic in ns3?
Reply all
Reply to author
Forward
0 new messages