Forum Discussion

Daniel_Tremmel's avatar
Daniel_Tremmel
Icon for Altostratus rankAltostratus
Oct 09, 2014

Persistency with Websockets Server

Hi guys,

my customer needs to use Websockets for his applications (online bets), currently we use a Performance L4 VS for the connection to the backend application server.

My questions:

  • Is there the possibility to use a Standard VS instead of the Performance L4 VS?

  • If not, how can I apply persistency onto that Performance L4 VS?

    I've build an iRule for Universal Persistence, which is working fine as long as you use a Standard VS. On a Performance L4 VS, it's not working because you can't use the HTTP iRule commands.

    when HTTP_REQUEST { 
     set token [findstr [HTTP::uri] "connectionToken" 16 "&"] 
     if { $token != "" } { 
     persist uie $token
     log $token 
     } 
    }

After that, I thought I could use the same logic on Layer 4 basis and created the following iRule:

when CLIENT_ACCEPTED {
  TCP::collect 600
}

when CLIENT_DATA {
  set token [findstr [TCP::payload 600] "connectionToken" 16 "&"]

  if { $token != "" } { 
   persist uie $token
   log local0.notice $token 
  } 

 TCP::release
}

But when I want to apply that, I get the error message:

01070394:3: TCP::collect in rule (/Common/token_persistence_layer4) requires an associated TCP profile on the virtual server (/Common/Test).

It seems that the Performance L4 VS is using the fastL4 Profile and not the default TCP Profile, according to DevCentral this is the reason why I can't use TCP::collect etc.

Is there a way to implement Universal Persistence on a Performance L4 VS?

best regards,

Daniel

3 Replies

  • Hello,

     

    Performance L4 is by design shortcutting most advance features and controls on the bigip. As you observer you will need to use a more "intelligent" vs type to play with these features. Is there anything preventing you from moving to L4 or L7 virtual ?

     

  • The problem is: at this time Websockets in this environment only work with a Performance L4 VS. I mean, yes we need to test again everything with a Standard VS but for now the only solution is a Performance L4 VS. Correct me if I'm wrong, but since Performance HTTP uses the fasthttp profile and not the default HTTP profile, you will again have limited iRule support?

     

    If someone has experience with Websockets and maybe, what's state of the art, what's best-practise, please let me know. Maybe Websockets work on a Standard VS as expected and it's our application behind who's the problem, I don't know.

     

  • Here are some interesting links. https://support.f5.com/kb/en-us/solutions/public/14000/700/sol14754.html

     

    You may achieve some results with a standard profile catching first request for persistence info then deactivating http profile in the irule for following traffic.