RE: HTB bug?

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Anton,

Below is the output you asked for.  I've included the output for both the wired case and the wireless case to show the differences.  I've also included the output of ip6tables -L -v -n -t mangle to show the rule counters in both cases have incremented.

Thanks,
Russell

--------------------------------------------------------
-----  This was captured using the wired interface -----
-----  ping6 ff02::1%em1         # for unmarked packets
-----  ping6 ff02::1%em1 -Q 0xb8 # for EF marked packets
--------------------------------------------------------

[root@rstrong rstrong]# ip6tables-save -c
# Generated by ip6tables-save v1.4.19.1 on Tue Jan  6 11:06:10 2015
*mangle
:PREROUTING ACCEPT [18:4320]
:INPUT ACCEPT [18:4320]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [73:7584]
:POSTROUTING ACCEPT [73:7584]
[32:3328] -A POSTROUTING -o em1 -m dscp --dscp 0x2e -j CLASSIFY --set-class 0001:0011
COMMIT
# Completed on Tue Jan  6 11:06:10 2015
# Generated by ip6tables-save v1.4.19.1 on Tue Jan  6 11:06:10 2015
*raw
:PREROUTING ACCEPT [18:4320]
:OUTPUT ACCEPT [73:7584]
COMMIT
# Completed on Tue Jan  6 11:06:10 2015
# Generated by ip6tables-save v1.4.19.1 on Tue Jan  6 11:06:10 2015
*filter
:INPUT ACCEPT [18:4320]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [73:7584]
COMMIT
# Completed on Tue Jan  6 11:06:10 2015


[root@rstrong rstrong]# tc -s -d q ls dev em1
qdisc htb 1: root refcnt 2 r2q 10 default 12 direct_packets_stat 0 ver 3.17 direct_qlen 1000
 Sent 8606 bytes 73 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0 
qdisc pfifo 111: parent 1:11 limit 1000p
 Sent 3776 bytes 32 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0 
qdisc pfifo 112: parent 1:12 limit 1000p
 Sent 4830 bytes 41 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0

[root@rstrong rstrong]# ip6tables -L -v -n -t mangle
Chain PREROUTING (policy ACCEPT 77 packets, 18480 bytes)
 pkts bytes target     prot opt in     out     source               destination         

Chain INPUT (policy ACCEPT 77 packets, 18480 bytes)
 pkts bytes target     prot opt in     out     source               destination         

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         

Chain OUTPUT (policy ACCEPT 73 packets, 7584 bytes)
 pkts bytes target     prot opt in     out     source               destination         

Chain POSTROUTING (policy ACCEPT 73 packets, 7584 bytes)
 pkts bytes target     prot opt in     out     source               destination         
   32  3328 CLASSIFY   all      *      em1     ::/0                 ::/0                 DSCP match 0x2e CLASSIFY set 1:11

--------------------------------------------------------
-----  This was captured using the wifi interface  -----
-----  ping6 ff02::1%em1         # for unmarked packets
-----  ping6 ff02::1%em1 -Q 0xb8 # for EF marked packets
--------------------------------------------------------

[root@rstrong fabric]# ip6tables-save -c
# Generated by ip6tables-save v1.4.19.1 on Tue Jan  6 11:16:28 2015
*mangle
:PREROUTING ACCEPT [77:18480]
:INPUT ACCEPT [77:18480]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [49:5088]
:POSTROUTING ACCEPT [49:5088]
[23:2392] -A POSTROUTING -o wlp4s0 -m dscp --dscp 0x2e -j CLASSIFY --set-class 0001:0011
COMMIT
# Completed on Tue Jan  6 11:16:28 2015
# Generated by ip6tables-save v1.4.19.1 on Tue Jan  6 11:16:28 2015
*raw
:PREROUTING ACCEPT [175:42000]
:OUTPUT ACCEPT [122:12672]
COMMIT
# Completed on Tue Jan  6 11:16:28 2015
# Generated by ip6tables-save v1.4.19.1 on Tue Jan  6 11:16:28 2015
*filter
:INPUT ACCEPT [175:42000]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [122:12672]
COMMIT
# Completed on Tue Jan  6 11:16:28 2015


[root@rstrong fabric]# tc -s -d q ls dev wlp4s0
qdisc htb 1: root refcnt 5 r2q 10 default 12 direct_packets_stat 0 ver 3.17 direct_qlen 1000
 Sent 5774 bytes 49 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0 
qdisc pfifo 111: parent 1:11 limit 1000p
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0 
qdisc pfifo 112: parent 1:12 limit 1000p
 Sent 5774 bytes 49 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0 


[root@rstrong fabric]# ip6tables -L -v -n -t mangle
Chain PREROUTING (policy ACCEPT 127 packets, 30480 bytes)
 pkts bytes target     prot opt in     out     source               destination         

Chain INPUT (policy ACCEPT 127 packets, 30480 bytes)
 pkts bytes target     prot opt in     out     source               destination         

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         

Chain OUTPUT (policy ACCEPT 49 packets, 5088 bytes)
 pkts bytes target     prot opt in     out     source               destination         

Chain POSTROUTING (policy ACCEPT 49 packets, 5088 bytes)
 pkts bytes target     prot opt in     out     source               destination         
   23  2392 CLASSIFY   all      *      wlp4s0  ::/0                 ::/0                 DSCP match 0x2e CLASSIFY set 1:11


-----Original Message-----
From: lartc-owner@xxxxxxxxxxxxxxx [mailto:lartc-owner@xxxxxxxxxxxxxxx] On Behalf Of Anton Danilov
Sent: Tuesday, 6 January 2015 10:44 AM
To: I-Strong, Russell J
Cc: lartc@xxxxxxxxxxxxxxx
Subject: Re: HTB bug?

Hello, Russell.

Show, please, output of 'iptables-save -c', 'tc -s -d q ls dev wlp4s0'
and 'tc -s c ls dev wlp4s0'.

2015-01-06 3:34 GMT+03:00 I-Strong, Russell J <Russell.J.Strong@xxxxxxxxxx>:
> Hi,
>
> Thanks for the ideas.  I was pretty sure it was device independant which is why this confused me.   I’ve checked the counter on the iptables rule.  The rule is being hit in both cases.  I’ve used wireshark to capture the output.  It shows the packets are correctly marked in both cases.  However when I look at the counters in tc –s qdisc show dev $dev all the traffic in the wifi case is going to the default bucket, but in the wired case it goes to the correct bucket.  The comments in the script below show the commands I’ve used to test it. Is there anything else I could be missing?  A module not loaded perhaps?  Anyone care to try and reproduce it with the script below?
>
> Russell
>
>
> From: Anton Danilov [mailto:littlesmilingcloud@xxxxxxxxx]
> Sent: Monday, 5 January 2015 7:59 PM
> To: I-Strong, Russell J
> Cc: lartc@xxxxxxxxxxxxxxx
> Subject: Re: HTB bug?
>
> Hello, Russel.
> Traffic control classification is device-type independed. Don't matter what kind of interfaces do you use. So, you have issue somewhere else. Check the actual classify rules and queue discipline and classes of your setup. Also check the actual dscp-value of outgoing packets with tcpdump.
>
> 2015-01-05 6:44 GMT+03:00 I-Strong, Russell J <Russell.J.Strong@xxxxxxxxxx>:
> I've been experimenting with HTB and have found that it works on a wired Ethernet devices but does not work on wireless devices.
> Packets are being correctly classified by the mangle table but are 
> being placed in the default bucket when using wireless.  They Are placed in the correct bucket when using wired.
>
> The script below shows how to reproduce it.
>
> Any thoughts?  Is this a bug?
>
> Regards,
> Russell
>
>
> #!/bin/bash
>
> # Test command to send EF packets
> # ping6 ff02::1%em1 -Q 0xb8
>
> # Test command to send unmarked packets # ping6 ff02::1%em1
>
> # View packet placement with
> # watch tc -s qdisc show dev em1
>
> # Verify ip6tables matching with counters # watch ip6tables -L -v -n 
> -t mangle
>
> dev=em1
> # dev=wlp4s0
>
> tc qdisc add dev ${dev} root handle 1: htb default 12 tc class add dev 
> ${dev} parent 1:  classid 1:1  htb rate 100.0mbit ceil 100.0mbit tc 
> class add dev ${dev} parent 1:1 classid 1:11 htb rate 40.0mbit ceil 
> 100.0mbit prio 1 tc qdisc add dev ${dev} parent 1:11 handle 111: pfifo 
> limit 1000 tc class add dev ${dev} parent 1:1 classid 1:12 htb rate 
> 40.0mbit ceil 100.0mbit prio 2 tc qdisc add dev ${dev} parent 1:12 
> handle 112: pfifo limit 1000
>
> ip6tables -t mangle -A POSTROUTING -o ${dev} -m dscp --dscp-class ef 
> -j CLASSIFY --set-class 1:11
> --
> To unsubscribe from this list: send the line "unsubscribe lartc" in 
> the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info 
> at  http://vger.kernel.org/majordomo-info.html
>
>
>
> --
> Anton.



--
Anton.
--
To unsubscribe from this list: send the line "unsubscribe lartc" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at  http://vger.kernel.org/majordomo-info.html
��.n��������+%������w��{.n����j�\�)��jg��������ݢj����G�������j:+v���w�m������w�������h�����٥




[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux