From: =?iso-8859-1?Q?Christian_R=F6=DFner?= Date: Thu, 10 Apr 2014 11:01:53 +0000 Subject: Re: tc nexthdr Message-Id: <08502D9B-24F9-4C1E-9609-3DA7397B8063@sys4.de> MIME-Version: 1 Content-Type: multipart/mixed; boundary="Apple-Mail=_3A6F73C4-C346-4B9E-912E-116CFA89DD63" List-Id: References: <8B7BC216-6397-41E8-B39C-66178AD6C805@sys4.de> In-Reply-To: <8B7BC216-6397-41E8-B39C-66178AD6C805@sys4.de> To: lartc@vger.kernel.org --Apple-Mail=_3A6F73C4-C346-4B9E-912E-116CFA89DD63 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 Hi Remy, > Although the u32 filter is quite powerful it has a few limitations. I = would not recommend matching VOIP which can use RTP, SIP, H323 etc.=20 > The issue you might be facing, in attempting to identify RTP, might be = due to the first 2 payload bytes of an RTP packet typically begin with = 0x8$$$ or 0x9$$$ ( where $ can be any hex value). This can erroneously = also match DNS or other UDP traffic. It can be done if you also specify = the packet length inorder to exclude DNS but I would recommend going = with a packet inspection library like nDPI (kernel module + iptables + = tc filter fw). thanks for your answer. I had thought about the false-positive rate and = watched the u32 rule for round about 48h. 90% is matched correctly, = which is quite acceptable for us, but=85 Earlier I had used OpenDPI and I was happy with it. But because it was = closed, I looked for another solution. I contacted hour well known SIP = providers and let me give the IP networks they use for telephony. This = works, but I always prefer a generic independent solution and therefor = thought about a way of detecting SIP/RTP. I first used the -m string match combined with packet length, UDP =97sport= 5000: and =97dport 5000:, but I think string-match is expensive. So I = deployed the u32 version. I know that nDPI is a fork of he latest OpenDPI, but still I could not = find a kernel module built with nDPI. Do you have a source for this? If nDP would be useable, I would detect packets and mark them and = afterwards using CONNMARK for the whole connection. That would be = probably the best solution. So if you have further details on that, I = really would appreciate it :) Currently the u32 is nice. I asked our SIP providers today, if they can = tell me, what codecs they use. It are: G.729 - ~ 12 kbit/s G.711 - ~ 100 kbit/s GSM - ~ 13 - 20 kbit/s G.726 - ~ 16 - 40 kbit/s and they use SIP and have no plans to switch to H.323 or IAX. So I could reduce u32 filters to these. But what would be the =84right=93 = nexthdr+X setting behind the u16 selector? Thanks in advance =20 -Christian R=F6=DFner -- [*] sys4 AG http://sys4.de, +49 (89) 30 90 46 64 Franziskanerstra=DFe 15, 81669 M=FCnchen Sitz der Gesellschaft: M=FCnchen, Amtsgericht M=FCnchen: HRB 199263 Vorstand: Patrick Ben Koetter, Marc Schiffbauer Aufsichtsratsvorsitzender: Florian Kirstein --Apple-Mail=_3A6F73C4-C346-4B9E-912E-116CFA89DD63 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - http://gpgtools.org iQEcBAEBAgAGBQJTRnohAAoJEDulekoEoTV32sQH/2mudImQmZyupfyXtiK3LotN M2ok5WvtjPdjQi5Decl5y8OolXMWhGsrmitCQTpPrhnHbdddvtxTv0TdbUX9uM8B Vi9jOSxuZIgeIUYxq5x6YrYb5OU2ubxCXc3M2LN1b8BborOa6bj+cl5UPxSQQmc7 xuMNbUyVNsTSlMB5vNJi0K1BywmoXkG8s5cIHI86DP7xQQXXTptvIDEOXueEI/sb 2CNLIvYi5Llpo7ipBJcRm/7IX4VT5x6P7xWh4OGAuKj1HwNxRDGRWBIQFnL/LhFi jEvutwSMK7144Ia6FttvtsYj8sOcN2if4Mfe6ptER4YKVEtYE+iLcvhVGK++S4k= =yK+m -----END PGP SIGNATURE----- --Apple-Mail=_3A6F73C4-C346-4B9E-912E-116CFA89DD63--