DPDK usage discussions
 help / color / mirror / Atom feed
* [dpdk-users] pktgen - IP address randomness
@ 2017-05-22 23:31 Chris Hall
  2017-05-23  5:16 ` Shyam Shrivastav
  2017-05-23 11:49 ` Wiles, Keith
  0 siblings, 2 replies; 4+ messages in thread
From: Chris Hall @ 2017-05-22 23:31 UTC (permalink / raw)
  To: users

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




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

* Re: [dpdk-users] pktgen - IP address randomness
  2017-05-22 23:31 [dpdk-users] pktgen - IP address randomness Chris Hall
@ 2017-05-23  5:16 ` Shyam Shrivastav
  2017-05-23 11:50   ` Wiles, Keith
  2017-05-23 11:49 ` Wiles, Keith
  1 sibling, 1 reply; 4+ messages in thread
From: Shyam Shrivastav @ 2017-05-23  5:16 UTC (permalink / raw)
  To: Chris Hall; +Cc: users

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




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

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

* Re: [dpdk-users] pktgen - IP address randomness
  2017-05-22 23:31 [dpdk-users] pktgen - IP address randomness Chris Hall
  2017-05-23  5:16 ` Shyam Shrivastav
@ 2017-05-23 11:49 ` Wiles, Keith
  1 sibling, 0 replies; 4+ messages in thread
From: Wiles, Keith @ 2017-05-23 11:49 UTC (permalink / raw)
  To: Chris Hall; +Cc: users


> On May 22, 2017, at 6:31 PM, 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”);

Currently you can not have a huge number of random values, the reason is to maintain performance levels I initialize the packets before starting the TX and do not update the packets on the fly in range mode.

The other problem I see is incrementing the IP address by 1.1.1.1 would only give about 256 IP address is that right. One other person used the lua scripts to setup N number of IP addresses then stopped, change the range to next N ranges and so on till he was able to test all of the ranges or very close to that many. The number of mbufs allocated to range mode is about 8192 packets, which means processing the packets in groups of 8192.

Not sure how long that will take, but not sure how long it would have taken is the range mode did support the complete range.

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


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

* Re: [dpdk-users] pktgen - IP address randomness
  2017-05-23  5:16 ` Shyam Shrivastav
@ 2017-05-23 11:50   ` Wiles, Keith
  0 siblings, 0 replies; 4+ messages in thread
From: Wiles, Keith @ 2017-05-23 11:50 UTC (permalink / raw)
  To: Shyam Shrivastav; +Cc: Chris Hall, users


> 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


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

end of thread, other threads:[~2017-05-23 11:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-22 23:31 [dpdk-users] pktgen - IP address randomness Chris Hall
2017-05-23  5:16 ` Shyam Shrivastav
2017-05-23 11:50   ` Wiles, Keith
2017-05-23 11:49 ` Wiles, 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).