[dpdk-users] pktgen - IP address randomness

Wiles, Keith keith.wiles at intel.com
Tue May 23 13:50:49 CEST 2017


> On May 23, 2017, at 12:16 AM, Shyam Shrivastav <shrivastav.shyam at 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 at 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



More information about the users mailing list