From owner-freebsd-stable@freebsd.org Mon Nov 30 21:23:36 2015 Return-Path: Delivered-To: freebsd-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 450C0A3DC6D; Mon, 30 Nov 2015 21:23:36 +0000 (UTC) (envelope-from dudu.meyer@gmail.com) Received: from mail-ob0-x22d.google.com (mail-ob0-x22d.google.com [IPv6:2607:f8b0:4003:c01::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0D57A128A; Mon, 30 Nov 2015 21:23:36 +0000 (UTC) (envelope-from dudu.meyer@gmail.com) Received: by obbnk6 with SMTP id nk6so138396413obb.2; Mon, 30 Nov 2015 13:23:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=B3m4+Q//6CS2fMcR17SUi5XsGVb1E6tcC1MbYNOYsZc=; b=kc1GzlZXrH1tHedARr6StZWfApr86RwnDy1Ajw9VoCZ0jUQPWxcyGfKmY7K8II4n3K BPNnNybldIqg7hETqmrhFoGNpYHKz/URvcDU0Ja4ci1FzUHIYHYZSvjtzNS//jT4K/Ug iIF0RMJA1ZP83g84YviazOT8MHU5DzOai6mKdIqtTXeQYTs3cJTRmkHwMVQ8h6iEeeW7 IwRvLUOfuumq3sbbh0z5ncZAwPQG+5e2BMRpEMmUXGV7CdxIFoOT0fnpFC/s7GreDZEx F7Qn3V+4u/4vCYakP2q5j5Ji4qzqwRmagtYUNs7fhqKctpoZnKqUnwoqb1/9/IusfeyW PB9g== MIME-Version: 1.0 X-Received: by 10.60.92.138 with SMTP id cm10mr44848386oeb.64.1448918615468; Mon, 30 Nov 2015 13:23:35 -0800 (PST) Received: by 10.182.116.167 with HTTP; Mon, 30 Nov 2015 13:23:35 -0800 (PST) In-Reply-To: References: Date: Mon, 30 Nov 2015 19:23:35 -0200 Message-ID: Subject: Re: Netmap vale + bridge on -STABLE From: Eduardo Meyer To: freebsd-stable@freebsd.org, "freebsd-net@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Nov 2015 21:23:36 -0000 OK, I am running current now. If I run: tcpdump -ni vale0:2 -w /tmp/2 & tcpdump -ni vale0:1 -w /tmp/1 & pkt-gen -i vale0:0 -f tx I get half of all generated traffic on /tmp/2 and the other half of /tmp/1. I guess this is the expected behavior, different from what I expected. Is that the expected behavior? Is there a way to create a VALE port that will mirror the traffic? Or is there a way to run the pcap enabled application (tcpdump in this case) in netmap mode (pcap netmap) without removing the packets from the ring? Say, I want to be table to run: pkt-gen -i vale0:0 -f tx pkt-gen -i vale0:1 -f rx tcpdump -ni vale0:2 -w /tmp/1 and have a copy of all traffic on /tmp/1. In the above tests, if I run: pkt-gen -i vale0:0 -f tx pkt-gen -i vale0:1 -f rx tcpdump -ni vale0:1 -w /tmp/1 tcpdump will remove as many packets as it can from the ring, and rx rates will drop to 0 or close to it (the ramaining rate is what tcpdump can not process) thank you On Fri, Nov 27, 2015 at 3:50 PM, Eduardo Meyer wrote: > Hello, > > I am trying to achieve a netmap based bridge which will allow me to > capture packets from it, say, I want to bridge ix0 + ix1 and be able to > tcpdump it (in fact I want to run other applications which are netmap > aware). > > Should it work on -STABLE? Because as far as I remember I could make it > work in the past, and some other people[1] had some success doing it too > (at least the vale + wire bridge part) > > What I get is an error while opening ix0 connected to vale: > > # ./vale-ctl > 257.967371 bdg_ctl [148] bridge:0 port:0 vale0:fnm0 > 257.967399 bdg_ctl [148] bridge:0 port:1 vale0:ids0 > 257.967407 bdg_ctl [148] bridge:0 port:2 vale0:ix0 > 257.967414 bdg_ctl [148] bridge:1 port:0 vale1:fnm1 > 257.967419 bdg_ctl [148] bridge:1 port:1 vale1:ids1 > 257.967428 bdg_ctl [148] bridge:1 port:2 vale1:ix1 > > # ./bridge -i netmap:ix0 -i netmap:ix1 > ./bridge built Nov 26 2015 19:18:34 > 268.504787 nm_open [839] NIOCREGIF failed: Device busy ix0 > 268.504800 main [233] cannot open netmap:ix0 > Exit 1 > > How can I achieve it? Is it ok to expect to have another netmap capable > software (say like suricata) to use this other vale connected port? Or will > both software (bridge and suricata) concurrently copy and remove packets > from netmap rings and therefore mess up the whole thing? > > [1] > https://lists.openinfosecfoundation.org/pipermail/oisf-users/2015-October/005310.html > > > -- > =========== > Eduardo Meyer > pessoal: dudu.meyer@gmail.com > profissional: ddm.farmaciap@saude.gov.br > -- =========== Eduardo Meyer pessoal: dudu.meyer@gmail.com profissional: ddm.farmaciap@saude.gov.br