SocketAddressTag was a long-standing API glitch. It was used to replicate the RecvFrom effect (i.e., to know the source address of packet) without calling RecvFrom.
This option is more harmful than useful, because in case of tunnels the new tag needs to replace the old one. Moreover, there is no real need to create a new API when there is a perfectly working one (i.e., RecvFrom).
This change allows us to more closely follow the Linux behavior. A packet
is only requeued when the device queue is stopped before we attempt to send
the packet to the device. Thus, a packet sent to a netdevice is never requeued.
It turns out that packets can only be requeued if the underlying device is
tc-aware and multi-queue. The PointToPointNetDevice code is updated accordingly.
...so that all the subclasses have such attributes. This
allows queue discs to have attributes specifying the mode and
size of their queue(s) and to create queues using their
own attributes.
This commit is heavily inspired by Natale's queue rework patch:
https://codereview.appspot.com/270540044/
This patch adds a NetDeviceQueue class to store information about a single
transmission queue of a network device. This class is meant to store the
state of a transmission queue (i.e., whether the queue is stopped or not)
and some data used by techniques such as Byte Queue Limits. Also, multi-queue
aware queue discs can aggregate a child queue disc to an object of this class.
These features (excluding BQL) are added in subsequent commits.
The NetDevice class maintains a vector of NetDeviceQueue pointers, one for
each transmission queue. A NetDevice constructor is added which creates a
single transmission queue by default for every device. The number of transmission
queues can be modified (by child classes) by calling NetDevice::SetTxQueuesN.
Two public methods, GetTxQueue and GetTxQueuesN, are also added to the NetDevice class
to return the i-th NetDeviceQueue and the number of transmission queues, respectively.
A QueueItem base class is introduced to represent the items stored
in a Queue. The base class only contains a Ptr<Packet>. Derived classes
can store additional information. DropTailQueue, RedQueue and CodelQueue,
along with their examples and testsuits, have been adapted. Objects using
such queues have been adapted too.