SS7RAW(7)

NAME
ss7raw - Linux SS7 raw sockets

SYNOPSIS
#include <sys/socket.h>
#include <netss7/ss7.h>
raw_socket = socket(PF_SS7, SOCK_RAW, int protocol);

DESCRIPTION

Raw SS7 sockets permit ferry clip testing and other experimentation with the SS7 protocols in user space. A raw SS7 socket sends ore receives SS7 PDUs without invoking the protocol state machine at the specified protocol level and permits simulation and protocol testing. Only processes with an effective user id of 0 or the CAP_NET_RAW capability are allowed to open raw sockets. All primitives, PDUs or errors matching the protocol number specified for the raw socket are passed to this socket. Raw SS7 sockets depend on the protocol specified. The following protocol values are allowed:

SS7_PROT_LINK
    This socket provides for the exchange of primitives and PDUs below the SS7 Link Level state machines (i.e. directly with the SS7 Link Interface). The socket will generate its own Link Level header (FSN/FIB, BSN/BIB, and LI) when sending PDUs on the socket unless the SS7_HDRINCL socket option is enabled on the socket.
    Level 2 Header Fields Modified on Sending
    Field | Action
    FSN/FIB | Supplied by socket
    BSN/BIB |
    LI | Calculated by socket

    If SS7_HDRINCL is specified, all Level 2 header fields must be supplied by the user.

SS7_PROT_NTWK
    This socket provides for the exchange of primitives and PDUs below the SS7 Network Level state machines (i.e., directly with the SS7 Link Level state machines). The socket will generate an SS7 Routing Label when sending a PDU unless the SS7_HDRINCL socket option is enabled on the socket.
    Level 3 Header Fields Modified on Sending
    Field | Action
    SI | Supplied by user
    NI |
    MP |
    DPC | Socket destination address when socket is bound, otherwise, supplied by user.
    OPC | Selected by MTP Routing
    SLS | Selected by MTP State Machine

    If SS7_HDRINCL is specified and the SS7 DPC has a non-zero destination address, then the destination address of the socket is used to route the primitive or PDU. When MSG_DONTROUTE is specified, the destination address should refer to the adjacent address of a local linkset, otherwise a routing table lookup is done anyways but routes via Signalling Transfer Points are ignored.

In OpenSS7 for Linux 2.2 all SS7 header fields and characteristics can be controlled using SS7 socket options, sysctls and ioctls. This means that raw SS7 sockets are usually only needed for simulation and testing. When a packet is received, it is passed to any raw sockets which have been bound to its protocol before it is passed to other protocol handlers (e.g. kernel protocol modules).

ADDRESS FORMAT
Raw SS7 sockets use the sockaddr_ss7 address structure defined in ss7(7).

SOCKET OPTIONS
Raw socket options can be set with setsockopt(2) and read with getsockopt(2) by passing the SOL_RAW family flag. There are no socket options specific to raw SS7 sockets at this time. In addition all ss7(7) SOL_SS7 socket options valid for datagram sockets are supported.

NOTES
A raw socket can be bound to a specific local address using the bind(2) call. If it isn't bound all packets with the specified SS7 protocol are received. In addition a RAW socket can be bound to a specific SS7 interface device using SO_BINDTODEVICE; see socket(7). An IPPROTO_RAW socket is send only. If you really want to receive all SS7 packets use a packet(7) socket with the ETH_P_SS7 protocol. If you want to receive all SNTM PDUs for an MTP socket it is often better to use SS7_RECVERR on that particular socket; see ss7(7). Raw sockets may tap all SS7 protocols in Linux, even protocols like MTP or SCCP which have a protocol module in the kernel. In this case the packets are passed to both the kernel module and the raw socket(s). This should not be relied upon in portable programs, other BSD socket implementation have differences here. Linux never changes headers passed from the user when SS7_HDRINCL is enabled (except for filling in some zeroed fields as described for SS7_HDRINCL). This may differ from other implementations of raw sockets for SS7. RAW sockets are generally rather unportable and should be avoided in programs intended to be portable. Sending on raw sockets should take the IP protocol from sin_port; this ability was lost in Linux 2.2. Work around is to use IP_HDRINCL.

ERROR HANDLING
Errors originating from the network are only passed to the user when the socket is connected or the SS7_RECVERR flag is enabled. For connected sockets only EMSGSIZE and EPROTO are passed for compatibility. With SS7_RECVERR all network errors are saved in the error queue.

ERRORS

EMSGSIZE
    SS7 raw sockets do not return this error. This is because it is intended for testing and the user may send an intentionally long packet.

EPROTO
    An ICMP error has arrived reporting a parameter problem.

EFAULT
    An invalid memory address was supplied.

EOPNOTSUPP
    Invalid flag has been passed to a socket call (like MSG_OOB).

EINVAL
    Invalid argument.

EPERM
    The user doesn't have permission to open raw sockets. Only processes with a effective user id of 0 or the CAP_NET_RAW attribute may do that.

BUGS

As this is an ALPHA (experimental) release. As such, there are probably many unknown bugs.

RESTRICTIONS

The SS7 raw packet capability was intended for testing the protocol implementation itself. Aside from protocol testing and test or simulation application, raw SS7 sockets serve no purpose.

HISTORY

The OpenSS7 package provides this BSD socket interface for SS7 and was first provided as a module for Linux 2.2.

AUTHOR

Brian F. G. Bidulock, <bidulock@openswitch.org>.

This man page borrows literally and heavily from the row(7) man page for Linux written by Andi Kleen <ak@muc.de>.

SEE ALSO

ss7device(7), link(7), mtp(7), sccp(7), isup(7), tcap(7), gws(7), ip(7), raw(7), socket(7), socket(2), listen(2), connect(2), accept(2), bind(2), htonl(3), recvmsg(2), sendto(2), write(2), setsockopt(2), getsockopt(2), sysctl(2), ioctl(2).

REFERENCES

ITU-T Rec. Q.700, Introduction to CCITT Signalling System No. 7,
ITU-T Rec. Q.701, Functional description of the MTP,
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 SPCs,
ITU-T Rec. Q.709, Hypothetical signalling reference connection,
ITU-T Rec. Q.710, Simplified MTP for small systems,
ITU-T Rec. Q.711, Functional description of the SCCP,
ITU-T Rec. Q.712, Definition and function of SCCP messages,
ITU-T Rec. Q.713, Signalling connection control part formats and codes,
ITU-T Rec. Q.714, Signalling connection control part procedures,
ITU-T Rec. Q.715, Signalling connection control part user guide,
ITU-T Rec. Q.716, Signalling connection control part performance.

ANSI T1.110, General Information,
ANSI T1.111, Message Transfer Part (MTP),
ANSI T1.112, Signalling Connection Control Part (SCCP),
ANSI T1.113, Integrated Services Digital Network (ISDN) User Part,
ANSI T1.114, Transaction Capability Application Part (TCAP),
ANSI T1.116, Operations, Maintenance and Administration Part (OMAP).

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),
ETSI ETS 300 009-1, Signalling Connection Control Part (SCCP),
ETSI ETS 300 009-2, Signalling Connection Control Part (SCCP),
ETSI ETS 300 009-3, Signalling Connection Control Part (SCCP),
ETSI ETS 301 008, Signalling Connection Control Part (SCCP).