13 | | 1. A free queue element is checked out and, if available, filled in with a packet payload. |
14 | | 2. The upper-level MAC decides which outgoing queue, if any, the packet should be added to and notifies the framework to add it to the end of that particular queue. |
15 | | 3. The upper-level MAC checks each of the outgoing queues when the lower-level MAC is ready for another packet. At this point, the upper-level MAC can implement any number of queuing structures. In our implementation, we have used a round-robin scheme where the upper-level MAC cycles through the queues of associated devices. We intend for this design to be modified by users if a more complex queueing scheme is required. Once a packet is selected, the upper-level MAC notifies the MAC High Framework to send from a particular queue. |
16 | | 4. Once sent, the queue element is returned back to the free pool so it can be checked out and filled in with a new payload in the future. |
| 13 | The queueing system is implemented in the MAC High Framework. At boot the framework creates a fixed number of free queue elements. When new packets requiring wireless transmission are received or generated a free queue element is checked out from the framework, populated with the new packet, then added to the tail of the queue associated with the node to which the packet is addressed. Broadcast packets are added to a dedicated queue. |
| 14 | |
| 15 | When the low-level MAC is ready for a new packet the high-level queue framework removes the head element from the next queue and passes it to the low-level MAC for transmission. By default the next queue is selected via round robin. More sophisticated queue management schemes (i.e. to support QoS) can be implemented in place of round robin. |
| 16 | |
| 17 | When the low-level MAC completes transmission of a packet the high-level framework clears the associated queue entry and returns it to the pool of available queue entries for future re-use. |
| 18 | |