[ovs-discuss] Small 802.1q-prepended packets not getting through to VM

Steinar H. Gunderson steinar-ovs at gunderson.no
Sun Jul 21 18:59:32 UTC 2019

On Wed, Jun 12, 2019 at 10:32:54PM +0200, Steinar H. Gunderson wrote:
> I do wonder what will happen if I open up a TAP device and just read from
> /dev/net/tun, with no bridge in-between; whether I will get undersized frames
> on read() then. It will be an interesting experiment when I find the time.

I found some time to deal with this, after I hit these issues again in a
different installation. First, I made a tap interface:

  klump:~> sudo ip tuntap del tap0 mode tap
  klump:~> sudo ip link set tap0 up
  klump:~> sudo ip addr add dev tap0

Then, I pinged a (nonexistent) host to generate some ARP packets:

  klump:~> ping

tcpdump showed them:

  20:51:38.272216 ARP, Request who-has tell, length 28
  20:51:39.276849 ARP, Request who-has tell, length 28
  20:51:40.300850 ARP, Request who-has tell, length 28

I then made a little program to open /dev/net/tun, select tap0 and report the
number of bytes for each read():

  Read 42 bytes from tap interface
  Read 42 bytes from tap interface
  Read 42 bytes from tap interface

So indeed; tap devices don't pad Ethernet frames (note that this experiment
doesn't involve OVS at all). So we're bad at the same question: Whose
responsibility is it? Linux, when generating the frame? Open vSwitch,
when sending it on? tap, when sending it to an file descriptor? qemu,
when reading it from said descriptor?

/* Steinar */
Homepage: https://www.sesse.net/

More information about the discuss mailing list