Solstice X.25 9.2 Administration Guide

Obtaining Packet and Link-Level Traces

Use /opt/SUNWconn/bin/x25trace command to capture information about each packet and/or frame sent and received by Solstice X.25.

You can specify the layer you want to trace, the interface you want to trace, and the destination you want to trace. This lets you narrow down the information you receive.

The x25trace command takes the form shown below:


# /opt/SUNWconn/bin/x25trace [options] [-i interface] filter_expression 

You must run it as root, in the foreground. If you want to capture its output in a file, use standard Unix redirection to do so. (This is useful if you intend to contact your local technical support representative for help.) x25trace runs until you enter a Ctrl-C.

You can use specific MAC addresses as filters. For example, you can enter a command that has the effect of saying, "Trace all packets that travel over interface A between address 1 and address 2." Such commands can extend beyond the width of a command line. In this case, use the backslash (\) continuation character to go beyond a single line.

Table 11-1 lists the devices x25trace supports:

Table 11-1 Devices Supported by x25trace

Device Name 

Description 

/dev/llc2

Supports LLC2 interfaces.  

/dev/lapb

Supports synchronous point-to-point interfaces. 

/dev/x25

Supports the X.25 Packet Layer interface 

The following options are available. They are supported by all of the devices.

-a

By default, x25trace displays the user data in hexadecimal for the highest protocol specified. This option tells x25trace to only display the number of bytes of user data and not display the data in hexadecimal. For example, if you enter:


hostname# x25trace -a -i /dev/llc2 x25

x25trace displays only the number of bytes in X.25 packets sent and received over the llc0 interface.

-l number

Specifies the link on which x25trace is to trace packets. By default, x25trace traces on all links and prints the link number in the traced information. (This option is useful only in the situation in which you have multiple links.)

-u

This option causes x25trace to buffer display output line-by-line, instead of the default operation of packet-by-packet.

-x

This option causes x25trace to display entire packets in hexadecimal, in addition to its default operation of decoding the packet. This option is useful in troubleshooting malformed packets. With such packets, you often see an error message starting with two asterisks (**).

You can use the following filter expressions in an x25trace command line:

betweenmac

Trace only the packets or frames passing between the 802.x MAC addresses you specify.

dstmac

Trace only the packets or frames that have a destination address that is the MAC address you specify.

lapb (or hdlc)

Trace only LAPB frames.

mac

Trace packets and frames to/from the MAC address you specify. Use only when tracing on a LAN interface.

multicast

Trace only LLC2 packets that have multicast addresses.

pdu_in

Trace only incoming Protocol Data Units (PDUs).

pdu_out

Trace only outgoing Protocol Data Units (PDUs).

srcmac

Trace only the packets or frames that have a source address that is the MAC address you specify.

x25

Trace only X.25 Packet Layer Protocol packets.

x25lcn [+|num>]

Used with a plus sign (+), this expression means trace only the packets that travel on the next logical channel set up. Used with a number, it means trace only the packets that travel on the logical channel identified by num.

x25trace Examples

Below are some examples of using x25trace for tracing incoming and outgoing packets.

Tracing LAPB and X.25 on /dev/lapb:

To trace LAPB frames and X.25 packets as they are sent or received by LAPB, enter:


hostname# x25trace -i /dev/lapb 

To trace X.25 packets as they are seen by the X25 driver, type one of the two following commands:


hostname# x25trace -i /dev/x25 x25
hostname# x25trace

Tracing LLC2 and X.25 on /dev/llc2:


hostname# x25trace -i /dev/llc2 

The command above captures all LLC frames, including Unnumbered Information frames used to carry CLNP and ES-IS PDUs. When tracing at the X.25 level on an LLC2 link, MAC addresses are displayed as 0:0:0:0:0:0. Tracing at the LLC2 level on the same link returns the correct MAC addresses.

Tracing a single X.25 connection (logical channel number):


hostname# x25trace -i /dev/lapb x25lcn  lcn_num x25 

Tracing only the next X.25 connection being set up:


hostname# x25trace -i /dev/lapb x25lcn + x25

Tracing LLC2 frames on /dev/llc2:


hostname# x25trace -i /dev/llc2 llc

Tracing X.25 packets to/from specific MAC addresses on /dev/llc2:


hostname# x25trace -i /dev/llc2 srcmac 8:20:0:1:2:3 x25
hostname# x25trace -i /dev/llc2 dstmac 8:20:0:1:2:3 x25
hostname# x25trace -i /dev/llc2 betweenmac 8:20:0:1:2:3 9:0:2b:18:21:5 x25 

Trace outgoing LLC2 frames that are not multicast:


hostname# x25trace -i /dev/llc2 pdu_out not multicast

Redirecting trace of X.25 packets over an LAPB link to a file:


hostname# x25trace -a -i /dev/lapb x25 > /var/adm/x25/packets.record