Re: Managing lengths of packets with ethertap...

From: Stuart Summerville (stuarts@icpdd.neca.nec.com.au)
Date: Sun Feb 06 2000 - 18:47:43 EST


On 7/02/00, 10:03:53, Rusty Russell <rusty@linuxcare.com.au> wrote
regarding Re: Managing lengths of packets with ethertap... :

> In message
<001a01bf6ddc$6fed0420$cb884c93@porpoise.icpdd.neca.nec.com.au> you
> write:
> > Firstly, I've found several sample uses of ethertap that poll the tap
device
> > with read combinations waiting for packets to be received. If the
linux
> > kernel spits a single packet into that queue (??) then doing a read on
> > /dev/tap0 will simply grab that packet & squirt it to the other end &
the
> > whole system can assume its one packet.

> One read, one packet. Think datagram.

Yes, if there's one packet there, then the read will properly grab it.
What if your read loop doesn't get to reading the tap device before a
second or 3rd packet is sent by the linux ip stack? How does the
simple "read hoping for a packet" method cater for multiple packets in
that devices buffer? What if the ip stack decided to fragment the
packet?

Also, is the placement of packets in the tap devices buffer
necessarily atomic? If not, then partial packets must surely be a problem.

I'm currently changing my code to make the assumption you've suggested
(& that I mentioned), & for what I want to do, might not have the
problems I'm suggesting, but I'd still like to know....

Thanks for your help, Rusty.

STu.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Feb 07 2000 - 21:00:14 EST