Deploying Cisco traffic generator in GNS3
July 21, 2016 9 Comments
Goal: Deploy TRex, a realistic Cisco traffic generator, to test devices in GNS3.
TRex traffic generator is a tool designed to benchmark platforms using realistic traffic.
One of the tools through which TRex can be learned and tested is a virtual machine instance, fully simulating TRex without the need for any additional hardware.…
The TRex Virtual Machine is based on Oracle’s Virtual Box freeware.
It is designed to enable TRex newbies to explore this tool without any special resources.
Download the virtual appliance ova file: http://trex-tgn.cisco.com/trex/T_Rex_162_VM_Fedora_21.ova
Open the image in VMWare (I am using VMWare workstation)
From GNS3 import the VMWare device:
Edit the VM template and make sure to select “Allow GNS3 to use any configured VMware adapter”
Insert the a device to test, DUT (Device Under Test), in our case it is a Cisco IOU router and build the following topology, in which TRex will play the role of the client and the server for the generated traffic.
Topology
Because TRex doesn’t implement ARP, we have to manually indicate the router MAC addresses of the directly connected interfaces.
You can set TRex to match the DUT MACs or DUT to match the default MAC configured on TRex. We opt for the first solution:
Note the router interface MAC addresses:
Login to TRex through the console:
- Username:
trex
- Password:
trex
and edit Trex configuration file
/etc/trex_cfg.yaml
and change the DUT MACs
Make sure the list of interfaces ids match the ones defined by dpdk_nic_bind.py
cd v1.62
sudo ./dpdk_nic_bind.py –status
We also need to set our router under test with the MAC addersses used by TRex for the traffic.
On the IOU router:
IOU1(config-if)#int e0/0
IOU1(config-if)#ip address 192.168.10.2 255.255.255.0
IOU1(config-if)#du fu
IOU1(config-if)#no sh
IOU1(config-if)#int e0/1
IOU1(config-if)#ip address 192.168.20.2 255.255.255.0
IOU1(config-if)#du fu
IOU1(config-if)#no shIOU1(config)#arp 192.168.10.1 0800.2723.21dc ARPA
IOU1(config)#arp 192.168.20.1 0800.2723.21dd ARPA
IOU1(config)#do sh arp
Protocol Address Age (min) Hardware Addr Type Interface
Internet 192.168.10.1 – 0800.2723.21dc ARPA
Internet 192.168.20.1 – 0800.2723.21dd ARPA
IOU1(config)#
e0/1 and e0/2 IP addresses are configured with 192.168.10.2 and 192.168.20.2. In fact it doesn’t matter for TRex because we have routes to forward traffic out the appropriate interfaces to reach TRex interfaces.
On the router set routes to the emulated client and servers:
ip route 16.0.0.0 255.0.0.0 192.168.10.1
ip route 48.0.0.0 255.0.0.0 192.168.20.1
For this lab we will generate IMIX traffic (64byte UDP packets profile) from emulated clients and servers using virtual IP range configurable in 16.0.0.[1-255] and 48.0.[0.1-255.255]
Back to TRex:
cap2/imix_64.yaml
So let’s configure our router to route traffic destined to previous ranges out the appropriate interfaces.
IOU router:
IOU1(config)#ip route 16.0.0.0 255.0.0.0 192.168.10.1
IOU1(config)#ip route 48.0.0.0 255.0.0.0 192.168.20.1
Start the emulation on Trex:
sudo ./t-rex-64 -f cap2/imix_64.yaml -d 60 -m 40000 -c 1
You can observe the generated traffic passing through the router with Wireshark
For more inf. please refer to
https://trex-tgn.cisco.com/trex/doc/trex_manual.html#_dns_basic_example
Hi,
Seems you have an error in /etc/trex_cfg.yaml
The MAC of router [0xAA,0xBB,0xCC,0x00,0x01,0x00] should be dest_mac.
Thanks,
Yaroslav.
Hi Yaroslav,
Indeed router MAC addresses are on dest_mac.
Corrected the corresponding image.
Appreciated!
Please share the TRex Machine Login and Password …
Thanks
Hi Dhruv, I added the note to the post:
Username: trex
Password: trex
Thanks for your contribution.
Thanks a lot, I figured it out..
Please ping me ur email I’d on : dhruv.varma1986@gmail.com just in case I need some help frm u regarding the same..
Pingback: Confluence: [ODC] Xian ODC
can we use any other router other than iou routers?
please reply fast.
thanks
Hi,
I tried to download the ova file from the link provided. But unfortunately the link is down and see the below error.
Gateway Timeout
Server error – server 173.36.109.208 is unreachable at this moment.
Please retry the request or contact your administrator.
Could you please let me the link where i can download Trex OVA file
thanks
Hi,
I also need to download a working voa, because for 4 months (not full time) I been trying to build from ground up, faced so many issues after issues
Hence looking for a fully working VM to test it
Please help