DescriptionBeing a subclass of Queue, WifiMacQueue gains the ability to trace enqueues, dequeues, and drops. The Cleanup() method has been removed by adopting the following strategy. Keep in mind that packets are timestamped when inserted in the queue, so packets are already sorted by increasing timestamp (from head to tail). When a dequeue or peek operation is requested, packets are processed one-by-one (starting from the head of the queue) until a packet is found that satisfies the requested conditions (e.g., tid and address) and whose time-to-live is not expired yet. Processed packets whose time-to-live is expired are clearly dropped. Given that packets are sorted by increasing timestamp and the time-to-live of the returned packet (if any) is not expired, we manage to remove all the expired packets from the queue. This comes at no additional cost (we necessarily have to walk the list until we find the packet to be returned).
When packets are enqueued, just the oldest item (the one at the head of the tail) is processed. If its timer is expired, it is removed so as to make room for the new packet.
Patch Set 1 #Patch Set 2 : Rebased on top of the recent wifi refactoring #
MessagesTotal messages: 8
|