tc filters and libpcap

tc filters and libpcap

Post by Adam » Sat, 04 Jun 2011 01:05:10

I'm trying to use tc to shape traffic sent using libpcap (actually
tcpreplay, which is based on libpcap). I'm doing this for a research

i have a simple prio scheduler with a default band 2:

tc qdisc add dev eth0 root handle 1: prio priomap 2 2 2 2 2 2 2 2 2 2
2 2 2 2 2 2

with two filters attached to it:

tc filter add dev eth0 protocol ip parent 1: prio 1 u32 match ip dport
80 0xffff flowid 1:1
tc filter add dev eth0 protocol ip parent 1: prio 2 u32 match ip dport
443 0xffff flowid 1:2

(don't mind the port numbers, they're here just for the example)

When sending actual traffic, the filters work and I see the
appropriate traffic entering the right class. BUT when replaying
captured traffic (with the appropriate port numbers)  over eth0 using
tcpreplay, all packets end up in the default band 2 as if the filters
simply refuse to work.

Can anyone suggest a solution?



1. tc qdisc change and tc filter change

Has anyone managed to get tc qdisc change or tc filter change to actually change any parameters?

I try creating a qdisc for example using
tc qdisc add dev eth0 parent 10:100 sfq quantum 1514b perturb 15
Now what if I want to change the perturb to 10? I try:
tc qdisc change dev eth0 handle 8003: sfq quantum 1514b perturb 10.
I get RTNETLINK answers: Invalid argument  error
same with filter change.
Any help would be greatly appreciated!
Andrew King.

2. USR Sportster Voice 33+ --- compatible with vgetty?

3. Frozen machine with adding a tc filter

4. "pidof" on a process (which was ran by passing arguments from the command line)

5. tc filter problems

6. Linux Mail-Order on Disk/Tape

7. Should I install BSD packet filter to using the libpcap library?

8. Possible Routing Problem

9. Regarding tc filter application order

10. shaping, tc, filtering

11. tc filter & udp

12. tc filter change issue

13. DLPI interface, libpcap, packet filtering