From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.windriver.com (mail.windriver.com [147.11.1.11]) by dpdk.org (Postfix) with ESMTP id 815CA2E8C for ; Mon, 24 Jun 2013 16:12:20 +0200 (CEST) Received: from ALA-HCA.corp.ad.wrs.com (ala-hca.corp.ad.wrs.com [147.11.189.40]) by mail.windriver.com (8.14.5/8.14.3) with ESMTP id r5OECWEt026594 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Mon, 24 Jun 2013 07:12:32 -0700 (PDT) Received: from ALA-MBA.corp.ad.wrs.com ([169.254.2.88]) by ALA-HCA.corp.ad.wrs.com ([147.11.189.40]) with mapi id 14.02.0342.003; Mon, 24 Jun 2013 07:12:32 -0700 From: "Wiles, Roger Keith" To: Peter Chen Thread-Topic: [dpdk-dev] Sending & Receiving Packets Thread-Index: AQHOcJa++ToMtBu+hEmJiK1ZJ/mU5ZlExGkAgAAE/YCAAJSAgA== Date: Mon, 24 Jun 2013 14:12:32 +0000 Message-ID: <99051FD0-C15C-4044-B19A-70DE29D03464@windriver.com> References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.25.40.165] Content-Type: multipart/alternative; boundary="_000_99051FD0C15C4044B19A70DE29D03464windrivercom_" MIME-Version: 1.0 Cc: "" Subject: Re: [dpdk-dev] Sending & Receiving Packets X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jun 2013 14:12:21 -0000 --_000_99051FD0C15C4044B19A70DE29D03464windrivercom_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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 application= s 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 th= e applications correctly with the correct routing information have a look a= t the L3fwd application code and docs. If you are using a standard OS and n= ot Pktgen or some type of traffic generator you must configure the sender m= achine 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 ha= ve 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 th= en do a 'arp' command on your sender machines that defines the correct IP a= ddress 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 deta= ils, but the DPDK docs should be able to help and understanding how a L3 ro= uter works is a big plus. Note one area I find most do not understand is the packet leaving the sende= r machine must have the MAC address of the server port and the IP address o= f the machine you are trying to send the packet, then the L3fwd configurati= on needs to know the correct routes to the port with that subnet or IP addr= ess. You should be able to find more detailed docs in the DPDK system. I hope yo= u 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 > 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 t= he port that DPDK has would not have an IP address nor will it be able to d= o 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 net= work 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 > wrote: Hi Peter, When DPDK is running on the server it takes control of the ports, which mea= ns the network stack that would answer a ping (ICMP Echo) would not be atta= ched to the port any more. You would have to add code to DPDK as an applica= tion 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 D= PDK 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 ha= rd as I do that work in Pktgen. If you want to do more then just grab packe= ts and determine if you need to send out a packet you would need to port so= me stack on top of DPDK like lwIP. You can this other ways, but it would ta= ke a bit more text to describe. Have a look at Pktgen on GitHub and you can look at that code for a basic e= xample. 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 > wrote: I was wondering how I can send/receive packets from my computer to my serve= r 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 dpd= k 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 --_000_99051FD0C15C4044B19A70DE29D03464windrivercom_ Content-Type: text/html; charset="iso-8859-1" Content-ID: Content-Transfer-Encoding: quoted-printable 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 applic= ations can forward L2 or L3 packets from one port to another. These applica= tions will not answer an ARP request or PING packet, so you have to configure the applications correctly with t= he correct routing information have a look at the L3fwd application code an= d docs. If you are using a standard OS and not Pktgen or some type of traff= ic generator you must configure the sender machine system correctly. 

In the L3fwd application you tell the application which IP address bel= ongs 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 y= ou 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 se= nder 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 addr= ess of the machine you are trying to send the packet, then the L3fwd config= uration 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>
 wrote:

Thanks for the reply, I understand that without the networ= k 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 wil= l 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 K= eith <keith.wi= les@windriver.com> wrote:
Hi Peter,

When DPDK is running on the server it takes control of the ports, whic= h 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 ap= plication 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 stac= k 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 th= at 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 descri= be.

Have a look at Pktgen on GitHub and you can look at that code for a ba= sic 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>=
 wrote:

I was wondering how I can send/receive packets from my com= puter to my server which has dpdk running. Since what seems to happen is th= at 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 dpd= k 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



--_000_99051FD0C15C4044B19A70DE29D03464windrivercom_--