# How to find reasons for dropped packets?



## ShyRain (May 22, 2013)

Hi,

I am trying to test my application on network traffic about 200 Mbit with an *I*ntel ethernet card. I have got some dropped packets which I find with the `netstat -B` command:


```
netstat -B [-z] [-I interface]
	     Show statistics about bpf(4) peers.  This includes information
	     like how many packets have been matched, dropped and received by
	     the bpf device, also information about current buffer sizes and
	     device states.
```

For example:

```
[root@mypc ~]# netstat -B
  Pid  Netif   Flags      Recv      Drop     Match Sblen Hblen Command
  444 pflog0 p--s--l         0         0         0     0     0 pflogd
64511   lan0 p--s---   6269494     94484   3936148  1304     0 myapplication
```

And I want to find reasons of dropped packets. What is the reason of dropped packets, and how can I find it?


----------



## Uniballer (May 23, 2013)

The `netstat -B` command shows you the bpf (Berkeley Packet Filter) statistics.  If you haven't already, try `man bpf` to find out how this interface is used.  Generally packets are dropped because there is no buffer available for an incoming packet.  Are you controlling the size of kernel buffers using the appropriate ioctl's? Are you using zero-copy buffer mode?  One of these strategies might help.


----------

