OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Apr 18, 2024 4:40 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Sending data to emulated NIC
PostPosted: Sat Nov 12, 2016 8:57 am 
Offline
Member
Member
User avatar

Joined: Fri Apr 03, 2015 9:41 am
Posts: 492
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.


Top
 Profile  
 
 Post subject: Re: Sending data to emulated NIC
PostPosted: Sat Nov 12, 2016 9:50 am 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4594
Location: Chichester, UK
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.


Top
 Profile  
 
 Post subject: Re: Sending data to emulated NIC
PostPosted: Sat Nov 12, 2016 1:16 pm 
Offline
Member
Member
User avatar

Joined: Fri Apr 03, 2015 9:41 am
Posts: 492
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.


Top
 Profile  
 
 Post subject: iansjack
PostPosted: Sat Nov 12, 2016 1:38 pm 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4594
Location: Chichester, UK
Well, the only way you can properly test that it is working is to send and receive some test packets. I


Top
 Profile  
 
 Post subject: Re: iansjack
PostPosted: Sat Nov 12, 2016 2:08 pm 
Offline
Member
Member
User avatar

Joined: Fri Apr 03, 2015 9:41 am
Posts: 492
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.


Top
 Profile  
 
 Post subject: Re: Sending data to emulated NIC
PostPosted: Sun Dec 11, 2016 12:51 pm 
Offline
User avatar

Joined: Fri Jan 20, 2012 8:26 am
Posts: 16
Location: Obrnice, Czech Republic
I always used "Network Traffic Generator and Analyzer" to play with packets. Very nice piece of SW.
http://ostinato.org/

Have fun .-)

_________________
[ MicroBe OS ]


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Majestic-12 [Bot] and 324 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group