All of lore.kernel.org
 help / color / mirror / Atom feed
* capture packets on VM
@ 2016-07-15  5:54 Raja Jayapal
  2016-07-15 12:59 ` Matt Laswell
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Raja Jayapal @ 2016-07-15  5:54 UTC (permalink / raw)
  To: dev

Hi All,

I have installed dpdk on VM and would like to know how to capture the packets on dpdk ports.
I am sending traffic from host  and want to know how to confirm whether the packets are flowing via dpdk ports.
I tried with tcpdump and wireshark but could not capture the packets inside VM.
setup : bridge1(Host)------- VM(Guest with DPDK) ----- bridge2(Host)

Please suggest.

Thanks,
Raja

=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: capture packets on VM
  2016-07-15  5:54 capture packets on VM Raja Jayapal
@ 2016-07-15 12:59 ` Matt Laswell
  2016-07-15 14:02 ` Pattan, Reshma
  2016-07-19 11:38 ` Raja Jayapal
  2 siblings, 0 replies; 4+ messages in thread
From: Matt Laswell @ 2016-07-15 12:59 UTC (permalink / raw)
  To: Raja Jayapal; +Cc: dev

Hey Raja,

When you bind the ports to the DPDK poll mode drivers, the kernel no longer
has visibility into them.  This makes some sense intuitively - it would be
very bad for both the kernel and a user mode application to both attempt to
control the ports.  This is why tools like tcpdump and wireshark don't work
(and why the ports don't show up in ifconfig generally).

If you just want to know that packets are flowing, an easy way to do it is
simply to emit messages (via printf or the logging subsystem of your
choice) or increment counters when you receive packets.  If you want to
verify a little bit of information about the packets but don't need full
capture, you can either add some parsing information to your messages, or
build out more stats.

However, if you want to actually capture the packet contents, it's a little
trickier.  You can write your own packet-capture application, of course,
but that might be a bigger task than you're looking for.  You can also
instantiate a KNI interface and either copy or forward the packets to it
(and, from there, you can do tcpdump on the kernel side of the interface).
  I seem to recall that there's been some work done on tcpdump like
applications within DPDK, but don't remember what state those efforts are
in presently.

--
Matt Laswell
laswell@infinite.io
infinite io, inc.

On Fri, Jul 15, 2016 at 12:54 AM, Raja Jayapal <raja.jayapal@tcs.com> wrote:

> Hi All,
>
> I have installed dpdk on VM and would like to know how to capture the
> packets on dpdk ports.
> I am sending traffic from host  and want to know how to confirm whether
> the packets are flowing via dpdk ports.
> I tried with tcpdump and wireshark but could not capture the packets
> inside VM.
> setup : bridge1(Host)------- VM(Guest with DPDK) ----- bridge2(Host)
>
> Please suggest.
>
> Thanks,
> Raja
>
> =====-----=====-----=====
> Notice: The information contained in this e-mail
> message and/or attachments to it may contain
> confidential or privileged information. If you are
> not the intended recipient, any dissemination, use,
> review, distribution, printing or copying of the
> information contained in this e-mail message
> and/or attachments to it are strictly prohibited. If
> you have received this communication in error,
> please notify us by reply e-mail or telephone and
> immediately and permanently delete the message
> and any attachments. Thank you
>
>
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: capture packets on VM
  2016-07-15  5:54 capture packets on VM Raja Jayapal
  2016-07-15 12:59 ` Matt Laswell
@ 2016-07-15 14:02 ` Pattan, Reshma
  2016-07-19 11:38 ` Raja Jayapal
  2 siblings, 0 replies; 4+ messages in thread
From: Pattan, Reshma @ 2016-07-15 14:02 UTC (permalink / raw)
  To: Raja Jayapal; +Cc: dev



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Raja Jayapal
> Sent: Friday, July 15, 2016 6:55 AM
> To: dev@dpdk.org
> Subject: [dpdk-dev] capture packets on VM
> 
> Hi All,
> 
> I have installed dpdk on VM and would like to know how to capture the packets
> on dpdk ports.
> I am sending traffic from host  and want to know how to confirm whether the
> packets are flowing via dpdk ports.
> I tried with tcpdump and wireshark but could not capture the packets inside VM.
> setup : bridge1(Host)------- VM(Guest with DPDK) ----- bridge2(Host)
> 

Hi,

On DPDK you can capture packets with app/pdump/ tool. This tool is available for use from 16.07RC1. 
What you can do is run testpmd and see if packets are seen in testpmd, that confirms if packets are landing on dpdk ports or not.
If you also want to capture packet for analysis, you need to run app/pdump/ tool along with testpmd. 
The pdump tool captures the packet to pcap file, so you can use tcpdump -ni <pcap file> to view the packets. 
More about the tool usage can be found under doc/guides/sample_app_ug/pdump.rst

Let me know if you need further help on this.

Thanks,
Reshma

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: capture packets on VM
  2016-07-15  5:54 capture packets on VM Raja Jayapal
  2016-07-15 12:59 ` Matt Laswell
  2016-07-15 14:02 ` Pattan, Reshma
@ 2016-07-19 11:38 ` Raja Jayapal
  2 siblings, 0 replies; 4+ messages in thread
From: Raja Jayapal @ 2016-07-19 11:38 UTC (permalink / raw)
  To: Pattan, Reshma; +Cc: dev

Hi Reshma, 

Thanks for your information.
I have been trying to run the testpmd app and would like to get some idea on the packet flow in testpmd.

br0 -----vnet0----- (port0)VM NIC

br1------vnet1------(port1)VM NIC

br2------vnet2------(port2)VM NIC

br0 IP and MAC:
fe:54:00:0d:af:af - 192.168.100.10
br1 IP and MAC:
fe:54:00:4e:5b:df - 192.168.100.20
br2 IP and MAC:
fe:54:00:93:78:6d - 192.168.100.30

Ran testpmd application on VM and sending packets from Host using packeth.

Using PackETH generator, sent traffic from br0 destined to br1(modified the source / destination MAC and IP in packeth tool), but i could see that the packets are received on port0 and transmitted on port2.

Sending packets from br0 to br1:

./testpmd -c 3 -n 4 -- -i --total-num-mbufs=3000
testpmd> show port stats all
  ######################## NIC statistics for port 0  ########################
  RX-packets: 4          RX-missed: 0          RX-bytes:  0
  RX-errors: 0
  RX-nombuf:  0         
  TX-packets: 0          TX-errors: 0          TX-bytes:  0
  ############################################################################
  ######################## NIC statistics for port 1  ########################
  RX-packets: 0          RX-missed: 0          RX-bytes:  0
  RX-errors: 0
  RX-nombuf:  0         
  TX-packets: 0          TX-errors: 0          TX-bytes:  0
  ############################################################################
  ######################## NIC statistics for port 2  ########################
  RX-packets: 0          RX-missed: 0          RX-bytes:  0
  RX-errors: 0
  RX-nombuf:  0         
  TX-packets: 4          TX-errors: 0          TX-bytes:  0
  ############################################################################
testpmd> 

Second time, sent traffic from br1 to br2, but the packets are received on port2 and transmitted on port0.

Sending packets from br1 to br2:

testpmd> show port stats all
  ######################## NIC statistics for port 0  ########################
  RX-packets: 0          RX-missed: 0          RX-bytes:  0
  RX-errors: 0
  RX-nombuf:  0         
  TX-packets: 6          TX-errors: 0          TX-bytes:  0
  ############################################################################
  ######################## NIC statistics for port 1  ########################
  RX-packets: 6          RX-missed: 0          RX-bytes:  0
  RX-errors: 0
  RX-nombuf:  0         
  TX-packets: 0          TX-errors: 0          TX-bytes:  0
  ############################################################################
  ######################## NIC statistics for port 2  ########################
  RX-packets: 0          RX-missed: 0          RX-bytes:  0
  RX-errors: 0
  RX-nombuf:  0         
  TX-packets: 0          TX-errors: 0          TX-bytes:  0
  ############################################################################
testpmd> 

Could you please suggest whether this is expected behaviour?
Also suggest if any configuarion needs to be done to make the flow to work correctly. 


Thanks,
Raja

-----"Pattan, Reshma" <reshma.pattan@intel.com> wrote: -----
To: Raja Jayapal <raja.jayapal@tcs.com>
From: "Pattan, Reshma" <reshma.pattan@intel.com>
Date: 07/15/2016 07:33PM
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: RE: [dpdk-dev] capture packets on VM


> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Raja Jayapal
> Sent: Friday, July 15, 2016 6:55 AM
> To: dev@dpdk.org
> Subject: [dpdk-dev] capture packets on VM
> 
> Hi All,
> 
> I have installed dpdk on VM and would like to know how to capture the packets
> on dpdk ports.
> I am sending traffic from host  and want to know how to confirm whether the
> packets are flowing via dpdk ports.
> I tried with tcpdump and wireshark but could not capture the packets inside VM.
> setup : bridge1(Host)------- VM(Guest with DPDK) ----- bridge2(Host)
> 

Hi,

On DPDK you can capture packets with app/pdump/ tool. This tool is available for use from 16.07RC1. 
What you can do is run testpmd and see if packets are seen in testpmd, that confirms if packets are landing on dpdk ports or not.
If you also want to capture packet for analysis, you need to run app/pdump/ tool along with testpmd. 
The pdump tool captures the packet to pcap file, so you can use tcpdump -ni <pcap file> to view the packets. 
More about the tool usage can be found under doc/guides/sample_app_ug/pdump.rst

Let me know if you need further help on this.

Thanks,
Reshma


=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-07-19 11:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-15  5:54 capture packets on VM Raja Jayapal
2016-07-15 12:59 ` Matt Laswell
2016-07-15 14:02 ` Pattan, Reshma
2016-07-19 11:38 ` Raja Jayapal

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.