From 1b02f3d5baabff25d5758d22898ee905a9a7cca0 Mon Sep 17 00:00:00 2001 From: teastep Date: Sat, 22 Mar 2008 15:20:58 +0000 Subject: [PATCH] Add info about the output of 'shorewall show tc' git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@8334 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- docs/traffic_shaping.xml | 94 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 90 insertions(+), 4 deletions(-) diff --git a/docs/traffic_shaping.xml b/docs/traffic_shaping.xml index 59c81bc8c..20ce4dfe5 100644 --- a/docs/traffic_shaping.xml +++ b/docs/traffic_shaping.xml @@ -1171,10 +1171,6 @@ ip link set ifb0 up tcrules file, the last match determines the classification. - - IP ranges are not supported - - ipsets are not supported @@ -1441,6 +1437,96 @@ filter parent 1: protocol ip pref 10 u32 fh 800: +
+ Understanding the output of 'shorewall show tc' + + The shorewall show tc (shorewall-lite + show tc) command displays information about the current state of + traffic shaping. For each device, it executes the following + commands: + + echo Device $device: + tc -s -d qdisc show dev $device + echo + tc -s -d class show dev $device + echo + + So, the traffic-shaping output is generated entirely by the + tc utility. + + Here's the output of for eth0. The configuration is the one shown in + the preceding section (the output was obtained almost 24 hours later than + the shorewall show filters output shown above). + + Device eth0: + + ============== The primary queuing discipline is HTB (Hierarchical Token Bucket) ==================== + +qdisc htb 1: r2q 10 default 120 direct_packets_stat 9 ver 3.17 + Sent 2133336743 bytes 4484781 pkt (dropped 198, overlimits 4911403 requeues 21) <=========== Note the overlimits and dropped counts + rate 0bit 0pps backlog 0b 8p requeues 21 + +============== The ingress filter. If you specify IN-BANDWIDTH, you can see the 'dropped' count here. ========= + + In this case, the packets are being sent to the IFB for shaping + +qdisc ingress ffff: ---------------- + Sent 4069015112 bytes 4997252 pkt (dropped 0, overlimits 0 requeues 0) + rate 0bit 0pps backlog 0b 0p requeues 0 + + ============ Each of the leaf HTB classes has an SFQ qdisc to ensure that each flow gets its turn ============ + +qdisc sfq 110: parent 1:110 limit 128p quantum 1514b flows 128/1024 perturb 10sec + Sent 613372519 bytes 2870225 pkt (dropped 0, overlimits 0 requeues 6) + rate 0bit 0pps backlog 0b 0p requeues 6 +qdisc sfq 120: parent 1:120 limit 128p quantum 1514b flows 128/1024 perturb 10sec + Sent 18434920 bytes 60961 pkt (dropped 0, overlimits 0 requeues 0) + rate 0bit 0pps backlog 0b 0p requeues 0 +qdisc sfq 130: parent 1:130 limit 128p quantum 1514b flows 128/1024 perturb 10sec + Sent 1501528722 bytes 1553586 pkt (dropped 198, overlimits 0 requeues 15) + rate 0bit 0pps backlog 11706b 8p requeues 15 + + ============= Class 1:110 -- the high-priority class =========== + + + Note the rate and ceiling calculated from 'full' + +class htb 1:110 parent 1:1 leaf 110: prio 1 quantum 4800 rate 192000bit ceil 384000bit burst 1695b/8 mpu 0b overhead 0b cburst 1791b/8 mpu 0b overhead 0b level 0 + Sent 613372519 bytes 2870225 pkt (dropped 0, overlimits 0 requeues 0) + rate 195672bit 28pps backlog 0b 0p requeues 0 <=========== Note the current rate of traffic. There is no queuing (no packet backlog) + lended: 2758458 borrowed: 111773 giants: + tokens: 46263 ctokens: 35157 + + ============== The root class ============ + +class htb 1:1 root rate 384000bit ceil 384000bit burst 1791b/8 mpu 0b overhead 0b cburst 1791b/8 mpu 0b overhead 0b level 7 + Sent 2133276316 bytes 4484785 pkt (dropped 0, overlimits 0 requeues 0) + rate 363240bit 45pps backlog 0b 0p requeues 0 + lended: 1081936 borrowed: 0 giants: 0 + tokens: -52226 ctokens: -52226 + + ============= Bulk Class (outgoing rsync, email and bittorrent) ============ + +class htb 1:130 parent 1:1 leaf 130: prio 3 quantum 1900 rate 76000bit ceil 230000bit burst 1637b/8 mpu 0b overhead 0b cburst 1714b/8 mpu 0b overhead 0b level 0 + Sent 1501528722 bytes 1553586 pkt (dropped 198, overlimits 0 requeues 0) + rate 162528bit 14pps backlog 0b 8p requeues 0 <======== Queuing is occurring (8 packet backlog). The rate is still below the ceiling. + lended: 587134 borrowed: 966459 giants: 0 During peak activity, the rate tops out at around 231000 (just above ceiling). + tokens: -30919 ctokens: -97657 + + ================= Default class (mostly serving web pages) =============== + +class htb 1:120 parent 1:1 leaf 120: prio 2 quantum 1900 rate 76000bit ceil 230000bit burst 1637b/8 mpu 0b overhead 0b cburst 1714b/8 mpu 0b overhead 0b level 0 + Sent 18434920 bytes 60961 pkt (dropped 0, overlimits 0 requeues 0) + rate 2240bit 2pps backlog 0b 0p requeues 0 + lended: 57257 borrowed: 3704 giants: 0 + tokens: 156045 ctokens: 54178 + + +
+
Using your own tc script