Ref: 99980083
Title: Networking with X.25
Date: 6/1/87

Copyright 3Com Corporation, 1991.  All rights reserved.

X.25, developed from the Department of Defense ARPANET, has been
a standard method of communications in Europe since the 1970s.
X.25 flourished in Europe because differences in phone systems,
various different national regulations, and other political
considerations precluded the use of leased phone lines (the major
alternative to packet switching).  Recently, the United States
has begun to follow the example of the Common Market and adopt
the CCITT (Consultative Committee for International Telegraph and
Telephone) X.25 recommendation.  The burgeoning need for
international data communications has made X>25 a highly
reliable, cost-effective, and internationally accepted
communications architecture to link multivendor data processing
devices.  Some of the largest data networks in the world are X.25
packet switching networks.

.h1;Packet Switching Networks

Packet Switching Networks are a subset of a larger group known
as Public Data Networks.  The first operational packet switching
approach to sharing resources went into service in 1969.  Since
then, Packet Switching Networks, both public and private, have
gained increasing importance around the world; for example,
Telenet (U.S.) was introduced in 1976, Datapac (Canada) in 1977,
Transpac (France) in 1978, and DDXP (Japan) in 1978.

In 1987, the interest in Packet Switching Networks is still
growing rapidly.  The three major reasons for this success are:

    *   Lower cost of data communications

    *   Increased nework reliability

    *   A well-defined, standard interface (X.25)

Packet switching Networks offer lower cost data communications
because the charge is based on how much data is sent across the
network (plus a flat monthly fee), not on connection time.

In the case of a dial-up connection or a leased-line circuit, the
users at each end of the circuit monopolize the physical
connection; therefore, they have to pay for the entire cost of
the connection no matter how long they have used it.  Whereas in
a Packet Switching Network, the resources are shared by users who
are concerned only with the delivery of their packets, not with
the path followed.  In fact, to maximize the use of its
transmission facility, the network will often use multiple
physical circuits.

The second benefit of Packet Switching Networks, increased
network reliability, is a result of the redundancy inherent in
the basic network structure.  A Packet Switching Network consists
of:

*   Switching nodes or switches, responsible for forwarding
packets across the network

*   Data Circuit Terminating Equipment (DCE), which provides the
interface between the network and the user

*   High-speed interconnections between the different elements of
the network, these interconnections can be telephone system
facilities, satellite links, microwave channels, etc.

A switching node can be connected to more than one other
switching node and DCEs are usually also connected to multiple
switching nodes.  If one node or one link fails, the network
automatically reroutes packets from the deficient path to another
with complete transparency to the user.  Most networks also have
"load balancing" algorithms, which permit the most efficient use
of the network facilities.

The third major benefit of packet switching networks is a well-
defined standard interface, X.25.

.h1;The X.25 Standard

The X.25 standard was defined in 1976 by the CCITT.  This
Committee is composed of European government-owned Postal,
Telegraph, and Telephone companies (PTTs), but is also includes
private telephone companies, scientific and industrial
organizations, and standards organizaitons such as the
International Standards Organization (ISO).  In fact, the CCITT
publishes recommendations only since it has no authority to
impose standards on any vendor.  X.25, though, has become a
defacto standard.

The X.25 recommendation defines the interface between the user's
DTE (Data Terminal Equipment) and the public packet switching DCE
networks.  X.25 covers the lower three layers of the ISO
architecture: physical level, link level, and network level.

This overview of the X.25 recommendation is not meant to be
comprehensive, but rather aims to make you more familiar with the
most frequenty used terms and concepts.  For further details,
refer to the CCITT specifications.

.h2;Physical Level

The physical level defines the mechanical, electrical, functional
and procedural characteristics needed to activate, maintain, and
deactivate the physical link between the DCE and the DTE.  The
X.25 recommendation specifies X.21, X.21bis, or the V Series.
X.21 was developed specifically for PDN access whereas X.21bis
was designed to permit the use of the RS-232 and V.35.  Below is
a summary of the X.25 physical protocol choices:

.h2;Data Link Level

The CCITT defined LAP(Link Access Protocol) and LAPB (Link Access
Protocol Balanced) as the frame-level protocol for X.25.  LAP and
LAPB implement the HDLC (High-level Data Link Control) protocol
defined by the International Standards Organization.  The frame
level or data link layer is responsible for a subset of the
following functions:

*   Bit versus character orientation

*   Link set-up

*   Link disconnect

*   Restart

*   Bit-stuffing transparency principles

*   Operating procedures

*   Flow control

*   Error detection, error recovery

*   X.25 multilink protocol

The communications phases as defined by the ISO are as follows:

*   Connect

*   Link establishment

*   Information transfer

*   Termination

*   Clear

The format of an HDLC frame:

*   Flags - All frames have a minimum of 6 octets of overhead and
begin and end with the flag octet 0111110.  In order to
differentiate a flag from the rest of the frame, the
transmitter hardware inserts a zero whenever a string of five
ones is detected.

*   Address field - HDLC defines two addressing modes.  The basic
mode uses only one octet, which permits the addressing of 256
stations on the data link.  The extended mode permits an
unlimited number of octets in the address field.

*   Control field - This field defines three types of frames: (1)
Numbered Information, (2) Supervisory, and (3) Unnumbered.

The control field of an information frame contains frame
sequence numbers N(r) and N(s).  N(r) is the frame-receive
sequence number and N(s) is the frame-send sequence number.
These numbers are used to control the window mechanism.  The
Poll/Find (P/F) bit is used to force an immediate response
from the other station, which will respond by sending a frame
containing the final bit.  The supervisory frames are used to
perform control functions on the link and can signify RR
(Receive Ready), RNR (Receiver Not Ready), or RES (Reject).

The unnumbered frames are used to perform additional
supervisory functions on the link such as SABM (Set
Asynchronous Balanced Mode), SARM (Set Asyncrhonous Response
Mode), or DISC (Disconnect).

*   Information field: This field has variable length and
contains packet-level leaders and data.

*   FCS (Frame Check Sequence) Field: This 16-bit field contains
a CRC (Cyclic Redundancy Check) polynomial.

.h2;Packet Level

Level 3 describes the packet format and the control procedures
for the exchange of packets between the DTE and the DCE.  In
addition to the user data packet format, there are several
formats for DTE/DCE administrative messages.

The physical and link protocols have a local meaning between the
DTE and DCE and can vary from one location to the other, while
the network layer is the same throughout the network.  This does
not mean, however, that the X.25 protcol is used internally
within the network.  In fact, a different protocol is ofter used
inside the Packet Switching Network; but X.25 packets are
delivered to the destination DCE, which transmits them to the
corresponding DTE.

.h2;General Packet Format

The diagram below shows the format of the first three octets for
all packet types:

          8    7    6    5    4    3    2    1
       -----------------------------------------------
      |      |    |    |    |    |    |    |          |
    1 |    GENERAL FORMAT   |    LOGICAL CHANNEL      |
      |     IDENTIFIER      |     GROUP NUMBER        |
      |-----------------------------------------------|
    2 |            LOGICAL CHANNEL NUMBER             |
      |                                               |
      |-----------------------------------------------|
    3 |            PACKET TYPE IDENTIFIER             |
      |                                               |
      |-----------------------------------------------|
      |      |    |    |    |    |    |    |          |
      |                                               |
      | /         OTHER FIELDS AS REQUIRED            |/
      |/                                              /

The general format identifier indicates whether this is a data-
bearing packet destined for an end-user or for the device
controlling the end-user's terminal.  Among other things, it
contains the D-bit and the Q-bit.

The D-bit is used to tell the network whether the DTE expects
acknowledgements from the local DCE or from the destination DTE.
The Q-bit or Qualifier bit is used for PAD opeations.  It permits
direct communication between the PAD and the packet mode DTE
(e.g., an X.25 host) for X.3 parameters settings.

The logical channel number is divided into a logical channel
group and a logical channel number.  The packet type identifier
defines six categories of packets: Call Establishment and
Clearing, Data and Interrupt, Flow Control and Reset, Restart,
Diagnostic, and Registration.


.h2;Call Establishment

The DTE initiates a transmission by sending a Call Request packet
to the local DCE.  This packet contains the address of the remote
DTE and is given on the highest unused logical channel.  The
Call Request packet is passed through the network and delivered
at the remote DCE/DTE interface as an Incoming Call packet.  This
packet is give to the remote DTE on the lowest unused logical
channel.  The called DTE has the option of either accepting the
call by sending a Call Accepted or rejecting it by sending a
Clear Request.  Below is the format of an incoming call or call
request packet.

      8   7   6   5   4        3   2   1
    -----------------------------------------
   |   General Format     |                  |
 1 |     Identifier       |                  |
   |______________________|           _______|
   |                                         |
 2 |         Logical Channel Number          |
   |-----------------------------------------|
   |                                         |
 3 |    0   0   0   0   1       0   1   1    |
   |-----------------------------------------|
   |                      |                  |
   |____Calling DTE       |    Called DTE____|
   |  Address Length      |   Address Length |
   |                      |                  | /
   |-/---------------------------------------/ /
   /  /           DTE Addresses            / /
 / -/----------------------------------------|
   |              Facility Length            |
   |-----------------------------------------|
   | /              Facilities            *  |/
   /-/--------------------------------------/ /
 / /             Call User Data          ** /|
   |-----------------------------------------|

  * 63 Octets Maximum
 ** 16 Octets Maximum


When a DTE places a call, it may request various network options
(called Facilities), such as: flow control negotiation, incoming
or outgoing calls barred, reverse charging, hunt group, fast
select.  Fast select is an optional service that allows the user
to send data on a Call Requst packet; i.e., without necessarily
establishing a connection.  The call can then be accepted or
cleared.  Note that the Clear packet can also contain data.

The address field in the incoming call packet contains provision
for both calling and called DTE addresses and has a variable
length.  The addressing can use different numbering schemes.  The
CCITT-X.121 recommendation, defines the worldwide numbering plan
for Public Data Networks.

.h2;Data Packets

A data packet has the following format:

         8   7    6    5    4         3    2    1
      --------------------------------------------------
     |      |     |      |     |     |     |     |      |
     |                         |                        |
     |     GENERAL FORMAT      |    LOGICAL CHANNEL     |
     |       IDENTIFIER        |     GROUP NUMBER       |
     |--------------------------------------------------|
     |                                                  |
     |              LOGICAL CHANNEL NUMBER              |
     |                                                  |
     |--------------------------------------------------|
     |                  |          |             |      |
     |      P(r)        |M         |P(s      )   | 0    |
     |--------------------------------------------------|
     |                                                  |
     /                                                  /
     /                USER DATA FIELD                   /
     |                                                  |
      --------------------------------------------------

The default packet size specified by the CCITT is 128, but
specific networks can use different packet sizes.

P(S) is the send sequence number for the packet. P(R) is the
acknowledgment whereby the transmitter is told which packet
sequence number is expected next at the receiver.

The M-bit is the more data bit used to indicate that the folliwng
packets are part of or are associated with the preceding packet.

The flow control window at the network layer operates in the same
manner as at the link layer.  Normally, modulo 7 sequence
numbering is used.  A modulo 128 format is also available.  The
default size is 2, which means that two outstanding
unacknowledged packets are permitted before the transmitter must
stop and wait.

.h2;Diagnostic Packets

Diagnostic packets are sent by the network to the DTE or indicate
some anomalous condition such as invalid packet type, invalid
logical channel number, timer expired, or call setup problem.

.h2;Packet Assembler/Disassemblers

A Packet Assembler/Disassembler (PAD) is a communications device
that provides an interface to a Packet Switching Network for
start-stop terminals.  It may be part of the network node or may
be privately owned and connected to the network by a leased line
as a packet mode DTE.

A PAD is a microporcessor-based device that has a number of
similarities to a Ethernet communications server, terminal are
plugged into one side and the other side provides a network
interface (to X.25).  When the Bridge GS/1-X.25 is used for
connecting a terminal on the Ethernet to host on the X.25 network
(connection service), the combination of the GS/1-X.25 and the
communications server provides the same functionality as a PAD.

A PAD appears to the Packet Switching Network as a fully
functioning packet mode DTE with a limited number of logical
channels.  Within the PAD, a single logical channel is assigned
to each terminal port.  The assignments of logical channel to
terminal port is done according to the standard DCE/DTE logical
channel allocation algorithm.  The data-forwarding mechanism is
similar to the one used on communications servers.  The data from
each port is independently buffered and accumulated until one of
the forwarding conditions such as expiration of an idle timer,
buffer full, or reception of a data-forwarding character occurs.

The PAD operation is regulated by three CCITT recommendations:

*   X.3 specifies the services a PAD must perform for the start-
stop terminal and defines a set of 18 parameters.  The GS/1-
C.25 supports the X.3 recommendation by providing a mapping
of the X.3 parameters with the Bridge parameters.  This
capability is used in connection service.

*   X.29 specifies the packet layer interface between a packet
mode DTE (e.g., an X.25 host) and a PAD to permit the packet
mode DTE to set and read the PAD's X.3 parameters.

*   X.28 defines the interface between the stop-start terminal
and the X.3 PAD.  It specifies the procedures for
establishing a network connection and transferring data, as
well as a means by which the terminal operator may set PAD
parameters or get status from the PAD>

