From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52980) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YroPT-00040t-JW for qemu-devel@nongnu.org; Mon, 11 May 2015 10:10:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YroPQ-0001el-7C for qemu-devel@nongnu.org; Mon, 11 May 2015 10:10:19 -0400 Received: from mail-wi0-x230.google.com ([2a00:1450:400c:c05::230]:32900) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YroPQ-0001ed-1I for qemu-devel@nongnu.org; Mon, 11 May 2015 10:10:16 -0400 Received: by wief7 with SMTP id f7so87234338wie.0 for ; Mon, 11 May 2015 07:10:15 -0700 (PDT) Date: Mon, 11 May 2015 15:10:10 +0100 From: Stefan Hajnoczi Message-ID: <20150511141010.GF16270@stefanha-thinkpad.redhat.com> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Zs/RYxT/hKAHzkfQ" Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] Networking Documentation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Borman Cc: qemu-devel@nongnu.org --Zs/RYxT/hKAHzkfQ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 07, 2015 at 10:47:15AM +0200, David Borman wrote: > I just want to introduce myseld. Iam David from Germany and hope i can ask > some development specific questions and this is the right place.What is my > best starting point getting familar with the networking code and is there > any useful, technicall documentation out there? >=20 > Iam espacially interrested in how QEMU handles/routes the incoming > networktraffic (from reaching physically the hosts ethernetc card, forwar= ded > into quemu networking and delegation to one of the running Guests OS > Instances. That is largely not done in the QEMU codebase. Many users rely on the -netdev tap option and use the host kernel's network stack for bridging or NAT. There is a userspace NAT solution (hack?) in QEMU which parses TCP/UDP packets and performs equivalent socket system calls. This is useful when running QEMU without permissions for the tun/tap device driver. But it's not how most users do networking on production VMs. Also, the vhost_net.ko driver on Linux bypasses QEMU and performs virtio-net rx/tx in the host kernel. So from that perspective, you may need to study the Linux source code and poke at a live host where libvirt has set up networking for VMs to understand how things work together. Stefan --Zs/RYxT/hKAHzkfQ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVULhCAAoJEJykq7OBq3PI3MkIAJbQaf92bcZZAZC4LknhdGip KTwk0VeXs02lP4kF8Cjbz/s3pZn1h/Hl2y+Rx+3dlwfYW1LT1z3vrIE+zA54Vgxr nxsX2++1cAFwxG/JXjG2/tzwAbJcUcaCmsG595aw2Vo1QlhU11FHmTUkkUbGK4eo rXrgKrbyBuxdRewjugAP27MxXkEP9du3w35O0Y1ZtViSRroVUS6rvIyHC8dJ4nix 7lkK3KE8cl7TNdmq0kZBl7wrtPB0fBrvehtfMU/F47YrHpe0bKkWqKPKj46tElEY ykAZzJuEjJiRG0dw+dKp7TYmgm9sYVhIt/rGZiifbeso4SejB+Mw1MFHawF/CYY= =z3E0 -----END PGP SIGNATURE----- --Zs/RYxT/hKAHzkfQ--