OpenSS7: Socket Documentation

OpenSS7 | Brian F. G. Bidulock, © Copyright 2000, Brian F. G. Bidulock, All Rights Reserved.
All OpenSS7 website, www.openss7.org resources have provided as a courtesy of the OpenSwitch Project and Herlein Engineering.

# Socket Documentation

When the SS7 socket module is loaded, socket support is provided for link, network, and sccp sockets using the socket abstraction. Sockets are opened with a protocol family of `PF_SS7`, with a socket type which corresponds to one of the types listed in the sections below, and a protocol from the following list:

Table 1 - SS7 Protocols
Protocol | Description
--- | ---
`SS7_PROT_LINK` | This is the SS7 MTP Level 2 (Link) protocol which is described in ITU-T Recommendation Q.703.
`SS7_PROT_NTWK` | This is the SS7 MTP Level 3 (Network) protocol which is described in ITU-T Recommendation Q.704.
`SS7_PROT_SCCP` | This is the SS7 SCCP protocol which is described in ITU-T Recommendation Q.711.

### Link Sockets

The following socket types are valid for protocol `SS7_PROT_LINK`:

Table 2 - SS7 Link Socket Types
SS7 Socket Type | Socket Type | Description
--- | --- | ---
`SOCK_LINK_RAW` | `SOCK_RAW` | When `SOCK_RAW` is specified, the socket is a RAW link socket which will send PDUs or Abstract Service Primitives (ASPs) directly to the link to which the socket is bound. This link cannot be bound to an SS7 MTP Level 3. Raw L2 sockets do not bypass the SS7 MTP Level 2 state machines described in ITU-T Recommendation Q.703. Raw L2 sockets are useful primarily for testing (or tester) purposes.

For additional information on link sockets, see the link sockets description.

### MTP Sockets

SS7 MTP is normally accessed by application user parts such as ISUP, TUP, etc. (This information is contained in the SS7 address `struct sockaddr_ss7` much like a TCP port number is for IP.) MTP provides reliable, sequenced end-to-end packet delivery or reliable but unsequenced packet delivery depending upon the user's use of SLS (Signalling Link Selection) field. All messages with the same SLS are guaranteed in-sequence delivery, whereas different SLSs does not necessarily provide in-sequence delivery, particularly in the presence of SS7 network failures.

The following socket types are valid for protocol `SS7_PROT_NTWK`:

Table 3 - SS7 MTP Socket Types
SS7 Socket Type | Socket Type | Description
--- | --- | ---
`SOCK_NTWK_NSEQ` | `SOCK_RDM` | When `SOCK_RDM` is chosen, the MTP protocol layer will rotate the SLS field to ensure balancing of messages across links in a linkset.
`SOCK_NTWK_ISEQ` | `SOCK_SEQPACKET` | When `SOCK_SEQPACKET` is chosen, the socket user must provide a stream number which the MTP protocol layer will use to assign a consistent SLS value for a given stream. There are conditions on the stream identifier which make it suitable for simple SLS selection, and there is no guarantee that the MTP will not just use the bottom 5 bits.
`SOCK_NTWK_RAW` | `SOCK_RAW` | When `SOCK_RAW` is specified, the socket is a raw MTP socket which will send PDUs or Abstract Service Primitives (ASPs) to the MTP state machines bypassing the SNM and STM management state machines within the MTP Level 3. This is primarily useful for testing (or tester) purposes.

For additional information on MTP sockets, see the MTP sockets description.

### SCCP Sockets

These mappings really don't make complete sense; however, there are four classes of SCCP transport service of which some correspond to the standard socket definitions here, and some which do not correspond so completely.

The following socket types are valid for protocol `SS7_PROT_SCCP`:

Table 4 - SS7 SCCP Socket Types
SS7 Socket Type | Socket Type | Description
--- | --- | ---
`SOCK_SCCP_CC_0` | `SOCK_DGRAM` | `SOCK_DGRAM` correpsonds to SCCP Connection Class 0. SCCP Connection Class 0 is unsequenced connectionless delivery. (Not necessarily unreliable.)
`SOCK_SCCP_CC_1` | `SOCK_RDM` | `SOCK_RDM` corresponds to SCCP Connection Class 1. SCCP Connection Class 1 is sequenced connectionless service. (Again, not necessarily unreliable.)
`SOCK_SCCP_CC_2` | `SOCK_SEQPACKET` | `SOCK_SEQPACKET` corresponds to SCCP Connection Class 2. SCCP Connection Class 2 is sequenced connection-oriented delivery without flow control.
`SOCK_SCCP_CC_3` | `SOCK_STREAM` | `SOCK_STREAM` corresponds to SCCP Connection Class 3. SCCP Connection Class 3 is sequenced connection-oriented delivery with flow control.
`SOCK_SCCP_RAW` | `SOCK_RAW` | When `SOCK_RAW` is specified, the socket is a raw SCCP socket which will send PDUs and ASPs to the SCCP state machines bypassing the SCCP Management state machines within the SCCP. This is primarily useful for testing (or tester) purposes.

For additional information on SCCP sockets, see the SCCP sockets description.

OpenSS7 | Brian F. G. Bidulock, © 2000, Brian F. G. Bidulock, All Rights Reserved. Last modified: $Date: 2000/10/04 03:52:24 $