This is an old revision of the document!


Topology

Setup

Download the archive and unpack it

wget http:///session6.zip
unzip session6.zip

The archive contains the follosing files

  • ubuntu.img - the virtual machine's disk
  • prepare.sh - the script for setting up the virtual machine
  • iperf_client.sh - launches multiple streams using iperf
  • iperf_server.sh - listens on multiple sockets using iperf

Install the necessary packets

sudo ./prepare.sh prepare

Boot up the virtual machine

sudo ./prepare.sh start

Open SSH consoles to the virtual machine

ssh root@192.168.0.2

Bandwidth

netperf

Run a simple netperf test

netperf -H 192.168.0.2
  • What is the bandwidth of the virtual link?
  • How does netperf run? On the virtual machine, check the TCP listening ports
    netstat -tlpn

    Which options are available to the netperf users?

    netperf --help

    The user can choose from a series of tests. Which are them?

    man netperf

    Run a TCP stream test. Now, the virtual machine should be the sender and the host the receiver. Compare the CPU load of the sender and the receiver.

    netperf -H 192.168.0.2 -t TCP_MAERTS -cC

Speedtest.net

Measure bandwidth and delay on links towards California and Spain

http://speedtest.net

Latency

ping

Ping the following hosts

192.168.0.2
cs.curs.pub.ro
gnu.org

Compare the latencies and verify the number of hops along each way using traceroute.

netperf

Run a 2 seconds UDP request-response test and display the CPU usage for both the host and the virtual machine

netperf -H 192.168.0.2 -t UDP_RR -l 2 -cC

How many request-responses have been issued ?

DNS latency

Browse the Web for a few random pages. Do you find the response time acceptable? What does a browser do when you type a web page's address? Which DNS server are you using? Try resolving a random hostname. What is the query time?

dig ampathos.ro

Edit /etc/resolv.conf to use Google's DNS instead of your ISP's DNS. Add the following line at the top of the file.

nameserver 8.8.8.8

Try resolving ampathos.ro again. Is the query time better? Surf the web. Is the lag significant? Revert your nameserver changes.

UDP and TCP

What is the MTU of the br0 link?

ip link sh dev br0

UDP

Measure the UDP bandwidth using the default send size (MTU). Display the UDP statistics before and after running the test for the host interface.

netperf -H 192.168.0.2 -t UDP_STREAM -l 1 -cC

Repeat the test sending 64-byte packets.

netperf -H 192.168.0.2 -t UDP_STREAM -l 1 -cC -- -m 64

The throughput is obviously worse and the CPU load is higher. Why? How is the throughput and the CPU load if jumbograms (frames larger than the MTU) are sent on the link?

netperf -H 192.168.0.2 -t UDP_STREAM -l 1 -cC -- -m 1600

Alter the MTU of the interfaces on both the host

ifconfig br0 mtu 256

and the virtual guest

ifconfig eth0 mtu 256

Measure the UDP bandwidth and CPU load using the default MTU.

netperf -H 192.168.0.2 -t UDP_STREAM -l 1 -cC

Revert the changes

ifconfig br0 mtu 1500
ifconfig eth0 mtu 1500

TCP

Coalescing

Run a TCP_STREAM test with the default MTU and with a 64-bit send size.

netperf -H 192.168.0.2 -t TCP_STREAM -l 1 -cC
netperf -H 192.168.0.2 -t TCP_STREAM -l 1 -cC -- -m 64

Why does the bandwidth does not decrease?

Packets in flight

What is the maximum window size for TCP on the hosts?

sysctl -n net.core.wmem_max
cat /proc/sys/net/core/wmem_max

How the TCP window be overridden using iperf?

man iperf

On the VM, use iperf to listen on TCP port 8080. Use a meager 1K receive window. Display the statistics once per second.

iperf --server --port 8080 --interval 1 --window 1K

On guest, run a TCP connection to the port opened on the VM. The flow should last 10 seconds.

iperf --client 192.168.0.2 --port 8080 --time 10

Compare the bandwith to the previous TCP results.

Traffic control

On the VM, start iperf_server.sh. On the client, run iperf_client.sh

./iperf_server.sh
./iperf_client.sh
sesiuni/virtualization-networking/session6.1372210060.txt.gz · Last modified: 2013/06/26 04:27 by freescale