Sending data to emulated NIC

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
osdever
Member
Member
Posts: 492
Joined: Fri Apr 03, 2015 9:41 am
Contact:

Sending data to emulated NIC

Post 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?
Developing U365.
Source:
only testing: http://gitlab.com/bps-projs/U365/tree/testing

OSDev newbies can copy any code from my repositories, just leave a notice that this code was written by U365 development team, not by you.
User avatar
iansjack
Member
Member
Posts: 4706
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Sending data to emulated NIC

Post 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.
User avatar
osdever
Member
Member
Posts: 492
Joined: Fri Apr 03, 2015 9:41 am
Contact:

Re: Sending data to emulated NIC

Post 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.
Developing U365.
Source:
only testing: http://gitlab.com/bps-projs/U365/tree/testing

OSDev newbies can copy any code from my repositories, just leave a notice that this code was written by U365 development team, not by you.
User avatar
iansjack
Member
Member
Posts: 4706
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

iansjack

Post by iansjack »

Well, the only way you can properly test that it is working is to send and receive some test packets. I
User avatar
osdever
Member
Member
Posts: 492
Joined: Fri Apr 03, 2015 9:41 am
Contact:

Re: iansjack

Post 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.
Developing U365.
Source:
only testing: http://gitlab.com/bps-projs/U365/tree/testing

OSDev newbies can copy any code from my repositories, just leave a notice that this code was written by U365 development team, not by you.
User avatar
online
Posts: 16
Joined: Fri Jan 20, 2012 8:26 am
Location: Obrnice, Czech Republic
Contact:

Re: Sending data to emulated NIC

Post by online »

I always used "Network Traffic Generator and Analyzer" to play with packets. Very nice piece of SW.
http://ostinato.org/

Have fun .-)
Post Reply