(Page 1 of 1 in this chapter) Version


Chapter 2

Getting Started


2.1 Overview of the MTP 2 Installation and configuration Process
2.1.1 Installation
2.1.2 Configuring TDM ports
2.1.3 Configuring MTP 2 Links
2.1.4 Downloading the board
2.1.5 Run a sample user application
2.2 SS7 Links and MTP Layer 2 Service Users
2.3 Entity and Instance IDs
2.4 TX Driver Interface
2.5 TX Driver Message Format
2.6 Byte Ordering Considerations
2.7 Layer 2 Interface Procedures
2.7.1 Binding
2.7.2 Connection Establishment
2.7.3 Data Transfer
2.7.4 Status/Control
2.7.5 Connection Clearing
2.8 MTP 2 Messages

2.1 Overview of the MTP 2 Installation and configuration Process

The following sections provide a summary of the steps required to install and configure the MTP layer 2 software.

2.1.1 Installation

First, the TX board needs to be installed properly. Remember which IRQ and memory address the board is set for before installing the card in the PC. See the appropriate installation manual for more information.

Next, the software needs to be installed. Install the TX Base/Device Driver package and then the MTP 2 layer software. See the Installation Instructions in the SS7 CD-ROM booklet for information on the installation of the Base/Device driver package for your operating system.

2.1.2 Configuring TDM ports

If the TX board which will run the MTP 2 task will be sending and receiving on a T1, E1 or MVIP/H.100/H.110 time slot, see the T1/E1/MVIP Interface Adapters Developer's Reference Manual for help with setting up TDM ports for use by the MTP 2 task. There are two sample configuration files included with the Base Software: tdmcp1.cfg and tdmcp2.cfg. These two samples will support a back-to-back arrangement of two TX boards using T1s.

2.1.3 Configuring MTP 2 Links

MTP 2 allows applications to configure the number of links as well as many parameters associated with those links. Four samples are included with MTP 2, two each for ANSI (located in \nms\tx\config) and ITU-T (located in \nms\tx\config\itu). The sample configurations support back-to-back configurations. These examples contain a definition for one TDM port and a "commented-out" V35 port. If the installation uses V35 ports, then "comment in" the example serial port definition in the file and "comment out" the TDM port.

2.1.4 Downloading the board

Once the software and links are set up properly, the TX board can be downloaded with the software and configuration. The mtp2load batch file is included to assist in this action. The mtp2load file accepts one parameter, the board number to load. This loader file downloads the necessary software to the TX board, including the proper kernel, support tasks for alarms and debugging, a console program, the MVIP and T1/E1 managers and, of course, MTP 2 itself. Finally, the configuration for MTP 2 is downloaded.

Here is the Windows NT version of mtp2load.bat:

@echo off
REM
set TXUTIL=c:\nms\tx\bin
set TXCP=c:\nms\tx\cp
set TXCONFIG=c:\nms\tx\config
set BRD=1
if not "%1"=="" set BRD=%1
REM
REM              TXn000 COMMUNICATIONS PROCESSOR BOOT FILE
REM
REM
REM Execute this file to boot/configure the TXn000 processor
REM
REM
REM Get the model number
%TXUTIL%\cpmodel -b %BRD%
if errorlevel 3000 goto boot3000
if errorlevel 2000 goto boot2000
echo ERROR! Check board number
goto end
:boot3000
%TXUTIL%\cplot -c %BRD% -f %TXCP%\cpk3000.lo -k -a -u ss7
goto loadsw
:boot2000
%TXUTIL%\cplot -c %BRD% -f %TXCP%\cpk.lo -k -a -u ss7
goto loadsw
:loadsw
REM
%TXUTIL%\cplot -c %BRD% -f %TXCONFIG%\TDMcp%BRD%.bin  -g tdm
%TXUTIL%\cplot -c %BRD% -f %TXCP%\nmg.lot -n netmgr  -p 5  -a
%TXUTIL%\cplot -c %BRD% -f %TXCP%\console.lot -n console -p 2  -a
%TXUTIL%\cplot -c %BRD% -f %TXCP%\inf.lot -n inf     -p 10 -a
REM
REM download the MVIP and T1/E1 manager tasks to enable use
REM of the MVIP and T1/E1 host APIs; NOTE: if you do not
REM use either of these APIs, remove the following 2 lines.
REM
%TXUTIL%\cplot -c %BRD% -f %TXCP%\mvip.lot -n mvip  -p 4  -a
%TXUTIL%\cplot -c %BRD% -f %TXCP%\t1e1mgr.lot -n t1e1mgr -p 15 -a
REM
REM Load MTP2 stand alone task 
REM
%TXUTIL%\cplot -c %BRD% -f %TXCP%\mtp2.lot -n mtp -p 10 -a -s 12000
%TXUTIL%\mtp2cfg -b %BRD% -f %TXCONFIG%\MTP2cp%BRD%.cfg
:end
set TXUTIL=
set TXCP=
set TXCONFIG=

The Unix version of MTP2LOAD looks similar:
# Reset board, clear driver stats
# load CPK/OS and related tasks,
# and configure SS7
if [ -z "$TX2BASE" ]
then
        TX2BASE=/usr/lib/txn
fi
if [ -z "$CONFIGBASE" ]
then
        CONFIGBASE=/etc/txn
fi
# reset board
cputil -b$1 -R
# clear driver stats
cputil -b$1 -C
# get board type
BOARDTYPE=\Qcputil -b$1 -i\Q
case $BOARDTYPE in
        TX3000)
                CPK="cpk3000.lo"
                ;;
        TX2000)
                CPK="cpk2000.lo"
                ;;
        *)
                echo "board $1 not available" 
                exit 1
                ;;
esac
# load CPK/OS 
cplot -c $1 -f $TX2BASE/$CPK -k -u ss7 -a
# load Related tasks
cplot -c $1 -f $TX2BASE/debug.lot -n debug -p 3 -a
cplot -c $1 -f $TX2BASE/nmg.lot -n netmgr -p 5 -a
cplot -c $1 -f $TX2BASE/console.lot -n console -p 2 -a
cplot -c $1 -f $TX2BASE/inf.lot -n inf -p 10  -a
# load TDM configuration - note: remove this line if you use
# serial (V.35) ports rather than T1/E1/MVIP
cplot -c $1 -f $CONFIGBASE/TDMcp$1.bin -g tdm
# load the MVIP and T1/E1 manager tasks to enable use
# of the MVIP and T1/E1 host APIs. Note: if you do not
# use either of these APIs, remove the following two lines
cplot -c $1 -f $TX2BASE/mvip.lot -n mvip -p 4 -a
cplot -c $1 -f $TX2BASE/t1e1mgr.lot -n t1e1mgr -p 15 -a
# MTP2 stand alone task
cplot -c $1 -f $TX2BASE/mtp2.lot -n mtp -p 10 -a
# MTP2 configuration. 
mtp2cfg -b $1 -f $CONFIGBASE/MTP2cp$1.cfg

The txalarm application is also included to help debugging the configuration and user applications. The following is a sample output from txalarm when the board is downloaded without sending a new MTP 2 configuration:

<12/05/1997 15:51:58> mtp   1    1 Registering MTP Layer 2
<12/05/1997 15:51:58> mtp   1    1 Configuring MTP Layer 1
<12/05/1997 15:51:58> mtp   1    1 MTP1 Initializing.
<12/05/1997 15:51:58> mtp   1    1 MTP1 General Configuration
<12/05/1997 15:51:58> mtp   1    1 MTP1 Configuring link 0: TDM, External
<12/05/1997 15:51:58> mtp   1    1 MTP1 Configuring link 1: TDM, External
<12/05/1997 15:51:58> mtp   1    1 MTP1 Configuring link 2: TDM, External
<12/05/1997 15:51:58> mtp   1    1 MTP1 Configuring link 3: TDM, External
<12/05/1997 15:51:58> mtp   1    1 MTP1 Configuration Done
<12/05/1997 15:51:58> mtp   1    1 Configuring MTP Layer 2
<12/05/1997 15:51:58> mtp   1    1 MTP2: General Configuration
<12/05/1997 15:51:58> mtp   1    1 MTP2: Link 0 Configuration
<12/05/1997 15:51:58> mtp   1    1 MTP2: Link 1 Configuration
<12/05/1997 15:51:58> mtp   1    1 MTP2: Link 2 Configuration
<12/05/1997 15:51:58> mtp   1    1 MTP2: Link 3 Configuration

2.1.5 Run a sample user application

When the board has been loaded, one of the sample applications can be started. mtp2app is an ANSI version and mtp2itu is an ITU-T (formerly CCITT) version of the sample application. See Chapter 4 for more details.

If using the TX board with test equipment, run an application then hit <return> to get a command prompt, then type connect 0 to ask the board to start the connect procedure on link 0. The txalarm output should look like the following if the link aligns properly:

<12/05/1997 15:52:45> mtp  1  1 Flushing Buffers (OPC=0)
<12/05/1997 15:52:45> mtp  1  1 Starting Alignment
<12/05/1997 15:52:45> mtp  1  1 IAC Rx SIO
<12/05/1997 15:52:45> mtp  1  1 IAC Rx SIO
<12/05/1997 15:52:45> mtp  1  1 Rx SIN
<12/05/1997 15:52:47> mtp  1  1 ALIGN TIMER 4 EXPIRED 
                                 (Link Aligned)

If using two TX boards back-to-back, after downloading each board separately, start an application on each board (mtp2app -b 2 to run on board 2), and type connect 0 on each. The txalarm output should look like the following if the link aligns properly:

<12/05/1997 15:52:42> mtp  2  1 Flushing Buffers (OPC=0) (Lnk 0)
<12/05/1997 15:52:42> mtp  2   1 Starting Alignment (Lnk 0)
<12/05/1997 15:52:45> mtp  1   1 Starting Alignment (Lnk 0)
<12/05/1997 15:52:45> mtp  2   1 Received SIOS (Lnk 0)
<12/05/1997 15:52:45> mtp  1   1 IAC Rx SIO (Lnk 0)
<12/05/1997 15:52:45> mtp  1   1 IAC Rx SIO (Lnk 0)
<12/05/1997 15:52:45> mtp  1   1 Rx SIN (Lnk 0)
<12/05/1997 15:52:45> mtp  2   1 IAC Rx SIO (Lnk 0)
<12/05/1997 15:52:45> mtp  2   1 IAC Rx SIO (Lnk 0)
<12/05/1997 15:52:45> mtp  2   1 Rx SIN (Lnk 0)
<12/05/1997 15:52:47> mtp  1   1 ALIGN TIMER 4 EXPIRED (Lnk 0)
<12/05/1997 15:52:47> mtp  2   1 ALIGN TIMER 4 EXPIRED (Lnk 0)

The middle column that contains 1's and 2's displays which board generated the alarm.

2.2 SS7 Links and MTP Layer 2 Service Users

A TX communications processor can support up to 16 SS7 links (depending on the board model and hardware configuration), numbered 0 - 15. Additional TX boards can be added for more links.

The MTP Layer 2 interface supports one or more user applications by way of Service Access Points, or SAPs. Each SAP corresponds to a single SS7 link controlled by the MTP 2 process. A user application binds to a particular SAP at initialization time, specifying the link number that the application wishes to bind to (0-15). An application implementing the MTP layer 3 would repeat the bind process for every SS7 link on every TX communication processor. Only one process is allowed to bind to each SS7 MTP 2 SAP (link).

Figure 2. MTP 2 Service Access Points (SAPS)

2.3 Entity and Instance IDs

Each user application must also have a unique entity and instance number, which is used to route messages among the various processes in the system. Entity IDs are single byte values in the range 0x00...0x3F, assigned as desired by the application developer. Entity IDs are allocated as follows:
Range

Usage

0x00 - 0x1F

Reserved for use by system utilities, configuration utilities, and management utilities

0x20 - 0x3F

Available for use by applications

Instance IDs identify the processor on which the entity executes. The host is always processor 0 (zero), so for all host-resident MTP 2 user applications this value should be coded to zero. All tasks on TX board number 1 receive an instance ID of 1, all tasks on TX board number 2 receive an instance ID of 2, and so on.

2.4 TX Driver Interface

The TX device drivers implement a message-passing interface between the host and TX processor (CP). The physical interface between the host and the CP (shared dual-port ram, or DPR) is subdivided into a set of virtual channels to support communication between processes on the host and processes on the TX board. The channel concept allows multiple process on both the host and TX processor to exchange messages without interfering with each other. The TX board currently supports 256 channels (numbered 0 - 255). Channels 0 - 31 are reserved for use by NMS standard products. Channels 32 - 255 are available for application use.

A process (on either the host or TX processor) wishing to receive messages registers with the driver for a particular channel number. For a host-resident process, the channel registration may be implicit with the device open request, or it may be a separate operation. Channel numbers are assigned statically at compile time; there is no built-in facility to dynamically learn the channel assigned to any particular function. Only one process may receive messages for a particular channel. Each message contains a header, supplied by the sender of the message, to identify the destination board and channel, the source board and channel, and the length of the message.

Each process in an SS7 implementation, both on the CP and on the host, registers for the channel that corresponds to that layer's (or application's) entity id, as described above. So, the MTP 2 layer registers for channel 0x16. To send a message to the MTP 2 layer on board n, the destination channel is set to 0x16, the destination board is set to n, and the source channel and board are set to the sender's entity id and board number (the host is board number zero).

The TX driver can be called through the CPI Library. See the CPI Library Software Interface Manual for more details. An application should perform a cpi_init before using any other CPI calls. A cpi_open should be issued to each board the application wishes to communicate with. API calls cpi_send and cpi_get_data are then used to send and retrieve data packets to and from the board. See the MTP 2 sample user applications' source code as well as the aforementioned CPI Library document.

2.5 TX Driver Message Format

This section describes the general format of messages passed between the MTP 3 process on the host and the MTP 2 task on the TX CP via the TX driver.
Octet

Message Format

0

Source Channel
(Source Entity ID)

1

Source Board
(Source Instance ID)

2

Destination Channel
(Destination Entity ID)

3

Destination Board
(Destination Instance ID)

4

5

Message Length
(2 octets)

6

7

Message Start Offset
(2 octets)

8

9

Message End Offset
(2 octets)

10..i

Filler

i + 1

Message Type

i + 2

...

...

MTP 2 Msg Parameters

n

...

The destination entity/instance IDs and the source entity/instance IDs define the intended recipient and the sender of the message, respectively. The Message Length contains the byte length of the entire message, including headers, filler, and parameters. The Message Start Offset contains the number of octets of filler included following the Message End Offset before the Message Type parameter. It is recommended that at least 4 bytes of filler are included on messages sent to MTP 2 to guarantee MTP 2 has room to prepend its header to the actual data portion of a message without having to copy the data to a new buffer. On messages received from MTP 2, the layer 3 application MUST use this parameter to determine where in the buffer the actual message content (the Message Type field) begins. See the MTP 2 Message Reference section. Several include files are available with the MTP 2 sample user application code. Mtp2app.h or mtp2itu.h along with txcpi.h contain structures for message formats.

2.6 Byte Ordering Considerations

Please note the following byte ordering conventions for 16-bit and 32-bit parameters in the messages to/from MTP 2. This is not the same byte ordering used for short and long integers on Intel 80x86 machines. The host application is responsible for converting between network and host byte order, if necessary, in both the send and receive directions.

Note: The Message Length field is part of the DPR header interface between the host application and the host device driver, and must be passed in host native byte order, not the byte order shown in this section. The Message Start and End offsets, on the other hand, are part of the interface between the host application and the MTP 2 process, and must be passed in the network byte order shown below.

16-Bit Fields:

32-Bit Fields:

The following nomenclature is used for data types:
Data Type

Description

U8

Unsigned 8-bit quantity

S16

Signed 16-bit quantity

U32

Unsigned 32-bit quantity

2.7 Layer 2 Interface Procedures

This section describes the procedures (the sequence of messages) used to interface to the SS7 MTP 2 process on the TX board. The SS7 layer 2 interface consists of several distinct phases: binding, connection establishment, data transfer, connection clearing, and status/control.

2.7.1 Binding

The binding phase establishes the host application (MTP layer 3) as the user of the layer 2 interface. Binding consists of a single BIND request from the application to layer 2, for which there is no response. A separate bind request must be sent to MTP 2 for every link on every TX board that the application wishes to use.

2.7.2 Connection Establishment

The layer 2 user requests layer 2 to establish a "connection" by sending a CONNECT request packet. This causes the SS7 layer 2 to attempt to bring up the link and initiate link alignment procedures with the far exchange. Layer 2 sends a CONNECT CONFIRMATION message back to the user when link alignment has been successfully established. Connection establishment is requested separately for each SS7 link.

Note: No data packets may be transferred until the CONNECT CONFIRMATION message has been received by the user application.

Figure 3. Message Flow for Connection Establishment

2.7.3 Data Transfer

The data transfer phase is entered on a particular link once the MTP 2 process has returned a CONNECT CONFIRMATION message to the application.

The layer 2 user application requests a SS7 packet to be transmitted on a particular link by sending a DATA REQUEST to layer 2. Layer 2 returns a DATA CONFIRMATION message back to the user application when the message has been acknowledged by the far exchange. The application may send multiple DATA REQUEST(s) to MTP 2 before receiving a DATA CONFIRMATION. The DATA CONFIRMATION message contains a credit field indicating the number of data requests being acknowledged by the data confirm.

Figure 4. Message Flow for an Outgoing Data Transfer


Layer 2 notifies the user application of an incoming data packet by sending a DATA INDICATION packet. There is no response to this packet from the user application back to layer 2.

Figure 5. Notification of an Incoming Data Packet


During data transfer, the user application may request layer 2 to apply flow control to a link (or to stop flow control) by sending a FLOW request. There is no response from layer 2 back to the user application for this request. Layer 2 may also send an unsolicited FLOW INDICATION message to the user application to indicate that congestion has started or ended on a link.

2.7.4 Status/Control

The MTP 2 status request supports a number of functions which help layer 3 implement link and traffic management procedures. The layer 3 application may use the status request to perform the following functions.

MTP 2 returns a STATUS CONFIRMATION message containing the current BSN (last acknowledged sequence number) for a link to the application in response to a "retrieve BSN" status request. MTP 2 may also return a STATUS CONFIRMATION message in response to a "retrieve messages" status request, but only if there are no unacknowledged messages to be retrieved. If there are unacknowledged messages to be retrieved, a DATA CONFIRMATION message, indicating a status of "unacknowledged [more|last]", is sent to the application for each message (the last indicates that it is the last). In this case, no STATUS CONFIRMATION message is returned to the application.

Figure 6. Use of "Retrieve" Status Requests to Implement Link Changeover

2.7.5 Connection Clearing

The user application may request that the link be disabled by sending a DISCONNECT request to layer 2. There is no response from layer 2 to a DISCONNECT request. Layer 2 may send an unsolicited DISCONNECT INDICATION message to the user application to notify it that a link has been disconnected and the reason for the disconnect.

Layer 2 will send unsolicited STATUS INDICATION messages to the user application to notify it of changes in the link status (up or down).

2.8 MTP 2 Messages

The following messages comprise the interface to the SS7 layer 2 task. All messages contain a message type and a link ID in addition to the parameters listed below. Actual message layouts are specified in Appendix A.
Message

Direction

Parameters

Description

BIND REQUEST

MTP 3 -> MTP 2

Service User ID Service Prov. ID User Entity ID User Instance ID

Binds user application as sole user of SS7 layer 2 link.

CONNECT REQUEST

MTP 3 -> MTP 2

Status

Requests layer 2 to bring up a physical link. Status parameter may be used to specify status to bring link up in (normal, emergency, power on only, etc.)

CONNECT

CONFIRM

MTP 2 -> MTP 3

None

Notifies user application that link connect has successfully completed (link is aligned).

DATA REQUEST

MTP 3 -> MTP 2

Data buffer

Requests layer 2 to transmit data buffer on a particular link.

DATA CONFIRM

MTP 2 -> MTP 3

Status Credit

Acknowledges transmission of a data request back to user application; Status parameter indicates whether more DATA rqsts may be issued, Credit parameter indicated how many requests are being acknowledged.

DATA INDICATION

MTP 2 -> MTP 3

Data buffer

Indicates received data packet to user application.

DISCONNECT REQUEST

MTP 3 -> MTP 2

Reason

Requests layer 2 to disconnect a link.

DISCONNECT INDICATION

MTP 2 -> MTP 3

Reason

Notifies user application that a link is disconnected.

FLOW REQUEST

MTP 3 -> MTP 2

Action

Requests layer 2 to start or stop flow control on a link.

FLOW INDICATION

MTP 2 -> MTP 3

Action

Notifies user application that congestion has started or stopped on a link.

STATUS REQUEST

MTP 3 -> MTP 2

Action Status

Requests special status/control function.

STATUS CONFIRM

MTP 2 -> MTP 3

Action Status

Response to status request for certain status/control functions.

STATUS INDICATION

MTP 2 -> MTP 3

Status

Notifies user application that a link has gone up or come down.



(Page 1 of 1 in this chapter) Version


tech_support@nmss.com
Copyright © 2000, Natural MicroSystems, Inc. All rights reserved.