From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DqLrK-0001p3-DC for qemu-devel@nongnu.org; Wed, 06 Jul 2005 22:11:28 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DqLrC-0001lI-S1 for qemu-devel@nongnu.org; Wed, 06 Jul 2005 22:11:22 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DqLrB-0001hM-BQ for qemu-devel@nongnu.org; Wed, 06 Jul 2005 22:11:17 -0400 Received: from [128.8.10.163] (helo=po1.wam.umd.edu) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DqLtK-0007jJ-1E for qemu-devel@nongnu.org; Wed, 06 Jul 2005 22:13:30 -0400 Received: from jbrown.mylinuxbox.org (jma-box.student.umd.edu [129.2.237.180]) by po1.wam.umd.edu (8.12.10/8.12.10) with ESMTP id j6726sRu022642 for ; Wed, 6 Jul 2005 22:06:54 -0400 (EDT) Date: Wed, 6 Jul 2005 22:06:54 -0400 From: "Jim C. Brown" Subject: Re: [Qemu-devel] make qemu use tap0 instead of tun0 Message-ID: <20050707020654.GA15922@jbrown.mylinuxbox.org> References: <20050706230842.GA14066@jbrown.mylinuxbox.org> <20050707015530.GC20325@MAIL.13thfloor.at> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050707015530.GC20325@MAIL.13thfloor.at> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On Thu, Jul 07, 2005 at 03:55:30AM +0200, Herbert Poetzl wrote: > 1.1 What is the TUN ? > The TUN is Virtual Point-to-Point network device. > TUN driver was designed as low level kernel support for > IP tunneling. It provides to userland application > two interfaces: > - /dev/tunX - character device; > - tunX - virtual Point-to-Point interface. > > Userland application can write IP frame to /dev/tunX > and kernel will receive this frame from tunX interface. > In the same time every frame that kernel writes to tunX > interface can be read by userland application from /dev/tunX > device. > > 1.2 What is the TAP ? > The TAP is a Virtual Ethernet network device. > TAP driver was designed as low level kernel support for > Ethernet tunneling. It provides to userland application > two interfaces: > - /dev/tapX - character device; > - tapX - virtual Ethernet interface. > > Userland application can write Ethernet frame to /dev/tapX > and kernel will receive this frame from tapX interface. > In the same time every frame that kernel writes to tapX > interface can be read by userland application from /dev/tapX > device. > > (from http://vtun.sourceforge.net/tun/faq.html) > > best, > Herbert > I know this. Actually that page seems out of date, as Linux's tuntap now sends all accesses to /dev/net/tun regardless of the type of device (tun or tap). qemu have never used tun devices, it only uses tap devices. In other words, qemu has never read/write IP frames, it only deals with ethernet frames. This is why having qemu use tun0 as the device name is misleading - it makes developers believe that qemu is using a tun device (IP frames) even though it is really using a tap device (ethernet frames). The current NE2000 emulation (or any hardware nic emulation for that matter) would not work if qemu used an actual tun device.