I would like to know the exact position of the following device in the packet flow for ingress traffic shaping:
- IFB: Intermediate Functional Block
I would like to better understand how packets are flowing to this device and exactly when this happens to understand what methods for filtering / classification can be used of the following:
tc filter ... u32 ...
iptables ... -j MARK --set-mark ...
iptables ... -j CLASSIFY --set-class ...
It seems hard to find documentation on this topic, any help where to find official documentation would be greatly appreciated as well.
Documentation as far as I know:
tc
: tldp.org HOWTO, lartc.org HOWTOimq
: IMQ - FAQ, lartc.orgnetfilter
packet flow: kernel_flow, docum.org kptd
From the known documentation I interpret the following:
Basic traffic control
figure 1
+-------+ +------+
|ingress| +---------+ |egress|
|qdisc +--->netfilter+--->qdisc |
|eth0 | +---------+ |eth0 |
+-------+ +------+
IMQ?
iptables -t mangle -A PREROUTING -i eth0 -j IMQ --todev 0
will result in?
figure 2
+----------+ +-------+ +------+ +----------+
|PREROUTING| |ingress| |egress| |PREROUTING|
|mangle +--->qdisc +--->qdisc +--->nat |
| | |imq0 | |imq0 | | |
+----------+ +-------+ +------+ +----------+
and iptables -t mangle -A POSTROUTING -o eth0 -j IMQ --todev 1
will result in?
figure 3
+-----------+ +-------+ +------+ +------+
|POSTROUTING| |ingress| |egress| |egress|
|nat +--->qdisc +--->qdisc +--->qdisc |
| | |imq1 | |imq1 | |eth0 |
+-----------+ +-------+ +------+ +------+