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? 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? 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? Thank you ~psr ----------------------- Pradeep Singh Member Technical Staff Server and Storage Group 51, Greams Road. HCL Technologies, Chennai DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
> -----Original Message----- > From: xen-devel-bounces@lists.xensource.com > [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of > Pradeep Singh, TLS-Chennai > Sent: 13 April 2007 09:33 > To: xen-devel@lists.xensource.com > 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]. -- 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@lists.xensource.com http://lists.xensource.com/xen-devel
RE: [Xen-devel] Xen Networking query -----Original Message----- From: Petersson, Mats [mailto:Mats.Petersson@amd.com] Sent: Fri 13-Apr-07 3:40 PM To: Pradeep Singh, TLS-Chennai; xen-devel@lists.xensource.com Subject: RE: [Xen-devel] Xen Networking query > -----Original Message----- > From: xen-devel-bounces@lists.xensource.com > [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of > Pradeep Singh, TLS-Chennai > Sent: 13 April 2007 09:33 > To: xen-devel@lists.xensource.com > 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 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? 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? Thank you ~psr -- Mats > > Thank you > > ~psr > > > ----------------------- > Pradeep Singh > Member Technical Staff > Server and Storage Group > 51, Greams Road. > HCL Technologies, Chennai > > > > DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
> -----Original Message----- > From: Pradeep Singh, TLS-Chennai [mailto:pradeep_s@hcl.in] > Sent: 13 April 2007 12:09 > To: Petersson, Mats; xen-devel@lists.xensource.com > Subject: RE: [Xen-devel] Xen Networking query > > > -----Original Message----- > From: Petersson, Mats [mailto:Mats.Petersson@amd.com] > Sent: Fri 13-Apr-07 3:40 PM > To: Pradeep Singh, TLS-Chennai; xen-devel@lists.xensource.com > Subject: RE: [Xen-devel] Xen Networking query > > > -----Original Message----- > > From: xen-devel-bounces@lists.xensource.com > > [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of > > Pradeep Singh, TLS-Chennai > > Sent: 13 April 2007 09:33 > > To: xen-devel@lists.xensource.com > > 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@lists.xensource.com http://lists.xensource.com/xen-devel
RE: [Xen-devel] Xen Networking query -----Original Message----- From: Petersson, Mats [mailto:Mats.Petersson@amd.com] Sent: Fri 13-Apr-07 5:00 PM To: Pradeep Singh, TLS-Chennai; xen-devel@lists.xensource.com Subject: RE: [Xen-devel] Xen Networking query > -----Original Message----- > From: Pradeep Singh, TLS-Chennai [mailto:pradeep_s@hcl.in] > Sent: 13 April 2007 12:09 > To: Petersson, Mats; xen-devel@lists.xensource.com > Subject: RE: [Xen-devel] Xen Networking query > > > -----Original Message----- > From: Petersson, Mats [mailto:Mats.Petersson@amd.com] > Sent: Fri 13-Apr-07 3:40 PM > To: Pradeep Singh, TLS-Chennai; xen-devel@lists.xensource.com > Subject: RE: [Xen-devel] Xen Networking query > > > -----Original Message----- > > From: xen-devel-bounces@lists.xensource.com > > [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of > > Pradeep Singh, TLS-Chennai > > Sent: 13 April 2007 09:33 > > To: xen-devel@lists.xensource.com > > 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 ping 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. Thank you, that was useful. ~psr -- Mats > > Thank you > > ~psr > -- > Mats > > > > Thank you > > > > ~psr > > > > > > ----------------------- > > Pradeep Singh > > Member Technical Staff > > Server and Storage Group > > 51, Greams Road. > > HCL Technologies, Chennai > > > > > > > > > > > > > > DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel