Page 1 of 1

Sending data to emulated NIC

Posted: Sat Nov 12, 2016 8:57 am
by osdever
I need to test my RTL8139 driver, at least will it receive any packets. How can I send a packet to QEMU's network card?

Re: Sending data to emulated NIC

Posted: Sat Nov 12, 2016 9:50 am
by iansjack
Just send a packet from any computer (the host is the easiest) on the same network as the QEMU NIC. Make its physical destination address that of your QEMU interface. Or you could just send an ethernet packet to the broadcast destination address (FF:FF:FF:FF:FF:FF). Or you could send a DHCP Discover packet from your QEMU VM; that should result in a reply from your DHCP server.

Re: Sending data to emulated NIC

Posted: Sat Nov 12, 2016 1:16 pm
by osdever
iansjack wrote:Just send a packet from any computer (the host is the easiest) on the same network as the QEMU NIC. Make its physical destination address that of your QEMU interface. Or you could just send an ethernet packet to the broadcast destination address (FF:FF:FF:FF:FF:FF). Or you could send a DHCP Discover packet from your QEMU VM; that should result in a reply from your DHCP server.
I don't even know does my code work. Also QEMU says that vlan0 isn't connected to the host network and I don't know any solution. BTW I want to only know did I set up NIC interrupt properly. If it's done properly I'll get the interrupt and "packet received" will be written to the log. I don't want to actually send or receive packets at first time.

iansjack

Posted: Sat Nov 12, 2016 1:38 pm
by iansjack
Well, the only way you can properly test that it is working is to send and receive some test packets. I

Re: iansjack

Posted: Sat Nov 12, 2016 2:08 pm
by osdever
iansjack wrote:Well, the only way you can properly test that it is working is to send and receive some test packets. I
I know.

Re: Sending data to emulated NIC

Posted: Sun Dec 11, 2016 12:51 pm
by online
I always used "Network Traffic Generator and Analyzer" to play with packets. Very nice piece of SW.
http://ostinato.org/

Have fun .-)