From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi0-x232.google.com (mail-oi0-x232.google.com [IPv6:2607:f8b0:4003:c06::232]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by huchra.bufferbloat.net (Postfix) with ESMTPS id 7B28521F2EE for ; Mon, 13 Apr 2015 07:16:43 -0700 (PDT) Received: by oica37 with SMTP id a37so4988149oic.0 for ; Mon, 13 Apr 2015 07:16:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=0mwAkynbVg3Gw/vlQxHoPz/Lbeoqcg7dpHLxK7/msAc=; b=eHQw794HFNhnG/w4wvfyg92saXGc7hdNS5MIxKuMTbU/hiym6IawEL/3Esjrp+U7jI MgMWzIfQIw7mIjU7JRH/M975SeMy91XkAPX22M9xOFtXMRSsgqzMYJ5Irix+MOAm1sID 7Ke/kYUeyaZSQEusJ7+Ot3lO1eyPh0CYJ7nsa7C4Q1uBJjTqKg4NoaXd2UBNo+kF4CFH JR4RfAnunmyfdD6nSKrDe3ulew4s6mVcVtUJaDpRnhRFkz51+eMNIkxU2W1AYSOtsaCd sxoQr3DvtnNnYbma+cU9eD5aeiQOo+hjDKzXLKVAGMdbMGVby6lesmm8YiMgcOrWfvo1 iJ+g== X-Received: by 10.60.40.195 with SMTP id z3mr3203579oek.85.1428934601830; Mon, 13 Apr 2015 07:16:41 -0700 (PDT) MIME-Version: 1.0 Sender: white.phoenix@gmail.com Received: by 10.202.188.8 with HTTP; Mon, 13 Apr 2015 07:16:10 -0700 (PDT) In-Reply-To: References: From: leetminiwheat Date: Mon, 13 Apr 2015 10:16:10 -0400 X-Google-Sender-Auth: Uj6cPBgLp9MaUkmujP4kH5wJJgM Message-ID: To: Sebastian Moeller , cerowrt-devel Content-Type: multipart/alternative; boundary=089e0153855e597a1505139bc385 Subject: Re: [Cerowrt-devel] squash/ignore DSCP and mangle table questions X-BeenThere: cerowrt-devel@lists.bufferbloat.net X-Mailman-Version: 2.1.13 Precedence: list List-Id: Development issues regarding the cerowrt test router project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Apr 2015 14:17:17 -0000 --089e0153855e597a1505139bc385 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Upon further inspection, the SQM log says: SQM: Keeping differentiated services code points (DSCP) from ingress. SQM: Perform DSCP based filtering on ingress. (3-tier classification), so perhaps the shaper can use this information? but only on ingress? I'm using the latest SQM scripts from git. Could this also be why my interfaces are remaining at 1000 txqueuelen due to new scripts? (I'm on 3.10.50-1) Still confused about what the xset stuff is doing though. On Mon, Apr 13, 2015 at 9:43 AM, leetminiwheat wrote: > > > > On Mon, Apr 13, 2015 at 7:32 AM, Sebastian Moeller wrote: > > > > > "Squash DSCP on inbound packets (ingress):=E2=80=9D this wi= ll replace all DSCP marks with 0x0 (I believe), but only after the ingress qdisc. > > > > In essence this means you can actually interpret ingress DSCP marks from upstream ("Ignore DSCP on ingress=E2=80=9D set to ALLOW) but wipe them= after the ingress shaping (with "Squash DSCP on inbound packets (ingress);=E2=80= =9D active). So the default should be =E2=80=9CIgnore DSCP on ingress=E2=80=9D = and Squash (the second can be argued, as long as no one bases routing decisions on the marks they do not hurt). The rest of your questions are beyond my expertise... > > > > > > Hmm, why would we want to remove all DSCP on output then? > > > > Because often we do not want to trust the internet to do the right thing and not game our classification? At least this is a common argument made... > > > > > I assume many ISPs and routers will squash them anyways, > > > > ISPs are free to set the DSCP values to whatever suits them, and sometimes they do weird things, in essence per default we should not trust them... > > > > > but wouldn't it serve *some* purpose to differentiate between different traffic types? > > > > Sure, if you know what you do setting reasonable DSCP values for VoIP sounds like a good thing (but due to fq_codel=E2=80=99s inner work= ing might not be required). Alas iptables is only available to us after the packets went through the IFB, so any resetting of DSCP values would be for internal network nodes, our shaper unfortunately can not use this information=E2=80=A6 > > Curious, if fq_codel runs after iptables and can't use DSCP information, why does it mark packets in the mangle chain? I'm still trying to wrap my head around the --set-xmark > > relevant snippet here with squash disabled and ignore ingress set to allow. Can anyone answer why it's matching DSCP marks and what is it doing with xset? I assumed it was marking packets for use in QOS, such as the chain suggests "Chain QOS_MARK_ge00" but this is a jump target from both PREROUTING and POSTROUTING so it should hit FORWARD too, > > ###########################################################################= ########################## > #iptables -nL -t mangle > Chain PREROUTING (policy ACCEPT) > target prot opt source destination > MARK tcp -- 0.0.0.0/0 0.0.0.0/0 MARK xset 0x2/0xff > fwmark all -- 0.0.0.0/0 0.0.0.0/0 > QOS_MARK_ge00 all -- 0.0.0.0/0 0.0.0.0/0 [goto] mark match 0x0/0xff > > Chain INPUT (policy ACCEPT) > target prot opt source destination > > Chain FORWARD (policy ACCEPT) > target prot opt source destination > mssfix all -- 0.0.0.0/0 0.0.0.0/0 > > Chain OUTPUT (policy ACCEPT) > target prot opt source destination > DSCP udp -- 0.0.0.0/0 0.0.0.0/0 multiport ports 123,53 DSCP set 0x24 > > Chain POSTROUTING (policy ACCEPT) > target prot opt source destination > QOS_MARK_ge00 all -- 0.0.0.0/0 0.0.0.0/0 [goto] mark match 0x0/0xff > > Chain QOS_MARK_ge00 (2 references) > target prot opt source destination > MARK all -- 0.0.0.0/0 0.0.0.0/0 MARK xset 0x2/0xff > MARK all -- 0.0.0.0/0 0.0.0.0/0 DSCP match 0x08 MARK xset 0x3/0xff > MARK all -- 0.0.0.0/0 0.0.0.0/0 DSCP match 0x30 MARK xset 0x1/0xff > MARK all -- 0.0.0.0/0 0.0.0.0/0 DSCP match 0x2e MARK xset 0x1/0xff > MARK all -- 0.0.0.0/0 0.0.0.0/0 DSCP match 0x24 MARK xset 0x1/0xff > MARK all -- 0.0.0.0/0 0.0.0.0/0 tos match0x10/0x3f MARK xset 0x1/0xff > > Chain fwmark (1 references) > target prot opt source destination > > Chain mssfix (1 references) > target prot opt source destination > TCPMSS tcp -- 0.0.0.0/0 0.0.0.0/0 tcp flags:0x06/0x02 /* wan (mtu_fix) */ TCPMSS clamp to PMTU > ###########################################################################= ########################## > #iptables -S -t mangle > -P PREROUTING ACCEPT > -P INPUT ACCEPT > -P FORWARD ACCEPT > -P OUTPUT ACCEPT > -P POSTROUTING ACCEPT > -N fwmark > -N mssfix > -A PREROUTING -i vtun+ -p tcp -j MARK --set-xmark 0x2/0xff > -A PREROUTING -j fwmark > -A PREROUTING -i ge00 -m mark --mark 0x0/0xff -g QOS_MARK_ge00 > -A FORWARD -j mssfix > -A OUTPUT -p udp -m multiport --ports 123,53 -j DSCP --set-dscp 0x24 > -A POSTROUTING -o ge00 -m mark --mark 0x0/0xff -g QOS_MARK_ge00 > -A QOS_MARK_ge00 -j MARK --set-xmark 0x2/0xff > -A QOS_MARK_ge00 -m dscp --dscp 0x08 -j MARK --set-xmark 0x3/0xff > -A QOS_MARK_ge00 -m dscp --dscp 0x30 -j MARK --set-xmark 0x1/0xff > -A QOS_MARK_ge00 -m dscp --dscp 0x2e -j MARK --set-xmark 0x1/0xff > -A QOS_MARK_ge00 -m dscp --dscp 0x24 -j MARK --set-xmark 0x1/0xff > -A QOS_MARK_ge00 -m tos --tos 0x10/0x3f -j MARK --set-xmark 0x1/0xff > -A mssfix -o ge00 -p tcp -m tcp --tcp-flags SYN,RST SYN -m comment --comment "wan (mtu_fix)" -j TCPMSS --clamp-mss-to-pmtu > ###########################################################################= ########################## > > I've inserted my custom --set-dscp user created chains into PREROUTING and POSTROUTING, which I excluded from the above but I still don't understand what exactly these marks are doing, even after reading the documentation. It seems like it's still replacing DSCP from what I can tell= . > > ------ > Also, another unrelated question regarding queue buffers; > > All my ifconfig interfaces show txqueuelen:1000 except for ifb4ge00 and ifb4gw00, both of which I have SQM rate limiting on. wasn't this supposed to be tweaked by debloat scripts? /etc/config/debloat says obsoleted by /etc/hotplug.d/iface/02-debloat but that file is empty. > > uci seems to show the txqueuelen options disabled. Did something change, are these not needed anymore, or did I screw up a config somewhere? > # uci show | grep debloat > debloat.@wireless[0]=3Dwireless > debloat.@wireless[0].txqueuelen=3D4 > debloat.@wirelessn[0]=3Dwirelessn > debloat.@wirelessn[0].txqueuelen=3D16 > debloat.@wired10[0]=3Dwired10 > debloat.@wired10[0].txqueuelen=3D4 > debloat.@wired100[0]=3Dwired100 > debloat.@wired100[0].txqueuelen=3D16 > debloat.@wired1000[0]=3Dwired1000 > debloat.@wired1000[0].txqueuelen=3D32 > uci: Entry not found > > > Thanks for your time, and my apologies if these questions seem dumb or regarded as unnecessary mailing list spam - I'm still learning and tweaking things. I do my best to search the wikis and google before asking here. > > > > > > --089e0153855e597a1505139bc385 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Upon further inspection, the SQM log says:=C2=A0

<= /div>
SQM: Keeping differentiated services code points (DSCP) from ingr= ess.
SQM: Perform DSCP based filtering on ingress. (3-tier classifi= cation),=C2=A0

so perhaps the shaper can use this = information? but only on ingress?

I'm using th= e latest SQM scripts from git. Could this also be why my interfaces are rem= aining at 1000 txqueuelen due to new scripts? (I'm on 3.10.50-1)
<= div>
Still confused about what the xset stuff is doing though= .

On Mon, Apr 13, 2015 at 9:43 AM, leetminiwheat <LeetMiniWheat@gmail.com> wrote:
><= br>>
>
> On Mon, Apr 13, 2015 at 7:32 AM, Sebastian Moeller = <moeller0@gmx.de> wrote:
&g= t;
> > > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 "Squash DSCP on = inbound packets (ingress):=E2=80=9D this will replace all DSCP marks with 0= x0 (I believe), but only after the ingress qdisc.
> > > > In= essence this means you can actually interpret ingress DSCP marks from upst= ream ("Ignore DSCP on ingress=E2=80=9D set to ALLOW) but wipe them aft= er the ingress shaping (with "Squash DSCP on inbound packets (ingress)= ;=E2=80=9D active). So the default should be =E2=80=9CIgnore DSCP on ingres= s=E2=80=9D and Squash (the second can be argued, as long as no one bases ro= uting decisions on the marks they do not hurt). The rest of your questions = are beyond my expertise...
> > >
> > > Hmm, why wou= ld we want to remove all DSCP on output then?
> >
> > =C2= =A0 =C2=A0 =C2=A0 =C2=A0 Because often we do not want to trust the internet= to do the right thing and not game our classification? At least this is a = common argument made...
> >
> > > I assume many ISPs a= nd routers will squash them anyways,
> >
> > =C2=A0 =C2= =A0 =C2=A0 =C2=A0 ISPs are free to set the DSCP values to whatever suits th= em, and sometimes they do weird things, in essence per default we should no= t trust them...
> >
> > > but wouldn't it serve *s= ome* purpose to differentiate between different traffic types?
> >=
> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 Sure, if you know what you do set= ting reasonable DSCP values for VoIP sounds like a good thing (but due to f= q_codel=E2=80=99s inner working might not be required). Alas iptables is on= ly available to us after the packets went through the IFB, so any resetting= of DSCP values would be for internal network nodes, our shaper unfortunate= ly can not use this information=E2=80=A6
>
> Curious, if fq_cod= el runs after iptables and can't use DSCP information, why does it mark= packets in the mangle chain? I'm still trying to wrap my head around t= he --set-xmark
>
> relevant snippet here with squash disabled a= nd ignore ingress set to allow. Can anyone answer why it's matching DSC= P marks and what is it doing with xset? I assumed it was marking packets fo= r use in QOS, such as the chain suggests "Chain QOS_MARK_ge00" bu= t this is a jump target from both PREROUTING and POSTROUTING so it should h= it FORWARD too,
>
> ###########################################= ##########################################################
> #iptable= s -nL -t mangle
> Chain PREROUTING (policy ACCEPT)
> target =C2= =A0 =C2=A0 prot opt source =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= destination
> MARK =C2=A0 =C2=A0 =C2=A0 tcp =C2=A0-- =C2=A00.0.0.0/0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A00.0.0.0/0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0MARK xset 0x2/0xff
> fwmark =C2=A0 =C2=A0 all =C2=A0-- = =C2=A00.0.0.0/0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A00.0.0.0/0
> QOS_MAR= K_ge00 =C2=A0all =C2=A0-- =C2=A00.0.0.0/0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A00.0.0= .0/0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 [goto] =C2=A0mark match 0x0/0xf= f
>
> Chain INPUT (policy ACCEPT)
> target =C2=A0 =C2=A0 = prot opt source =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 destinatio= n
>
> Chain FORWARD (policy ACCEPT)
> target =C2=A0 =C2= =A0 prot opt source =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 destin= ation
> mssfix =C2=A0 =C2=A0 all =C2=A0-- =C2=A00.0.0.0/0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A00.0.0.0/0
>
> Chain OUTPUT (policy ACCEPT)=
> target =C2=A0 =C2=A0 prot opt source =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 destination
> DSCP =C2=A0 =C2=A0 =C2=A0 udp =C2= =A0-- =C2=A00.0.0.0/0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A00.0.0.0/0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0multiport ports 123,53 DSCP set 0x24
>=
> Chain POSTROUTING (policy ACCEPT)
> target =C2=A0 =C2=A0 pro= t opt source =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 destination> QOS_MARK_ge00 =C2=A0all =C2=A0-- =C2=A0= 0.0.0.0/0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A00.0.0.0/0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 [goto] =C2=A0mark= match 0x0/0xff
>
> Chain QOS_MARK_ge00 (2 references)
> = target =C2=A0 =C2=A0 prot opt source =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 destination
> MARK =C2=A0 =C2=A0 =C2=A0 all =C2=A0-- =C2= =A00.0.0.0/0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A00.0.0.0/0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0MARK xset 0x2/0xff
> MARK =C2=A0 =C2=A0 =C2= =A0 all =C2=A0-- =C2=A00.0.0.0/0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A00.0.0.0/0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0DSCP match 0x08 MARK xset 0x3/0x= ff
> MARK =C2=A0 =C2=A0 =C2=A0 all =C2=A0-- =C2=A0
0.0.0.0/0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A00.0.0.0/0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0D= SCP match 0x30 MARK xset 0x1/0xff
> MARK =C2=A0 =C2=A0 =C2=A0 all =C2= =A0-- =C2=A00.0.0.0/0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A00.0.0.0/0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0DSCP match 0x2e MARK xset 0x1/0xff
> M= ARK =C2=A0 =C2=A0 =C2=A0 all =C2=A0-- =C2=A00.= 0.0.0/0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A00.0.0.0/0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0DSCP match 0x= 24 MARK xset 0x1/0xff
> MARK =C2=A0 =C2=A0 =C2=A0 all =C2=A0-- =C2=A0= 0.0.0.0/0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A00.0.0.0/0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0tos match0x10/0x3f MARK xset 0x1/0xff
>
> C= hain fwmark (1 references)
> target =C2=A0 =C2=A0 prot opt source =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 destination
>
> C= hain mssfix (1 references)
> target =C2=A0 =C2=A0 prot opt source =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 destination
> TCPMSS = =C2=A0 =C2=A0 tcp =C2=A0-- =C2=A00.0.0.0/0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A00.0.= 0.0/0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0tcp flags:0x06/0x02 /* w= an (mtu_fix) */ TCPMSS clamp to PMTU
> ##############################= #######################################################################
= > #iptables -S -t mangle
> -P PREROUTING ACCEPT
> -P INPUT A= CCEPT
> -P FORWARD ACCEPT
> -P OUTPUT ACCEPT
> -P POSTROU= TING ACCEPT
> -N fwmark
> -N mssfix
> -A PREROUTING -i vt= un+ -p tcp -j MARK --set-xmark 0x2/0xff
> -A PREROUTING -j fwmark
= > -A PREROUTING -i ge00 -m mark --mark 0x0/0xff -g QOS_MARK_ge00
>= -A FORWARD -j mssfix
> -A OUTPUT -p udp -m multiport --ports 123,53 = -j DSCP --set-dscp 0x24
> -A POSTROUTING -o ge00 -m mark --mark 0x0/0= xff -g QOS_MARK_ge00
> -A QOS_MARK_ge00 -j MARK --set-xmark 0x2/0xff<= br>> -A QOS_MARK_ge00 -m dscp --dscp 0x08 -j MARK --set-xmark 0x3/0xff> -A QOS_MARK_ge00 -m dscp --dscp 0x30 -j MARK --set-xmark 0x1/0xff> -A QOS_MARK_ge00 -m dscp --dscp 0x2e -j MARK --set-xmark 0x1/0xff
= > -A QOS_MARK_ge00 -m dscp --dscp 0x24 -j MARK --set-xmark 0x1/0xff
&= gt; -A QOS_MARK_ge00 -m tos --tos 0x10/0x3f -j MARK --set-xmark 0x1/0xff> -A mssfix -o ge00 -p tcp -m tcp --tcp-flags SYN,RST SYN -m comment --= comment "wan (mtu_fix)" -j TCPMSS --clamp-mss-to-pmtu
> ###= ###########################################################################= #######################
>
> I've inserted my custom --set-d= scp user created chains into PREROUTING and POSTROUTING, which I excluded f= rom the above but I still don't understand what exactly these marks are= doing, even after reading the documentation. It seems like it's still = replacing DSCP from what I can tell.
>
> ------
> Also, a= nother unrelated question regarding queue buffers;
>
> All my i= fconfig interfaces show txqueuelen:1000 except for ifb4ge00 and ifb4gw00, b= oth of which I have SQM rate limiting on. wasn't this supposed to be tw= eaked by debloat scripts? /etc/config/debloat says obsoleted by /etc/hotplu= g.d/iface/02-debloat but that file is empty.
>
> uci seems to = show the txqueuelen options disabled. Did something change, are these not n= eeded anymore, or did I screw up a config somewhere?
> =C2=A0# uci sh= ow | grep debloat
> debloat.@wireless[0]=3Dwireless
> debloat.@= wireless[0].txqueuelen=3D4
> debloat.@wirelessn[0]=3Dwirelessn
>= ; debloat.@wirelessn[0].txqueuelen=3D16
> debloat.@wired10[0]=3Dwired= 10
> debloat.@wired10[0].txqueuelen=3D4
> debloat.@wired100[0]= =3Dwired100
> debloat.@wired100[0].txqueuelen=3D16
> debloat.@w= ired1000[0]=3Dwired1000
> debloat.@wired1000[0].txqueuelen=3D32
&g= t; uci: Entry not found
>
>
> Thanks for your time, and m= y apologies if these questions seem dumb or regarded as unnecessary mailing= list spam - I'm still learning and tweaking things. I do my best to se= arch the wikis and google before asking here.
>
>
>
&g= t;
>
>
--089e0153855e597a1505139bc385--