Example on comparing performance of DAG cards and NIC
=====================================================

Purpose
--------
This example compares the performance of a DAG card to a standard NIC (network interface card).   
  
Two applications are provided:
  [1] dag_nic -- Uses libpcap to access network packets through a network interface. 
  				 The network interface can either be a NIC or a DAG card.  
  				 This application allows the user to measure the amount of data 
  				 captured by each device at varying traffic rates. 
  				 
  [2] dag_cap -- Uses DAG API to capture network packets through DAG card. 
  				 Demonstrates the use of the API through a simple example. 
  				 
Source code
-----------
    xpack.h 	-- 	header file, defining Ethernet, IP, TCP header structure
					and a few related prototypes.
    xpack.c 	-- 	implements the prototypes defined in xpack.h.
    dag_nic.c 	--	has two callback functions running as separate threads. The first is 
      				get_pack(), which is triggered on every packet's arrival. 
      				The second is "show_sta", which is called every second. The source code 
      				provides detailed comments.
    dag_cap.c 	-- 	runs for 5 seconds and provides 10 continuous results about the network traffic 
                 	before terminating.
    Makefile 	-- 	Make file script to build the applications.

Experiment environment
----------------------
  [1] Host:
      Linux system, preferably version 2.6 installed over intel IA32 architecture
      with super user privilege
  [2] Cards:
      A DAG card and a NIC card with comparable speed, e.g. both cards
      operating at 1000 Mpbs.
  [3] Network traffic generator:
      Network equipment to generate and send packets. If no measurement is 
      required then connecting to a physical network is fine.

Software setup
--------------
  The following software modules and libraries are requires:
  [1] DAG driver.
  [2] NIC driver.
  [3] DAG API library.
  [4] Libpcap API library.
  [5] A C compiler such as gcc.

Installation of libpcap
-----------------------
  The DAG software must be installed prior to this step. Please refer
  to DAG software installation manual for more details.

  [1] get a copy of libpcap
  
  [2] uncompress the file
	  $ tar -zxvf libpcap.tar.gz

  [3] build the libpcap
	  $ cd libpcap
      $ ./configure --with-dag
      $ make
      $ make install

Build and run application software
--------------------------------
Note: You must be a superuser (or root) in order to run these applications.   

  $ make all
  $ ./dagcap
  $ ./dagcap | od
... display some results

  $ ./dag_nic dag0
  $ ./dag_nic eth0

Disclaimer
----------

Endace has made best effort to check the above examples. The examples are not for use on production systems.  They are meant as a starting point from which to develop your own applications.

