From owner-freebsd-net@freebsd.org Sat Jan 9 15:41:30 2016 Return-Path: Delivered-To: freebsd-net@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 3004AA6976E for ; Sat, 9 Jan 2016 15:41:30 +0000 (UTC) (envelope-from pavel.odintsov@gmail.com) Received: from mail-ig0-x234.google.com (mail-ig0-x234.google.com [IPv6:2607:f8b0:4001:c05::234]) (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 0111F15FC for ; Sat, 9 Jan 2016 15:41:30 +0000 (UTC) (envelope-from pavel.odintsov@gmail.com) Received: by mail-ig0-x234.google.com with SMTP id h5so50679785igh.0 for ; Sat, 09 Jan 2016 07:41: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:date:message-id:subject:from:to :cc:content-type; bh=+AnIYxKC7WtZ+NypuTYxVpwLYp8Elw9lPNfputZ+bew=; b=S9bnxJ/OcyD7sQZtpTTT+4q6iLCPpEdgpOLdVoEU+OwVR4eCO4CRJQJrDP7abnYMbh V4pv2s9acwyHmC+uTCRzqaklueZ6spc4cVRA475t0HCmy/0cGL0nUs+MkBx2Tp+Q+qfa W53CP1GFiOx3Ix5NzfNl/aG84qt1pptioEOaUBYGmHDz+6H5jV9rxITck4rws5GQGK3S DUfS6B02HGBtTohegfHxADClFch9m23cCJBYmzqSwRDPMxAQJxJYXzKAwRyKhgavtLGP UQlwxwUuBkKwrZk0UfctfISLb3I0TUUMqMtC9Xn8VQZXOpvw0wMpmusb4lwRT9Py4qOD KqjA== MIME-Version: 1.0 X-Received: by 10.50.143.39 with SMTP id sb7mr4279603igb.37.1452354089272; Sat, 09 Jan 2016 07:41:29 -0800 (PST) Received: by 10.79.36.79 with HTTP; Sat, 9 Jan 2016 07:41:29 -0800 (PST) In-Reply-To: References: Date: Sat, 9 Jan 2016 18:41:29 +0300 Message-ID: Subject: Re: Netmap software interface mirror / netmap monitor From: Pavel Odintsov To: Luigi Rizzo Cc: "freebsd-net@freebsd.org" , Giuseppe Lettieri Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 15:41:30 -0000 Hello! Work like a charm! I have started two pkt-gen apps in monitoring mode for main application simultaneously and got same traffic for three apps! That's awesome! Really brilliant feature! Thanks so much for your work! ./pkt-gen -i netmap:eth1/rt 703.793991 main [1930] interface is netmap:eth1/rt 703.794050 main [2050] running on 1 cpus (have 8) 703.794227 extract_ip_range [367] range is 10.0.0.1:0 to 10.0.0.1:0 703.794245 extract_ip_range [367] range is 10.1.0.1:0 to 10.1.0.1:0 703.794648 main [2148] mapped 334980KB at 0x7fb9dfd7d000 Receiving from netmap:eth1/rt: 1 queues, 1 threads and 1 cpus. 703.794680 main [2235] Wait 2 secs for phy reset 705.794774 main [2237] Ready... 705.794923 receiver_body [1412] reading from netmap:eth1/rt fd 3 main_fd 3 706.795880 main_thread [1720] 722.277 Kpps (723.030 Kpkts 4.485 Gbps in 1001042 usec) 15.40 avg_batch 0 min_space 707.796928 main_thread [1720] 733.192 Kpps (733.960 Kpkts 4.529 Gbps in 1001048 usec) 15.72 avg_batch 317 min_space 708.797974 main_thread [1720] 753.922 Kpps (754.710 Kpkts 4.690 Gbps in 1001045 usec) 14.45 avg_batch 328 min_space 709.799034 main_thread [1720] 726.498 Kpps (727.269 Kpkts 4.496 Gbps in 1001061 usec) 14.21 avg_batch 374 min_space ./pkt-gen -i netmap:eth1/rt 723.359000 main [1930] interface is netmap:eth1/rt 723.359062 main [2050] running on 1 cpus (have 8) 723.359258 extract_ip_range [367] range is 10.0.0.1:0 to 10.0.0.1:0 723.359282 extract_ip_range [367] range is 10.1.0.1:0 to 10.1.0.1:0 723.359610 main [2148] mapped 334980KB at 0x7f1e1a67e000 Receiving from netmap:eth1/rt: 1 queues, 1 threads and 1 cpus. 723.359657 main [2235] Wait 2 secs for phy reset 725.359733 main [2237] Ready... 725.359814 receiver_body [1412] reading from netmap:eth1/rt fd 3 main_fd 3 726.360884 main_thread [1720] 765.146 Kpps (765.975 Kpkts 4.794 Gbps in 1001083 usec) 10.42 avg_batch 0 min_space 727.361920 main_thread [1720] 756.678 Kpps (757.461 Kpkts 4.683 Gbps in 1001035 usec) 12.66 avg_batch 330 min_space 728.362984 main_thread [1720] 695.403 Kpps (696.144 Kpkts 4.208 Gbps in 1001065 usec) 14.78 avg_batch 298 min_space 729.364064 main_thread [1720] 693.850 Kpps (694.599 Kpkts 4.192 Gbps in 1001080 usec) 14.35 avg_batch 332 min_space 730.365101 main_thread [1720] 732.741 Kpps (733.501 Kpkts 4.519 Gbps in 1001037 usec) 9.72 avg_batch 303 min_space On Fri, Jan 8, 2016 at 10:24 PM, Pavel Odintsov wrote: > That's awesome! Thanks for lightning fast answer! Will check soon! > > On Fri, Jan 8, 2016 at 9:46 PM, Luigi Rizzo wrote: >> On Fri, Jan 8, 2016 at 10:35 AM, Pavel Odintsov >> wrote: >>> Hello, Dear Community! >>> >>> I'm working with netmap and my application uses netmap for traffic >>> capture. It's works really well. >>> >>> But I need some way to feed same data from physical interface to two >>> or more applications. >>> >>> I have found this code >>> https://github.com/luigirizzo/netmap/blob/master/sys/dev/netmap/netmap_monitor.c >>> but could not find any docs about it. >>> >>> Could you help me with examples and use cases? >> >> look at netmap_user.h, where it explains how to open a port >> in monitor mode. >> Essentially, once you have an active netmap port say netmap:ix0, you can >> sniff the traffic opening additional netmap ports named >> netmap:ix0/r (for rx traffic) or netmap:ix0/t (for tx) >> or even netmap:ix0/rt (for both tx and rx) >> >> Giuseppe (in Cc) can give more details >> >> cheers >> luigi > > > > -- > Sincerely yours, Pavel Odintsov -- Sincerely yours, Pavel Odintsov