Forum Discussion

Yiorgos_213296's avatar
Yiorgos_213296
Icon for Nimbostratus rankNimbostratus
Jul 29, 2015

Load Balancing w/o HTTP?

Can I do load balancing in a scenario where clients and servers use a custom messaging protocol on top of TCP? The criterion would be something along the lines: Look in the message body and if ByteN==x, then direct the message to server X, if ByteN==y, then direct the message to server Y, etc., and a similar scheme in the opposite direction (from server to client).

 

Thanks George

 

1 Reply

  • John_Gruber_432's avatar
    John_Gruber_432
    Historic F5 Account

    The limitation would be which events will fire. Since the highest level protocol you've talked about was TCP, you need to stick to L4 events. CLIENT_ACCEPTED will be the event which will let you know a new TCP connection has happened on the client side of the proxy.

     

    You can capture the data segment associated with the TCP connection using the TCP::collect command in an iRule. From there you need to map the data segment to your protocol.

     

    Here is an article which walks you through the process:

     

    iRules 101 - 17 mapping protocol fields with the binary scan command

     

    Once you have logic to pull out your protocol field you can use the node command to select the pool member you want to connect on the server side of the proxy.