summerofcode2015:ne2000emulationforbhyve

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
summerofcode2015:ne2000emulationforbhyve [2015/08/23 20:02] – AlexTeacasummerofcode2015:ne2000emulationforbhyve [2015/08/23 20:17] (current) – AlexTeaca
Line 43: Line 43:
  
 ===== Final Results ===== ===== Final Results =====
-I've implemented the NE2000 emulation in the bhyve hypervisor under both PCI and LPC attachements. The full implementation is located in: +I've implemented the NE2000 emulation in the bhyve hypervisor under both PCI and LPC attachments. The full implementation is located in: 
-/usr/src/usr.sbin/bhyve/ne2000.c, and emulates the ne2000 device for the ED driver in %%FreeBSD%%: /usr/src/sys/dev/ed/if_ed.c+///usr/src/usr.sbin/bhyve/ne2000.c//, and emulates the ne2000 device for the ED driver in %%FreeBSD%%: ///usr/src/sys/dev/ed/if_ed.c//
  
 In order to use the device in bhyve, you need to configure it in the parameters list as: In order to use the device in bhyve, you need to configure it in the parameters list as:
Line 54: Line 54:
  
 In the guest operating system you will see the network interfaces as: In the guest operating system you will see the network interfaces as:
 +
 +<code>
 ed0 at port 0x310-0x32f irq 10 on isa0 ed0 at port 0x310-0x32f irq 10 on isa0
 ed0: Ethernet address: 00:a0:98:4a:0e:ee ed0: Ethernet address: 00:a0:98:4a:0e:ee
Line 59: Line 61:
 ed1: Ethernet address: 00:a0:98:4a:0e:de ed1: Ethernet address: 00:a0:98:4a:0e:de
  
-ed0: flags=8802%%<%%BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500 +ed0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500 
-ether 00:a0:98:4a:0e:ee + ether 00:a0:98:4a:0e:ee 
-nd6 options=29%%<%%PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL> + nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL> 
-media: Ethernet 10baseT/UTP %%<%%full-duplex> + media: Ethernet 10baseT/UTP <full-duplex> 
-ed1: flags=8802%%<%%BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500 +ed1: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500 
-ether 00:a0:98:4a:0e:de + ether 00:a0:98:4a:0e:de 
-nd6 options=29%%<%%PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL> + nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL> 
-media: Ethernet 10baseT/UTP %%<%%full-duplex>+ media: Ethernet 10baseT/UTP <full-duplex>}}}
  
-Any ne2000 device attached under the PCI bus will be probed as the ed2, ed3 ... network interface.+Any ne2000 device attached under the PCI bus will be probed as the ed2, ed3 ... network interfaces.
  
-Note0: For the LPC attachements you need to add in the /boot/device.hints file from the guest operating system the following lines:+'''Note0:''' For the LPC attachments you need to add in the /boot/device.hints file from the guest operating system the following lines:{{{
 hint.ed.0.at="isa" hint.ed.0.at="isa"
 hint.ed.0.port="0x310" hint.ed.0.port="0x310"
Line 76: Line 78:
 hint.ed.1.at="isa" hint.ed.1.at="isa"
 hint.ed.1.port="0x330" hint.ed.1.port="0x330"
-hint.ed.1.irq="11"+hint.ed.1.irq="11"}}} 
 + 
 +== Test Plan == 
 +All these tests have passed successfully: 
 + * transmit/receive tcp/udp traffic on the ED interface 
 + * stop, start the ED interface during the traffic is running 
 + * transmit/receive multicast traffic 
 + * enable promiscuous mode with the tcpdump enabled, so all packets are accepted 
 + 
 +== Performance Tests == 
 +In order to measure the N2000 emulation performance I've used the iperf tool running as server and client in two virtual machine instances.{{{ 
 +guest1: ifconfig ed0 inet 192.168.0.1 
 +guest2: ifconfig ed1 inet 192.168.0.2}}} 
 + 
 +In order to make connectivity between them, I've attached their tap interfaces in a bridge. For example:{{{ 
 +ifconfig bridge create 
 +ifconfig bridge0 addm tap0 addm tap1 
 +ifconfig bridge0 inet 192.168.0.10}}} 
 + 
 +For the UDP traffic I've run these iperf commands:{{{ 
 +guest2: iperf -s -u 
 +guest1: iperf -c 192.168.0.2 -f Mbyte -u -b 7m 
 +------------------------------------------------------------ 
 +Client connecting to 192.168.0.2, UDP port 5001 
 +Sending 1470 byte datagrams 
 +UDP buffer size: 0.01 MByte (default) 
 +------------------------------------------------------------ 
 +[  3] local 192.168.0.1 port 54052 connected with 192.168.0.2 port 5001 
 +[ ID] Interval       Transfer     Bandwidth 
 +[  3]  0.0-10.0 sec  7.09 MBytes  0.71 MBytes/sec 
 +[  3] Sent 5057 datagrams 
 +[  3] Server Report: 
 +[  3]  0.0-10.0 sec  7.09 MBytes  0.71 MBytes/sec   2.649 ms    0/ 5056 (0%) 
 +[  3]  0.0-10.0 sec  1 datagrams received out-of-order}}} 
 + 
 +For the TCP traffic I've run these iperf commands:{{{ 
 +guest2: iperf -s 
 +guest1: iperf -c 192.168.0.2 -f Mbyte 
 +------------------------------------------------------------ 
 +Client connecting to 192.168.0.2, TCP port 5001 
 +TCP window size: 0.03 MByte (default) 
 +------------------------------------------------------------ 
 +[  3] local 192.168.0.1 port 31221 connected with 192.168.0.2 port 5001 
 +[ ID] Interval       Transfer     Bandwidth 
 +[  3]  0.0-10.0 sec  6.75 MBytes  0.67 MBytes/sec}}}
  
-===== Test Plan =====+'''Note1:''' The hardware N2000 devices are supposed to work at 10 Mbits/sec which means 1.25 MBytes/sec.
  
-(List of steps you plan to use to test your work, as discussed with your mentor)+== The Code ==
  
-===== The Code =====+ * https://socsvn.freebsd.org/socsvn/soc2015/iateaca/bhyve-ne2000-head/ 
 + * https://svnweb.freebsd.org/socsvn/soc2015/iateaca/bhyve-ne2000-head/
  
-  * https://socsvn.freebsd.org/socsvn/soc2015/iateaca/bhyve-ne2000-head/ +== Useful links ==
-  * https://svnweb.freebsd.org/socsvn/soc2015/iateaca/bhyve-ne2000-head/+
  
-===== Useful links =====+ * [0] http://www.osdever.net/documents/DP8390Details.pdf?the_id=46 
 + * [1] https://github.com/qemu/qemu/blob/master/hw/net/ne2000.c 
 + * [2] http://realtek.info/pdf/rtl8029as.pdf
  
-  * [0] http://www.osdever.net/documents/DP8390Details.pdf?the_id=46 +</code>
-  * [1] https://github.com/qemu/qemu/blob/master/hw/net/ne2000.c +
-  * [2] http://realtek.info/pdf/rtl8029as.pdf+
  
  • summerofcode2015/ne2000emulationforbhyve.1440360163.txt.gz
  • Last modified: 2015/08/23 20:02
  • by AlexTeaca