DPDK usage discussions
 help / color / mirror / Atom feed
From: "Wiles, Keith" <keith.wiles@intel.com>
To: Shyam Shrivastav <shrivastav.shyam@gmail.com>
Cc: Chris Hall <chris.hall@stackpath.com>, "users@dpdk.org" <users@dpdk.org>
Subject: Re: [dpdk-users] pktgen - IP address randomness
Date: Tue, 23 May 2017 11:50:49 +0000	[thread overview]
Message-ID: <78E13D86-2391-4A25-8C3C-CE422EA0839A@intel.com> (raw)
In-Reply-To: <CAGSp03nANkqUV68WDR7grLeG6GhWu-6yGw2aqpzQ0=D+EToDBQ@mail.gmail.com>


> On May 23, 2017, at 12:16 AM, Shyam Shrivastav <shrivastav.shyam@gmail.com> wrote:
> 
> Sometime back I used lua in moongen to continuously generate ip:tcp packets
> with random ip src and random tcp src/dst ports. Here is the corresponding
> lua script fragment, don't know how much useful it can be with pktgen as I
> have not looked at or used pktgen till now but just in case ...
> 
> 
>                        x1 = math.random(1,254);
>                        x2 = math.random(1,254);
>                        x3 = math.random(1,254);
>                        x4 = math.random(1,254);
>                        p1 = math.random(1025,65534);
>                        p2 = math.random(1025,65534);
>                        pkt.ip.src:set(x1*256*256*256 + x2*256*256 + x3*256
> + x4)
>                        pkt.tcp:setSrcPort(p1);
>                        pkt.tcp:setDstPort(p2);
> 
> 

May want to look at the random mode in pktgen as that mode packets are changed on the fly using a mask and random values.

> 
> 
> On Tue, May 23, 2017 at 5:01 AM, Chris Hall <chris.hall@stackpath.com>
> wrote:
> 
>> Hello,
>> 
>> pktgen-3.2.4
>> 
>> I Looking to get as much randomness out of src ip’s as possible. Using
>> this config in lua…
>> 
>>        pktgen.src_ip('0', 'start',"0.0.0.1");
>>        pktgen.src_ip('0', 'min', "0.0.0.1");
>>        pktgen.src_ip('0', 'max', "255.255.255.254");
>>        pktgen.src_ip('0', 'inc', "1.1.1.1");
>> 
>> running a packet capture of 5Million packets on the receiving host,
>> parsing the pcap file, based on source ip, seems I can only get about 32769
>> uniq ip's, (each connected about 150 times).
>> 
>> As a comparison I used hping3 with --rand-source option (5million packets)
>> I can get about 4942744 uniq ip’s.
>> 
>> Is there a configure option(s) somewhere that could be tuned for more
>> randomness or is the above parms just wrong ?
>> 
>> Thanks much.
>> 
>>  *   Chris
>> 
>> 
>> 
>> 

Regards,
Keith


  reply	other threads:[~2017-05-23 11:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-22 23:31 Chris Hall
2017-05-23  5:16 ` Shyam Shrivastav
2017-05-23 11:50   ` Wiles, Keith [this message]
2017-05-23 11:49 ` Wiles, Keith

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=78E13D86-2391-4A25-8C3C-CE422EA0839A@intel.com \
    --to=keith.wiles@intel.com \
    --cc=chris.hall@stackpath.com \
    --cc=shrivastav.shyam@gmail.com \
    --cc=users@dpdk.org \
    /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).