Subject: Queries on BPF
To: 'port-mac68k@NetBSD.ORG' <port-mac68k@NetBSD.ORG>
From: Ashwini Gupte <A.Gupte@zensar.com>
List: port-mac68k
Date: 12/13/2000 10:45:05
Hello,

1)
I am using BPF Library to read packets on my LAN. I have set promiscous mode
and immediate mode.
But BPF device seems to be dropping some packets and some packets are
getting merged.
i.e. 2 or more distinct packtes (viewed on ethereal packet analyzer) are
bieng read as one packet. Some times read() function calls returns
datalength > 5000.

I want to know that is there any limitations on BPF device and read()
function that how fast they can read packets or so? (such as PPS-Packtes per
Second)
If I am reading packets from pcap library functions (pcap_dispatch()),
packets are correctly received. (i.e. read is returning one packet data at a
time)

Note: This problem is taken case for now if we use dedicated network with
less traffic and applying filters to bpf to exclude packets send by own
machine.

2) Other problem is If I am compiling/linking my program using pthread
(posix thread)
the read() call is not waiting till TIMEOUT (blocking I/O). I have enabled
TimeOut.
It immediately returns from read() call saying "No Resource is available now
".
I tried with only one thread also. but whenever I am linking my code with
pthread, TIMEOUT is having no effects evenif no threads are used.
Is there any flag to be used while open/read for "BLOCKING" I/O in case of
multithread application?



Thanks and Regards,
Abhijit Parekh
==================================
Zensar Technologies Ltd.
Home Page : www.abhijit.cjb.net
Email: A.Parekh@ZenSar.com
abhijit@lycos.com
Tel: +91-20-6684001 Ext. 503
+91-20-5438581 (Res.)
==================================