NAME | SOCKET OPTIONS | SEE ALSO | RESTRICTIONS |
SYNOPSIS | IOCTLS | NOTES | AUTHOR |
DESCRIPTION | ERROR HANDLING | CAVEATS | HISTORY |
ADDRESS FORMATS | ERRORS | DIAGNOSTICS | REFERENCES |
SYSCTLS | EXAMPLES | BUGS |
mtp - SS7 Message Transfer Part (MTP) Protocol
SYNOPSIS
#include <sys/socket.h> #include <net/ss7.h> mtp_socket = socket(PF_SS7, SOCK_NTWK_NSEQ, SOCK_PROT_NTWK);
This is an implementation of the SS7 (Signalling System No. 7) MTP (Message Transfer Part) protocol defined in ITU-T Recommendation Q.704, ANSI T1.111.4 and ETSI 300 008-1.
When an MTP socket is created, the MTP Point Code to which it applies is
unspecified. PDUs can be sent immediately using sendto(2)
or sendmsg(2)
with a valid destination address (including
DPC - Destination Point Code and UP - User Part) as an argument. When
connect(2)
is called on the socket, the default
destination address is set and datagrams can then be sent using
send(2)
or write(2)
without specifying
a destination address. It is still possible to set to other destinations by
passing an address to sendto(2)
or
sendmsg(2)
.
To receive packets, the socket must be bound to a local address first by using
bind(2)
, when this is not the case the socket layer will
deliver messages for any local PC (Point Code) and UP (User Part) which is not
already bound to a socket. Although this is analogous to
udp(7)
operation, it must be used with care and is a
privileged operation.
All receive operations return only one packet. When the packet is smaller
than the passed buffer, only that much data is returned, when it is bigger,
the packet is truncated and the MSG_TRUNC
flags is set.
SS7 options may be sent or received using the socket options described in
ss7(7)
.
They are only processed by the kernel when the
appropriate sysctl is enabled (but still passed to the user even when it is
turned off). See ss7(7)
.
When the MSG_DONTROUTE
flag is set on sending, the
destination address must refer to a local interface address and the packet is
only sent to that interface.
MTP discards the packet when its total length exceeds the interface MTU
(Maximum Transfer Unit) or SS7 SIF_MAX
.
ADDRESS FORMATS
MTP uses the SS7 sockaddr_ss7
address format described in
ss7(2)
.
SYSCTLS
The following sysctls can be accessed by the
/proc/sys/net/ss7/conf/mtp/*
files or with the
sysctl(2)
interface:
Default values are really only default-default values, and can be changed by
changing the values in the
/proc/sys/net/ss7/conf/mtp/default/*
files. Default values are only effective to newly added SS7 MTP signalling
points. Changing the default values will have an affect on all subsequently
added SS7 MTP signalling points; existing signalling points will be
unaffected.
protocol_variant
Value | Protocol Variant |
---|---|
0 | ITU-T Recommendation Q.704 (03/93) |
1 | ETSI ETS 300 008-1 |
2 | ANSI T1.111.4 (1992) |
When the protocol variant is set, all other sysctls are set to the default values for that protocol variant. Therefore, to customize a protocol variant for other needs, set the protocol variant first, and then customize other sysctls. Default sysctls are set as follows:
Sysctl | Protocol Variant | ||
---|---|---|---|
0 (ITU-T) | 1 (ETSI) | 2 (ANSI) | |
protocol_variant |
0 | 1 | 2 |
transfer_function |
N (0) | N (0) | N (0) |
transfer_restricted |
N (0) | N (0) | Y (1) |
message_priority |
N (0) | N (0) | Y (1) |
multi_congest_levels |
N (0) | N (0) | Y (1) |
cluster_routing |
N (0) | N (0) | Y (1) |
ansi_sls_rotation |
N (0) | N (0) | Y (1) |
test_timers |
ITU-T values | ETSI values | ANSI values |
timers |
ITU-T values | ETSI values | ANSI values |
transfer_function
transfer_restricted
(Note that OpenSS7 will always respond with the optional behavior upon the receipt of a transfer-restricted message, this option only controls whether transfer-restricted messages will be generated.)
message_priority
multi_congest_levels
cluster_routing
transfer_function
is not enabled, this option has
no effect.
(Note that OpenSS7 will always respond with the optional behavior upon the receipt of a transfer-cluster message, this option only controls whether the transfer-cluster messages will be generated.)
ansi_sls_rotation
test_timers
Default values (in seconds) are as follows (minimum and maximum values are as per ITU-T Q.707, ANSI T1.111.7 and ETSI ETS 300 008-1):
T | Timeouts (sec) | Description | ||
---|---|---|---|---|
Min | Def | Max | ||
T1 | 4 | 8 | 12 | Signalling link set test acknowledgement |
T2 | 30 | 60 | 90 | Signalling link set test |
Currently, the values of the timeouts for test timers do not vary with protocol variant. The same ranges are used to ITU-T, ETSI and ANSI.
timers
Default values (in seconds) are as follows (minimum and maximum values are as per ITU-T Q.704, ANSI T1.111.4 and ETSI ETS 300 008-1):
T | Timeouts (sec) | Description | ||
---|---|---|---|---|
Min | Def | Max | ||
T1 | 0.5 | 0.5 | 1.2 | Delay to avoid message mis-sequencing on changeover |
T2 | 0.7 | 1.4 | 2.0 | Waiting for changeover acknowledgement |
T3 | 0.5 | 0.8 | 1.2 | Time controlled diversion-delay to avoid mis-sequencing on changeback |
T4 | 0.5 | 0.8 | 1.2 | Waiting for changeback acknowledgement (first attempt) |
T5 | 0.5 | 0.8 | 1.2 | Waiting for changeback acknowledgement (second attempt) |
T6 | 0.5 | 0.8 | 1.2 | Delay to avoid message mis-sequencing on controlled rerouting |
T7 | 1.0 | 1.5 | 2.0 | Waiting for signalling data link connection acknowledgement |
T8 | 0.8 | 1.0 | 1.2 | Transfer prohibited inhibition timer (transient solution) |
T9 | - | 0 | - | Not used |
T10 | 30 | 45 | 60 | Waiting to repeat signalling route set test message |
T11 | 30 | 60 | 90 | Transfer restricted timer |
T12 | 0.8 | 1.2 | 1.5 | Waiting for uninhibit acknowledgement |
T13 | 0.8 | 1.2 | 1.5 | Waiting for force uninhibit |
T14 | 2.0 | 2.5 | 3.0 | Waiting for inhibition acknowledgement |
T15 | 2.0 | 2.5 | 3.0 | Waiting to start signalling route set congestion test |
T16 | 1.4 | 1.7 | 2.0 | Waiting for route set congestion status update |
T17 | 0.8 | 1.2 | 1.5 | Delay to avoid oscillation of initial alignment failure and link restart |
T | Timeouts (sec) | Description | ||
---|---|---|---|---|
Min | Def | Max | ||
T18 | 0 | 58 | 59 | Timer within a signalling point whose MTP restarts for supervising link and link set activation as well as the receipt of routing information |
T19 | 67 | 68 | 69 | Supervision timer during MTP restart to avoid possible ping-pong of TFP, TFR and TRA messages |
T20 | 59 | 60 | 61 | Overall MTP restart timer at the signalling point whose MTP restarts |
T21 | 63 | 64 | 65 | Overall MTP restart timer at a signalling point adjacent to one whose MTP restarts |
T22 | 180 | 270 | 360 | Local inhibit test timer |
T23 | 180 | 270 | 360 | Remote inhibit test timer |
T24 | 0.5 | 0.5 | 0.5 | Stabilising timer after removal of local processor outage, used in LPO latching to RPO (national option) |
T25 | - | 0 | - | Not used |
T26 | - | 0 | - | Not used |
T27 | - | 0 | - | Not used |
T28 | - | 0 | - | Not used |
T29 | - | 0 | - | Not used |
T30 | - | 0 | - | Not used |
T | Timeouts (sec) | Description | ||
---|---|---|---|---|
Min | Def | Max | ||
T18 | - | 0 | - | Not used |
T19 | 480 | 540 | 600 | Supervision timer during MTP restart to avoid possible ping-pong of TFP, TFR and TRA messages |
T20 | 90 | 100 | 120 | Overall MTP restart timer at the signalling point whose MTP restarts |
T21 | 90 | 100 | 120 | Overall MTP restart timer at a signalling point adjacent to one whose MTP restarts |
T22 | (a) | 270 | (a) | Local inhibit test timer |
T23 | (a) | 270 | (a) | Remote inhibit test timer |
T24 | (a) | 0.5 | (a) | Stabilising timer after removal of local processor outage, used in LPO latching to RPO (national option) |
T25 | 30.0 | 32.5 | 35.0 | Timer at SP adjacent to restarting SP, waiting for traffic restart allowed message |
T26 | 12.0 | 13.5 | 15.0 | Timer at restarting SP waiting to repeat traffic restart waiting mesage |
T27 | 2 | 3 | 5 | Minimum duration of unavailability for full restart |
T28 | 3 | 30 | 35 | Timer at SP adjacent to restarting SP waiting for traffic restart waiting message |
T29 | 60.0 | 62.5 | 65.0 | Timer started when TRA sent in response to unexpected TRA or TRW |
T30 | 30.0 | 32.5 | 35.0 | Timer to limit sending of TFPs and TFRs in response to unexpected TRA or TRW |
Note (a): These ranges and defaults are network dependent. Minimum values is 0 and maximum values is MAXINT. |
To set or get an MTP socket option, call getsockopt(2)
to
read or setsockopt(2)
to write the option with the socket
family argument set to SOL_MTP
. In addition, most
SOL_SS7
socket options are valid on MTP sockets. For more
information see ss7(7)
.
MTP_SIFMAX
SIF_MAX
are
ignored and have no effect.
All of the ioctls described in socket(7)
apply to ss7.
The ioctls to configure gateway screening are documented in gws(7)
from the
bgws
package. Ioctls to configure generic device
parameters and described in
ss7device(7)
.
All of the ioctls which are described in ss7(7)
are also applicable to MTP
sockets.
There are no MTP specific ioctls at this time.
ERROR HANDLING
All fatal errors will be passed to the user as an error return even when the socket is not connected. This behavior differs from many other BSD socket implementations which don't pass any errors unless the socket is connected.
For compatibility with legacy code, it is possible to set the
SO_BSDCOMPAT
SOL_SOCKET
option to receive
remote errors only when the socket has been connected (except for
EPROTO
and EMSGSIZE
). It is better to
fix the code to handle errors properly than to enable this option. Locally
generated errors are always passed.
When the SS7_RECVERR
option is enabled, all errors are
stored in the socket error queue and can be received by
recvmsg(2)
with the MSG_ERRQUEUE
flag
set.
Whan a network error occurs, MTP tries to route around the failure. If MTP is
unable to route around the failure, the last received error for this user part
is immediately reported.
ERRORS
All errors documented for socket(7)
or ss7(7)
may be returned by a send or
received on an MTP socket.
ENOTCONN
EINVAL
EMSGSIZE
SIF_MAX
) on the
link and it cannot be fragmented. MTP does not permit fragmentation of
packets. Links combined in a link set may have different SS7 MTUs
depending on the type of link and interface device. For more information,
see link(7)
.
EACCES
EADDRINUSE
ENOMEM
and ENOBUFS
ENOPROTOOPT
and EOPNOTSUPP
ip(7)
, many
ip(7)
options are invalid for SS7 and return one of
these two errors.
EPERM
ESOCKTNOSUPPORT
EISCOMM
connect(2)
was called on an already connected socket.
EALREADY
ECONNABORTED
accept(2)
.
EPIPE
SIG_PIPE
signal raised if the socket options are appropriately set.
ENOENT
SIOCGSTAMP
was called on a socket where no packet
arrived.
EHOSTUNREACH
ENODEV
ENOPKG
Other errors may be generated by the underlying or overlaying protocols; see
ss7(7)
,
raw(7)
and socket(7)
EXAMPLES
SEE ALSO
ss7(7)
,
link(7)
,
ss7device(7)
,
gws(7)
,
socket(7)
,
raw(7)
,
ip(7)
,
udp(7)
,
sysctl(2)
,
getsockopt(2)
,
setsockopt(2)
,
bind(2)
,
connect(2)
,
accept(2)
,
sendto(2)
,
sendmsg(2)
,
recvmsg(2)
,
send(2)
,
write(2)
.
NOTES
CAVEATS
When an MTP socket is not bound to a local PC (Point Code) and UP (User Part)
with the bind(2)
call, and a
recvmsg(2)
or other receive operation is specified, the
socket will receive any message which is for any local point code and user
part which is not already bound to a socket. This causes problems if multiple
sockets are left unbound yet are involved in a receive operation as the kernel
only delivers the packet to the first unbound socket. No other unbound socket
will received the packet. Because of this, receiving on an unbound socket is
a privileged operation.
DIAGNOSTICS
BUGS
As this is an ALPHA (experimental) release. As such, there are probably many unknown bugs.
The sysctls transfer_restricted
,
message_priority
, multi_congest_levels
,
cluster_routing
and ansi_sls_rotation
are not implemented and have no effect at this time. The ANSI behavior is
always chosen.
RESTRICTIONS
MTP does not really implement SS7_NTWK_NSEQ
sockets any
differently form SS7_NTKW_ISEQ
sockets. The user of the
socket must specify an SLS (Signalling Link Selection) code in the destination
address which either provides in-sequence delivery or non-guaranteed
in-sequence delivery as the user wishes. I do not intend to change this.
When multiple SPCs (Signalling Point Codes) are assigned to a host and the
transfer_function
option is enabled, it is assumed that
there is connectivity for transferring messages between any of the SPCs
defined. The gws(7)
(Gateway
Screening) package can be used to restrict the transfer of messages between
local SPCs similar to the ipchains
package for
ip(7)
with ipv4_forward
enabled.
MTP sockets only support LSL (Low Speed Links) and not HSL (High Speed Links)
nor broadband MTP.
AUTHOR
OpenSS7, <openss7@openss7.org>.
This man page borrows literally and heavily from the
udp(7)
man page for Linux written by Andi Kleen
<ak@muc.de>.
HISTORY
OpenSS7 was implemented first for Linux for the Linux 2.2 kernels.
REFERENCES
ITU-T Rec. Q.700, Introduction to CCITT Signalling System No. 7,
ITU-T Rec. Q.701, Functional description of the message transfer part (MTP) of Signalling System No. 7,
ITU-T Rec. Q.702, Signalling data link,
ITU-T Rec. Q.703, Signalling link,
ITU-T Rec. Q.704, Signalling network functions and messages,
ITU-T Rec. Q.705, Signalling network structure,
ITU-T Rec. Q.706, Message transfer part signalling performance,
ITU-T Rec. Q.707, Testing and maintenance,
ITU-T Rec. Q.708, Assignment procedures for international signalling point codes,
ITU-T Rec. Q.709, Hypothetical signalling reference connection,
ITU-T Rec. Q.710, Simplified MTP for small systems
ANSI T1.110, General Information,
ANSI T1.111, Message Transfer Part (MTP)
ETSI ETS 300 008-1, Message Transfer Part (MTP),
ETSI ETS 300 008-2, Message Transfer Part (MTP),
ETSI ETS 300 336, Message Transfer Part (MTP),
ETSI ETS 300 346, Message Transfer Part (MTP)