Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- # Example script with more complex fq_codel hash configuration
- # You can load up the network and see the behavior of the active classes
- # via tc -s qdisc show dev eth2 in this case
- tc qdisc del dev eth2 root
- # Use small number of flows. Suitable for less than 2Mbits...
- # A smaller quantum prioritizes smaller packets over bigger ones, also useful at low bandwidths
- tc qdisc add dev eth2 handle a root fq_codel flows 16 quantum 300
- # catch-all filter for protocol types that don't match. We just do this so packets
- # aren't dropped on the floor while we add more filters
- tc filter add dev eth2 parent a: protocol all prio 999 u32 match ip protocol 0 0x00 flowid a:f
- # match multicast packets and give them their own bin.
- # There is no need to segregate ipv6 and ipv4 traffic here, this is just an example
- tc filter add dev eth2 parent a: protocol ip prio 5 u32 match u8 0x01 0x01 at -14 flowid a:9
- tc filter add dev eth2 parent a: protocol ipv6 prio 6 u32 match u8 0x01 0x01 at -14 flowid a:9
- # What the heck, toss arp into its own bin
- tc filter add dev eth2 parent a: protocol arp prio 7 u32 match u8 0x01 0x01 at -14 flowid a:a
- # Give EF traffic its own bin. Ideally this would be *bins*. Using map, rather than hash?
- # Secondly, this doesn't work for some reason. Neither does ff or 3f as a mask
- # tested with netperf -Y EF,EF fd01::1 and on ipv4 and with numeric constants too.
- # e2? WTF?
- tc filter add dev eth2 parent a: protocol ip prio 8 u32 match ip tos 0x2e fc flowid a:b
- tc filter add dev eth2 parent a: protocol ipv6 prio 9 u32 match ip6 priority 0x2e fc flowid a:b
- # Stick traffic marked interactive into the EF bin too. Would be better to give them their
- # own bins....
- tc filter add dev eth2 parent a: protocol ip prio 10 u32 match ip tos 0x08 0xfc flowid a:b
- tc filter add dev eth2 parent a: protocol ipv6 prio 11 u32 match ip6 priority 0x08 0xfc flowid a:b
- # Toss CS1 background into its own bin, too. Segregate ipv6 for sake of example
- # This DOES work, unlike EF (netperf -Y CS1,CS1 fd01::1)
- # But should be bins in a larger configuration
- tc filter add dev eth2 parent a: protocol ip prio 12 u32 match ip tos 0x20 0xfc flowid a:c
- tc filter add dev eth2 parent a: protocol ipv6 prio 13 u32 match ip6 priority 0x20 0xfc flowid a:d
- # Not entirely clear to me if using the pre-natted ip stuff works always
- tc filter add dev eth2 parent a: handle 3 protocol ipv6 prio 94 flow hash keys proto-dst,rxhash divisor 8
- tc filter add dev eth2 parent a: handle 4 protocol all prio 97 flow hash keys proto-dst,nfct-src divisor 8
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement