[Winpcap-users] winpcap sends packets double (or libpcap receives
tschut at gmail.com
Thu Aug 31 12:02:26 GMT 2006
Hmm, it could be that yes.
My application doesn't require a 100% reliability, and I can imagine packets
getting lost on the physical network layer every once in a while. On the
other hand, since the use of nice -n-20 dramatically decreased the packet
loss this probably had to do with the CPU not giving my app enough time, ie
a buffer overrun, probably on kernel level. Perhaps pcap_setbuff could have
helped (or still can) here.
What I can't quite imagine is packets being magically duplicated on the
physical layer. Note that I'm not talking high level packet, just plain raw
ethernet (mac addresses & data). What possible cause is there for a packet
to get duplicated on the wire? I believe none.
So, I didn't just post my problem here, I tried some stuff myself ;) And it
looks like the problem is solved by disabling as many protocols as possible
on the network interface. (In windows, right click the network adapter,
select properties, and turn off the checkboxes). My guess is that the TCP/IP
stack in windows does some funny things, maybe send keepalives or so?
My receiving app isn't prepared to receive any traffic but the one I send
myself, so I guess this is the answer.
Thanks anyway. Oh, and I know TCP uses error correction and stuff, but as
the final product I'm developing will receive it's data from specialistic
hardware, I can't quite ask these guys to build there own TCP/IP stack in an
FPGA ;) (let alone have them create a hardware buffer to buffer enough data
at a 350 mbit/s rate to enable retransmits ;))
On 8/31/06, Bryan Kadzban <bryan at kadzban.is-a-geek.net> wrote:
> Tiemen Schut wrote:
> > Now, the problem. At first I didn't even think this could happen, but
> > it does. I receive packets twice!
> I am pretty sure Ethernet is not reliable -- i.e., your packets can be
> either dropped *or duplicated* while on the wire or being processed in
> the NIC. This would have nothing to do with WinPcap or libpcap or the
> network driver on either end; it'd be a property of the medium.
> I know IP and UDP are not reliable; both of them can drop or duplicate
> packets. I believe 802.11 is *supposed* to be reliable, but since IP
> and UDP don't care, and TCP explicitly corrects for dropped or doubled
> packets, I doubt anyone relies on that. I'm not sure about 802.3 though.
> In any case, it seems that requiring a protocol to be reliable that
> explicitly claims not to be (i.e., IP or UDP) is a pretty bad idea.
> Perhaps it would be better to use TCP to send and receive your data,
> instead of winpcap and libpcap? Not sure on your requirements, though.
> Winpcap-users mailing list
> Winpcap-users at winpcap.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Winpcap-users