ASTF, easy way configure port continuous port speed?

617 views
Skip to first unread message

Dave Houser

unread,
Apr 23, 2021, 10:22:31 AM4/23/21
to TRex Traffic Generator
Simple question, is there an easy way to specify port bandwidth used by trex in sessions? I do not see any easy to way to do this in ASTF mode. Is there some flag I am missing? I feel like I need to do calculations to figure out port speed with -m... Am I missing something? 

The ask would be to tell trex "make the server send 10Gbps", or "tell the client to receive at 1Gbps", or some way to specify exact port speed for an interface?

Besart Dollma

unread,
Apr 24, 2021, 2:22:59 AM4/24/21
to TRex Traffic Generator
Hi,
The way it works with ASTF is as follows: Each profile has a CPS defined, and when starting/updating  the multiplier will multiply the CPS of the profile. There is no way to tell an ASTF client send 10Gbps. This is because it is stateful traffic, connection based. For example, take TCP. There might be many duplicates or rst that you can't know ahead of time, so how do you take them into consideration when saying 10Gbps?
Hence the only way to measure the traffic is the number of Connections Per Second (CPS). Now, in an easy case: Let's say one connection sends 1 Gbps traffic, and let's say we have 5 cores, so in order to get to 10Gbps you will need to multiply by 2. But when you go to higher rates, rst and duplicates (and other errors) come into consideration so the calculation isn't exact.
The number shouldn't be so hard to find using the TRex console into interactive mode.
Thanks,

Dave Houser

unread,
Apr 29, 2021, 9:16:33 AM4/29/21
to TRex Traffic Generator
Thanks for the breakdown. Do you mind going into a little more detail on the calculations? Its still not clear to me.
Mainly when you say the following:


"Let's say one connection sends 1 Gbps traffic, and let's say we have 5 cores, so in order to get to 10Gbps you will need to multiply by 2. "

When you say "lets say one connection sends 1Gbps", how is that defined? Is there somewhere in the profile or python file I can define that value? Where is is the baseline traffic rate defined in stf/astf? Or is it more complicated then that, where I would need to determine packet length of each packet being sent in the .pcap I use in the ASTFProfile, and calculate the rate based on cps?

Besart Dollma

unread,
Apr 30, 2021, 2:29:35 AM4/30/21
to TRex Traffic Generator
Hi,
It is more complicated than that, it depends how much traffic the connection is sending and at what rate (might be 64 byte packets at a very high rate or 1500 bytes at a low rate). I don't think it is worth it to start doing the maths. Try and find the correct multiplier using the trex-console and update the multiplier using the update function.
Thanks

Kuwarbi

unread,
Jun 27, 2022, 12:43:28 AM6/27/22
to TRex Traffic Generator
Hi besi7,

How can I calculate CPS with below data ?


{'m_active_flows': 3828300, 'm_est_flows': 1727348, 'm_tx_bw_l7_r': 47.440832958975754, 'm_tx_bw_l7_total_r': 47.440832958975754, 'm_rx_bw_l7_r': 533354.0809185817, 'm_tx_pps_r': 245566.625, 'm_rx_pps_r': 58.40320587158203, 'm_avg_size': 0.27145112493608964, 'm_tx_ratio': 100.0, '-': 0, 'm_traffic_duration': 696.60411464, 'TCP': 0, 'tcps_connattempt': 5701836, 'tcps_accepts': 0, 'tcps_connects': 3600884, 'tcps_closed': 1873536, 'tcps_segstimed': 9302720, 'tcps_rttupdated': 7160118, 'tcps_delack': 0, 'tcps_sndtotal': 674727071, 'tcps_sndpack': 3600884, 'tcps_sndbyte': 1419757164, 'tcps_sndbyte_ok': 896620116, 'tcps_sndctrl': 11718396, 'tcps_sndacks': 659407777, 'tcps_rcvtotal': 0, 'tcps_rcvpack': 543733208, 'tcps_rcvbyte': 616831120860, 'tcps_rcvackpack': 3600884, 'tcps_rcvackbyte': 896620116, 'tcps_rcvackbyte_of': 0, 'tcps_preddat': 536531446, 'tcps_drops': 895, 'tcps_conndrops': 1872641, 'tcps_timeoutdrop': 0, 'tcps_rexmttimeo': 14, 'tcps_rexmttimeo_syn': 6016560, 'tcps_persisttimeo': 0, 'tcps_keeptimeo': 1872916, 'tcps_keepprobe': 275, 'tcps_keepdrops': 1872641, 'tcps_testdrops': 0, 'tcps_sndrexmitpack': 14, 'tcps_sndrexmitbyte': 3486, 'tcps_sndprobe': 0, 'tcps_sndurg': 0, 'tcps_sndwinup': 0, 'tcps_rcvbadsum': 0, 'tcps_rcvbadoff': 0, 'tcps_rcvshort': 0, 'tcps_rcvduppack': 115674569, 'tcps_rcvdupbyte': 3440846, 'tcps_rcvpartduppack': 0, 'tcps_rcvpartdupbyte': 0, 'tcps_rcvoopackdrop': 0, 'tcps_rcvoobytesdrop': 0, 'tcps_rcvoopack': 0, 'tcps_rcvoobyte': 0, 'tcps_rcvpackafterwin': 0, 'tcps_rcvbyteafterwin': 0, 'tcps_rcvafterclose': 0, 'tcps_rcvwinprobe': 0, 'tcps_rcvdupack': 3601184, 'tcps_rcvacktoomuch': 0, 'tcps_rcvwinupd': 0, 'tcps_pawsdrop': 0, 'tcps_predack': 0, 'tcps_persistdrop': 0, 'tcps_badsyn': 0, 'tcps_reasalloc': 0, 'tcps_reasfree': 0, 'tcps_nombuf': 0, 'UDP': 0, 'udps_accepts': 0, 'udps_connects': 0, 'udps_closed': 0, 'udps_sndbyte': 0, 'udps_sndpkt': 0, 'udps_rcvbyte': 0, 'udps_rcvpkt': 0, 'udps_keepdrops': 0, 'udps_nombuf': 0, 'udps_pkt_toobig': 0, 'Flow Table': 0, 'rss_redirect_rx': 0, 'rss_redirect_tx': 0, 'rss_redirect_drops': 0, 'err_cwf': 0, 'err_no_syn': 0, 'err_len_err': 0, 'err_fragments_ipv4_drop': 0, 'err_no_tcp_udp': 0, 'err_no_template': 0, 'err_no_memory': 0, 'err_dct': 5828, 'err_l3_cs': 0, 'err_l4_cs': 0, 'err_redirect_rx': 0, 'redirect_rx_ok': 0, 'err_rx_throttled': 198193, 'err_c_nf_throttled': 0, 'err_c_tuple_err': 0, 'err_s_nf_throttled': 0, 'err_flow_overflow': 0, 'defer_template': 0, 'err_defer_no_template': 0}

I am using python libraries and fetching this data onto different host than the T-Rex host.

Regards,
Hemant

Besart Dollma

unread,
Jun 27, 2022, 6:59:55 AM6/27/22
to TRex Traffic Generator
Hi Hermant,
There is a field called m_tx_cps too. Probably you fetched the stats after the traffic was stopped, so the value for m_tx_cps was 0.

Hemant Singh Kuwarbi

unread,
Jun 30, 2022, 9:01:50 AM6/30/22
to Besart Dollma, TRex Traffic Generator
Hello Besart, 

I have installed trex v2.87 because that's the only version which was supported with OL7.9 and Mellanox[ConnectX-6 Dx].
Is  m_tx_cps  is available in v2.87 as well ? 
The stats are taken when the traffic was running.

Regards,
Hemant

--
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/abc62436-8440-4760-8351-14373a213179n%40googlegroups.com.

Besart Dollma

unread,
Jun 30, 2022, 9:07:58 AM6/30/22
to TRex Traffic Generator
It should be.

Kuwarbi

unread,
Jun 30, 2022, 3:33:08 PM6/30/22
to TRex Traffic Generator
Hello Besi,

I am running a CPS test with
a. 4 T-Rex Clients - 4 T-Rex Servers
b. using 20k ports in each of the T-Rex profile
c. multiplier=4

The CPS should come around 320 Kcps.
20000 x 4 x 4 = 320 Kcps

How can I validate the CPS ?


I am getting the stats on manager host using python library.
stats = self.astf_server_info['trex_astf_client_obj'].get_traffic_stats(skip_zero=False,pid_input=self.astf_server_info['pid_list'][0])
print("stats=")

Regards,
Hemant

Besart Dollma

unread,
Jul 3, 2022, 2:44:59 AM7/3/22
to TRex Traffic Generator
If you open the console you will see there is an CPS field. Just follow the code on how the console collects this value from the server. It does so using JSON-RPC.

Hemant Singh Kuwarbi

unread,
Jul 20, 2022, 4:41:27 PM7/20/22
to Besart Dollma, TRex Traffic Generator
Hello Besi,

Thank you for the help. I was able to fetch the CPS from the client machine over SSH.

I have one more query. I looked for answers in many places but could not find one. I hope you will be able to help me on this.

Each client BM has mellanox 6 2 NIC(50 Gbps each)

I am only able to use just one NIC(If I try to use NIC 2), SSH goes off.

And I am able to achieve ~4 Million Active Connections from one client but the CPU goes upto 99% because I am able to use only 1 core.
When I tried to use multi-core. It asks for the multiple server IPs(as range) in the T-Rex profile in ASTF mode. But in my case there is only one VIP.


cli1 ------------_                                                 _--------------be1
cli2------------_<====> Load Balancer <====>_--------------be2  
cli3 ------------                     (VIP)                         --------------be3

Is there a way to improve the CPU, 
increase more connections,
use VLANs and virtual functions to improve on the scale or CPU,
or maybe use NIC0 partly as well ?

Regards,
Hemant


Kuwarbi

unread,
Jul 20, 2022, 4:42:06 PM7/20/22
to TRex Traffic Generator
Hello Besi,

Thank you for the help. I was able to fetch the CPS from the client machine over SSH. It was enough for me.

I have one more query. I looked for answers in many places but could not find one. I hope you will be able to help me on this.

Each client BM has Mellanox 6 2 NIC(50 Gbps each)

I am only able to use just one NIC(If I try to use NIC 2), SSH goes off.

And I am able to achieve ~4 Million Active Connections from one client but the CPU goes upto 99% because I am able to use only 1 core.
When I tried to use multi-core. It asks for the multiple server IPs(as range) in the T-Rex profile in ASTF mode. But in my case there is only one VIP.


cli1 ------------_                                                 _--------------be1
cli2------------_<====> Load Balancer <====>_--------------be2  
cli3 ------------                     (VIP)                         --------------be3

Is there a way to improve the CPU, 
increase more connections,
use VLANs and virtual functions to improve on the scale or CPU,
or maybe use NIC0 partly as well ?

Regards,
Hemant

Besart Dollma

unread,
Jul 21, 2022, 7:19:24 AM7/21/22
to TRex Traffic Generator
Hi,
I don't understand your topology. And no idea what SSH has to do with anything.
Please try and explain better.
Thanks, 


Kuwarbi

unread,
Jul 21, 2022, 3:05:11 PM7/21/22
to TRex Traffic Generator
Hello Besi,

I have 2 BMs. Each has 2 NICs : NIC0 and NIC1, 50Gbps each with Mellanox card.

Now let's say I have minimal topology : 1 client BM(running T-Rex client), 1 Load Balancer(single VIP) and 1 server BM(running T-Rex server responding to client traffic received from Load Balancer) 

client BM <-----> LoadBalancer <------> backend BM
                               1 VIP

Configuration wise, 
In Client BM and Server BM both, NIC1 is used by T-Rex. It is binding to that NIC.
(Of Course port numbering 0/1 is different in conf)
dp flows : 7000000

T-Rex Client(running on client BM) and T-Rex Server(running on server BM) each is running on a single core.
When I tried to run with multiple cores, option "-c 3". 
I get below error :  
Last profile _ command failed: Profile split to DP cores error: Pool:(0.0.0.2-0.0.0.2) has only 1 address. Number of IPs in each pool must exceed the number of Data path threads, which is 2.

In Client BM, it is asking to provide the range of IPs for servers to use multiple cores. 
But in my case there is only 1 VIP of the Load Balancer.

And with a single core I am able to achieve 3.8 Million active flows but the CPU usage is 99% because of running onto 1 core.
Is there a way to run in multiple cores when the DUT is a single VIP of Load Balancer ? 

Thanks.

Regards,
Hemant

Besart Dollma

unread,
Jul 24, 2022, 2:21:01 AM7/24/22
to TRex Traffic Generator
Hi Hemant, 
So what you are saying is that you are limited to one server IP only? Is the load balancer the device under test?
This reduces drastically the number of flows you can generate, and as such the CPU is high. 
Each flow is bound per CPU so in order to have multiple CPUs you need multiple flows.
Thanks,

Kuwarbi

unread,
Jul 24, 2022, 1:22:20 PM7/24/22
to TRex Traffic Generator
Hello Besi,

Yes you are right the server IP is limited to only one. Yes the load balancer is the device under test.

So one unique client IP and one unique server IP are considered a single flow. And we can assign a core to such flows only ??

Thanks.

Regards,
Hemant

Besart Dollma

unread,
Jul 28, 2022, 2:53:21 AM7/28/22
to TRex Traffic Generator
No, a 5 tuple is considered a unique flow. 
The flow table is kept per core. So having one flow limits to one core.
Thanks,

Kuwarbi

unread,
Jul 28, 2022, 3:15:40 AM7/28/22
to TRex Traffic Generator
Thank you for the confirmation and providing a valid reason.

Regards,
Hemant
Reply all
Reply to author
Forward
0 new messages