Estou usando o Xen 4.0.1 com o Linux 2.6.32-5-xen-amd64 (pacotes padrão em um sistema Debian Squeeze).
Em Rede de Xen :
For each new domU, Xen creates a new pair of "connected virtual ethernet
interfaces", with one end in domU and the other in dom0. For linux domU's,
the device name it sees is named eth0. The other end of that virtual
ethernet interface pair exists within dom0 as interface vif<id#>.0
Think of them as two ethernet interfaces connected by an internal crossover
ethernet cable.
Meu entendimento dessa coisa crossover interna é que as estatísticas de rede devem ser as mesmas, não importa se você as mede no dom0 ( vifN.N interface) ou no domU (interface eth0 ). Os valores de RX / TX devem ser os mesmos, apenas invertidos.
No entanto, estou obtendo valores ~ 20% maiores quando o tráfego é medido em dom0. Minha pergunta é porque os valores são (que) diferentes ?
Iniciando o domínio convidado:
root@dev1:/etc/xen# xm create node2050.cfg
Using config file "./node2050.cfg".
Started domain node2050 (id=35)
root@dev1:/etc/xen# xm list node2050
Name ID Mem VCPUs State Time(s)
node2050 35 256 1 -b---- 2.5
root@dev1:/etc/xen# ip address show vif35.0
70: vif35.0: <BROADCAST,MULTICAST,PROMISC,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 32
link/ether fe:ff:ff:ff:ff:ff brd ff:ff:ff:ff:ff:ff
inet6 fe80::fcff:ffff:feff:ffff/64 scope link
valid_lft forever preferred_lft forever
No domU:
node2050:~# ip address show eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:16:3e:44:2e:5a brd ff:ff:ff:ff:ff:ff
inet xx.yy.zz.50/24 brd xx.yy.zz.255 scope global eth0
inet6 fe80::216:3eff:fe44:2e5a/64 scope link
valid_lft forever preferred_lft forever
Logo depois de iniciar o node2050
:
em dom0.
root@dev1:~# while true; do date; cat /sys/class/net/vif35.0/statistics/{r,t}x_bytes; sleep 1; done
...
Thu Jan 19 13:18:00 EST 2012
4826
466049
Thu Jan 19 13:18:01 EST 2012
4826
466580
Thu Jan 19 13:18:02 EST 2012
4826
467427
Thu Jan 19 13:18:03 EST 2012
4826
467910
Thu Jan 19 13:18:04 EST 2012
4826
468769
Thu Jan 19 13:18:05 EST 2012
4826
469764
no domU:
root@node2050:~# while true; do date; cat /sys/class/net/eth0/statistics/{r,t}x_bytes; sleep 1; done
...
Thu Jan 19 13:18:00 EST 2012
395229
5792
Thu Jan 19 13:18:01 EST 2012
395961
5792
Thu Jan 19 13:18:02 EST 2012
396617
5792
Thu Jan 19 13:18:03 EST 2012
397304
5792
Thu Jan 19 13:18:04 EST 2012
397735
5792
Thu Jan 19 13:18:05 EST 2012
398620
5792
A configuração:
root@dev1:/etc/xen# cat node2050.cfg
kernel = '/boot/vmlinuz-2.6.32-5-xen-amd64'
ramdisk = '/boot/initrd.img-2.6.32-5-xen-amd64'
vcpus = '1'
memory = '256'
root = '/dev/xvda2 ro'
disk = [
'phy:/dev/vg0/node2050-disk,xvda2,w',
'phy:/dev/vg0/node2050-swap,xvda1,w',
]
name = 'node2050'
vif = [ 'ip=xx.yy.zz.50,mac=00:16:3E:44:2E:5A' ]
on_poweroff = 'destroy'
on_reboot = 'restart'
on_crash = 'restart'
extra = 'console=hvc0 xencons=hvc0'