ILXFlow

new ILXFlow()

Since:
  • BIP-IP TMOS 13.0

An ILXFlow is created by the ILXPlugin class ` <ILXPlugin.html#event:connect>`__

ILXPlugin#event:connect

event. The flow represents an end to end connection from the client, through a BigIP, to the server. There are client side (ILXFlow.client) and server side streams (ILXFlow.server) available.

Properties:

Name Type Description
client
ILXStream The client ILXStream object.
server
ILXStream The server ILXStream object.
virtual
object

Object with clientside virtual server metadata associated with the flow.

Propertie

s
name:properties-

1

Nam e Typ e Des cri pti on
nam e str ing Nam e of vir tua l ser ver
add res s str ing IP of vir tua l ser ver
por t num ber Por t pf the vir tua l ser ver
rou teD oma in num ber Rou te dom ain of the vir tua l ser ver
lb
ILXFlow~lb
ILXFlow~lb

object

Listens to Events:

Example:

 var f5 = require('f5-nodejs');
var plugin = new f5.ILXPlugin();

plugin.on('connect', function(flow) {
  flow.client.on('requestComplete', function(request) {
    <some code using ILXStream object>
    request.complete();
  });

  // Register callbacks for error events. Errors events must be caught.
  flow.client.on('error', function(errorText) {
    console.log('client error event: ' + errorText);
  });
  flow.server.on('error', function(errorText) {
    console.log('server error event: ' + errorText);
  });
  flow.on('error', function(errorText) {
    console.log('flow error event: ' + errorText);
  });
});

var options = new f5.ILXPluginOptions();
options.handleServerData = false;
options.handleClientData = false;
plugin.start(options);

Methods

destroy()

Immediate shutdown of client and server streams. Flow is no longer usable.

Note: flow.destroy has a bug where it closes the server side connflow, but does not close the client side connection. This is documented in BZ636093 and F5 PTG is currently working the issue.

detach()

Detach the flow, including both client and server streams from the tmm. Data will continue to flow to and from the client and server but the plugin is no longer in the loop. The plugin receives no further data events for this stream. This will increase performance of applications that inspect a relatively small amount of traffic at the beginning of a connection, while allowing the remainder of the connection to be processed entirely by the BigIP tmm.

Note that for Node.js to properly shutdown the client and server streams the close event will be emitted. Any actions performed on a stream that has been detached will result in an exception.

Example:

 plugin.on('connect', function(flow) {
  if (flow.client.remoteAddress === '<some_ip>') flow.detach();
});

end()

Graceful shutdown of client and server streams (via TCP FIN). Flow is no longer usable.

lbSelect(lbOptions)

Specify that the system connect to a specific virtual, pool or server.

Note: For a load balancing selection to be made the plugin must enable the plugin option

ILXPluginOptions.handleClientOpen

and must be called before

flow.client.allow()

. Also, data should not be written to the

ILXFlow.server

stream until after the load balancing selection has been made.

Parameters:

Name Type Description
lbOptions
ILXLbOptions ILXLbOptions object

Example:

 // URI path based pool selection
var f5 = require('f5-nodejs');
var plugin = new f5.ILXPlugin();

plugin.on('connect', function(flow) {
  flow.client.on('requestComplete', function(request) {
    var otherPoolMatch = '/images/';
    if (request.params.uri.slice(0, otherPoolMatch.length) === otherPoolMatch) {
      var options = new f5.ILXLbOptions();
      options.pool = '/Common/other_pool';
      flow.lbSelect(options);
    }
    flow.client.allow();
    request.complete();
  });

  flow.client.on('error', function(errorText) {
    console.log('client error event: ' + errorText);
  });
  flow.server.on('error', function(errorText) {
    console.log('server error event: ' + errorText);
  });
  flow.on('error', function(errorText) {
    console.log('flow error event: ' + errorText);
  });
});

var options = new f5.ILXPluginOptions();
options.handleServerData = false;
options.handleServerResponse = false;
options.handleClientData = false;
options.handleClientOpen = true;
plugin.start(options);

setTraceLevel(level, streams)

Set the trace level for the flow and optionally the streams associated with the flow.

Parameters:

tmmId()→ {number}

Returns the ID of the TMM that is handling the flow.

Returns:

Type Description
number TMM ID

traceLevel()→ {number}

Returns the flow trace level.

Returns:

Type Description
number Flow trace level

Type Definitions

lb

Serverside information about the load balancing selection made by/for the flow. Available only after ` <ILXStream.html#event:connect>`__

ILXStream#event:connect

, ` <ILXStream.html#event:responseStart>`__

ILXStream#event:responseStart

and ` <ILXStream.html#event:responseComplete>`__

ILXStream#event:responseComplete

events.

Type:

  • object

Properties:

Name Type Description
virtualServer
string This will be undefined unless the connection was load balanced to a virtual server (vs targeting vs)
pool
string LTM pool name, will be undefined if ILXFlow.lb.virtualSer ver is not undefined.
remote
object

Remote server information (dest IP info on serverside connection)

Propertie

s
name:properties-

3

Nam e Typ e Des cri pti on
add res s str ing Rem ote ser ver add res s
por t num ber Rem ote ser ver por t
rou teD oma in num ber Rem ote ser ver rou te dom ain
vlan
number Numeric VLAN ID used for the connection to the server. This will be zero in the case of vs targeting vs.
nexthop
string MAC address, undefined if the nexthop is all zeros
snatpool
string SNAT pool name, if SNAT is enabled
local
object

Information connection information (source IP info on server side connection)

Propertie

s
name:properties-

4

Nam e Typ e Des cri pti on
add res s str ing Loc al add res s, if SNA T is ena ble d
por t num ber Loc al por t, if SNA T is ena ble d
rou teD oma in num ber Loc al rou te dom ain , if SNA T is ena ble d

Events

close

The close event is emitted when both client and server connections of an ILXFlow have been closed.

error

The error event is emitted when there is an error encountered on the flow. The flow is no longer usable.

Parameters:

Name Type Description
msg
string error text