From an implementation standpoint, what this means is this. When queuing disciplines are created for a device, a pointer to the queue is maintained in the device structure (in include/netdevice.h). The IP layer, after adding the necessary header information to a packet (in net/ipv4/ip_output.c) , calls the function dev_queue_xmit (in net/core/dev.c). A portion of this code is shown below.
q = dev->qdisc;
if (q->enqueue) {
q->enqueue(skb, q);
qdisc_wakeup(dev);
return 0;
}
.
.
.
.
if (dev->hard_start_xmit(skb, dev) == 0)
.
.
.
This function shows that before actually sending the packet on the output interface (by doing a hard_start_xmit), the packet is enqueued in the queue maintained by the device, if one exists. Thus, an mentioned before, traffic control is implemented just before the packet is sent to the device driver.
As already mentioned, the linux traffic control mechanism provides the basic framework for the development of integrated services [1] and differentiated services [2] support in linux. This is shown in Figure 2.
As shown in Figure 2, the QoS support in linux consists of the following three basic building blocks, namely:
Let us now discuss these basic blocks in detail.