void
RoutingHelper::SetupRoutingMessages (NodeContainer & c,
Ipv4InterfaceContainer & adhocTxInterfaces)
{
// Setup routing transmissions
OnOffHelper onoff1 ("ns3::UdpSocketFactory",Address ());
onoff1.SetAttribute ("OnTime", StringValue ("ns3::ConstantRandomVariable[Constant=1.0]"));
onoff1.SetAttribute ("OffTime", StringValue ("ns3::ConstantRandomVariable[Constant=0.0]"));
Ptr<UniformRandomVariable> var = CreateObject<UniformRandomVariable> ();
int64_t stream = 2;
var->SetStream (stream);
for (uint32_t i = 0; i < m_nSinks; i++)
{
// protocol == 0 means no routing data, WAVE BSM only
// so do not set up sink
if (m_protocol != 0)
{
Ptr<Socket> sink = SetupRoutingPacketReceive (adhocTxInterfaces.GetAddress (i), c.Get (i));
}
AddressValue remoteAddress (InetSocketAddress (adhocTxInterfaces.GetAddress (i), m_port));
onoff1.SetAttribute ("Remote", remoteAddress);
ApplicationContainer temp = onoff1.Install (c.Get (i + m_nSinks));
temp.Start (Seconds (var->GetValue (1.0,2.0)));
temp.Stop (Seconds (m_TotalSimTime));
}
}
// in VanetRoutingExperiment::VanetRoutingExperiment ()
m_nSinks (10)
// in void VanetRoutingExperiment::SetupScenario ()
else if (m_scenario == 2)
{
// Realistic vehicular trace in some roads around the university of Houston
// "low density, 17 total vehicles"
m_traceFile = "/home/princeozed/mobility.tcl";
m_logFile = "vtovpro.log";
m_mobility = 1;
m_nNodes = 17; // total number of nodes has been changed here
m_TotalSimTime = 20.01;
m_nodeSpeed = 20;
m_nodePause = 0;
m_CSVfileName = "vtov.csv";
m_CSVfileName = "vtov2.csv";
}
static ns3::GlobalValue g_nSinks ("VRCnSinks",
"Number of sink nodes for routing non-BSM traffic",
ns3::UintegerValue (10),
ns3::MakeUintegerChecker<uint32_t> ());