Solstice X.25 9.2 Administration Guide

Appendix F Compatibility with SunNet X.25 7.0

Solstice X.25 9.2. is compatible with earlier versions of X.25, however, if you are using SunNet X.25 7.0, you need to know about some particular features of Solstice X.25 9.2 that make it backwards compatible with version 7.0. You have no need of these features if you do not use SunNet X.25 7.0. The backwards compatibility features are:

This appendix also contains a section of "Compatibility Tips", to help you make the most efficient use of your configuration.

The vcstat Command


Note -

This command has been included as it is familiar to users of SunNet X.25 7.0. In general, use x25stat, see "Checking the Datalink Layer".


The vcstat command allows you to monitor link and virtual circuit statistics, on a cumulative or periodic basis. The command has the following syntax


% /opt/SUNWconn/bin/vcstat [-L] [-n] [-l interface] [-i interval ] [-p period] 

The vcstat options are explained as follows:

-L

Display link-related statistics instead of virtual circuit statistics. By default, vcstat displays virtual circuit statistics. Examples of displays for each type of statistics are shown below.

-n

Display only cumulative (since reboot) statistics, instead of periodically updated display. By default, vcstat displays current statistics at 30-second intervals.

-l interface

Display statistics for the link specified by interface. This interface corresponds to the number specified for the interface parameter in your link configuration file.

-i interval

Sampling interval for display of cumulative statistics. If you omit this and the -n options, vcstat displays cumulative statistics at 30-second intervals.

-p period

Specifies the length of time, in minutes, vcstat will run when it is displaying current statistics. By default, vcstat displays statistics for 1440 minutes (24 hours).

-v virtual circuit

Specify a virtual circuit or range of virtual circuits.

-S symbolic address

Specify a symbolic address.

Virtual Circuit Statistics

Without the -L option (that is, by default), vcstat displays statistics for all currently active virtual circuits, rather than for links. For example:


hostname% /opt/SUNWconn/bin/vcstat -i10
Tue Sep 18 16:24:23 1990
   If LCN    State Substate Sent Recv Remote address MAC address
O 1 0x200 Data 0/0/0/0 130 130 129.144.133.2
O 1 0x201 Data 0/0/0/0 679 5180 10002244
I 2 0x202 Data 0/0/0/0 501 641 20009988       08:00:20:07:11:a1,0e 

The fields and headings in the above example display are explained as follows:

Column 1 (no heading)

In the first column you see either O, for an outgoing call; I, for an incoming call; or P, for a permanent virtual circuit.

If

Identifies the link over which the call was made. Corresponds to the value of the Link Number parameter in the Link Editor window in x25tool.

State

Displays Data when the call is in the data transfer phase of the connection.

Substate

Displays four toggles (1 is true, 0 false). From left to right these are:

  • Sent Receive Not Ready

  • Sent Interrupt

  • Received Interrupt

  • Received Receive Not Ready

Sent and Recv

Displays the number of frames sent and received since the last reboot. (These counts are not reset if you stop and restart your link.)

Remote Address

This field displays the following types of addresses:

  • IP addresses for virtual circuits used for IP connections

  • AEFs. This type of address is accompanied by a string, osi, partial-osi, or non-osi, indicating the type of AEF.

  • X.121 addresses

To display a name or partial name from the xhosts table, use the --s option.

MAC Address

An LSAP address is present for virtual circuits running over LLC2.

Link Statistics

With the -L option, vcstat displays link-related, rather than virtual-circuit-related, statistics. It displays statistics for all currently active links. For example, to see link-related statistics, updated every 10 seconds, you enter:


hostname% /opt/SUNWconn/bin/vcstat -L -i10
 Wed Sep 19 08:56:52 1990
 If Type State SABM   Recv   Sent   Abort Crc Over Under
  0 hdlc UP     3      1112   1141   8     20   13 21
  1 hdlc UP     3      239    268    17    45   4   4
  2 llc UP      1      601    589    4     12   0   0

The fields in the vcstat output are explained as follows:

If

Identifies the link number over which the call was made. Corresponds to the value of the Link Number parameter in Link Editor window in x25tool.

Type

Can be lapb or llc, identifying the type of connection. The designator lapb indicates a serial-link connection, while llc indicates an LLC2 connection over a LAN.


Note -

For LLC2, vcstat collects statistics on a per-physical-link basis, not per dynamic LLC2 link.


State

Displays UP when the call is in the data transfer phase of the connection and DOWN when the call is being set up or taken down. Further, displays DOWN-SABM when the link is down and a SABM has been sent; DOWN-FRMR, when a link is down and a Frame Reject has been sent; and DOWN-DISC, when a link is down and a Disconnect has been sent.

SABM

Indicates the number of Set Asynchronous Balanced Mode frames that have been sent. This type of frame is used to establish a frame-layer connection.

Recv and Sent

Displays the number of frames sent and received since the last reboot. (These counts are not reset if you stop and restart your link.)

Abort

Displays the number of aborted received frames. Occurs when the local serial port received a sequence of eight consecutive ones, in violation of LAPB framing rules. Abort errors result from an interruption in the service provided by the link or from clocking problems. Such errors might also be caused by the software running over Solstice X.25. A small number of abort errors probably indicates a software problem rather than a broken link or a persistent clocking problem.

Crc

Reports the number of received frames with CRC (Cyclical Redundancy Check, an error detection method) errors. A CRC error is recorded when the checksum on a received frame is incorrect. CRC errors occur when there is a clocking problem (different rates on each side) or a noisy line.

Over

Reports the number of receiver overrun errors. Such errors occur when the local system is unable to accept data fast enough and the port hardware buffers overflow. A frame that is not completely received is aborted, triggering error recovery. Underrun errors can occur when the signaling rate in use on a link is too fast for the local system.

Under

Reports the number of transmitter underrun errors. Such errors occur when the local system is too busy to service the serial port hardware. A frame that is not completely sent is aborted, triggering error recovery. Underrun errors can occur when the signaling rate in use on a link is too fast for the local system.

High-Level Data Link Control


Note -

The Solstice X.25 9.2 LAPB driver implements an interface that is compatible with SunNet X.25 7.0's HDLC interface. This has been included for backward-compatibility with SunNet X.25 7.0 only. In other situations, use LAPB plus DLPI. This implementation of HDLC does not support hdlcconf.


Solstice X.25 9.2 supports the Application Program interface that was available in SunNet X.25 7.0. An application program can open an HDLC device as a file and can control HDLC through SunOS system calls.

Before starting X.25, you need to associate the HDLC driver with the relevant WAN port. To do so, enter:


hostname#: iflayer ifdn portname

Application Program

You can access HDLC from a program with the same interface used at the user level, the ifnet device. A program can perform all the user-level tasks presented above with standard system calls.


Note -

This description assumes that you are familiar with the system calls open(2), close(2), read(2), write(2) and ioctl(2). It also assumes that the ifnet device has been initialized and layered.


All of the contents and structures used are in the following include files:


#include <stdio.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/ioctl.h>
#include <sundev/syncstat.h>
#include <nethdlc/hdlc_ioctl.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <net/if.h>

Access HDLC by opening the ifd device attached to it. In the examples, this is /dev/ifd0. For example:


fid = open ("/dev/ifd0", )_RDWR);

To configure HDLC, invoke ioctl(2) as follows:


int fid, error;
struct hdlc_param_req hpr;
struct hdlc_param *hdlc_param

hdlc_param = &hpr.hp:
/* set fields in structure pointed to by hdlc_param */
error = ioctl(fid, HDLC_SET_PARAM, (caddr_t) &hpr);

where fid is the value returned by open, HDLC_SET_PARAM is the call to set the parameters, and hdlc_param is a structure defined as follows:


struct hdlc_param {
      u_short hp_t1;        /*T1 - P-bit timer (msec) */
      u_short hp_t2;        /*T2 - max delay before ACK (msec) */
      u_short hp_t3;        /*T3 - max idle link time (msec)
      u_short hp_t4;        /*T4 - LLC2 busy timer (msec) */
      u_short hp_t5;        /*T5 - LLC2 reject timer (msec) */
      u_short hp_t6;        /*T6 - Ack timer (msec) */
      u_short hp_tick;      /* resolution of timer (msec/tick) */
      u_short hp_n1;        /*N1 - max frame size - bytes */
      u_char hp_n2;         /*N2 - max retries (used with T1, T4) */
      u_char hp_xcntl;      /* extended control - mod 128 */
      u_char hp_k;          /* K - window size */
      u_char hp_addr;       /* address */

The value hp_t1 corresponds to the --t1 flag parameter of hdlcconf command and the values hp_t2, hp_t3, hp_tick, hp_n1 and hp_n2 correspond similarly. The hp_xcntl is a boolean value. If it is set, then the implementation will operate in Asynchronous Balanced Mode Extended. Otherwise, it will run in Asynchronous Balanced Mode. The window size is set with hp_k. Lastly, set the HDLC address with hp_addr and the following values:


#define LAPB_ADDR_A   0x03   /* commands to DTE secondary */
                             /* responses from DTE secondary */
#define LAPB_ADDR_B   0x01   /* commands to DCE secondary */
                             /* responses from DCE secondary

Setting Parameters

The kernel does not check the parameters, it assumes they are set to reasonable values. Take care when setting them, as wrong parameters can affect the operation of the HDLC link.

Before setting the parameters, it is advisable to get them first with the ioctl call HDLC_GET_PARAM. The HDLC_SET_PARAM and HDLC_GET_PARAM calls have the same parameter format.

After setting the HDLC parameters, start HDLC by making the following call:


int fid;
 error = ioctl (fid, HDLC_INIT, 0);

In Solstice X.25 9.2 this is equivalent to executing hdlcstart in SunNet X.25 7.0.

Data Transfer

To transfer data to or from HDLC, use read (2) and write (2). Each operation corresponds to an HDLC frame, which means that each read call will return only one packet, even if there is more data waiting and room in the buffer. If there is not enough room in the buffer for the current frame, read fails, and the frame is discarded. The buffer passed to a write call corresponds to a single HDLC frame. Calls to write with a length greater than the maximum frame size (hp_n1) fail.

Statistics


Note -

The command x25stat returns more complete statistics than those returned by the procedure shown below.


To get the same statistics as those returned by hdlcstate in SunNet X.25 7.0, your program should run the HDLC_STATS ioctl call as follows:


int fid, error;
 struct hdlc_stats_req hsr;
 struct hdlc_stats *hdlc_stats;

 hdlc_stats = &hsr.he;
 error = ioctl(fid, HDLC_STATS, (caddr_t) &hsr);
 /* results are in structure pointed to by hdlc_stats */

The hdlc_stats is of type struct hdlc_stats shown below:


struct hdlc_stats {
       u_short        hs_state;     /* hdlc state */
       u_short        hs_sentsabms; /* sabms sent */
       struct ss_dstats hs_data;    /* data stats */
       struct ss_estats hs_errors;  /* error stats */

The value hs_sentsabmns is the cumulative total of SABMS that were transmitted, including retry attempts. The field hs_state can be any one of the following:


#define HDLCLINK_DOWN 0 /* initial state */
#define HDLCLINK_SABM 1 /* SABM outstanding
#define HDLCLINK_FMR 2  /* FRMR outstanding */
#define HDLCLINK_DISC 3 /* DISC outstanding */
#define HDLCLINK_UP   4 /* information transfer state */

The structures ss_dstats and ssestats are defined in the file <sundev/syncstat.h> as follows:


struct ss_dstats {
      long ssd_spack;    /* input packets */
      long ssd_opack;    /* output packets */
      long ssd_ichar;    /* input bytes */
      long ssd_ochar;    /* output bytes */
 ];

 struct ss_estats {
      long sse_abort;    /* abort received */
      long sse_crc;      /* CRC error */
      long sse_overrun;  /* receiver overrun */
      long sse_underrun; /* xmitter underrun */

Their values correspond to the Total bytes and Errors lines of the hdlcstate display.

Shutdown

Normally, HDLC remains up for as long as the remote host is physically connected to the local port. For this reason, close (2) does not affect the state of HDLC, and any packets queued for output are transmitted.

To shut down HDLC, execute the following ioctl:


int fid;
error = ioctl(fid, HDLC_RESET, 0);

This puts the line into the HDLCLINK_DOWN state. Calls to read and write will fail, and errno is set to ENETDOWN. This is the same call that hdlcstop uses.

Compatibility Tips

Follow the tips in the section to make the best possible use of a network that has systems running both SunNet X.25 7.0 and Solstice X.25.

Point-to-Point Configurations

If you configure an IP point-to-point link between a machine running the current release of Solstice X.25 and a machine running SunNet X.25 7.0, configure the 7.0 machine as the "caller", rather than "called". This role is determined by the value of the mode parameter in the x25mgr configuration file. See page 118 of the SunNet X.25 7.0 System Administration Manual for a description of the mode parameter. Also, you should set the Disconnection Timer to a high value.

The reason for this is the different treatment of IP point-to-point links by SunNet X.25 7.0 and the current release of Solstice X.25. The 7.0 product keeps switched virtual circuits up all of the time in support of point-to-point links, while the current release drops the virtual circuits after a specified period of inactivity. If a 7.0 machine is configured as "called", rather than "caller", it is not able to establish an IP connection with a current-release machine until the latter machine sends a Call Request. This does not occur until the current-release machine has IP packets to send to the 7.0 machine. If the 7.0 machine is configured as "caller" (as it should be), there remains the problem that the current-release machine drops the virtual circuit upon inactivity. When this occurs, the 7.0 machine immediately calls to re-establish the virtual circuit. If your PSDN charges for call setup (as many do), such behavior becomes very expensive. To avoid this, change the Disconnection Timer to a figure that will keep the virtual circuit up long enough to outlast periodic gaps in IP traffic.

Setting the Max. NSDU

If you have an IP/X.25 link between a current-release Solstice X.25 machine and a machine running SunNet X.25 7.0, set Max NSDU to at least 1024. Otherwise IP connections can hang when a high volume of data is sent from the 7.0 machine. If you have two current-release machines on each side of the link, set Max NSDU to be the same on both sides. It can be as high as 8192.