netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: jamal <hadi@cyberus.ca>
To: Adam Katz <adamkatz0@gmail.com>
Cc: netdev@vger.kernel.org
Subject: Re: libpcap and tc filters
Date: Mon, 04 Jul 2011 09:05:40 -0400	[thread overview]
Message-ID: <1309784740.26180.21.camel@mojatatu> (raw)
In-Reply-To: <CAA0qwj7cH8Ah69fBMkXpGkwG77TH_ZqMhKwj-Cc8Vc=F5c9SSw@mail.gmail.com>

On Mon, 2011-07-04 at 15:37 +0300, Adam Katz wrote:
> here's a more concrete example:
> 
> An example configuration:
> 
> 	sudo tc qdisc add dev eth1 root handle 1: prio priomap 2 2 2 2 2 2 2
> 2 2 2 2 2 2 2 2 2
> 	sudo tc qdisc add dev eth1 parent 1:1 handle 10: pfifo 	
> 	sudo tc qdisc add dev eth1 parent 1:2 handle 20: pfifo
> 	sudo tc qdisc add dev eth1 parent 1:3 handle 30: pfifo
> 	sudo tc filter add dev eth1 protocol ip parent 1: prio 1 u32 match ip
> dport 22 0xffff flowid 1:1
> 	sudo tc filter add dev eth1 protocol ip parent 1: prio 1 u32 match ip
> sport 22 0xffff flowid 1:1
> 	sudo tc filter add dev eth1 protocol ip parent 1: prio 2 u32 match ip
> dport 80 0xffff flowid 1:2
> 	sudo tc filter add dev eth1 protocol ip parent 1: prio 2 u32 match ip
> sport 80 0xffff flowid 1:2


looks fine.

> I then used scp to copy a small file between computers while capturing
> with wireshark:
> 
> http://dl.dropbox.com/u/3237005/port22example.pcap
> 
> and later I replayed the same capture using tcpreplay.
> When using scp, the packets once again ended up where they should be
> (1:1 in this configuration). With tcpreplay they ended up in the
> default 1:3

Where is the capture from tcpreplay? What i was asking is you validate
that the capture before and what is sent out by tcprelay look the same.
Can you please do that?
It is possible because your filters are not matched they end up on your
default queue based on tos value.

If you have your kernel compiled with CONFIG_CLS_U32_PERF you should
see when the filters get hit as well
(do something like sudo tc -s filter ls dev eth1)


cheers,
jamal




  reply	other threads:[~2011-07-04 13:05 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-04  7:38 libpcap and tc filters Adam Katz
2011-07-04 10:20 ` Eric Dumazet
2011-07-04 11:11 ` jamal
2011-07-04 12:01   ` Adam Katz
2011-07-04 12:37     ` Adam Katz
2011-07-04 13:05       ` jamal [this message]
2011-07-04 13:24         ` Adam Katz
2011-07-04 14:06           ` jamal
2011-07-04 14:16             ` Adam Katz
2011-07-05 10:56               ` jamal
2011-07-05 12:47                 ` jamal
2011-07-05 13:07                   ` Adam Katz
2011-07-05 13:56                     ` jamal
2011-07-05 14:21                       ` Adam Katz
2011-07-05 14:41                         ` jamal
2011-07-05 15:16                           ` Adam Katz
2011-07-05 16:14                             ` Eric Dumazet
2011-07-05 16:54                               ` Adam Katz
2011-07-05 19:19                                 ` jamal
2011-07-05 20:07                                   ` Adam Katz
     [not found] <CAA0qwj5Ktxi=v3XDAdTpKS_pWa+HjFL5XcN2qsK5m57JJ5G2Bg@mail.gmail.com>
2011-07-03 12:49 ` Adam Katz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1309784740.26180.21.camel@mojatatu \
    --to=hadi@cyberus.ca \
    --cc=adamkatz0@gmail.com \
    --cc=jhs@mojatatu.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).