Hi,
I am running code that broadcasts packets but port is not specified and it works as data is received at other nodes. For Getting Rx trace from application layer i tried to use PacketSinkHelper but it needs port number besides address and Internet protocol needs to be installed.
This is broadcast sender working code snippet with no port specified and no Internet protocol. how can i capture packets Rx traces at application layer, what helper i need to install and what port number?
// Add packet socket handlers
ns3::PacketSocketHelper packetSocket;
packetSocket.Install(m_nodes);
// Configure packet socket: use broadcasts
ns3::PacketSocketAddress socket;
socket.SetAllDevices();
socket.SetPhysicalAddress(ns3::Mac48Address::GetBroadcast());
socket.SetProtocol(1);
ns3::OnOffHelper onOff ("ns3::PacketSocketFactory", ns3::Address (socket));
onOff.SetAttribute ("PacketSize", ns3::UintegerValue (400 - GetProtocolOverheads()));
onOff.SetAttribute ("OnTime", StringValue ("ns3::ConstantRandomVariable[Constant=1.0]"));
onOff.SetAttribute ("OffTime", StringValue ("ns3::ConstantRandomVariable[Constant=0.0]"));
onOff.SetAttribute ("DataRate", ns3::DataRateValue (ns3::DataRate ("128kb/s"))); // MA "40kb/s"
ns3::ApplicationContainer app;
app = onOff.Install (m_nodes);
app.Start(ns3::Seconds (0.0));
app.Stop(ns3::Seconds (SimTime)); //20.0