Manual Chapter : iRule support for Diameter

Applies To:

  • BIG-IP LTM

    15.0.1, 15.0.0

iRule support for Diameter

An iRule is a powerful and flexible feature within the BIG-IP local traffic management system that you can use to manage your network traffic. It allows operators to implement custom behavior beyond the native capabilities of the BIG-IP system.

MRF Diameter provides a set of iRule events which are raised during message processing and routing which allow operators to inspect and edit the Diameter messages. They allow operators to forward, route, reject or drop messages.

Event Description
DIAMETER_INGRESS Triggered when the system receive each DIAMETER message.
DIAMETER_EGRESS Triggered when the system is ready to send DIAMETER message.
DIAMETER_RETRANSMISSION Triggered when a request message is to be retransmitted.

If a client sends a message, DIAMETER_INGRESS is the client-side event and DIAMETER_EGRESS is the server-side event. If a server sends a message, DIAMETER_INGRESS is the server-side event and DIAMETER_EGRESS is the client-side event.

An iRule can be attached to the Virtual server and also to the transport-config attached to a peer.

If there is no transport config attached to the peer, then all events (DIAMETER_INGRESS/DIAMETER_EGRESS) in the iRule attached to the virtual server execute.

If a peer has a tranport-config attached to it, then the corresponding events must be present in the iRule in transport-config.

After routing has completed, the route status attribute will contain the status (success or failure) of the routing operation.

All the Diameter iRule commands specified in the following link are supported.

https://clouddocs.f5.com/api/irules/DIAMETER.html

Command

Description

Valid Diameter Events

Valid MR Events

DIAMETER::persist [new-persist-key][bidirection]

Deletes any persistence entry with the current persist key of this message.

DIAMETER_INGRESS

MR_INGRESS [For response messages returns EMPTY string]

DIAMETER::persist reset

Deletes any persistence entry with the current persist key of this message.

DIAMETER_INGRESS

DIAMETER_EGRESS

MR_INGRESS

MR_EGRESS

MR_FAILED

DIAMETER::persist use

Use the current persistence record for routing the message if present. If not present, route the message using the route table.

DIAMETER_INGRESS

MR_INGRESS

DIAMETER::persist bypass

Route the message using the route table (or iRule command). On completion of routing, add a new persistence record if one does not exist. If an existing persistence record exists, the existing record will not be replaced and the selected route will not be modified.

DIAMETER_INGRESS

MR_INGRESS

DIAMETER::persist replace

Route the message using the route table (or iRule command). On completion of routing, add a new persistence record if one does not exist. I an existing persistence record exists, replace the persistence record with the route selected.

DIAMETER_INGRESS

MR_INGRESS

DIAMETER::persist ignore

Route the message using the route table (or iRule command). The results of the routing will not be stored in the persistence table.

DIAMETER_INGRESS

MR_INGRESS

DIAMETER::persist timeout [new-timeout]

Updates the persistence timeout to the new-timeout value. If a persistence value is added or updated, the provided timeout will be used.

DIAMETER_INGRESS

DIAMETER_EGRESS

MR_INGRESS

MR_EGRESS

MR_FAILED

DIAMETER::persist bidirectional [boolean]

Gets or sets the bidirectional persistence flag for custom persistence keys.

DIAMETER_INGRESS

DIAMETER_EGRESS

MR_INGRESS

MR_EGRESS

MR_FAILED

DIAMETER::route_status

Returns the routing status of the current message.

DIAMETER_EGRESS

DIAMETER::retransmission_default action [new-action]

Sets or gets the default retransmission action for subsequent messages on this connection.

CLIENT_ACCEPTED

SERVER_CONNECTED

DIAMETER::retransmission_default timeout [new-timeout]

Sets or gets the default retransmission timeout (in seconds) for subsequent messages on this connection.

CLIENT_ACCEPTED

SERVER_CONNECTED

DIAMETER::retransmission_default error-codes [new-error-code-list]

Sets or gets the default retransmission error code list for subsequent messages on this connection.

CLIENT_ACCEPTED

SERVER_CONNECTED

DIAMETER::retransmission action [new-action]

Sets or gets the retransmission action for a current message.

DIAMETER_INGRESS

DIAMETER::retransmission timeout [new-timeout]

Sets or gets the retransmission timeout (in seconds) for current message.

DIAMETER_INGRESS

DIAMETER::retransmission error-codes [new-error-code-list]

Sets or gets the retransmission error code list for current message.

DIAMETER_INGRESS

DIAMETER::retransmit action [note]

Triggers retransmission of the corresponding queued request for the current answer message.

DIAMETER_EGRESS

DIAMETER::is_retransmission

Returns ‘1’ if the current message is a retransmitted request (a request internally triggered for retransmission).

DIAMETER_EGRESS

DIAMETER_RETRANSMISSION

MR_INGRESS

MR_EGRESS

MR_FAILED

DIAMETER::retransmission_reason

Returns the trigger for retransmitting the current message

DIAMETER_RETRANSMISSION,

DIAMETER_EGRESS

MR_INGRESS

when DIAMETER_INGRESS {
  DIAMETER::persist [DIAMETER::host origin]
  log local0. "New Persist-key = [DIAMETER::persist]"
}
when DIAMETER_INGRESS{
  log local0. "Persist-key = [DIAMETER::persist]"
}