VDE and UML switch

KVM with uml_switch

  $ more start-umlsw-1
#! /bin/bash
sudo chmod 666 /dev/net/tun
sudo tunctl -u jssu -t umlsw-1
sudo ifconfig umlsw-1 192.168.0.9 netmask 255.255.255.255 up
sudo iptables --table nat -A POSTROUTING --out-interface eth0 -s 192.168.0.0/24 -j MASQUERADE
sudo iptables -A FORWARD --in-interface umlsw-1 -j ACCEPT
sudo sysctl net.ipv4.ip_forward=1
sudo sysctl net.ipv4.conf.umlsw-1.proxy_arp=1
sudo arp -Ds 192.168.0.79 eth0 pub
sudo route add -host 192.168.0.79 dev umlsw-1
echo "Starting VM: umlsw-1..., mem=512M"
######################################################
# kvm -net vde,vlan=0,sock=/src3/KVM/network-umlsw-1 \
#     -net nic,vlan=0,macaddr=1c:6f:65:e4:b0:c0 \
#     -m 512M \
#     -hda ../img/Debian-Mini.img &
######################################################
kvm -net tap,vlan=0,ifname=umlsw-1,script=no \
    -net nic,vlan=0,macaddr=1c:6f:65:e4:b0:c0 \
    -m 512M \
    -hda ../img/Debian-Mini.img &
  

KVMs use the same vde_switch

#! /bin/bash
# Don't Edit, File automatically generated by Config-KVM script
if [ $EUID -ne 0 ]
   then sudo echo "Super User passwd, please:"
        if [ $? -ne 0 ]
          then  echo "Sorry, need su privilege!"
                exit 1
        fi
fi
sudo chmod 666 /dev/net/tun
sudo tunctl -u jssu -t tapVDEsw-1
sudo tunctl -u jssu -t tapVDEsw-2
sudo ifconfig tapVDEsw-1 192.168.0.9 netmask 255.255.255.255 up
sudo ifconfig tapVDEsw-2 192.168.0.9 netmask 255.255.255.255 up
sudo arp -Ds 192.168.0.79 eth0 pub
sudo arp -Ds 192.168.0.80 eth0 pub
sudo route add -host 192.168.0.79 dev tapVDEsw-1
sudo route add -host 192.168.0.80 dev tapVDEsw-2
##
sudo iptables --table nat -A POSTROUTING --out-interface eth0 -j MASQUERADE
sudo iptables -A FORWARD --in-interface tapVDEsw-1 -j ACCEPT
sudo iptables -A FORWARD --in-interface tapVDEsw-2 -j ACCEPT
sudo sysctl net.ipv4.ip_forward=1
sudo sysctl net.ipv4.conf.tapVDEsw-1.proxy_arp=1
sudo sysctl net.ipv4.conf.tapVDEsw-2.proxy_arp=1
echo "Starting vde_switch..."
vde_switch -tap tapVDEsw-1,tapVDEsw-2 -mod 644 \
           -sock=/src3/KVM/network-VDEsw-1 \
           -mgmt /src3/KVM/network-VDEsw-1/vde_switch.mgmt -daemon /dev/null
echo "Starting VM: VDEsw-1..., mem=512M"
######################################################################
# kvm -m 512M -hda ../img/Debian-Mini-vde.img \
#     -monitor unix:/src3/KVM/network-VDEsw-1/MonSock,server,nowait \
#     -net vde,vlan=0,sock=/src3/KVM/network-VDEsw-1 \
#     -net nic,vlan=0,macaddr=6c:f0:49:a0:91:5b &
######################################################################
kvm -m 512M -hda ../img/Debian-Mini-vde.img \
    -monitor unix:/src3/KVM/network-VDEsw-1/MonSock,server,nowait \
    -net tap,vlan=0,ifname=tapVDEsw-1,script=no \
    -net nic,vlan=0,macaddr=6c:f0:49:a0:91:5b &
echo "Starting VM: VDEsw-2..., mem=512M"
#######################################################################
# kvm -m 512M -hda ../img/Debian-Mini-vde-2.img \
#     -monitor unix:/src3/KVM/network-VDEsw-1/MonSock-2,server,nowait \
#     -net vde,vlan=0,sock=/src3/KVM/network-VDEsw-1 \
#     -net nic,vlan=0,macaddr=6c:f0:49:09:ec:e1  &
#######################################################################
kvm -m 512M -hda ../img/Debian-Mini-vde-2.img \
    -monitor unix:/src3/KVM/network-VDEsw-1/MonSock-2,server,nowait \
    -net tap,vlan=0,ifname=tapVDEsw-2,script=no \
    -net nic,vlan=0,macaddr=6c:f0:49:09:ec:e1 &

UMLs use the same vde_switch

  $ more start-lan
#! /bin/bash
# Do NOT edit this file, it is automatically generated by ./Config-UML-Rfs!
#############################################################
IsThereTapDevice()
  {
   declare int i=0;
   for devices in `find /sys/class/net -type l -name "tap*"`
     do
       ((i++));
     done
   if [ ${i} -gt 0 ]
     then echo "Yes"
   else echo "No"
   fi
  }
#############################################################
sudo echo Need SU passwd: 
sudo chmod 666 /dev/net/tun
sudo tunctl -u jssu -t tap0
sudo tunctl -u jssu -t tap1
sudo ifconfig tap0 192.168.0.9 netmask 255.255.255.255 up
sudo ifconfig tap1 192.168.0.9 netmask 255.255.255.255 up
if [ `IsThereTapDevice` = "No" ]
   then sudo iptables --flush
        sudo iptables --table nat --flush
        sudo iptables --delete-chain
        sudo iptables --table nat --delete-chain
        sudo iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE
fi 
sudo iptables --append FORWARD --in-interface tap0 -j ACCEPT
sudo iptables --append FORWARD --in-interface tap1 -j ACCEPT
sudo chmod 666 /dev/net/tun # The first time, we get 660 on /dev/net/tun
sudo sysctl net.ipv4.ip_forward=1
sudo sysctl net.ipv4.conf.tap0.proxy_arp=1
sudo sysctl net.ipv4.conf.tap1.proxy_arp=1
sudo arp -Ds 192.168.0.100 eth0 pub
sudo arp -Ds 192.168.0.101 eth0 pub
sudo route add -host 192.168.0.100 dev tap0
sudo route add -host 192.168.0.101 dev tap1
vde_switch -tap tap0,tap1 -mod 644 -sock=/src3/UML/network-26864 \
-mgmt /src3/UML/network-26864/vde_switch.mgmt -daemon < /dev/null >/dev/null
  $ more startUML-0-1
#! /bin/bash
linux.uml ubd0=DebSqz-UltraLight.ext3 \
          eth0=vde,/src3/UML/network-26864 mem=512M \
          con=pty con0=fd:0,fd:1 umid=VDE-1
  $ more startUML-0-2
#! /bin/bash
linux.uml ubd0=DebSqz-UltraLight2.ext3 \
          eth0=vde,/src3/UML/network-26864 mem=512M \
          con=pty con0=fd:0,fd:1 umid=VDE-2

UML iperf with VDE switch

Errors during booting:
overflow in relocation type 11 val 81c64760
`x_tables' likely not compiled with -mcmodel=kernel
overflow in relocation type 11 val 81c76760
`x_tables' likely not compiled with -mcmodel=kernel
Errors during iperf benchmark:
uml_net_start_xmit: failed(-1)
uml_net_start_xmit: failed(-1)
uml_net_start_xmit: failed(-1)
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-61.5 sec  4.78 GBytes    667 Mbits/sec

UML iperf with UML switch

 $ iperf -c 192.168.0.9 -i 10 -t 60
------------------------------------------------------------
Client connecting to 192.168.0.9, TCP port 5001
TCP window size: 44.9 KByte (default)
------------------------------------------------------------
[  3] local 192.168.0.101 port 40287 connected with 192.168.0.9 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec    776 MBytes    651 Mbits/sec
[  3] 10.0-20.0 sec    763 MBytes    640 Mbits/sec
[  3] 20.0-30.0 sec    778 MBytes    653 Mbits/sec
[  3] 30.0-40.0 sec    747 MBytes    627 Mbits/sec
[  3] 40.0-50.0 sec    732 MBytes    614 Mbits/sec
[  3] 50.0-60.0 sec    827 MBytes    694 Mbits/sec
[  3]  0.0-60.1 sec  4.52 GBytes    646 Mbits/sec

KVM with Open vSwitch

One VM to Host

TypeBandwidth
  KVM with uml_switch    158 Mbits/sec  
  KVM with VDE switch    125 Mbits/sec  
  KVM with Open vSwitch    none  
  UML with uml_switch    638 Mbits/sec  
  UML with VDE switch    480 Mbits/sec  
  UML with Open vSwitch     none   

VM to VM

  1. Single Switch
  2. TypeBandwidth
      Host lookback    12.3 Gbits/sec  
      KVM with uml_switch    160 Mbits/sec  
      KVM with VDE switch    165 Mbits/sec  
      KVM with Open vSwitch    222 Mbits/sec  
      UML with uml_switch    740 Mbits/sec  
      UML with VDE switch    141 Mbits/sec  
      UML with Open vSwitch     none   

  3. Mutiple Switches




  4. ChiSheng Su