DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] Sending & Receiving Packets
@ 2013-06-24  4:52 Peter Chen
  2013-06-24  5:03 ` Wiles, Roger Keith
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Chen @ 2013-06-24  4:52 UTC (permalink / raw)
  To: dev

[-- Attachment #1: Type: text/plain, Size: 518 bytes --]

I was wondering how I can send/receive packets from my computer to my
server which has dpdk running. Since what seems to happen is that dpdk
binds to the ethernet device, what would be its IP address?

For example how would I send a ping from one computer to my server with
dpdk binded to the NIC?

Would I send a packet with only MAC address and dpdk binded NIC would pick
it up and move the packet up to dpdk and then to the user space? Just kind
of confused how that works. I would be grateful for any help!

Peter

[-- Attachment #2: Type: text/html, Size: 591 bytes --]

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

* Re: [dpdk-dev] Sending & Receiving Packets
  2013-06-24  4:52 [dpdk-dev] Sending & Receiving Packets Peter Chen
@ 2013-06-24  5:03 ` Wiles, Roger Keith
       [not found]   ` <CAMGYKAfYt3xyZj-Np6bsgydGHW_FKv81ZxODFG0_+U+KohQZig@mail.gmail.com>
  0 siblings, 1 reply; 5+ messages in thread
From: Wiles, Roger Keith @ 2013-06-24  5:03 UTC (permalink / raw)
  To: Peter Chen; +Cc: <dev@dpdk.org>

[-- Attachment #1: Type: text/plain, Size: 1749 bytes --]

Hi Peter,

When DPDK is running on the server it takes control of the ports, which means the network stack that would answer a ping (ICMP Echo) would not be attached to the port any more. You would have to add code to DPDK as an application to receive the ICMP Echo packet and respond with a ICMP Reply packet. The other method would be to attach a network stack as the application to DPDK and use that network stack to receive and send packets.

Writing a simple DPDK application to receive packets off the ports and look for ICMP Echo request and to respond with a ICMP Echo reply is not that hard as I do that work in Pktgen. If you want to do more then just grab packets and determine if you need to send out a packet you would need to port some stack on top of DPDK like lwIP. You can this other ways, but it would take a bit more text to describe.

Have a look at Pktgen on GitHub and you can look at that code for a basic example.

Thank you, ++Keith
-------------------------------
Keith Wiles
Principal Technologist for Networking
cell 972-213-5533
Wind River Systems






On Jun 23, 2013, at 11:52 PM, Peter Chen <peter.feifan.chen@gmail.com<mailto:peter.feifan.chen@gmail.com>>
 wrote:

I was wondering how I can send/receive packets from my computer to my server which has dpdk running. Since what seems to happen is that dpdk binds to the ethernet device, what would be its IP address?

For example how would I send a ping from one computer to my server with dpdk binded to the NIC?

Would I send a packet with only MAC address and dpdk binded NIC would pick it up and move the packet up to dpdk and then to the user space? Just kind of confused how that works. I would be grateful for any help!

Peter


[-- Attachment #2: Type: text/html, Size: 2854 bytes --]

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

* Re: [dpdk-dev] Sending & Receiving Packets
       [not found]   ` <CAMGYKAfYt3xyZj-Np6bsgydGHW_FKv81ZxODFG0_+U+KohQZig@mail.gmail.com>
@ 2013-06-24 14:12     ` Wiles, Roger Keith
  0 siblings, 0 replies; 5+ messages in thread
From: Wiles, Roger Keith @ 2013-06-24 14:12 UTC (permalink / raw)
  To: Peter Chen; +Cc: <dev@dpdk.org>

[-- Attachment #1: Type: text/plain, Size: 4339 bytes --]

Hi Peter,

Pktgen can send the packets but they have to be configured correctly. DPDK has a couple of applications two are L2fwd and L3fwd. These two applications can forward L2 or L3 packets from one port to another. These applications will not answer an ARP request or PING packet, so you have to configure the applications correctly with the correct routing information have a look at the L3fwd application code and docs. If you are using a standard OS and not Pktgen or some type of traffic generator you must configure the sender machine system correctly.

In the L3fwd application you tell the application which IP address belongs to which port, think of the L3fwd application as a L3 router that you have to configure the route by hand correctly. Then on the sender machine you have to hardcode the ARP addresses in the arp cache to force the local OS not try a ARP request. Find out the MAC address of the two server ports and then do a 'arp' command on your sender machines that defines the correct IP address and MAC address of port. It is not too hard, but you do need to get the sender and L3fwd configured correctly. I have not given all of the details, but the DPDK docs should be able to help and understanding how a L3 router works is a big plus.

Note one area I find most do not understand is the packet leaving the sender machine must have the MAC address of the server port and the IP address of the machine you are trying to send the packet, then the L3fwd configuration needs to know the correct routes to the port with that subnet or IP address.

You should be able to find more detailed docs in the DPDK system. I hope you are able to get things working.

Thank you, ++Keith
-------------------------------
Keith Wiles
Principal Technologist for Networking
cell 972-213-5533
Wind River Systems






On Jun 24, 2013, at 12:21 AM, Peter Chen <peter.feifan.chen@gmail.com<mailto:peter.feifan.chen@gmail.com>>
 wrote:

Thanks for the reply, I understand that without the network stack, ping won't work. I am curious as to how I would even get a packet sent over since the port that DPDK has would not have an IP address nor will it be able to do ARP to get one. So how do I even send a packet over (e.g. ping would need some IP address to ping in the first place regardless of if there is a network stack on the other side to process a reply).

would PktGen be able to send packets over without an IP address?


On Sun, Jun 23, 2013 at 10:03 PM, Wiles, Roger Keith <keith.wiles@windriver.com<mailto:keith.wiles@windriver.com>> wrote:
Hi Peter,

When DPDK is running on the server it takes control of the ports, which means the network stack that would answer a ping (ICMP Echo) would not be attached to the port any more. You would have to add code to DPDK as an application to receive the ICMP Echo packet and respond with a ICMP Reply packet. The other method would be to attach a network stack as the application to DPDK and use that network stack to receive and send packets.

Writing a simple DPDK application to receive packets off the ports and look for ICMP Echo request and to respond with a ICMP Echo reply is not that hard as I do that work in Pktgen. If you want to do more then just grab packets and determine if you need to send out a packet you would need to port some stack on top of DPDK like lwIP. You can this other ways, but it would take a bit more text to describe.

Have a look at Pktgen on GitHub and you can look at that code for a basic example.

Thank you, ++Keith
-------------------------------
Keith Wiles
Principal Technologist for Networking
cell 972-213-5533
Wind River Systems






On Jun 23, 2013, at 11:52 PM, Peter Chen <peter.feifan.chen@gmail.com<mailto:peter.feifan.chen@gmail.com>>
 wrote:

I was wondering how I can send/receive packets from my computer to my server which has dpdk running. Since what seems to happen is that dpdk binds to the ethernet device, what would be its IP address?

For example how would I send a ping from one computer to my server with dpdk binded to the NIC?

Would I send a packet with only MAC address and dpdk binded NIC would pick it up and move the packet up to dpdk and then to the user space? Just kind of confused how that works. I would be grateful for any help!

Peter




[-- Attachment #2: Type: text/html, Size: 6451 bytes --]

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

* Re: [dpdk-dev] Sending & Receiving Packets
  2014-01-20 18:31 Sharma, RishiX
@ 2014-01-20 19:08 ` Wiles, Roger Keith
  0 siblings, 0 replies; 5+ messages in thread
From: Wiles, Roger Keith @ 2014-01-20 19:08 UTC (permalink / raw)
  To: Sharma, RishiX; +Cc: dev

Hi Rishi,

Normally I use 'start <portlist|all>'

pktgen> start 0             # Start port 0 sending
pktgen> start 0,3         # Start port 0 and 3 sending
pktgen> start 0-3        # start port 0, 1, 2 and 3 send packets.
pktgen> start all          # start sending on all ports

pktgen> stp             # stop sending on all ports
pktgen> str             # start sending on all ports

On the main screen is the single packet send configuration for the ports. You need to make sure you set your dst mac to the correct DUT MAC address. If you are fowarding L3 packets then you need to make sure the IP dst/src addresses are correct.

set mac <portlist> etheraddr       - Set MAC addresses 00:11:22:33:44:55
                                                     You can use 0011:2233:4455 format as well

set ip src|dst <portlist> ipaddr   - Set IP addresses


set ip dst 0 192.168.0.10
set ip src 0 192.168.0.1/24

Let me know if that helps.

Thanks
++Keith

Keith Wiles, Principal Technologist for Networking member of the CTO office, Wind River
direct 972.434.4136  mobile 940.213.5533  fax 000.000.0000
[Powering 30 Years of Innovation]<http://www.windriver.com/announces/wr30/>

On Jan 20, 2014, at 12:31 PM, Sharma, RishiX <rishix.sharma@intel.com<mailto:rishix.sharma@intel.com>> wrote:

Hi Keith,

Just to give you the background .I need to test the packet throughput performance of one of my device using DPDK .

The DUT is connected to my Linux host machine with one of the port and I want to run the Pktgen on my host machine to send the packets to the DUT where DPDK (Testpmd app) is running in fwd rx_only mode.I have setup one of the network port as igb_uio port and using it .

I'm able to compile and run the pktgen with start all but I don't know how to configure the pktgen to send packets to DUT.

I want to know the steps and exact commands required to send packets to my DUT .


-Rishi

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

* Re: [dpdk-dev] Sending & Receiving Packets
@ 2014-01-20 18:31 Sharma, RishiX
  2014-01-20 19:08 ` Wiles, Roger Keith
  0 siblings, 1 reply; 5+ messages in thread
From: Sharma, RishiX @ 2014-01-20 18:31 UTC (permalink / raw)
  To: 'dev@dpdk.org'

Hi Keith,

Just to give you the background .I need to test the packet throughput performance of one of my device using DPDK .

The DUT is connected to my Linux host machine with one of the port and I want to run the Pktgen on my host machine to send the packets to the DUT where DPDK (Testpmd app) is running in fwd rx_only mode.I have setup one of the network port as igb_uio port and using it .

I'm able to compile and run the pktgen with start all but I don't know how to configure the pktgen to send packets to DUT.

I want to know the steps and exact commands required to send packets to my DUT .


-Rishi

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

end of thread, other threads:[~2014-01-20 19:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-24  4:52 [dpdk-dev] Sending & Receiving Packets Peter Chen
2013-06-24  5:03 ` Wiles, Roger Keith
     [not found]   ` <CAMGYKAfYt3xyZj-Np6bsgydGHW_FKv81ZxODFG0_+U+KohQZig@mail.gmail.com>
2013-06-24 14:12     ` Wiles, Roger Keith
2014-01-20 18:31 Sharma, RishiX
2014-01-20 19:08 ` Wiles, Roger Keith

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).