ASTF rand IP distribution between client & servers

130 views
Skip to first unread message

Petr Redkin

unread,
Apr 21, 2021, 1:58:49 PM4/21/21
to TRex Traffic Generator

Hello,

I want to achieve predictible random in distribution between client & server IP ranges but option distribution with "rand" in ASTFIPGenDist doesn't help - I see same traffic as with "seq" with 1 to 1 distribution between client & server IP.

        ip_gen_c = ASTFIPGenDist(ip_range=["172.16.0.2", "172.16.3.234"], distribution="rand")

        ip_gen_s = ASTFIPGenDist(ip_range=["8.1.0.109", "8.1.3.93"], distribution="rand")

        ip_gen = ASTFIPGen(glob=ASTFIPGenGlobal(ip_offset="1.0.0.0"), dist_client=ip_gen_c, dist_server=ip_gen_s)

1.PNG

I achieved what I need when changed only last octet of server to value 81,

ip_gen_s = ASTFIPGenDist(ip_range=["8.1.0.109", "8.1.3.81"], distribution="rand")

2.PNG

but

1 – with value 85 I achieve the same 1 to 1 distribution

2 – with value 94 I achieve pseudo-random distribution

Is this some type of a bug? May I predict value of last octet to always achieve random distribution or in another way to get it?

ASTF @ v2.89

Thanks.

hanoh haim

unread,
Apr 22, 2021, 9:06:26 AM4/22/21
to Petr Redkin, TRex Traffic Generator
Hi Petr, 
It depends on how many cores and how many ports you have. The range of the server is split equally  to each core. 
I've took your range in case of an issue (2133) and simulate 1-21 number of cores and I don't see the issue. 
Could you check with 2 ports and one core (-c 1) 

j=0
 --------------
 0
 280
 1611
 978
 1136
 467
 100
 1448
 1448
 1993
 j=1
 --------------
 408
 553
 885
 36
 56
 564
 715
 8
 408
 71
 j=2
 --------------
 296
 488
 418
 661
 601
 374
 65
 464
 295
 498
 j=3
 --------------
 485
 406
 139
 25
 392
 174
 337
 403
 528
 194
 j=4
 --------------
 105
 418
 307
 320
 277
 30
 269
 376
 116
 185
 j=5
 --------------
 272
 169
 84
 97
 127
 59
 172
 318
 322
 21
 j=6
 --------------
 275
 153
 156
 96
 299
 150
 80
 27
 288
 22
 j=7
 --------------
 133
 102
 73
 243
 140
 123
 250
 13
 202
 204
 j=8
 --------------
 196
 29
 3
 163
 205
 149
 174
 171
 236
 210
 j=9
 --------------
 49
 65
 74
 109
 125
 180
 87
 179
 57
 88
 j=10
 --------------
 103
 90
 55
 34
 29
 110
 154
 6
 103
 96
 j=11
 --------------
 169
 132
 98
 157
 110
 149
 28
 37
 126
 23
 j=12
 --------------
 14
 45
 0
 67
 4
 116
 153
 39
 29
 52
 j=13
 --------------
 134
 99
 22
 103
 58
 58
 75
 22
 89
 128
 j=14
 --------------
 83
 135
 78
 21
 139
 58
 20
 80
 35
 69
 j=15
 --------------
 61
 127
 16
 26
 42
 83
 16
 86
 82
 106
 j=16
 --------------
 30
 59
 48
 25
 3
 112
 53
 17
 118
 51
 j=17
 --------------
 15
 104
 10
 19
 8
 43
 29
 15
 92
 53
 j=18
 --------------
 39
 50
 90
 104
 72
 24
 76
 101
 28
 96
 j=19
 --------------
 49
 53
 63
 86
 80
 48
 100
 67
 46
 87

 


--
You received this message because you are subscribed to the Google Groups "TRex Traffic Generator" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trex-tgn+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trex-tgn/6728ed38-ee96-4e49-bd78-ffdd5f143e82n%40googlegroups.com.


--
Hanoh
Sent from my iPhone

hanoh haim

unread,
Apr 22, 2021, 9:18:45 AM4/22/21
to Petr Redkin, TRex Traffic Generator
Hi Petr, 
I read again the question, you probably **sorting* the clients and looks for the servers right? 
We are using the same random generator for both client and server ranges, so this is expected if the range is the same.
If your range (in each core) is the same the random stream will be the same because the seed is the same (and predictable).

e.g. for core=1 
client range - 0..10 
server range - 0..10 

you will get the same stream of random hence 1:1 relation betwean them,
In the other example you gave there is a different ranges.

The best is to give a different range and give a prime number range per core. 

total-range = cores * prime_number 

so if you have 20 cores total (2 ports and -c =20)

client range = 20*13
server range = 20 * 97 

 Thanks
Hanoh

Petr Redkin

unread,
Apr 23, 2021, 4:06:37 AM4/23/21
to TRex Traffic Generator
Thank you Hanoh! 
For now I statically assigned client & server ranges which produce required distribution (not 1 client IP always connecting to 1 server IP). 
        ip_gen_c = ASTFIPGenDist(ip_range=[172.18.0.0, 172.18.3.255], distribution="rand")
        ip_gen_s = ASTFIPGenDist(ip_range=[8.1.0.109, 8.1.3.255], distribution="rand")

My config (for history): 10 cores, 2 ports.
четверг, 22 апреля 2021 г. в 16:18:45 UTC+3, Hanoch Haim:
Reply all
Reply to author
Forward
0 new messages