Contents
The Diameter protocol is an authentication, authorization, and accounting protocol for computer networks that evolved from and replaces the RADIUS protocol that preceded it.
The Spotfire Streaming Client Controller Adapter for Diameter allows for controlling of the Diameter client connection and also outputs status information about the current Diameter connection. This adapter is not required for the Diameter client input and output adapters to work, but it is highly recommended as no status output occurs on the other client adapters. All the adapters sharing a configuration work together on the same underlying connection; see the section below about shared configurations for more information.
This section describes the properties you can set for this adapter, using the various tabs of the Properties view in StreamBase Studio.
Name: Use this required field to specify or change the name of this instance of this component. The name must be unique within the current EventFlow module. The name can contain alphanumeric characters, underscores, and escaped special characters. Special characters can be escaped as described in Identifier Naming Rules. The first character must be alphabetic or an underscore.
Adapter: A read-only field that shows the formal name of the adapter.
Start with application: If this field is set to Yes
(default) or to a module parameter that evaluates to true
, this instance of this adapter starts as part of the JVM
engine that runs this EventFlow fragment. If this field is set to No or to a module
parameter that evaluates to false
, the adapter
instance is loaded with the engine, but does not start until you send an
epadmin container resume command (or
its sbadmin equivalent), or until you
start the component with StreamBase Manager.
Enable Error Output Port: Select this checkbox to add an Error Port to this component. In the EventFlow canvas, the Error Port shows as a red output port, always the last port for the component. See Using Error Ports to learn about Error Ports.
Description: Optionally, enter text to briefly describe the purpose and function of the component. In the EventFlow Editor canvas, you can see the description by pressing Ctrl while the component's tooltip is displayed.
Property | Type | Description |
---|---|---|
Diameter Configuration | Edit Button |
Shortcut to the StreamBase Configuration File Editor, used for
adapter configuration or converting an existing application's adapter-configurations.xml file to HOCON format.
|
Adapter Configuration | Drop-down list | The adapter configuration from the configuration file to use with this adapter. |
Enable Control Port | Check box | If enabled a control port will allow commands to be sent to the operator to perform actions during runtime. |
Log Level | INFO | Controls the level of verbosity the adapter uses to issue informational traces to the console. This setting is independent of the containing application's overall log level. Available values, in increasing order of verbosity, are: OFF, ERROR, WARN, INFO, DEBUG, TRACE. |
Use the Concurrency tab to specify parallel regions for this instance of this component, or multiplicity options, or both. The Concurrency tab settings are described in Concurrency Options, and dispatch styles are described in Dispatch Styles.
Caution
Concurrency settings are not suitable for every application, and using these settings requires a thorough analysis of your application. For details, see Execution Order and Concurrency, which includes important guidelines for using the concurrency options.
The shared adapter configuration for the Diameter adapters is located in HOCON.
name = "Diameter.conf" type = "com.tibco.ep.streambase.configuration.adapter" version = "1.0.0" configuration = { // An adapter group type defines a collection of EventFlow adapter configurations, // indexed by adapter type. AdapterGroup = { // A collection of EventFlow adapter configurations, indexed by adapter type. // This object is required and must contain at least one configuration. adapters = { // The root section for an EventFlow adapter configuration. DiameterAdapters = { // Section list. This array is optional and has no default value. sections = [ // A configuration for an EventFlow adapter named section. { // Section name. The value does not have to be unique; that // is, you can have multiple sections with the same name // in the same array of sections. This property is required. name = "DiameterAdapter" // Section for setting adapter properties. All values must be strings. This object // is optional and has no default value. settings = { dictionary = "TestDictionary.json" host = "" id = "DiameterSectionedMessagesServer" originHost = "127.0.0.1" originRealm = "tibco.com" productName = "Streambase" } } // A configuration for an EventFlow adapter named section. { // Section name. The value does not have to be unique; that is, // you can have multiple sections with the same name // in the same array of sections. This property is required. name = "DiameterAdapter" // Section for setting adapter properties. All values must be strings. This object // is optional and has no default value. settings = { dictionary = "TestDictionary.json" host = "127.0.0.1" id = "DiameterSectionedMessagesClient" originHost = "127.0.0.1" originRealm = "tibco.com" productName = "Streambase" } } ] } } } }
Property | Type | Default | Description |
---|---|---|---|
id | string | This is the name that will link the adapters together and is displayed in the dropdown list on each adapter's property configuration. | |
dictionary | string | This is the Diameter dictionary file name that will be used for composing and parsing Diameter messages. | |
host | string | For the server, this is the host it will accept connections on; leave blank for all, and for the client this is the host to connect to. | |
port | int | 3868 | For the server, this is the port the server listens on; if 0, a random port is selected; for the client, this is the port the client will create the outbound connection to. |
networkProtocol | string | TCP |
Valid values are TCP and
SCTP and determines the
underlying network protocol to use.
|
startServerAtStartup | boolean | true | Only valid for server adapters. If set to true, the server creates a listener at the startup of the application. If set to false, then the control port must be used to start the server listener. |
connectAtStartup | boolean | true | Only valid for client adapters. If set to true, the client attempts to connect to the server at startup of the application; if set to false then you must use the control port to establish a connection. |
noDelay | boolean | false |
If set to true, the connection option no delay
is set on the sockets.
|
enableAutomaticReconnect | boolean | true | Only valid for client adapters. If set to true, the adapter will attempt to reconnect to the server if for any reason the connection is lost or is not initially established. |
connectTimeoutMS | int | 5000 | Only valid for client adapters. This value is the number of milliseconds to wait between a disconnect or invalid connection attempt and when a new connection attempt should be started. |
ceaTimeoutMS | int | 5000 | Only valid for client adapters. This value is the number of milliseconds to wait for a Capabilities-Exchange-Answer (CEA) after sending the Capabilities-Exchange-Request (CER). If this timeout expires without receiving the CEA, the connection will be closed and reconnection will be attempted. Setting this to 0 will disable this functionality. |
maxReconnectAttempts | int | 10 | Only valid for client adapters. This value is the maximum number of reconnect attempts that should be made before giving up trying to connect to the server. The number of reconnect attempts is reset after a valid connection is made. A value of 0 means unlimited connection attempts. |
maxDeviceWatchDogRequests | int | 3 | The maximum number of device watch dog request messages to send before disconnecting. |
watchDogTimeoutMS | int | 3000 | The amount of time (in milliseconds) before the watch dog times out and sends a watchdog request. |
originHost | string | 127.0.0.1 | The origin host to use with the connection. |
originRealm | string | my.realm | The origin realm to use with the connection. |
productName | string | StreamBase | The product name to use with the connection. |
firmwareVersion | int | 210 | The firmware to use with the connection. |
readBufferSize | int | 102400 | The number of bytes for each sockets circular read buffer. |
writeBufferSize | int | 102400 | The number of bytes for each sockets circular write buffer. |
socketReceiveBufferSize | int | -1 | This value directly sets the SO_RCVBUF size. If this option is missing or less than 0 it will be ignored and the default for your system is used. |
socketSendBufferSize | int | -1 | This value directly sets the SO_SNDBUF size. If this option is missing or less than 0 it will be ignored and the default for your system is used. |
connectTimeoutMS | int | -1 | This value sets the connection timeout in milliseconds. If this option is missing or less than 0 it will be ignored and the default for your system is used. |
writeSpinCount | int | -1 | The write spin count is used to control how many times the underlying socket.write(...) is called per write operation. If this option is missing or less than 0 it will be ignored and the default for your system is used. |
writeBufferWaterMarkHigh | int | -1 | If the number of bytes queued in the write buffer exceeds the high water mark, the channel will pause writing until it falls before the low water mark. If this option or writeBufferWaterMarkLow is missing or less than 0 it will be ignored and the default for your system is used. |
writeBufferWaterMarkLow | int | -1 | If the number of bytes queued in the write buffer exceeds the high water mark and then dropped down below the low water mark, the channel will start writing again. If this option or writeBufferWaterMarkHigh is missing or less than 0 it will be ignored and the default for your system is used. |
enableConnectionEventLogging | boolean | false | If enabled, verbose connection events are output at the debug log level such as READ, WRITE, and CONNECT. If the adapters log level is currently set to trace then detailed information is output for events with data such as READ and WRITE. |
secureCommunicationConfig | string | The name of the SecureCommunicationServerProfile (used in the Diameter Server Input adapter) or SecureCommunicationClientProfile (used in the Diameter Client Input adapter) HOCON configuration to use when setting up an SSL connection. If this value is missing or empty, no SSL is enabled for connections. | |
useSelfSignedCert | boolean | false | This option is only available when a name is given for the secureCommunicationConfig setting. When enabled, it ignores all security settings and instead generates and uses a self-signed certificate. This option only affects a Diameter server. WARNING! Use this option for testing purposes only. |
useInsecureTrustManager | boolean | false | This option is only available when a name is given for the secureCommunicationConfig setting. When enabled it ignores all security settings and instead uses a insecure trust manager which will allow all certificates. This option only affects a Diameter client. WARNING! Use this option for testing purposes only. |
rateControlType | string | NONE |
Valid values are NONE ,
SHED , and THROTTLE and will determine the rate
control type to use. Using THROTTLE causes the system to only hand
n number of requests per second
and will slow down the connection to that target rate. Using SHED causes
messages that go above the target rate to be discarded with a failure
message returned to the send.
|
tps | int | 1000 | The maximum number of tuples per second the system will handle per Origin Host. |
overallTPS | int | 5000 | The maximum number of tuples per second the system will handle overall. |
rateControlResultCode | int | 3004 | Only used when the rateControlType is set to SHED. This value is used as the Result Code of the reject message. |
rateControlAVP | string | Only used when the rateControlType is set to SHED. This value is used as the FailedAVP of the reject message. The format of this string is a comma-separated list of code and vendorIds with vendorId being optional; code and vendorId are joined with a pipe character. For example: code|vendorId,code|vendorId,code,code | |
outputRawBinaryInTraceLog | boolean | false | This option will output all messages sent and received to the log in raw binary format when the log level is set to trace and this option is set to true. WARNING! Use this option for testing purposes only. |
This section describes Diameter dictionaries and how they are used with the adapters to parse and compose Diameter messages.
Dictionary files are in JSON format and are cumulative in that you can include more dictionary files inside of other dictionary files to keep them organized and less complex.
StreamBase includes a Diameter
sample that comes with a BaseDictionary.json
file. It is a best practice to use the file as the base for your Diameter projects.
This base dictionary includes all the required information for the Diameter
adapters to perform the most basic Diameter protocol functions. The sample also
includes a TestDictionary.json
that shows the most
basic dictionary files, including the base dictionary, to get the adapters up and
running.
The following shows the schema to which each dictionary must conform:
{ "$schema":"http://json-schema.org/draft-04/schema#", "type":"object", "properties":{ "includeDictionary":{ "type":"array", "items":{ "type":"object", "properties":{ "file":{ "type":"string" } }, "required":[ "file" ] } }, "settings":{ "type":"object", "properties":{ "enumAsString":{ "type":"boolean" }, "applicationAndCommandAsString":{ "type":"boolean" } } }, "vendors":{ "type":"array", "items":{ "type":"object", "properties":{ "name":{ "type":"string" }, "id":{ "type":"string" }, "code":{ "type":"integer" } }, "required":[ "name", "id", "code" ] } }, "dataTypes":{ "type":"array", "items":{ "type":"object", "properties":{ "dataType":{ "type":"string" }, "parentDataType":{ "type":"string" } }, "required":[ "dataType" ] } }, "avps":{ "type":"array", "items":{ "type":"object", "properties":{ "name":{ "type":"string" }, "code":{ "type":"integer" }, "vendorId":{ "type":"string" }, "must":{ "type":"array", "items":{ "enum":[ "M", "V", null ] } }, "must-not":{ "type":"array", "items":{ "enum":[ "M", "V", null ] } }, "type":{ "type":"object", "properties":{ "dataType":{ "type":"string" }, "enum":{ "type":[ "array", "object" ], "items":{ "type":"object", "properties":{ "value":{ "type":"integer" }, "name":{ "type":"string" } }, "required":[ "name" ] } } }, "required":[ "dataType" ] }, "grouped":{ "type":"array", "items":{ "type":"object", "properties":{ "name":{ "type":"string" }, "min":{ "type":"integer" }, "max":{ "type":"integer" } } } } }, "required":[ "name", "code" ] } }, "applications":{ "type":"array", "items":{ "type":"object", "properties":{ "applicationId":{ "type":"integer" }, "name":{ "type":"string" }, "commands":{ "type":"array", "items":{ "type":"object", "properties":{ "name":{ "type":"string" }, "code":{ "type":"integer" }, "proxiable": { "type":"boolean" }, "request":{ "type":"array", "items":{ "type":"object", "properties":{ "name":{ "type":"string" }, "min":{ "type":"integer" }, "max":{ "type":"integer" }, "vendorId":{ "type":"string" }, "index":{ "type":"integer" }, "hidden":{ "type":"boolean" } }, "required":[ "name", "min" ] } }, "answer":{ "type":"array", "items":{ "type":"object", "properties":{ "name":{ "type":"string" }, "min":{ "type":"integer" }, "max":{ "type":"integer" }, "vendorId":{ "type":"string" }, "index":{ "type":"integer" }, "hidden":{ "type":"boolean" } }, "required":[ "name", "min" ] } } }, "required":[ "name", "code", "proxiable", "request", "answer" ] } } }, "required":[ "commands", "applicationId" ] } } }, "required":[ "vendors", "dataTypes", "avps", "applications" ] }
The following are the major categories of the dictionary file and an overview of their usage.
The includeDictionary section is an array of files that allows one dictionary file to include another dictionary file. This enables you to organize your dictionaries into logical application or vendor groups and combine them into a single dictionary.
-
file — The relative path to the linked dictionary file to include.
The settings section allows dictionary related settings to be set.
-
enumAsString — The enumAsString setting is a true/false flag that determines if the string values of the enumerations in the dictionary should be used in EventFlow instead of the integer values. If set to true, the schemas produced by parsing the dictionary files will input/output a string value for all enum fields and require that any input fields match one of the enum values listed.
-
applicationAndCommandAsString — The applicationAndCommandAsString setting is a true/false flag that determines if the applicationId and commandCode fields of the request and answer message headers should be treated as string or numeric fields. If this value is true, the input and outputs of the adapters will consider the applicationId and commandCode to be string fields and match them to the dictionary name values. All messages read from the Diameter connection are translated to the correct string values, and all tuples are converted to the correct numeric values for the outbound Diameter messages.
The vendors section allows you to add vendor names and codes that will be used later in avp's and application commands.
-
name — The human-readable name of the vendor.
-
code — The code of the vendor to use with vendorId fields in other sections, for linking.
-
id — The ID of the vendor to send with Diameter messages.
The dataTypes section allows you to add any extended data types that are not already specified by the base dictionary.
-
dataType - The name of the data type which will be used when creating AVPs.
-
parentDataType - The parent data type which must eventually link back to one of the base underlying data types (OctetString, OctetStringBinary, OctetStringBase64, Integer32, Integer64, Unsigned32, Unsigned64, Float32, Float64).
-
OctetStringBinary will produce a blob field and the data from the diameter packet will be direct output to event flow as a binary payload
-
OctetStringBase64 will produce a string field and the data from the diameter packet will be Base64 encoded into event flow and Base64 decoded before sending.
-
Note
As AVPs of type Address have an underlying data type
of OctetString, they are represented as strings by
the adapter. However, since such addresses may use different formatting and
encoding based on their AdressType, additional information is needed so the
adapter expects the string to be of format XX|<value>
, where XX is the address family number as
defined in the document IANA Address Family Numbers. Thus, an IPv4 address of
127.0.0.1
will be represented as the string
1|127.0.0.1
, the IPv6 address 0:0:0:0:0:0:0:1
will be 2|0:0:0:0:0:0:0:1
and the E.164 address representing the phone
number 1-213-555-1212 will be 8|12135551212
.
The avps (attribute value pairs) section allows you to add any AVPs that are not currently present in the base dictionary. These AVPs can be self-referenced to form nested structures. The AVPs are used in the application commands as the fields for each request and answer command.
-
name — The AVP name that is used later in the application commands to link AVPs to commands.
code — The AVP code that is sent and used in the Diameter message.
vendorId — (Optional) The vendor associated with this AVP; use the code of one of the vendors in the vendor section.
must — An array of Diameter values to specify how this AVP will operate, value available:
-
M — In the must case it means the AVP must appear in the Diameter message or the message will be rejected.
-
V — In the must case it means the vendorId must have a value.
must-not — An array of Diameter values to specify how this AVP will operate, value available:
-
M — In the must-not case it means the AVP must NOT appear in the Diameter message or the message will be rejected.
-
V — In the must-not case it means the vendorId must NOT appear in the Diameter message or the message will be rejected.
type — The data type of this AVP which must correspond to one of the base or extended data types. If this field is missing then the
grouped
field must exist.grouped — An array of nested AVP values.
-
name — The name of the AVP to include.
-
min — (Optional) The minimum number of times this value must appear.
-
max — (Optional) The maximum number of times this value must appear.
-
The applications section allows you to add any applications and commands that are not currently present in the base dictionary. The applications section is the main building block for creating a Diameter application and is comprised of multiple commands. Each command in turn has a request and answer message that is created from one or many AVPs listed in the AVP section.
-
applicationId — The application ID used when sending Diameter messages. This value is also used during the capabilities exchange.
-
name — The human-readable name of this application to use in the adapter properties.
-
commands — The array of commands associated with this application.
-
name — The name of the command, and is used in the adapter properties.
-
code — The code of the command used to create the Diameter message.
-
proxiable — A flag to specify if this command is proxiable.
-
request/answer — An array of AVP values which make up the request/answer commands.
-
name — The name of the AVP to include.
-
min — (Optional) The minimum number of times this value must appear.
-
max — (Optional) The maximum number of times this value must appear.
-
vendorId — (Optional) The vendor associated with this AVP; use the code of one of the vendors in the vendor section.
-
index — (Optional) The index of this AVP value is the order of the AVP values.
-
hidden — (Optional) If hidden is true, the AVP value will be parsed from messages but is ignored in the StreamBase application and does not appear in the generated schema. This value cannot be true if the min value present and is greater than 0.
-
-
Use the command port to send action commands to the adapter.
The schema for the command input port is a single field named command
of type string.
The suggested full schema for the command input port is the following:
-
command, string—The command to send to the adapter. Valid values are:
-
connect—Starts a connection to a Diameter server.
-
disconnect—Forcefully disconnects the current connection from the Diameter server.
-
gracefuldisconnect—Starts a client disconnection by sending a Disconnect Peer(282) request message and waits for an answer before closing the connection.
-
-
host, string (Optional)—Used to override the configurations host when the connect command is used.
-
port, int (Optional)—Used to override the configurations port when the connect command is used.
The status output port will output tuples for the current configuration giving relevant information about the connection.
The schema for the status output port is:
Field Name | Field Type | Description |
---|---|---|
Status | String | A string describing the current status of the adapter. |
Time | timestamp | The timestamp that the status occurred. |
Info | list(tuple(Name string, Value string)) | A list of name-value pairs of data to got more context to the status. |
The following is a list of status outputs and the associated objects:
Status | Description | Info Elements |
---|---|---|
Listening | (Server Only) Indicates the server has started listening for connections |
|
Listen Stopped | (Server Only) Indicates the server has stopped listening for connections |
|
Listen Error | (Server Only) Indicates the server failed to start listening |
|
Connected | (Client Only) Indicates a connection has successfully been made |
|
Connecting | (Client Only) Indicates a connection attempt is starting to a server |
|
Connect Error | (Client Only) Indicates a connection failed to be made to the server |
|
Reconnect Error | (Client Only) The maximum number of connection retry attempts was reached. |
|
Client Connected | (Server Only) Indicates a client connection has successfully been made |
|
Client Connect Error | (Server Only) Indicates a client connection failed to be made |
|
Disconnected | Indicates a connection has been disconnected |
|
Disconnect Error | Indicates an error occurred while trying to disconnect a connection |
|
Watchdog Timer expired | Indicates the connections watch dog timer has expired |
|
Start Request Error | Indicates an error occurred while trying to process a startrequest command |
|
Write Error | Indicates an error occurred when a tuple is unable to be written to the connection. This may be an error composing the message into Diameter format or a socket-level error writing to the underlying socket. |
|
CER Error | Indicates an error occurred while trying to handle a CER message |
|
CER Send Error | Indicates an error occurred while trying to send a CER message |
|
CEA Error | Indicates an error occurred while trying to handle a CER message |
|
DWR Error | Indicates an error occurred while trying to handle a DWR message |
|
DWR Send Error | Indicates an error occurred while trying to send a DWR message |
|
DWA Send Error | Indicates an error occurred while trying to send a DWA message |
|
DPR Error | Indicates an error occurred while trying to handle a DPR message |
|
DPA Send Error | Indicates an error occurred while trying to send a DWA message |
|
Control Error | (Control Adapters) Indicates an error occurred processing a command |
|
Read Error | Indicates and error occurred during a read operation |
|
Shutdown Error | Indicates an error occurred during shutdown of the client selector thread |
|