virtio vs e1000 vs rtl8139: what's the difference?

13,968

In the context of setting up a virtual machine, e1000 emulates an Intel NIC, rtl8139 emulates a Realtek NIC, and virtio is a para-virtualized driver, i.e. it "knows" it's operating in a VM and basically just passes the network traffic between the VM and the host in the most straightforward way possible.

If you are running a legacy operating system within the VM, you may need to choose the virtual NIC according to what NICs are supported in the legacy OS. Intel e1000 has drivers available for even pretty old & obscure OSs. But the hardware of the physical e1000 NIC is pretty complex, so there will be some overhead because of the need to emulate it.

Realtek 8139 apparently is pretty simple, hardware-wise, so it may be comparatively easier to emulate in a VM than Intel e1000. But on the other hand, the simplicity also means the operating system inside the VM may need to do some extra work to satisfy the conditions of the NIC emulation when the actual host NIC could do some of it in hardware.

But if whatever you're running inside the VM supports virtio, it is likely to give you the best performance (aside from host NIC hardware designed for VFIO passthrough/SR-IOV), since it allows the VM to simply skip most of the steps related to emulating the virtual NIC and controlling the virtual hardware, and the host to utilize the hardware features of the actual physical NIC for maximum benefit to the VMs' traffic.

Share:
13,968
Arseni Mourzenko
Author by

Arseni Mourzenko

Developer, architect, project manager, tester, and active DevOps supporter, I'm studying, observing and advising companies which have an important risk to fail their IT-related projects. I specialize in quality and productivity. After six years of freelancing, I worked for several companies, including Tata Con­sul­tan­cy Ser­vices. Today, I'm a happy member of Finaxys. I most­ly work with Lin­ux, Python, and Node.js, as well as the Mi­crosoft stack. Outside information technology, I'm interested by photography. I'm mostly active on SE.SE, and also maintain my blog. If you want to contact me, my email is [email protected]. Feel free to drop me a note about any de­vel­op­ment-re­lat­ed dis­cus­sions. If you live in Paris or want to vis­it Paris, you're very wel­come to con­tact me too.

Updated on September 18, 2022

Comments

  • Arseni Mourzenko
    Arseni Mourzenko over 1 year

    When creating a virtual machine on Ubuntu, I have a choice between three device models for the virtual network interface: virtio, e1000 and rtl8139.

    What is the difference between the three? In other words, what should I consider when choosing the device model?

    Googling “virtio vs e1000 vs rtl8139” didn't help much. The first two pages of results are filled with official documentation, which doesn't say much, and the blog posts which boil down to “use option N, because I tried it and it's great.” The only helpful resource I found is a discussion which seems to indicate that e1000 is slow but has the most compatibility compared to virtio. The discussion seems to imply that e1000 was at some point preferred to rtl8139, but doesn't tell why.

  • Rui F Ribeiro
    Rui F Ribeiro almost 4 years
    Great answer, would not put it better. A few years ago, in some of our tests, using e1000 or a paravirtualized interface, was the difference between getting 50Kbps or 50Mbps. (that was a testing rig on quite old hw) Cannot recall the exact values, but the difference even in gigabit hw was like two orders of magnitude.
  • Admin
    Admin almost 2 years
    Today, in my experience, E1000 vs VirtIO is a difference of 500Mbps to 900Mbps