Forum Discussion

tatmotiv's avatar
tatmotiv
Icon for Cirrostratus rankCirrostratus
Jul 09, 2015

TCP payload persistence (convert Cisco ACE l4-payload stickiness)

Hi all,

I'm currently transforming lots of Cisco ACE configurations to Big IPs running 11.6.0. On the ACE, there is a sticky method called "l4-payload" which can use a fixed offset and length setting in order to grab a specific portion of the TCP payload and generate a sticky entry based on that string (see http://www.cisco.com/c/en/us/td/docs/interfaces_modules/services_modules/ace/vA5_1_0/command/reference/ACE_cr/sticky.htmlwp1040212)

For example, I have the following sticky setting on the ACE that I need to convert to bigIP:

sticky layer4-payload my_l4_stickiness
 layer4-payload offset 30 length 20
 serverfarm my_serverfarm
 timeout 1
 replicate sticky

Which approach would you suggest? I think, I will need a combined iRule and universal persistence in order to achieve the same on the BigIP. Has anybody built something like that already? Any help is appreciated.

Thanks in advance!

Regards

Martin

  • Digging deeper into the issue, I thought about something like that...

    when CLIENT_ACCEPTED {
      TCP::collect 50
    }
    
    when CLIENT_DATA {
      set payload_first_50 [TCP::payload]
      set persist_string [substr $payload_first_50 29 20]
       log local0. "Fetched $persist_string as conn ID for client [IP::client_addr]."
      persist uie $persist_string 60
      TCP::release
    }
    

    ... but I'm not sure if the data returned by [TCP::payload] is to be considered a string, thus being unsure whether using the substr method on it will return valid data.