-
Improvement
-
Resolution: Fixed
-
Major
-
None
-
None
-
Any using T-Rex traffic generator
Need to add multi-stream support to T-Rex.
Here is some data I've already come up with to support this.
For layer 2
Use the code below to calculate the end range such as if we are doing 1024 L2 Multistream
{{def change_mac(mac, offset):
return "{:012X}".format(int(mac, 16) + offset)
>>> change_mac('abcdef01aabb', 1024)
'ABCDEF01AEBB'
>>>
Then we can plug that into the pkt builder class with the vm param
}}
if self._params['traffic']['multistream'] and self._params['traffic']['stream_type'] == 'L2': |
vm = vm + [ |
STLVmFlowVar(name="mac_src",min_value=0,max_value=num_flows,size=4,op="inc"), |
STLVmWrFlowVar(fv_name="mac_src",pkt_offset=7) |
{{]
For L3 use the ipaddress module in python
>>> ipaddress.ip_address('192.168.0.1') + 1024
IPv4Address('192.168.4.1')
}}
if self._params['traffic']['multistream'] and self._params['traffic']['stream_type'] == 'L3': |
vm = vm + [ |
STLVmFlowVar(name="ip_src",min_value=ip_src['start'],max_value=ip_src['end'],size=4,op="inc"), |
STLVmWrFlowVar(fv_name="ip_src",pkt_offset= "IP.src") |
]