Erlang -- diameter_sctp(3)

Diameter

Reference Manual

Version 2.2

- User's Guide
- Reference Manual
- Release Notes
- PDF
- Top

- Expand All
- Contract All

### Table of Contents

- diameter
  - Top of manual page
  - add_transport/2
  - call/4
  - origin_state_id/0
  - remove_transport/2
  - service_info/2
  - services/0
  - session_id/1
  - start/0
  - start_service/2
  - stop/0
  - stop_service/1
  - subscribe/1
  - unsubscribe/1
- diameterc
- diameter_app
  - Top of manual page
  - Mod:handle_answer/4
  - Mod:handle_error/4
  - Mod:handle_request/3
  - Mod:peer_down/3
  - Mod:peer_up/3
  - Mod:pick_peer/4
  - Mod:prepare_request/3
  - Mod:prepare_retransmit/3
- diameter_codec
  - Top of manual page
  - decode/2
  - encode/2
- diameter_dict
- diameter_make
  - Top of manual page
  - codec/2
  - flatten/1
  - format/1
  - format_error/1
- diameter_transport
  - Top of manual page
  - Mod:start/3
- diameter_tcp
  - Top of manual page
  - start/3
- diameter_sctp
  - Top of manual page
  - start/3

# diameter_sctp

### Module

diameter_sctp

### Module Summary

Diameter transport over SCTP.

### Since

Module diameter_sctp was introduced in OTP R14B03.

### Description

This module implements diameter transport over SCTP using gen_sctp(3). It can be specified as the value of a transport_module option to diameter:add_transport/2 and implements the behaviour documented in diameter_transport(3).

### Exports

start({Type, Ref}, Svc, [Opt]) -> {ok, Pid, [LAddr]} | {error, Reason} | OTP R14B03

### Types

Type = connect | accept
Ref = diameter:transport_ref()
Svc = #diameter_service{}
Opt = OwnOpt | SctpOpt
Pid = pid()
LAddr = inet:ip_address()
Reason = term()
OwnOpt = {raddr, inet:ip_address()} | {rport, integer()} | {accept, Match} | {unordered, boolean() | pos_integer()} | {packet, boolean() | raw} | {message_cb, diameter:eval()} | {sender, boolean()}
SctpOpt = term()
Match = inet:ip_address() | string() | [Match]

The start function required by diameter_transport(3).

Options raddr and rport specify the remote address and port for a connecting transport and not valid for a listening transport: the former is required while latter defaults to 3868 if unspecified. Multiple raddr options can be specified, in which case the connecting transport in question attempts each in sequence until an association is established.

Option accept specifies remote addresses for a listening transport and is not valid for a connecting transport. If specified, a remote address that does not match one of the specified addresses causes the association to be aborted. Multiple accept options can be specified. A string-valued Match that does not parse as an address is interpreted as a regular expression.

Option unordered specifies whether or not to use unordered delivery, integer N being equivalent to N =< OS, where OS is the number of outbound streams negotiated on the association in question. Regardless of configuration, sending is ordered on stream 0 until reception of a second incoming message, to ensure that a peer receives capabilities exchange messages before any other. Defaults to false.

Option packet determines how/if an incoming message is packaged into a diameter_packet record. If false then messages are received as binary(). If true then as a record with the binary() message in the bin field and a {stream, Id} tuple in the transport_data field, where Id is the identifier of the inbound stream the message was received on. If raw then as a record with the received ancillary sctp_sndrcvinfo record in the transport_data field. Defaults to true.

Options message_cb and sender have semantics identical to those documented in diameter_tcp(3), but with the message argument to a recv callback being as directed by the packet option.

An {outstream, Id} tuple in the transport_data field of a outgoing diameter_packet record sets the outbound stream on which the message is sent, modulo the negotiated number of outbound streams. Any other value causes successive such sends to cycle though all outbound streams.

Remaining options are any accepted by gen_sctp:open/1, with the exception of options mode, binary, list, active and sctp_events. Note that options ip and port specify the local address and port respectively.

Multiple ip options can be specified for a multihomed peer. If none are specified then the values of Host-IP-Address in the diameter_service record are used. Option port defaults to 3868 for a listening transport and 0 for a connecting transport.

Warning

An small receive buffer may result in a peer having to resend incoming messages: set the inet(3) option recbuf to increase the buffer size.

An small send buffer may result in outgoing messages being discarded: set the inet(3) option sndbuf to increase the buffer size.

### SEE ALSO

diameter(3), diameter_transport(3), gen_sctp(3), inet(3)