Blame doc/README.dag

Packit 209cc3
Packit 209cc3
The following instructions apply if you have a Linux or FreeBSD platform and
Packit 209cc3
want libpcap to support the DAG range of passive network monitoring cards from
Packit 209cc3
Endace (http://www.endace.com, see below for further contact details).
Packit 209cc3
Packit 209cc3
1) Install and build the DAG software distribution by following the
Packit 209cc3
instructions supplied with that package. Current Endace customers can download
Packit 209cc3
the DAG software distribution from https://www.endace.com
Packit 209cc3
Packit 209cc3
2) Configure libcap. To allow the 'configure' script to locate the DAG
Packit 209cc3
software distribution use the '--with-dag' option:
Packit 209cc3
Packit 209cc3
        ./configure --with-dag=DIR
Packit 209cc3
Packit 209cc3
Where DIR is the root of the DAG software distribution, for example
Packit 209cc3
/var/src/dag. If the DAG software is correctly detected 'configure' will
Packit 209cc3
report:
Packit 209cc3
Packit 209cc3
        checking whether we have DAG API... yes
Packit 209cc3
Packit 209cc3
If 'configure' reports that there is no DAG API, the directory may have been
Packit 209cc3
incorrectly specified or the DAG software was not built before configuring
Packit 209cc3
libpcap.
Packit 209cc3
Packit 209cc3
See also the libpcap INSTALL.txt file for further libpcap configuration
Packit 209cc3
options.
Packit 209cc3
Packit 209cc3
Building libpcap at this stage will include support for both the native packet
Packit 209cc3
capture stream (linux or bpf) and for capturing from DAG cards. To build
Packit 209cc3
libpcap with only DAG support specify the capture type as 'dag' when
Packit 209cc3
configuring libpcap:
Packit 209cc3
Packit 209cc3
        ./configure --with-dag=DIR --with-pcap=dag
Packit 209cc3
Packit 209cc3
Applications built with libpcap configured in this way will only detect DAG
Packit 209cc3
cards and will not capture from the native OS packet stream.
Packit 209cc3
Packit 209cc3
----------------------------------------------------------------------
Packit 209cc3
Packit 209cc3
Libpcap when built for DAG cards against dag-2.5.1 or later releases:
Packit 209cc3
Packit 209cc3
Timeouts are supported. pcap_dispatch() will return after to_ms milliseconds
Packit 209cc3
regardless of how many packets are received. If to_ms is zero pcap_dispatch()
Packit 209cc3
will block waiting for data indefinitely.
Packit 209cc3
Packit 209cc3
pcap_dispatch() will block on and process a minimum of 64kB of data (before
Packit 209cc3
filtering) for efficiency. This can introduce high latencies on quiet
Packit 209cc3
interfaces unless a timeout value is set. The timeout expiring will override
Packit 209cc3
the 64kB minimum causing pcap_dispatch() to process any available data and
Packit 209cc3
return.
Packit 209cc3
Packit 209cc3
pcap_setnonblock is supported. When nonblock is set, pcap_dispatch() will
Packit 209cc3
check once for available data, process any data available up to count, then
Packit 209cc3
return immediately.
Packit 209cc3
Packit 209cc3
pcap_findalldevs() is supported, e.g. dag0, dag1...
Packit 209cc3
Packit 209cc3
Some DAG cards can provide more than one 'stream' of received data.
Packit 209cc3
This can be data from different physical ports, or separated by filtering
Packit 209cc3
or load balancing mechanisms. Receive streams have even numbers, e.g.
Packit 209cc3
dag0:0, dag0:2 etc. Specifying transmit streams for capture is not supported.
Packit 209cc3
Packit 209cc3
pcap_setfilter() is supported, BPF programs run in userspace.
Packit 209cc3
Packit 209cc3
pcap_setdirection() is not supported. Only received traffic is captured.
Packit 209cc3
DAG cards normally do not have IP or link layer addresses assigned as
Packit 209cc3
they are used to passively monitor links.
Packit 209cc3
Packit 209cc3
pcap_breakloop() is supported.
Packit 209cc3
Packit 209cc3
pcap_datalink() and pcap_list_datalinks() are supported. The DAG card does
Packit 209cc3
not attempt to set the correct datalink type automatically where more than
Packit 209cc3
one type is possible.
Packit 209cc3
Packit 209cc3
pcap_stats() is supported. ps_drop is the number of packets dropped due to
Packit 209cc3
RX stream buffer overflow, this count is before filters are applied (it will
Packit 209cc3
include packets that would have been dropped by the filter). The RX stream
Packit 209cc3
buffer size is user configurable outside libpcap, typically 16-512MB.
Packit 209cc3
Packit 209cc3
pcap_get_selectable_fd() is not supported, as DAG cards do not support
Packit 209cc3
poll/select methods.
Packit 209cc3
Packit 209cc3
pcap_inject() and pcap_sendpacket() are not supported.
Packit 209cc3
Packit 209cc3
Some DAG cards now support capturing to multiple virtual interfaces, called
Packit 209cc3
streams. Capture streams have even numbers. These are available via libpcap
Packit 209cc3
as separate interfaces, e.g. dag0:0, dag0:2, dag0:4 etc. dag0:0 is the same
Packit 209cc3
as dag0. These are visible via pcap_findalldevs().
Packit 209cc3
Packit 209cc3
libpcap now does NOT set the card's hardware snaplen (slen). This must now be
Packit 209cc3
set using the appropriate DAG configuration program, e.g. dagthree, dagfour,
Packit 209cc3
dagsix, dagconfig. This is because the snaplen is currently shared between
Packit 209cc3
all of the streams. In future this may change if per-stream slen is
Packit 209cc3
implemented.
Packit 209cc3
Packit 209cc3
DAG cards by default capture entire packets including the L2
Packit 209cc3
CRC/FCS. If the card is not configured to discard the CRC/FCS, this
Packit 209cc3
can confuse applications that use libpcap if they're not prepared for
Packit 209cc3
packets to have an FCS.
Packit 209cc3
Packit 209cc3
Libpcap now reads the environment variable ERF_FCS_BITS to determine
Packit 209cc3
how many bits of CRC/FCS to strip from the end of the captured
Packit 209cc3
frame. This defaults to 32 for use with Ethernet. If the card is
Packit 209cc3
configured to strip the CRC/FCS, then set ERF_FCS_BITS=0. If used with
Packit 209cc3
a HDLC/PoS/PPP/Frame Relay link with 16 bit CRC/FCS, then set
Packit 209cc3
ERF_FCS_BITS=16.
Packit 209cc3
Packit 209cc3
If you wish to create a pcap file that DOES contain the Ethernet FCS,
Packit 209cc3
specify the environment variable ERF_DONT_STRIP_FCS. This will cause
Packit 209cc3
the existing FCS to be captured into the pcap file. Note some
Packit 209cc3
applications may incorrectly report capture errors or oversize packets
Packit 209cc3
when reading these files.
Packit 209cc3
Packit 209cc3
----------------------------------------------------------------------
Packit 209cc3
Packit 209cc3
Please submit bug reports via <support@endace.com>.
Packit 209cc3
Packit 209cc3
Please also visit our Web site at:
Packit 209cc3
Packit 209cc3
        http://www.endace.com/
Packit 209cc3
Packit 209cc3
For more information about Endace DAG cards contact <sales@endace.com>.