CLASS="SECT1" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" >

4. Native ATM PVCs

PVCs can be used for machines that are either connected back to back or via a switch. In the latter case, the cell forwarding has to be manually set up at the switch.

4.1. Traffic Tools

aread/awrite and br/bw are simple programs to access the ATM API. awrite sends the text string passed as its second argument in an AAL5 PDU. aread receives one AAL5 PDU and displays it in hex. Both programs also display the return values of the corresponding system calls and the current values of errno.

bw either sends its standard input or a stream of blocks containing arbitrary data (if a number is passed as its fourth argument) in 8 kB AAL5 PDUs. br receives AAL5 PDUs and writes them to standard output.

The first argument of aread, awrite, br and bw is always the PVC address, i.e. the ATM interface number, the VPI and the VCI number, with a dot between elements. The interface number can be omitted if it is zero. Example:

% awrite 1.0.42 hi

Note that some adapters only support VPI == 0. Also, the VCI range may be limited, e.g 0 to 1023. The interface number can be obtained from the initialization message the driver printed during startup. atm0 is interface 0, atm1 is interface 1, etc. If the system is equipped with a real ATM adapter (e.g. not only atmtcp), that adapter is normally at atm0.

aping receives and sends small AAL5 PDUs on a PVC. It expects that messages it sends are either echoed back or that a similar program on the other side generates a stream of messages. aping reports an error if no messages are received for too long. aping is invoked by specifying the PVC, like aread.

For "real" tests, you should use the modified version of ttcp that comes with this package. The original is available at ftp://ftp.sgi.com/sgi/src/ttcp/. The following options have been added:

-a

use native ATM instead of UDP/TCP. The address must be in the format [itf.]vpi.vci for PVCs, or a valid ATM end system address for SVCs.

-P num

use a CBR connection with a peak cell rate of num cells per second. Default is to use UBR.

-C

disable (UDP) checksums

Example:

%a ttcp_atm -r -a -s 0.90
%b ttcp_atm -t -a -s 0.90

4.2. Direct Cell Access

On adapters where the device driver supports access to raw cells (``AAL0''), individual cells can be composed and received with the atmdump program. Here is an example:

a% sleep 10; date | ./atmdump -t 1 -c 0.51
b% ./atmdump 0.51
825079645.192480: VPI=0 VCI=51, GFC=0x0, CLP=1, Data SDU 1 (PTI 1)
   46 72 69 20 46 65 62 20 32 33 20 31 32 3a 34 37 
   3a 32 35 20 47 4d 54 20 31 39 39 36 0a 00 00 00 
   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00