[Ns-developers] Delete a packet in WifiMacQueue

Mathieu Lacage mathieu.lacage at sophia.inria.fr
Sun Jan 18 11:29:24 PST 2009


On Sun, 2009-01-18 at 14:24 +0100, Mirko Banchi wrote:

> WifiMacQueue
> --------
>  P4-RA
> --------
>  P3-RA
> --------
>  P2-RB
> --------
>  P1-RA
> --------
> 
> I remove from queue P1 so aggregation could be made with P3 and P4 that
> have same receiver RA. But aggregation is performed by an algorithm that
> decides how many packets will form aggregated packet so they should be
> removed from queue only if they are really part of final A-MSDU.The
> others must preserve arrive order.
> 
> Another way than deletion with packet id, could be storing of a
> PacketQueueI per packet?
> Maybe in this way:
> 
> std::list<std::pair<Ptr<Packet>,PacketQueueI> >
> WifiMacQueue::GetPacketsForReceiver (Mac48Address addr)

Why do you need to get all matching packets in one go ? Could you not
get each packet separately ? i.e., 

class WifiMacQueue 
{
public:
  // return the first packet at top of queue
  Ptr<Packet> Peek (WifiMacHeader *hdr);
  // return the first matching packet from top of queue
  Ptr<Packet> Peek (WifiMacHeader *hdr, Mac48Address dest);
  // remove first packet at top of queue
  Ptr<Packet> Dequeue (WifiMacHeader *hdr);
  // remove first matching packet from top of queue
  Ptr<Packet> Dequeue (WifiMacHeader *hdr, Mac48Address dest);
};

Mathieu



More information about the Ns-developers mailing list