Hi!
I'm writing a nw card driver for my OS.
I've stuck at a programming problem, and don't have
a consistent test to check my modifications.
Could you tell me a simple way to send raw
packets from a host process to guest QEMU VM?
Nw hw is an e1000 or something similar, standard card.
Thanks in advance
Simplest way to test PCI nw driver
Re: Simplest way to test PCI nw driver
I don't think that's possible. Not in a simple way anyway. Try using simple one packet protocols instead, like ICMP or UDP. Check out "ping", "mtr" and "nc -u" (netcat).Robert wrote:Could you tell me a simple way to send raw packets
Otherwise tcpdump can save pcap files, and there's a way to replay a pcap with bit-twist or tcpreplay. So if you manually create a pcap file with a hex editor, you can send raw packets, but that's not simple nor easy to do at all.
Cheers,
bzt
Re: Simplest way to test PCI nw driver
It should be possible to write a script or program to send raw pocket from the host. Probably can't be too malformed though like not having IP headers, etc. You aren't trying to reinvent a different networking standard from that level up right? Standard NICs are unlikely to accept pockets without IP headers either so that either ways won't work.Robert wrote:Hi!
I'm writing a nw card driver for my OS.
I've stuck at a programming problem, and don't have
a consistent test to check my modifications.
Could you tell me a simple way to send raw
packets from a host process to guest QEMU VM?
Nw hw is an e1000 or something similar, standard card.
Thanks in advance
Then, you can probably find some inspirations from viewtopic.php?f=1&t=39828 about how to get the pockets into Qemu.
Good luck!
Re: Simplest way to test PCI nw driver
So if I'd like to create a tap device to connect VM's nw interface and my package sender python script, how should I do it (it doesn't work for me now)
my idea:
sudo /etc/qemu-ifup tapdev
qemu ... -net tap,ifname=tapdev,script=0,downscript=no
And open /dev/tapdev as a binary file
my idea:
sudo /etc/qemu-ifup tapdev
qemu ... -net tap,ifname=tapdev,script=0,downscript=no
And open /dev/tapdev as a binary file