named-data-ndnSIM / ndnSIM

ndnSIM: NS-3 based NDN simulator
GNU General Public License v3.0
108 stars 165 forks source link

Divide by zero:ConsumerCbr's Frequency maybe set zero,and cause bug!!! #114

Open fgfxf opened 1 year ago

fgfxf commented 1 year ago

the consumer 's interest packet's frequency is a double varble,and can be set to zero.

ndnSIM/apps/ndn-consumer-cbr.cpp

col 93: m_sendEvent = Simulator::Schedule((m_random == 0) ? Seconds(1.0 / m_frequency) : Seconds(m_random->GetValue()), &Consumer::SendPacket, this);

SetAttribute("Frequency", ns3::StringValue("0"));

i want to set Frequency small to make frequency little.

SetAttribute("Frequency", ns3::StringValue("0.1")); // 10 second a interests