User Manual
TRex 42 / 113
Chapter 5
Advanced features
5.1 VLAN (dot1q) support
To add a VLAN tag to all traffic generated by TRex, add a “vlan” keyword in each port section in the platform config file, as
described in the YAML Configuration File [trex_config_yaml_config_file] section.
You can specify a different VLAN tag for each port, or use VLAN only on some ports.
One useful application of this can be in a lab setup where you have one TRex and many DUTs, and you want to test a different
DUT on each run, without changing cable connections. You can put each DUT on a VLAN of its own, and use different TRex
platform configuration files with different VLANs on each run.
5.2 Utilizing maximum port bandwidth in case of asymmetric traffic profile
Note
If you want simple VLAN support, this is probably not the feature to use. This feature is used for load balancing. To configure
VLAN support, see the “vlan” field in the YAML Configuration File [trex_config_yaml_config_file] section.
The VLAN Trunk TRex feature attempts to solve the router port bandwidth limitation when the traffic profile is asymmetric
(example: Asymmetric SFR profile).
This feature converts asymmetric traffic to symmetric, from the port perspective, using router sub-interfaces. This requires TRex
to send the traffic on two VLANs, as described below.
YAML format - This goes in the traffic YAML file.
vlan : { enable : 1 , vlan0 : 100 , vlan1 : 200 }
Example
- duration : 0.1
vlan : { enable : 1 , vlan0 : 100 , vlan1 : 200 }
v
1
v
1
Enable load balance feature: vlan0==100 , vlan1==200
For a full file example, see the TRex source in: scripts/cap2/ipv4_load_balance.yaml










