Forum Discussion

Jag_43151's avatar
Jag_43151
Icon for Nimbostratus rankNimbostratus
Jul 07, 2010

pool selection

Hi,

 

 

I am fairly new to iRule. It will be great if someone can help me out here.

 

 

Background:

 

The iRule is tagged to a VS which accepts RTSP connection at port 554 and is intended to do pool selection by sniffing the TCP payload for a string, based on which it will make the pool selection decision. Since RTSP negotiates with several methods to set up the signaling plane before the actual streaming starts, we have to make sure that the initial method (whatever it may be) of the RTSP plane selects the pool appropriately and not any intermediate methods thereafter.

 

 

Problem:

 

The iRule seems to work fine as expected, but we are seeing some intermittent issues with RTP (over UDP) packets. Once the signaling plane has been completed, the UDP packets from the upstream are not able to reach back to the client. I see the UDP packet reaching the egress of F5 from the upstream, but tis getting lost somewhere and is not able to get to the ingress. In packet captures I see ICMP Destination port Unreachable messages. BUT, this is intermittent and does not happen all the time. Could this be persistence issue and if so how do I handle it? Or could this be related to load, beyond which the F5 is not able to maintain RTSP persistence.

 

 

BIG-IP Version:

 

BIG-IP Version 9.4.8

 

 

iRule:

 

rule pool-selection {

 

 

when CLIENT_ACCEPTED {

 

if { [session lookup uie [IP::client_addr]] eq "" } {

 

session add uie [IP::client_addr] [IP::client_addr] 60

 

log local0. "Just Added Cookie for [session lookup uie [IP::client_addr]]"

 

}

 

TCP::collect

 

}

 

 

when SERVER_CONNECTED {

 

TCP::collect

 

}

 

 

when SERVER_DATA {

 

TCP::release

 

TCP::collect

 

---------------------------------------------------

 

}

 

 

when CLIENT_DATA {

 

if { [session lookup uie [IP::client_addr]] eq [IP::client_addr] } {

 

session delete uie [IP::client_addr]

 

if { [TCP::payload] contains "domain1.com" || [TCP::payload] contains "domain2.com" || [TCP::payload] contains "domain3.com" } {

 

use pool pool-three

 

} else {

 

if {[active_members pool-one] == 0} {

 

use pool pool-two

 

} else {

 

use pool pool-one

 

}

 

}

 

}

 

TCP::release

 

TCP::collect

 

}

1 Reply

  • Hmmm, interesting rule. Why are you creating a persistence record on connection but removing it when data is sent? Why are you using TCP::collect in the CLIENT_DATA event?

     

    You could probably also use some logic to only scan the payload once rather than every time there is data.