I'm trying to make a network with a switch that supports Ieee802.1q tagging. I checked the examples in inet but they were only helpful in regards to making VLANs which I now understand. My question is if the standard switch created in inet supports priority queueing with the Ieee8021qHeader and, if so, can anyone help me?
There is no direct support for priority queueing based on that field, but could be done relatively easily:
Check the inet.queueing
package. There is a whole lot of queuing, scheduling etc. related stuff there. (you can check the tutorial too: https://inet.omnetpp.org/docs/tutorials/queueing/doc/index.html)
What you need is to deploy inet.queueing.PacketQueue
(see docs in the NED file) (or DropTailQueue
(if you have to limit the queue size) which is just a PacketQueue with a drop strategy configured)
Implement an IPacketComparatorFunction
class in C++ to order your packets as you need and then configure that class as the comparatorClass
parameter of the PacketQueue
.
The EtherMac
is currently configured to use EtherQueue
as a queue module, which is a DropTailQueue
parametrized with a comparator that gives priority to ethernet PAUSE frames using inet::EthernetFrameComparator
(see that for an example, how to create a comparator class).
Once you implement proper comparator based on VLAN tags, you can just configure your own comparator as the queue's comparatorClass
parameter.