Rate This Document
Findability
Accuracy
Completeness
Readability

Configuring the VM Environment

Operations for configuring the VM environment on host 1 and host 2 are similar. Perform the following steps on all VMs. Exceptions will be specified.

  1. Modify the VM configuration file.

    For details, see step "Start the VM" in Running and Verifying XPF in the OVS Flow Table Normalization Feature Guide.

  2. Configure the network.
    Run the following command on both host 1 and host 2:
    1
    sh topology_all.sh setvxlan
    
  3. Verify the networking.
    1
    ovs-vsctl show
    

    If no error is reported, the networking is successful.

  4. Assign an IP address to a VM.
    1
    ifconfig eth0 <VM IP address> up
    

    Example environment configuration:

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    Host 1:
    VM1 192.168.1.11/24
    VM2 192.168.1.12/24
    VM3 192.168.1.13/24
    VM4 192.168.1.14/24
    VM5 192.168.1.15/24
    VM6 192.168.1.16/24
    VM7 192.168.1.17/24
    VM8 192.168.1.18/24
    Host 2:
    VM1 192.168.1.21/24
    VM2 192.168.1.22/24
    VM3 192.168.1.23/24
    VM4 192.168.1.24/24
    VM5 192.168.1.25/24
    VM6 192.168.1.26/24
    VM7 192.168.1.27/24
    VM8 192.168.1.28/24
    

    In the VXLAN networking, the default MTU of the host and VM is 1500. If a VM service data packet exceeds 1450 bytes, it exceeds 1500 bytes after being forwarded by OVS and added with the VXLAN header. The data packet is sent through a physical NIC (OVS+DPDK) which does not fragment the data packet. Thus VM service traffic cannot be forwarded. This is a known issue of the open source solution. Currently, you can set the MTU of the VM to a value less than 1450. In the example environment, the MTU of all VMs is set to 1450.

    1
    ifconfig eth0 mtu 1450
    
  5. Disable the VM firewall and SELinux.
    1
    2
    systemctl stop firewalld.service && systemctl disable firewalld.service
    setenforce 0
    

    This operation temporarily disables SELinux. To permanently disable the SELinux, edit the /etc/selinux/config configuration file and set SELINUX=disabled.

  6. Enable communication between the hosts and a VM.
    1. On the host, configure an IP address that is in the same network segment as the VM for the br-int bridge of the OVS.
      1
      ifconfig br-int 192.168.1.254/24 up
      
      Verify the communication.
      1
      ping <IP address of any VM>
      

      After confirming that the communication is normal, use tools such as FTP and SCP to transfer resources to the VM over the network.

  7. Install the test tool on a VM.
    1. Download vnStat-2.6 and Netperf-2.7.0 on the host.

      vnStat: https://github.com/vergoh/vnstat/archive/refs/tags/v2.6.zip

      Netperf: https://github.com/HewlettPackard/netperf/archive/refs/tags/netperf-2.7.0.zip

    2. Transfer vnStat of the host to the VM:
      1
      scp vnstat-2.6.zip root@192.168.3.2:/home
      

      Enter the password of the root user of the VM to transfer vnStat to the /home directory of the VM.

    3. Use the same method to transfer Netperf to the VM.
    4. Decompress the vnStat and Netperf packages and perform compilation.
      1
      2
      3
      4
      5
      6
      cd /home
      unzip vnstat-2.6.zip && cd vnstat-2.6
      ./configure && make && make install
      cd /home
      unzip netperf-netperf-2.7.0.zip && cd netperf-netperf-2.7.0
      ./configure && make && make install
      

      Before the compilation, ensure that the VM has a built-in compiler.

  8. Prepare the VM test script.
    1. Prepare the VM script of host 2. All VMs use the same script. (In the example VM, the script is named run.sh.)
      1
      2
      3
      4
      5
      6
      7
      8
      9
      pkill netserver
      taskset -c  0 netserver -4 -p 21101
      taskset -c  1 netserver -4 -p 21102
      taskset -c  2 netserver -4 -p 21103
      taskset -c  3 netserver -4 -p 21104
      taskset -c  0 netserver -4 -p 25101
      taskset -c  1 netserver -4 -p 25102
      taskset -c  2 netserver -4 -p 25103
      taskset -c  3 netserver -4 -p 25104
      
    1. Prepare the VM script of host 1 for different scenarios.
      • Script for testing the software offloading packet rate (In the example environment, the script is named run_8VM.sh.)

        VM 1:

        1
        2
        3
        4
        5
        6
        7
        8
        9
        pkill netperf
        taskset -c 0 netperf -t UDP_STREAM -H 192.168.1.21  -p 21101 -l 10000 -- -m 18 &
        taskset -c 1 netperf -t UDP_STREAM -H 192.168.1.22  -p 21101 -l 10000 -- -m 18 &
        taskset -c 2 netperf -t UDP_STREAM -H 192.168.1.23  -p 21101 -l 10000 -- -m 18 &
        taskset -c 3 netperf -t UDP_STREAM -H 192.168.1.24  -p 21101 -l 10000 -- -m 18 &
        taskset -c 0 netperf -t UDP_STREAM -H 192.168.1.25  -p 21101 -l 10000 -- -m 18 &
        taskset -c 1 netperf -t UDP_STREAM -H 192.168.1.26  -p 21101 -l 10000 -- -m 18 &
        taskset -c 2 netperf -t UDP_STREAM -H 192.168.1.27  -p 21101 -l 10000 -- -m 18 &
        taskset -c 3 netperf -t UDP_STREAM -H 192.168.1.28  -p 21101 -l 10000 -- -m 18 &
        

        VM 2: The configuration is similar to that of VM 1. Simply change ports in the script to 21102.

        VM 3: Simply change ports in the script to 21103.

        VM 4: Simply change ports in the script to 21104.

        VM 5: Simply change ports in the script to 25101.

        VM 6: Simply change ports in the script to 25102.

        VM 7: Simply change ports in the script to 25103.

        VM 8: Simply change ports in the script to 25104.

        • taskset -c 0 indicates CPU affinity.
        • -t UDP_STREAM indicates that UDP is used to send streams.
        • -H 192.168.1.21 specifies the peer IP address.
        • -p 21101 specifies the port.
        • -l 10000 specifies the duration in seconds.
        • -m 1 specifies the packet length in bytes. If the packet length is less than 64 bytes, 64 bytes are automatically filled in.
      • Script for testing the software offloading bandwidth. (In the example environment, the script is named bw_8VM.sh.)

        VM 1:

        1
        2
        3
        4
        5
        6
        7
        8
        9
        pkill netperf
        taskset -c 0 netperf -t TCP_STREAM -H 192.168.1.21  -p 21101 -l 10000 &
        taskset -c 1 netperf -t TCP_STREAM -H 192.168.1.22  -p 21101 -l 10000 &
        taskset -c 2 netperf -t TCP_STREAM -H 192.168.1.23  -p 21101 -l 10000 &
        taskset -c 3 netperf -t TCP_STREAM -H 192.168.1.24  -p 21101 -l 10000 &
        taskset -c 0 netperf -t TCP_STREAM -H 192.168.1.25  -p 21101 -l 10000 &
        taskset -c 1 netperf -t TCP_STREAM -H 192.168.1.26  -p 21101 -l 10000 &
        taskset -c 2 netperf -t TCP_STREAM -H 192.168.1.27  -p 21101 -l 10000 &
        taskset -c 3 netperf -t TCP_STREAM -H 192.168.1.28  -p 21101 -l 10000 &
        

        VM 2: The configuration is similar to that of VM 1. Simply change ports in the script to 21102.

        VM 3: Simply change ports in the script to 21103.

        VM 4: Simply change ports in the script to 21104.

        VM 5: Simply change ports in the script to 25101.

        VM 6: Simply change ports in the script to 25102.

        VM 7: Simply change ports in the script to 25103.

        VM 8: Simply change ports in the script to 25104.

      • Open-source packet rate test script (In the example environment, the script is named run_3_4VM.sh.)

        VM 1:

        1
        2
        3
        4
        5
        pkill netperf
        taskset -c  0 netperf -t UDP_STREAM -H 192.168.1.21 -p 21101 -l 10000 -- -m 1 &
        taskset -c  1 netperf -t UDP_STREAM -H 192.168.1.21 -p 21102 -l 10000 -- -m 1 &
        taskset -c  2 netperf -t UDP_STREAM -H 192.168.1.21 -p 25103 -l 10000 -- -m 1 &
        taskset -c  3 netperf -t UDP_STREAM -H 192.168.1.21 -p 25104 -l 10000 -- -m 1 &
        

        VM 2: The configuration is similar to that of VM 1. Simply change the IP address to 192.168.1.22.

        VM 3: Simply change the IP address to 192.168.1.23.

        VM 4: Simply change the IP address to 192.168.1.24.

        VM 5: Simply change the IP address to 192.168.1.25.

        VM 6: Simply change the IP address to 192.168.1.26.

        VM 7: Simply change the IP address to 192.168.1.27.

        VM 8: Simply change the IP address to 192.168.1.28.

      • Open-source bandwidth test script (In the example environment, the script is named bw_3_4VM.sh.)

        VM 1:

        1
        2
        3
        4
        5
        pkill netperf
        taskset -c  0 netperf -t TCP_STREAM -H 192.168.1.21 -p 21101 -l 10000 &
        taskset -c  1 netperf -t TCP_STREAM -H 192.168.1.21 -p 21102 -l 10000 &
        taskset -c  2 netperf -t TCP_STREAM -H 192.168.1.21 -p 25103 -l 10000 &
        taskset -c  3 netperf -t TCP_STREAM -H 192.168.1.21 -p 25104 -l 10000 &
        

        VM 2: The configuration is similar to that of VM 1. Simply change the IP address to 192.168.1.22.

        VM 3: Simply change the IP address to 192.168.1.23.

        VM 4: Simply change the IP address to 192.168.1.24.

        VM 5: Simply change the IP address to 192.168.1.25.

        VM 6: Simply change the IP address to 192.168.1.26.

        VM 7: Simply change the IP address to 192.168.1.27.

        VM 8: Simply change the IP address to 192.168.1.28.