I have to count packets for each incoming flow actively in RED Queue in Ns2. I have to integrate it in the queue algorithm itself so that changes (in variables of active queues) occur when the packet in queued. For simple codes it's like:
for each incoming packet
count[i]=count[i]+packet[i]
How do I say “for each incoming packet” in NS2, and how do I define [i]
such that [i]
is the IP Address representing different individual flow?
You can do it by modifying the .cc and .h files of the queue implementation which can be found at
ns-allinone-x.xx\ns-x.xx\queue.
See the following link for more information
http://www.projectguideline.com/topic/can-we-view-the-packet-content-in-ns2-not-the-header/