Hi,
I am trying to count the received packet number by each node,so I tried callback functions,which is
void ReceivedPacket(Ptr<const Packet> packet ,const Address &)
{
NS_LOG_UNCOND("Received one Packet ");
pktcounter++; //defined before
std::cout<<"packet number is :"<<pktcounter<<std::endl;
}
and call it by
Config::ConnectWithContext("NodeList/*/ApplicationList/*/$ns3::PacketSink/Rx",MakeCallback(&ReceivedPacket,this ) );
when I run the code,it can run successfully,but the output is packet numbers from all nodes,what can I do to get received packet number from each node?
Thanks
Mark