- Home Page of ProjectGuideline.com ›
- Forums ›
- Get Help to do your B.E., and M.E., M.Tech., & M.S., Project in Ns2 ›
- How can i calculate the no of data packets sent out from my
How can i calculate the no of data packets sent out from my routing protocol node (c++)? thanks =)
Generally, any agent of ns2 will receive a packet through a function named ::recv. For example the following aodv function will receive packets at routing layer of aodv.
void
AODV::recv(Packet *p, Handler*) {
.....
...
After receiving the packet it will behave with respect to the received packet.
It may forward or send or drop the packet at that point (in side that function body).
On the other hand, timers also can be called periodically to do some routine function. So at at point also sending a packet can happen.
So just search for lines like
Scheduler::instance().schedule(target_, p,
0.01 * Random::uniform());
Actually, the function “schedule” will schedule a packet for transmission.
Technically, what I am saying is, you can not count the transmitted packet from one point.
[/b]