DPDK patches and discussions
 help / color / mirror / Atom feed
From: Vladimir Medvedkin <medvedkinv@gmail.com>
To: sabu kurian <sabu2kurian@gmail.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] Crafting a packet for transmission.
Date: Thu, 13 Mar 2014 15:48:47 +0400	[thread overview]
Message-ID: <CANDrEHk97DVz2pnxcgj3yT6YS5f9tUfoX2m+_71JS5vuD1r17g@mail.gmail.com> (raw)
In-Reply-To: <CAJ2bnfACaT6rOjKALHW68woU-ooG-iZC=_ZSM9B7BYt7kWEDUw@mail.gmail.com>

Hi,

At first look at https://github.com/Pktgen/Pktgen-DPDK

If you need your custom app:
- alloc mbuf with rte_pktmbuf_alloc
- fill up L2-4 headers fields (look at rte_pktmbuf_append func for example)
- send packet via rte_eth_tx_burst

Regards,
Vladimir


2014-03-13 15:15 GMT+04:00 sabu kurian <sabu2kurian@gmail.com>:

> Hai friends,
>
> My requirement is to create a packet generator. So I could use
>
> struct rte_mbuf * m;
>
> to create a single packet holder. So how am I suppose to fill in the packet
> details like the MAC source , destination and also the IP source ,
> destination (in case of IPv4 packets).
>
> Following the l2fwd example, which has got the TAP interface to write the
> data to and read the data from.
>
> using the ether_hdr , one could read the MAC address from the packet
>
> eth = rte_pktmbuf_mtod(m, struct ether_hdr *);
> tmp = &eth->s_addr.addr_bytes[0];
>
> But how am I suppose to craft a packet and supply in all these details , so
> that I could sent the packet via rte_eth_tx_burst
>
>
> Thanks in advance
>

  reply	other threads:[~2014-03-13 11:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-13 11:15 sabu kurian
2014-03-13 11:48 ` Vladimir Medvedkin [this message]
     [not found]   ` <CALySL4R9Nn0V7myS4wow_mOB4ENJPfFu4xci2OZeGSDX+tcVSQ@mail.gmail.com>
2014-03-13 12:51     ` Vladimir Medvedkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CANDrEHk97DVz2pnxcgj3yT6YS5f9tUfoX2m+_71JS5vuD1r17g@mail.gmail.com \
    --to=medvedkinv@gmail.com \
    --cc=dev@dpdk.org \
    --cc=sabu2kurian@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).