Network Traffic Generation

Network Traffic Generation

Oleg Goldshmidt pub at goldshmidt.org
Sat Mar 14 17:09:36 IST 2009


Shachar Shemesh <shachar at shemesh.biz> writes:

>      Unless VM0 sends an ARP inquiring about the destination IP,
>
> This ARP is sent to a physical NIC.

Actually, no. It is sent by the VM's virtual NIC (the VM does not know
anything else), and the "switch" in the hypervisor forwards it, among
other things, to the virtual NIC of the other VM, that has its own MAC
address, etc.

I suppose it may depend on the configuration - I am not performing any
experiments.

> Unless it is layer 3 aware, there is no reason for it to know that
> the ARP received through a physical Ethernet device originated in
> our machine.

But it isn't received on the physical interface - see above.

> Who gave the VM the right to assume that VM1 and VM0 are layer 2
> connected? If it does that, switch VM software - it's a bug.

The VM does not assume anything, nor does it know about the other VM,
for that matter. It needs to send a packet to an IP address that - in
your setup - is somewhere else. It sends an Ethernet frame out of its
virtual NIC (the only one it knows of), and as soon as this is done
the VM considers the frame to be out in the "network", even though it
may still be inside the physical box. The hypervisor, in turn,
contains a virtual switch, that has virtual ports virtually connected
to the VM's virtual NICs, and has the appropriate forwarding table
that says, "for DA 'X' forward to port N."

At least this is what happens in today's VMware. Again, possibly
modulo configurations that I am not checking. The motivation behind it
is exactly the above: not to send frames out to the physical network
if it can be avoided. There are heated discussions going on in the
IEEE standartization bodies in order to determine whether forcing the
frames out to real switches would be "better" overall, but that's
another topic.

Xen/KVM/others may be different (I have not checked lately if they
include virtual switches by default).

-- 
Oleg Goldshmidt | pub at goldshmidt.org



More information about the Linux-il mailing list