Testing Trex on virtualbox with ubuntu

540 views
Skip to first unread message

Aleksandar Petkovski

unread,
Aug 19, 2016, 2:13:37 AM8/19/16
to TRex Traffic Generator
Hi,

Can someone please clarify the setup for a virtualbox environment with trex. I cannot get packets to loop back to trex receive port. Not sure how this will forward if I cannot populate ARP entries for at least the gateway, do I need to assign IP's on the Trex interfaces?

-Global stats enabled 

 Cpu Utilization : 2.4  %  0.1 Gb/core 

 Platform_factor : 1.0  

 Total-Tx        :     985.87 Kbps  

 Total-Rx        :       8.60 Kbps  

 Total-PPS       :       1.99 Kpps  

 Total-CPS       :       0.96  cps  


 Expected-PPS    :       2.00  pps  

 Expected-CPS    :       1.00  cps  

 Expected-BPS    :       1.30 Kbps  


 Active-flows    :        0  Clients :      511   Socket-util : 0.0000 %    

 Open-flows      :        8  Servers :      255   Socket :        8 Socket/Clients :  0.0 

 drop-rate       :     977.27 Kbps   

 current time    : 9.4 sec  

 test duration   : 90.6 sec  


-Latency stats enabled 

 Cpu Utilization : 0.7 %  

 if|   tx_ok , rx_ok  , rx check ,error,       latency (usec) ,    Jitter          max window 

   |         ,        ,          ,     ,   average   ,   max  ,    (usec)                     

 ---------------------------------------------------------------------------------------------------------------- 

 0 |     8178,       0,         0,    0,          0  ,       0,       0      |  0  0  0  0  0  0  0  0  0  0  0  0  0 

 1 |     8179,       0,         0,    0,          0  ,       0,       0      |  0  0  0  0  0  0  0  0  0  0  0  0  0



--------- I have the following setup ----------

1- Trex v2.07 running on fedora vm

[trex@localhost v2.07]$ sudo ./dpdk_setup_ports.py --show


Network devices using DPDK-compatible driver

============================================

0000:00:09.0 '82540EM Gigabit Ethernet Controller' drv=igb_uio unused=e1000

0000:00:0a.0 '82540EM Gigabit Ethernet Controller' drv=igb_uio unused=e1000


Network devices using kernel driver

===================================

0000:00:03.0 '82540EM Gigabit Ethernet Controller' if=enp0s3 drv=e1000 unused=igb_uio *Active*

0000:00:08.0 '82540EM Gigabit Ethernet Controller' if=enp0s8 drv=e1000 unused=igb_uio 


Other network devices

=====================


[trex@localhost etc]$ more trex_cfg.yaml 

- port_limit    : 2         

  version       : 2

  interfaces    : ["00:09.0","00:0a.0"]   # list of the interfaces to bind run ./dpdk_nic_bind.py --status 

  port_info       :  # set eh mac addr 

          - dest_mac        :   [0x08,0x00,0x27,0x81,0x6d,0xe0]  # port 0

            src_mac         :   [0x08,0x00,0x27,0x8e,0xfc,0x42]

          - dest_mac        :   [0x08,0x00,0x27,0x81,0xf6,0x63]  # port 1

            src_mac         :   [0x08,0x00,0x27,0x23,0x21,0xdc]


2 - Ubuntu VM (as router)


enp0s8    Link encap:Ethernet  HWaddr 08:00:27:81:6d:e0  

          inet addr:16.0.0.100  Bcast:16.255.255.255  Mask:255.0.0.0

          inet6 addr: fe80::a00:27ff:fe81:6de0/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:194601 errors:0 dropped:0 overruns:0 frame:0

          TX packets:1641 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:12168754 (12.1 MB)  TX bytes:98628 (98.6 KB)


enp0s9    Link encap:Ethernet  HWaddr 08:00:27:81:f6:63  

          inet addr:48.0.0.100  Bcast:48.255.255.255  Mask:255.0.0.0

          inet6 addr: fe80::a00:27ff:fe81:f663/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:197601 errors:0 dropped:0 overruns:0 frame:0

          TX packets:3045 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:27870734 (27.8 MB)  TX bytes:182868 (182.8 KB)


root@ubuntu:/etc/network# route

Kernel IP routing table

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

default         10.0.2.2        0.0.0.0         UG    0      0        0 enp0s3

10.0.2.0        *               255.255.255.0   U     0      0        0 enp0s3

16.0.0.0        *               255.0.0.0       U     0      0        0 enp0s8

48.0.0.0        *               255.0.0.0       U     0      0        0 enp0s9



hanoh haim

unread,
Aug 19, 2016, 5:47:15 AM8/19/16
to Aleksandar Petkovski, TRex Traffic Generator
Hi,
You will need to add static arp in both direction for the TRex interfaces MAC (for next hope IP).
See the manual for ASR1k configuration guidelines.

We plan to solve this in the next releases.


Thanks,
Hanoh
--
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+unsubscribe@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/deb020d4-89d6-4570-b637-de3747689489%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Hanoh
Sent from my iPhone

Aleksandar Petkovski

unread,
Aug 21, 2016, 11:47:52 PM8/21/16
to TRex Traffic Generator, apet...@gmail.com
Thanks for the help and reply, following is the config which worked for me. Main thing was the static ARP and dummy IP's pointing to Trex interfaces:

VirtualBox Trex config

                   -----------| |-------------------|
          Trex client-MAC01---trex-intnet---MAC03-Ubuntu-enp0s8 |
  | |                         |                       |
          Trex Server-MAC02----intnet-------MAC04-Ubuntu-enp0s9 |
  | |                         |                       |
                   -----------| |-------------------|
MAC01: [0x08,0x00,0x27,0x8e,0xfc,0x42] IP: N/A
MAC02: [0x08,0x00,0x27,0x23,0x21,0xdc] IP: N/A

MAC03: [0x08,0x00,0x27,0x81,0x6d,0xe0] IP: 192.168.1.100 Int: enp0s8
MAC04: [0x08,0x00,0x27,0x81,0xf6,0x63] IP: 192.168.2.100 Int: enp0s9

Trex server
=============
+ Trex configuration is the same as the standard test config found at: https://trex-tgn.cisco.com/trex/doc/trex_vm_manual.html
+ Make sure the two interfaces you have for the internal VM network match the ones configured for Ubuntu server [trex_intnet / intnet]
+ Confirm the ARP entires on the Ubuntu server match the Trex VM
+ Confirm the MAC details of the Yaml test file OR the 

[trex@localhost etc]$ more trex_cfg.yaml 
- port_limit    : 2         
  version       : 2
  interfaces    : ["00:09.0","00:0a.0"]   # list of the interfaces to bind run ./dpdk_nic_bind.py --status 
  port_info       :  # set eh mac addr 
          - dest_mac        :   [0x08,0x00,0x27,0x81,0x6d,0xe0]  # port 0 <--Ubuntu MAC trex_intnet
            src_mac         :   [0x08,0x00,0x27,0x8e,0xfc,0x42]
          - dest_mac        :   [0x08,0x00,0x27,0x81,0xf6,0x63]  # port 1 <--Ubuntu MAC intnet
            src_mac         :   [0x08,0x00,0x27,0x23,0x21,0xdc]
[trex@localhost etc]$ 


[trex@localhost v2.07]$ sudo ./dpdk_setup_ports.py --show

Network devices using DPDK-compatible driver
============================================
0000:00:09.0 '82545EM Gigabit Ethernet Controller (Copper)' drv=igb_uio unused=e1000
0000:00:0a.0 '82545EM Gigabit Ethernet Controller (Copper)' drv=igb_uio unused=e1000

Network devices using kernel driver
===================================
0000:00:03.0 '82540EM Gigabit Ethernet Controller' if=enp0s3 drv=e1000 unused=igb_uio *Active*
0000:00:08.0 '82540EM Gigabit Ethernet Controller' if=enp0s8 drv=e1000 unused=igb_uio 

Other network devices
=====================
<none>


Ubuntu Server
===============
+ Add two interfaces to the VirtualBox VM, each with adapter type of 'server'
+ Place each one in a separate VLAN [trex_intnet / intnet]
+ Configure the interfaces with an IP on separate subnets
+ Add the static routes for relevant pcap tests being run from Trex [eg; 16.0.0.0 and 48.0.0.0]. Route to dummy IP towards Trex
+ Add the static ARP entires for next hop per interface to the dummy IP 

Configure the interfaces with an IP on separate subnets
Add the static routes for relevant pcap tests being run from Trex [eg; 16.0.0.0 and 48.0.0.0]. Route to dummy IP towards Trex


source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto enp0s3
iface enp0s3 inet dhcp

auto enp0s8
iface enp0s8 inet static
address 192.168.1.100
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
up route add -net 16.0.0.0 netmask 255.0.0.0 gw 192.168.1.101

auto enp0s9
iface enp0s9 inet static
    address 192.168.2.100
    netmask 255.255.255.0
network 192.168.2.0
    broadcast 192.168.2.255
up route add -net 48.0.0.0 netmask 255.0.0.0 gw 192.168.2.101

Add the static ARP entires for next hop per interface to the dummy IP 

sudo arp -i enp0s8 -s 192.168.1.101 08:00:27:8e:fc:42
sudo arp -i enp0s9 -s 192.168.2.101 08:00:27:23:21:dc

aleks@ubuntu:/etc/network$ arp
Address                  HWtype  HWaddress           Flags Mask            Iface
192.168.2.101            ether   08:00:27:23:21:dc   CM                    enp0s9
192.168.1.101            ether   08:00:27:8e:fc:42   CM                    enp0s8
10.0.2.2                 ether   52:54:00:12:35:02   C                     enp0s3

aleks@ubuntu:/etc/network$ route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         10.0.2.2        0.0.0.0         UG    0      0        0 enp0s3
10.0.2.0        *               255.255.255.0   U     0      0        0 enp0s3
16.0.0.0        192.168.1.101   255.0.0.0       UG    0      0        0 enp0s8
48.0.0.0        192.168.2.101   255.0.0.0       UG    0      0        0 enp0s9
192.168.1.0     *               255.255.255.0   U     0      0        0 enp0s8
192.168.2.0     *               255.255.255.0   U     0      0        0 enp0s9
Reply all
Reply to author
Forward
0 new messages