Manual Chapter : Implementing FIX Hybrid or Late Binding mode

Applies To:

  • BIG-IP LTM

    21.0.0, 17.5.1, 17.5.0, 17.1.3, 17.1.2, 17.1.1, 17.1.0, 17.0.0, 16.1.6, 16.1.5, 16.1.4, 16.1.3, 16.1.2, 16.1.1, 16.1.0, 16.0.1, 16.0.0, 15.1.10, 15.1.9, 15.1.8, 15.1.7, 15.1.6, 15.1.5, 15.1.4, 15.1.3, 15.1.2, 15.1.0, 15.0.1, 15.0.0, 14.1.5, 14.1.4, 14.1.3, 14.1.2, 14.1.0, 14.0.1, 14.0.0

Implementing FIX Hybrid or Late Binding mode

You can create a custom Fast L4 profile to manage Layer 4 traffic for FIX.

  1. On the Main tab, click Local Traffic > Profiles > Protocol > Fast L4. The Fast L4 screen opens.

  2. Click Create. The new Fast L4 profile screen opens.

  3. In the Name field, type a unique name for the profile.

  4. Select the Custom check box.

  5. Set the PVA Acceleration field to Dedicated if the platform supports PVA acceleration.

  6. Select the Loose Close check box only for a one-arm virtual server configuration.

  7. Set the TCP Close Timeout setting, based on the type of traffic the virtual server will process.

  8. Select the Late Binding check box to enable the late binding feature.

  9. Select the Explicit Flow Migration check box to enable the explicit iRule command to migrate down to ePVA hardware.

  10. Click Finished.

The custom Fast L4 profile appears in the list of Fast L4 profiles.

You can create the FIX profile for low latency electronic trading with FIX load balancing.

  1. On the Main tab, click Local Traffic > Profiles > Services > FIX. The FIX profile list screen opens.

  2. Click Create. The New FIX Profile screen opens.

  3. In the Name field, type a unique name for the profile.

  4. From the Parent Profile list, select the profile with the required settings. By default, fix is selected.

  5. Select the Custom check box to modify the configuration settings.

  6. From the Report Log Publisher list, select the publisher for error messages and status reports.

  7. Click Finished.

The FIX profile is configured for low latency electronic trading with FIX load balancing.

However, when this profile is created for Late Binding, a virtual server can choose a server pool based on the contents of the FIX connection’s initial packet. The Late Binding feature allows combining load balancing with low latency.

This is a simplified FIX profile. The low latency path goes through ePVA hardware, which does not examine the contents of each FIX packet. The only packet the BIG-IP software examines is the logon packet, which the BIG-IP system uses to choose a server pool. Therefore, most of the features in the FIX-profile screen (such as tag substitution) are ignored for low latency trading.

Before starting this task:

  • Decide on the IP addresses or FQDNs for the servers that you want to include in your server pool.

  • If your system is using DHCP, make sure your DNS servers are not configured for round-robin DNS resolutions; instead, they should be configured to return all available IP addresses in a resolution.

Use this task to create a pool of servers with pool members. The pool identifies which servers you want the virtual server to send client requests to. As an option, you can identify the servers by their FQDNs instead of their IP addresses. In this way, the system automatically updates pool members whenever you make changes to their corresponding server IP addresses on your network.

  1. On the Main tab, click Local Traffic > Pools.

    The Pool List screen opens.

  2. Click Create.

    The New Pool screen opens.

  3. In the Name field, type a unique name for the pool.

  4. For the Health Monitors setting, from the Available list, select a monitor and move the monitor to the Active list.

    Note: A pool containing nodes represented by FQDNs cannot be monitored by inband or sasp monitors.

  5. From the Load Balancing Method list, select how the system can distribute traffic to members of this pool. The default is Round Robin.

  6. For the New Members setting, add each server that you want to include in the pool:

    1. Select New Node or New FQDN Node.

    2. (Optional) In the Node Name field, type a name for the node.

    3. If you chose New Node, then in the Address field, type the IP address of the server. If you chose New FQDN Node, then in the FQDN field, type the FQDN of the server.

      Note: If you want to use FQDNs instead of IP addresses, you should still type at least one IP address. Typing one IP address ensures that the system can find a pool member if a DNS server is not available.

    4. For the Service Port option, pick a service from the list.

    5. If you are using FQDNs for the server names, then for Auto Populate, keep the default value of Enabled. When you leave Auto Populate turned on, the system creates an ephemeral node for each IP address returned as an answer to a DNS query. Also, when a DNS answer shows that the IP address of an ephemeral node no longer exists, the system deletes the ephemeral node.

    6. Click Add.

    7. Do this step again for each node.

  7. Click Finished.

Creating an iRule for load-balancing Layer 7 (FIX) traffic requires that the Late Binding feature is enabled in the Fast L4 profile. A virtual server with Late Binding enabled can choose a server pool based on the contents of the FIX connection’s initial logon packet(s).

You can create an iRule that reads the FIX logon fields and directs each TCP stream to a different server pool based on the field settings.

  1. On the Main tab, click Local Traffic > iRules. The iRule List screen displays a list of existing iRules.

  2. Click the Create button. The new iRule screen opens.

  3. In the Name field, type a unique name for the iRule.

  4. In the Definition field, type an iRule to match FIX fields and choose a server pool based on their settings. Use the FIX_HEADER iRule event to select the first five fields in a FIX packet:

    • BeginString
    • BodyLength
    • MsgType
    • SenderCompID
    • TargetCompID

    The total length of a FIX message is unbounded, so that you can capture all of the relevant data to choose a back-end server pool without waiting to collect all of the FIX message.

    For example, this iRule sends messages from each of the three senders to a specific server pool. Messages from any other senders revert to the default pool in a virtual server that uses this iRule. The iRule also logs a message to indicate that a new FIX stream has been opened:

    tcl
    when FIX_HEADER {
        set MsgType [FIX::tag get 35]
        if { $MsgType eq "A" } {  # an A message is a logon message
            # record the sender and the target
            set SenderCompID [FIX::tag get 49]
            set TargetCompID [FIX::tag get 56]
    
            # log the event locally - a new FIX stream is being created
            log "FIX header: Sender $SenderCompID, Target $TargetCompID"
    
            # log the event with High Speed Logging (HSL), too
            set hsl [HSL::open -proto UDP -pool syslog_server_pool]
            HSL::send $hsl "[IP::client_addr]: Sender $SenderCompID, Target $TargetCompID\n"
    
            # choose a server pool based on the name of the sender
            switch $SenderCompID {
                "Fred's Bank"   { pool FIX1 }
                "Wilma's Bank"  { pool FIX2 }
                "Barney's Bank" { pool FIX3 }
            }
        }
    }

    The iRule may explicitly send the flow down to the ePVA, rather than doing it automatically. This explicit control is only possible if you set it in the Fast L4 profile. In the following example, the rule does not release the flow unless it encounters a FIX packet from a sender named “Mr. Slate’s Bank”. You must release the flow on both the client side (with the CLIENT_ACCEPTED event) and the server side (with the SERVER_CONNECTED event):

    tcl
    when CLIENT_ACCEPTED {
        # prepare for releasing the flow down to the ePVA
        BIGTCP::release_flow
    }
    when FIX_HEADER {
        # (same as above example, with an additional sender)
        set MsgType [FIX::tag get 35]
        if { $MsgType eq "A" } {  # an A message is a logon message
            # record the sender and the target
            set SenderCompID [FIX::tag get 49]
            set TargetCompID [FIX::tag get 56]
            # log the event - a new FIX stream is being created
            log "FIX header: Sender $SenderCompID, Target $TargetCompID"
            # choose a server pool based on the name of the sender
            switch $SenderCompID {
                "Fred's Bank"      { pool FIX1 }
                "Wilma's Bank"     { pool FIX2 }
                "Barney's Bank"    { pool FIX3 }
                "Mr. Slate's Bank" { pool FIX4 }
            }
        }
    }
    when SERVER_CONNECTED {
        if {$SenderCompID eq "Mr. Slate's Bank"}{
            # Mr. Slate's Bank sent this, so lower the latency
            log local0. "Detected $SenderCompID - releasing flow to ePVA"
            BIGTCP::release_flow
        }
    }

    The previous code sends all FIX streams through standard FIX-profile processing except the one(s) from “Mr. Slate’s Bank”, which goes through the ePVA.

  5. Click Finished.

The iRule is now available. You can use this iRule in a virtual server that also offers a FIX profile and the low latency of Fast L4.

After you create a server pool, profile(s), and (optionally) iRule, you need to create a virtual server that references those components.

  1. On the Main tab, click Local Traffic > Virtual Servers. The Virtual Server List screen opens.

  2. Click Create. The new Virtual Server screen opens.

  3. In the Name field, type a unique name for the virtual server.

  4. From the Type list, select Performance (Layer 4).

  5. In the Destination Address field, type the IP address in CIDR format. This is the address to which FIX clients send their FIX transmissions. The supported format is address/prefix, where the prefix length is in bits. For example, an IPv4 address/prefix is 10.0.0.1 or 10.0.0.0/24, and an IPv6 address/prefix is ffe1::0020/64 or 2001:ed8:77b5:2:10:10:100:42/64. When you use an IPv4 address without specifying a prefix, the BIG-IP system automatically uses a /32 prefix. The IP address you type must be available and not in the loopback network.

  6. In the Service Port field, specify a port number or select a type from the port list to listen to a virtual server.

    Note:

    • You can select * to listen to all the ports.
    • You can direct traffic to different pools using iRule based on the port number to listen to multiple ports.
  7. From the Configuration list, select Advanced.

  8. From the Protocol list, select TCP.

  9. From the Protocol Profile (Client) list, select the custom Fast L4 profile you defined for low latency FIX trading.

  10. Go to the FIX Profile list and select the custom FIX profile you defined for low latency trading.

  11. For the Port Translation setting, clear the Enabled check box.

    Note: Clearing the Enabled check box disables network address translation (NAT) functionality. If you require NAT, you must select the Enabled check box.

  12. In the Resources area of the screen, from the Default Pool list, select the pool name for FIX streams. This pool is for streams that do not match your iRule(s).

  13. For the iRules setting, from the Available list, select the name of the iRule that you created for the Late Binding feature and move it to the Enabled list. The iRule enables load balancing based on the Layer 7 (FIX) fields at the head of each stream.

  14. Click Finished.

The virtual server is configured to use the specified Fast L4 profile and pool. If a client initiates a FIX connection with this virtual server, the connection uses the Fast L4 (ePVA) hardware.

This implementation configures a BIG-IP® system to manage electronic trading functionality, optimizing the system for predictable latency and jitter.