Stateless bidirectional traffic configuration

898 views
Skip to first unread message

aparn...@gmail.com

unread,
Jun 21, 2016, 2:54:28 PM6/21/16
to TRex Traffic Generator
Hi,

I'm trying to pass bidirectional traffic through the DUT, and I'm trying to do this using the imix.py stateless profile. I see that direction by default has been set to 0. How do I change the direction to 1?

I also tried running it on stl-sim and dumping the output to a PCAP file, and I only see packets in one direction and not in the other direction. I wanted to know how the direction can be manipulated dynamically.

Thanks and Regards,
Aparna

Itay Marom

unread,
Jun 21, 2016, 4:24:05 PM6/21/16
to aparn...@gmail.com, TRex Traffic Generator
Hi Aparna,

'Direction' is a tunable which has a special behaivor.

A tunable is a optional parameter that can be passed to a profile and the profile might
use it or ignore it and 'direction' is no different.
All the profiles support any tunable that can be passed.

Let me divide the following cases:

from the Python API code:
simply provide the tunable to the profile load code:
STLProfile.load('imix.py', direction = 1)

from the console
when you load a profile from the console, 'direction' is taken either by providing it explicitly or the value
(port_id % 2)

so, if you do 'start -f stl/imix.py -p 0 -t direction=1' the direction will be 1 for port 0.

if you do 'start -f stl/imix.py -p 0 1' direction will be passed for port 0 as 1 and for port 1.

Thanks,
Itay


--
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/ba297c5d-85f6-40e1-acca-81b5b05b1f45%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Itay Marom

Itay Marom

unread,
Jun 21, 2016, 4:27:14 PM6/21/16
to aparn...@gmail.com, TRex Traffic Generator

Aparna Suri

unread,
Jun 21, 2016, 5:16:31 PM6/21/16
to Itay Marom, TRex Traffic Generator
Thanks a lot Itay. That was very useful information. I have a follow-up question : So it says that by default odd port numbers have direction '1' and even ports have direction '0'. So without using the tunable also I should be able to see bidirectional traffic right? Is there a way for me to verify / see the bidirectional traffic as output?

Regards,
Aparna


Itay Marom

unread,
Jun 21, 2016, 5:52:57 PM6/21/16
to Aparna Suri, TRex Traffic Generator
​​
Hi Aparna,

Well, the odd/even direction per port is true only for the console.
the reason is that using the Python API you can provide any direction you want explicitly:

STLProfile.load('imix.py', direction = 0) --> to port 0
STLProfile.load('imix.py', direction = 1) --> to port 1

so using the STLSim with the Python API is one way:
simply use STLSim to simulate both profiles.

If you want to test the console output:
'start -f stl/imix.py -p 0 1'
and verify it is bi-directional I suggest the following way ( a hack ):

Go to the profile and per direction also change the packet size:


# create imix streams
return [self.create_stream(x['size'] * 2 if direction == 1 else x['size'], x['pps'],x['isg'] , vm) for x in self.imix_table]

and check the stats on the TUI to see if on the other side you get *2 BW.

--
Itay Marom

Itay Marom

unread,
Jun 21, 2016, 6:22:30 PM6/21/16
to Aparna Suri, TRex Traffic Generator
Hi Aparna,

thinking of this again, actually, the easiest way is to simply use stl-sim script:
./stl-sim -p 0 1 -f stl/sim.py -o test.cap

this should generate the correct result:
bi-directional IMIX profile.

Thanks,
Itay

--
Itay Marom

Aparna Suri

unread,
Jun 23, 2016, 4:10:27 PM6/23/16
to Itay Marom, TRex Traffic Generator
Hello Itay,

Sorry for the late response. I really appreciate your help. I tried the stl-sim solution that you gave and it doesn't recognize the -p option for ports. It says -p is for BP_SIM_PATH. -i is listed as the option for Port ID. However, I tried the profile hack that you suggested and was able to verify the bidirectional functionality with that.

Thanks and Regards,
Aparna

You received this message because you are subscribed to a topic in the Google Groups "TRex Traffic Generator" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/trex-tgn/Piy9UXzh5Uc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to trex-tgn+u...@googlegroups.com.

To post to this group, send email to trex...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages