[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Xen-devel] Xen Networking query


  • To: "Pradeep Singh, TLS-Chennai" <pradeep_s@xxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx
  • From: "Petersson, Mats" <Mats.Petersson@xxxxxxx>
  • Date: Fri, 13 Apr 2007 13:30:34 +0200
  • Delivery-date: Fri, 13 Apr 2007 04:29:34 -0700
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>
  • Thread-index: Acd9pkuyqrtqhAsiRoebFPfmYj8hXgAB0OtgAANcOGsAAFZd8A==
  • Thread-topic: [Xen-devel] Xen Networking query

 

> -----Original Message-----
> From: Pradeep Singh, TLS-Chennai [mailto:pradeep_s@xxxxxx] 
> Sent: 13 April 2007 12:09
> To: Petersson, Mats; xen-devel@xxxxxxxxxxxxxxxxxxx
> Subject: RE: [Xen-devel] Xen Networking query
> 
> 
> -----Original Message-----
> From: Petersson, Mats [mailto:Mats.Petersson@xxxxxxx]
> Sent: Fri 13-Apr-07 3:40 PM
> To: Pradeep Singh, TLS-Chennai; xen-devel@xxxxxxxxxxxxxxxxxxx
> Subject: RE: [Xen-devel] Xen Networking query
> 
> > -----Original Message-----
> > From: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
> > [mailto:xen-devel-bounces@xxxxxxxxxxxxxxxxxxx] On Behalf Of
> > Pradeep Singh, TLS-Chennai
> > Sent: 13 April 2007 09:33
> > To: xen-devel@xxxxxxxxxxxxxxxxxxx
> > Subject: [Xen-devel] Xen Networking query
> >
> > Hi All,
> >
> > Assume ,I create a connection from remote host to a Xen
> > machine using sockets.
> >
> > AFAIK xen hypervisor doesnot have a network stack but uses
> > dom0's tcp/ip stack for networking.Right?
> 
> Correct, Dom0 has all the networking protocols, Xen's 
> Hypervisor doesn't
> even know what a network card is, nor has any idea of what happens on
> the network in general [of course, the Hypervisor receives 
> the interrupt
> from the hardware, but the interrupt is just forwarded to the guest
> owning the hardware, and xen doesn't actually know (or care) what the
> reason/purpose of the interrupt is].
> >
> > This mean, the very first time a conncetion is made the
> > packet is recieved by the NIC which is handled by the driver
> > and the TCP/IP stack in the dom0. Am i right?
> 
> This is a good question. From what I understand, and this page
> http://linux-net.osdl.org/index.php/Bridge agrees, the networking to
> forward packets from Dom0 to DomU is done at "ethernet 
> level", e.g. the
> TCP/IP stack (or any other protocol stack above Ethernet) is 
> not used in
> Dom0 to determine the destination or purpose of the DomU packet.
> 
> >
> > Subsequent data transfer to this connection(to the domU)
> > doesnot goes through dom0 TCP/IP stack but goes through the
> > domU's tcp/ip stack. Is my understanding of the Xen
> > networking correct?
> 
> All packets received by DomU goes through the DomU TCP/IP stack,
> regardless of whether it was necessary for Dom0 to parse them too, or
> not. [But if the above is correct, Dom0 doesn't even look at 
> the packet
> aside from the Ethernet address].
> 
> Thanks Mats.
> That was really helpful.
> 
> But then how does Xen hypervisor makes sure that first time 
> the data is recieved is for which DomU?

Because each DomU has a different Ethernet address (aka MAC address). 

> Because the IP the remote machine sees is that of the dom0 
> right? This means if i send data to the Xen server it is for 
> dom0 and not for the domU.Am i correct in my understanding?

Unless you are using something like NAT on Dom0, each guest will have
it's own individual IP address, which translates to a unique [1]
mac-address. 

The mac-address is the "hardware address", e.g. a network card in normal
operation will use the mac-address to distinguish between data for this
machine and for other machines, likewise for Ethernet switches that
limit the traffic to the outputs of the switch to match the machines on
the other side of the switch. [2] 

You can try this out yourself if you have another Linux/Unix machine: 
ping <your Dom0 machine>
ping <your DomU guest>

Then do "arp -a", which will list all "address resolotions", which is
the translation layer between IP address and MAC address. [Note that you
have to do this relatively quickly, or the arp-table will have
"forgotten" the addreses of your ping's]. You should see something like:
Dom0: 192.168.1.3: 00:0A:5E:xx:yy:zz
DomU: 192.168.1.5: 00:16:3E:aa:bb:cc

Of course, the IP and MAC addresses may be completely different (and you
will most likely see some other stuff as well, if your machine has been
accessing [or accessed by] some other machine at any point recently). 

Of course, it does get a tad more complicated if you start looking at
what happens with packets that leave your local network - this is where
gateways and routers get involved, and as far as I'm concerned, this is
way outside our realm here. If you want to understand this, I suggest
you Google for "How does Wide Area Network work" or some such. 

[1] Technically, all MAC addresses should be universally unique, and for
all network adapaters that are "real" this is the case, as each
manufacturer is given a range of MAC addresses to use, and each card
from a manufacturer has it's own unique address, but since Xen sets it's
own mac addresses on the virtual network adapter, it's not necessarily
unique in the world. It should, however, be unique within the local
network at least. [And you may need to ENSURE this by setting your own
MAC addreses in the configuration file]. 

[2] There are switches that work on IP address level, rather than MAC
address level. But that's outside our scope here. 
> 
> Or is it that Xen hypervisor just sends it to the dom0's 
> tcp/ip stack and then dom0's stack chooses the domU's who 
> should handle the packet? If so are there any parameters 
> governing this selective switching?

The HYPERVISOR has NOTHING to do with any networking (aside from said
forwarding of interrupts from the real hardware to relevant guest(s)). 

And as described above, Dom0 doesn't actually look at the packet at a
higher protocol level than the basic Ethernet protocol level, and
decides how to forward packets based on the MAC address given at that
level. 

--
Mats
> 
> Thank you
> 
> ~psr
> --
> Mats
> >
> > Thank you
> >
> > ~psr
> >
> >
> > -----------------------
> > Pradeep Singh
> > Member Technical Staff
> > Server and Storage Group
> > 51, Greams Road.
> > HCL Technologies, Chennai
> >
> >
> >
> >
> 
> 
> 
> 
> 
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.