From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-it0-x243.google.com (mail-it0-x243.google.com [IPv6:2607:f8b0:4001:c0b::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.bufferbloat.net (Postfix) with ESMTPS id 174563B260 for ; Thu, 10 Nov 2016 21:53:29 -0500 (EST) Received: by mail-it0-x243.google.com with SMTP id e187so7654138itc.0 for ; Thu, 10 Nov 2016 18:53:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=0NLfIhufDoV2bzmZsjVJeP7Tr+3lSkXiJ16KCo5+b34=; b=tRUWNNr03cJ+qsfOZ+zignTg4kgeUvUh5uyOEvlaP83wtq5PafV9cP4bbyytCwDOsO VSeheO0bOdw/YVtuRbnJL3lZh1H02+j/YxDKxrsBH4PyKduRnfjYX5qnzH3r+roO/uHg uijD31CETMURrhTh2+ADYYpKgYEeZaebxEqUxjXSS4PlqJAHbFvsoRKBrXWJpQN7qaev 33z7oFiQW0vPzAUcnuCXVPc4ws55MyPFa6oGCEE5py2asvDz4ByMfHNJ/QIwF4++/Pg/ Sm3cyuiL5RthTs7blEZq4WFqatJI1DNVVTGCFIqxF8QEUT/LJ7ddzZOZILApNXI6p/jA 7EUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=0NLfIhufDoV2bzmZsjVJeP7Tr+3lSkXiJ16KCo5+b34=; b=EeTbpoazkFsk8VCtHLSTOU8fBGAwH23ipiEgI5+lo399NBhAANiXRqaTj0EiVyHRxD fgVTxExDeI05sGdkA7ZsfoTFIYkmef6vtNYSr9jQzSnBLRDpr+Jvs56z2tjjizcbi3Eq 4im3sAatX269KyLXkCmrmagcqrUNDskNU0lkPaKNbe2v2YOzcm9KJqVx2L8HEh/QZxXY HpY4ALEE2Y8rDirxcRAvsk7vAbwfRvw0lYmdSXuagoa1L1hCD1ex5x5LwYZYWw9+kl+O O/3DSQpz6ghAxUL1qbVHxGwdBol3a9LFs5K885j492UKL6MNDX2qT8ioyrkLE4PkakhH 4f9Q== X-Gm-Message-State: ABUngvc3jPWc8LbhiyWWmLwszPyghl77R1xi268wzYDi6fbhvtVEfSjdWK+7iOsOjT22iSTmhGIytMsdBqQnMw== X-Received: by 10.107.1.138 with SMTP id 132mr9362339iob.72.1478832808333; Thu, 10 Nov 2016 18:53:28 -0800 (PST) MIME-Version: 1.0 Received: by 10.36.22.80 with HTTP; Thu, 10 Nov 2016 18:52:47 -0800 (PST) In-Reply-To: <46c0133b-b6f8-fe1f-4d2e-0cf6088e024d@gmail.com> References: <3e5942d2-6d6b-0e01-8aa6-98c3535c26ef@gmail.com> <46c0133b-b6f8-fe1f-4d2e-0cf6088e024d@gmail.com> From: Outback Dingo Date: Fri, 11 Nov 2016 10:52:47 +0800 Message-ID: To: Noah Causin Cc: cake@lists.bufferbloat.net Content-Type: text/plain; charset=UTF-8 Subject: Re: [Cake] Cake with Deep Packet Inspection X-BeenThere: cake@lists.bufferbloat.net X-Mailman-Version: 2.1.20 Precedence: list List-Id: Cake - FQ_codel the next generation List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Nov 2016 02:53:29 -0000 On Fri, Nov 11, 2016 at 10:42 AM, Noah Causin wrote: > I took an extra router I had and bridged two ports on the router's switch, > so they just pass traffic. (eth0.2 and eth0.3) > > Clients >-[Main Router] --[Extra Router]--[Cable-Modem] > > The extra router is passive. It acts like it's part of the Ethernet cable > between the main router and cable modem. It does not interfere. > > The extra router needs these packages: > > kmod-ebtables, kmod-ebtables-ipv4, kmod-crypto-pcompress and the two > packages compiled from the Makefile I showed below (iptables-mod-ndpi and > iptables-mod-ndpi) > > I edited /etc/sysctl.conf and change the last two lines to this: > > net.bridge.bridge-nf-call-ip6tables=1 > net.bridge.bridge-nf-call-iptables=1 > > This enables bridge firewalling, so the traffic between the two ports can be > marked. > > I then added firewall rules to LuCIs custom firewall rules tab. > > Example Rules, modify classes as desired: > > iptables -t mangle -A FORWARD -m ndpi --steam -m mac ! --mac-source Your > Main Router's Mac Address -j DSCP --set-dscp-class cs0 > iptables -t mangle -A FORWARD -m ndpi --youtube -m mac ! --mac-source Your > Main Router's Mac Address -j DSCP --set-dscp-class cs2 > > iptables -t mangle -A FORWARD -m ndpi --netflix -m mac ! --mac-source Your > Main Router's Mac Address -j DSCP --set-dscp-class cs3 > iptables -t mangle -A FORWARD -m ndpi --skype -m mac ! --mac-source Your > Main Router's Mac Address -j DSCP --set-dscp-class cs4 > > Have your main router use some form of DiffServ for both upload and download > on its WAN interface. For upload traffic, you just need the two packages > from the makefile to be installed on the main router and create firewall > rules like this: > > iptables -t mangle -A FORWARD -o eth2 -m ndpi --netflix -j DSCP > --set-dscp-class cs3 > iptables -t mangle -A FORWARD -o eth2 -m ndpi --skype -j DSCP > --set-dscp-class cs4 > > If you need help building a custom firmware image, just let me know. > Ok got it, its in-line.... right now im fighting the GFW of China using shadowsocks and chinadns so im pretty customized already, i was having issues with sqm and kernel segfaults on 4.4.30 ill build a cake and DPI image and see how that goes, maybe Ill try this after i deem sqm is stable with cake on this build. It a ZBT-WG3526 router... so its ralink based > > On 11/10/2016 9:06 PM, Outback Dingo wrote: > > On Fri, Nov 11, 2016 at 9:55 AM, Noah Causin wrote: > > I finally got my project working. > > I integrated the NDPI Deep Packet Inspection engine into my LEDE build, so I > could prioritize applications using Cake. > > http://www.ntop.org/products/deep-packet-inspection/ndpi/ > > NDPI integrates into IPTables, which allows me to DSCP mark packets. Cake > reads the DiffServ markings and puts the traffic into appropriate classes. > > I found a Makefile which successfully compiles: > https://github.com/981213/lede_src/blob/0d344bc2958838dcbc547a8f0a3d8842e6f6d2f8/package/my_package/ndpi-netfilter/Makefile > > The system works very well. Steam traffic is deprioritized to allow > applications like YouTube, Netflix, and Skype to receive higher amounts of > the available bandwidth. > > What I do for ingress is bridge two ports on an extra router, enable bridge > firewalling, and create IPTables rules to mark downstream packets. The > router I use is a D-Link DGL-5500, which is comparable to an Archer C7. > > IPv6 support is not available in this netfilter module, but the IPv4 support > is great. > > Noah Causin > > very nice.... however, can you describe a bit better how you > configured for ingress ? a second router? configuration file ? your > high level description seems a bit confusing to me > > > _______________________________________________ > Cake mailing list > Cake@lists.bufferbloat.net > https://lists.bufferbloat.net/listinfo/cake > >