Multiplier : how does it work

829 views
Skip to first unread message

nicol...@gmail.com

unread,
Aug 3, 2018, 9:22:46 AM8/3/18
to TRex Traffic Generator
Hello dear Trex users/developers,

I don't understand how the multiplier option works.

While running a profile in ASTF mode, with cps=1, I got these results :

Trying multiplier 30000.0
FAIL - Conn dropped: 135929 CPS: 262142 Established CPS: 28810
Trying multiplier 20000.0
FAIL - Conn dropped: 36113 CPS: 177984 Established CPS: 73825
Trying multiplier 15000.0
FAIL - Conn dropped: 3020 CPS: 69500 Established CPS: 40215
Trying multiplier 12500.0
PASS - Conn dropped: 0 CPS: 7485 Established CPS: 7385
Trying multiplier 13750.0
FAIL - Conn dropped: 316 CPS: 34518 Established CPS: 23003
Trying multiplier 13125.0
PASS - Conn dropped: 0 CPS: 16812 Established CPS: 11751
Trying multiplier 13437.5
FAIL - Conn dropped: 33 CPS: 22563 Established CPS: 15283
Trying multiplier 13281.25
FAIL - Conn dropped: 16 CPS: 20925 Established CPS: 13754
Trying multiplier 13203.125
...

Note that "Conn dropped" comes from "tcps_conndrops", "CPS" from "m_active_flows" and "Established CPS" from "m_est_flows".


According to the documentation :

-m <num>

Rate multiplier. TRex will multiply the CPS rate of each template by num.

So I was expecting that CPS counter will equal to the multiplier, but it is not. Why ? Am I missing something ?
And I couldn't find any relationship between CPS and multiplier :

m = 12500.0, CPS=7485
m = 30000, CPS=262142

This is not the same scale factor.

I tried to run cps=10000 (in profile) and m=1.0 :

Trying multiplier 1.0
PASS - Conn dropped: 0 CPS: 5989 Established CPS: 5964

Only 5989 CPS ... Maybe I do read the wrong counters ?

My template :

from trex_astf_lib.api import *


class Prof1():
def __init__(self):
pass

def get_profile(self):
# ip generator
ip_gen_c = ASTFIPGenDist(ip_range=["16.0.0.1", "16.0.0.255"], distribution="seq")
ip_gen_s = ASTFIPGenDist(ip_range=["48.0.0.1", "48.0.0.255"], distribution="seq")
ip_gen = ASTFIPGen(glob=ASTFIPGenGlobal(ip_offset="1.0.0.0"),
dist_client=ip_gen_c,
dist_server=ip_gen_s)

c_glob_info = ASTFGlobalInfo()
c_glob_info.scheduler.accurate = 1

return ASTFProfile(default_ip_gen=ip_gen,
cap_list=[ASTFCapInfo(file="./http_1k.pcap",
cps=1)])
def register():
return Prof1()

Run it with :
./t-rex-64 -f ./profile.py -c 1 -m 30 -d 20 --astf --nc

Oh, and the pcap is just a simple http 1k body from Spirent.

Thanks for help :)

Nicolas Pamart.

hanoh haim

unread,
Aug 4, 2018, 2:19:57 PM8/4/18
to nicol...@gmail.com, TRex Traffic Generator
in case of one template with cps==1 the Console CPS should be equal to the multipler 

More generally 
Console CPS= M*  Sum(templates cps)

In your case I suspect that you are in corner case. 

Try to loopback the TRex ports and send the full counters so we can help you.

Thanks,
Hanoh

--
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 post to this group, send email to trex...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trex-tgn/688be3d4-008c-4177-860e-9e0eebb32d20%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Hanoh
Sent from my iPhone

Matt Callaghan

unread,
Aug 15, 2018, 11:23:16 AM8/15/18
to TRex Traffic Generator
+1 for this;

can we explain how mulitplier actually works? (does it vary per mode? stateful/astf/...)

i.e. in stateful mode, if a user specifies a cps per template, the expectation is that the CPS is static (N connections per second) - regardless of the multiplier

yet multiplier implies it can increase pps (and thus bitrate)

but how can this be achieved without impacting the CPS?
(the only other way I can think of is by padding bytes...)
(even if one was to send the same flow from the same 5-tuple in a burst, for TCP this would have to be counted as a "new connection' ...)

-m <num> Rate multiplier. TRex will multiply the CPS rate of each template by num.

, has a pretty good explanation of expectations, but it fails to describe HOW this is accomplished without breaking the requested CPS

nicol...@gmail.com

unread,
Aug 16, 2018, 4:35:37 AM8/16/18
to TRex Traffic Generator
Hi Matt,

If you just want to limit the number of CPS, and you are in ASTF mode, you can do it by adding "limit=target_cps" while calling ASTFTCPClientTemplate constructor in your profile.

See this example, line 86 : https://github.com/cisco-system-traffic-generator/trex-core/blob/master/scripts/astf/http_eflow.py

For the other modes I don't know.

nicol...@gmail.com

unread,
Aug 16, 2018, 5:37:45 AM8/16/18
to TRex Traffic Generator
Hi Hanoh,

Sorry for the late answer, here are the full loopback counters with cps=1 in profile and multiplier=100000 and 50000. There is a scale of around 1.6 between multiplier and active_flows for both multiplier. Maybe this is because I replicate a pcap file ? Anyway it seems constant between different multiplier and this is a good thing.

And maybe that scale between multiplier and actual cps was not the same for each multiplier because of the DUT limiting/Adding randomness to active_flows ?

Here are the counters : https://gist.github.com/pamartn/08ac28c296e4a81d96b677496bf1348f

hanoh haim

unread,
Aug 16, 2018, 5:39:53 AM8/16/18
to nicol...@gmail.com, TRex Traffic Generator
I’m not following, are we talking about CPS or active_flows? There are totally *different* metrics 

--
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 post to this group, send email to trex...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

nicol...@gmail.com

unread,
Aug 16, 2018, 8:16:23 AM8/16/18
to TRex Traffic Generator
EDIT: This will limit the number of active flows, not the CPS. Sorry for the bad answer ;-)

nicol...@gmail.com

unread,
Aug 16, 2018, 8:21:18 AM8/16/18
to TRex Traffic Generator
We are talking about CPS. I have been mistaken thinking active_flows are CPS, but they are just the number of open connections right ?
In this case I think my problem is resolved. Correct me if i'm wrong :
If I want to bench CPS on a DUT, all I have to do is to increase multiplier until I've got some drops, and the multiplier is my CPS (if I set my profile with cps=1) ?

Thanks for your time, and sorry for my mistake.

hanoh haim

unread,
Aug 16, 2018, 9:15:18 AM8/16/18
to nicol...@gmail.com, TRex Traffic Generator
Correct.
 Active_flows = CPS • flow_duration


For more options, visit https://groups.google.com/d/optout.
--

Matt Callaghan

unread,
Aug 16, 2018, 10:15:58 AM8/16/18
to TRex Traffic Generator
@Hanoh,

so what does multiplier do?

Consider:
 * stateful mode
 * say we use one of the normalized traffic profiles to 1Gbps
 * X_connections_per_second (which I interpret aka "new flows per second")

when multiplier = 1, we'll get 1Gbps of traffic, with a constant X cps

if multiplier = 10, we'll get 10Gbps and 10X cps?
Message has been deleted

Matt Callaghan

unread,
Aug 16, 2018, 3:57:46 PM8/16/18
to TRex Traffic Generator
I confirmed my theory today -- multiple IN FACT does multiply both the bitrate and the connections per second

bitrate=multipliern=1∑SUM_NUM_FLOWS  (flow_cpsflow_total_bytes)

(latex doesn't paste well into google groups it seems)

Matt Callaghan

unread,
Aug 16, 2018, 5:41:01 PM8/16/18
to TRex Traffic Generator
Reply all
Reply to author
Forward
0 new messages