<div dir="auto"><div>Hi Otávio,<div dir="auto"><br></div><div dir="auto">Are you configuring three nodes in a presumedly multi-access wifi? Then I believe a transmission from the node at (10,70) and the other node at (120,70) would take one hop, no?</div><div dir="auto"><br></div><div dir="auto">You can trace packets with a regular ns-3 logging tool. (NetDevice and Channel, for example). <a href="https://www.nsnam.org/docs/release/3.37/manual/html/logging.html">https://www.nsnam.org/docs/release/3.37/manual/html/logging.html</a></div><br><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Fri, Jan 17, 2025, 5:08 AM Otávio Augusto via ndnSIM <<a href="mailto:ndnsim@lists.cs.ucla.edu">ndnsim@lists.cs.ucla.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:large">Hello.<br></div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:large"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:large">The contents of the ndn_wifi_3_nodes.cc file seem to be unavailable. So, here is the code:</div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:large"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">#include "ns3/core-module.h"</div><div class="gmail_default" style="font-family:tahoma,sans-serif">#include "ns3/network-module.h"<br>#include "ns3/applications-module.h"<br>#include "ns3/wifi-module.h"<br>#include "ns3/mobility-module.h"<br>#include "ns3/internet-module.h"<br><br>#include "ns3/ndnSIM-module.h"<br><br>using namespace std;<br>namespace ns3 {<br><br>NS_LOG_COMPONENT_DEFINE("ndn.WifiExample1");<br><br>int<br>main(int argc, char* argv[])<br>{<br> // disable fragmentation<br> Config::SetDefault("ns3::WifiRemoteStationManager::FragmentationThreshold", StringValue("2200"));<br> Config::SetDefault("ns3::WifiRemoteStationManager::RtsCtsThreshold", StringValue("2200"));<br> Config::SetDefault("ns3::WifiRemoteStationManager::NonUnicastMode",<br> StringValue("OfdmRate24Mbps"));<br><br> CommandLine cmd;<br> cmd.Parse(argc, argv);<br><br> WifiHelper wifi;<br> // wifi.SetRemoteStationManager ("ns3::AarfWifiManager");<br> wifi.SetStandard(WIFI_STANDARD_80211a);<br> wifi.SetRemoteStationManager("ns3::ConstantRateWifiManager", "DataMode",<br> StringValue("OfdmRate24Mbps"));<br><br> YansWifiChannelHelper wifiChannel;<br> wifiChannel.SetPropagationDelay("ns3::ConstantSpeedPropagationDelayModel");<br> wifiChannel.AddPropagationLoss("ns3::ThreeLogDistancePropagationLossModel");<br> wifiChannel.AddPropagationLoss("ns3::NakagamiPropagationLossModel");<br><br> YansWifiPhyHelper wifiPhyHelper;<br> wifiPhyHelper.SetChannel(wifiChannel.Create());<br> wifiPhyHelper.Set("TxPowerStart", DoubleValue(5));<br> wifiPhyHelper.Set("TxPowerEnd", DoubleValue(5));<br><br> WifiMacHelper wifiMacHelper;<br> wifiMacHelper.SetType("ns3::AdhocWifiMac");<br><br> MobilityHelper mobility;<br><br> NodeContainer nodes;<br> nodes.Create(3);<br><br> ////////////////<br> // 1. Install Wifi<br> NetDeviceContainer wifiNetDevices = wifi.Install(wifiPhyHelper, wifiMacHelper, nodes);<br><br> // 2. Install Mobility model<br> mobility.Install(nodes);<br><br> std::cout << "set position for nodes" << std::endl;<br><br> Ptr<ConstantPositionMobilityModel> s1 = nodes.Get(0)->GetObject<ConstantPositionMobilityModel> ();<br> Ptr<ConstantPositionMobilityModel> s2 = nodes.Get(1)->GetObject<ConstantPositionMobilityModel> ();<br> Ptr<ConstantPositionMobilityModel> s3 = nodes.Get(2)->GetObject<ConstantPositionMobilityModel> ();<br><br> s1->SetPosition (Vector ( 10.0, 70.0, 0));<br> s2->SetPosition (Vector ( 70.0, 70, 0));<br> s3->SetPosition (Vector ( 120.0, 70.0, 0));<br><br> // 3. Install NDN stack<br> NS_LOG_INFO("Installing NDN stack");<br> ndn::StackHelper ndnHelper;<br> // ndnHelper.AddNetDeviceFaceCreateCallback (WifiNetDevice::GetTypeId (), MakeCallback(MyNetDeviceFaceCallback));<br> ndnHelper.setPolicy("nfd::cs::lru");<br> ndnHelper.setCsSize(0);<br> ndnHelper.SetDefaultRoutes(true);<br> ndnHelper.Install(nodes);<br><br> // Set strategy<br> ndn::StrategyChoiceHelper::Install(nodes, "/", "/localhost/nfd/strategy/multicast");<br><br> // 4. Set up applications<br> NS_LOG_INFO("Installing Applications");<br><br> ndn::AppHelper consumerHelper("ns3::ndn::ConsumerCbr");<br> consumerHelper.SetPrefix("/test/prefix");<br> consumerHelper.SetAttribute("Frequency", DoubleValue(1.0));<br> consumerHelper.Install(nodes.Get(0));<br><br> ndn::AppHelper producerHelper("ns3::ndn::Producer");<br> producerHelper.SetPrefix("/");<br> producerHelper.SetAttribute("PayloadSize", StringValue("1200"));<br> producerHelper.Install(nodes.Get(2));<br> <br><br> Simulator::Stop(Seconds(30.0));<br><br> Simulator::Run();<br> Simulator::Destroy();<br><br> return 0;<br>}<br><br>} // namespace ns3<br><br>int<br>main(int argc, char* argv[])<br>{<br> return ns3::main(argc, argv);<br>}<br></div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif"><font size="4">Att,</font></div><div class="gmail_default" style="font-family:tahoma,sans-serif"><font size="4">Otávio</font></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Em qua., 15 de jan. de 2025 às 10:29, Otávio Augusto <<a href="mailto:otavio.augusto.snc@gmail.com" target="_blank" rel="noreferrer">otavio.augusto.snc@gmail.com</a>> escreveu:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:large">Hello everyone.</div><div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:large"><br>I'm testing a multi-node with wifi connection in ndnSIM, the code is attached (ndn_wifi_3_nodes.cc). In addition, I'm using ndnSIM from Windows OS with WSL 2, Ubuntu 20.04 (I don't know if this is important).</div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:large"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:large">Using the following command I get some log information about the consumer:<br><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif"><i>NS_LOG=ndn.Consumer ./waf --run=ndn_wifi_3_nodes<br></i><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:large">The output is in the out.txt attachment.<br>I expected the communication to go through the intermediary. However, as you can see, many messages timed out and the data packets that reached the consumer contain hop count equal to 1, which probably means that the consumer and producer are communicating directly, without using the intermediary node. Why did this happen?</div></div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:large"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:large">Note 1: in the 'ndn-simple-wifi' example the best-route strategy is used, but for me it resulted in NACK, I don't know why. Because of this, I used the multicast strategy.</div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:large">Note 2: How can I see the ndn route log (intermediate node, node 1)? I know how to check the consumer and producer logs, but I don't know what name I use to check the ndn router log with <i style="font-size:small">NS_LOG</i>.</div><span class="gmail_signature_prefix">--</span><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><font face="tahoma, sans-serif">Otávio da Cruz</font></div><font face="tahoma, sans-serif">Doctor student</font><div><font face="tahoma, sans-serif">Electrical Engineering at the Graduate Program in Electrical Engineering of the Federal University of Rio Grande do Sul (UFRGS) - Brazil</font></div></div></div></div></div>
</blockquote></div>
_______________________________________________<br>
ndnSIM mailing list<br>
<a href="mailto:ndnSIM@lists.cs.ucla.edu" target="_blank" rel="noreferrer">ndnSIM@lists.cs.ucla.edu</a><br>
<a href="https://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim" rel="noreferrer noreferrer" target="_blank">https://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim</a><br>
</blockquote></div></div></div>