Forum Discussion

Billy_chuang_16's avatar
Billy_chuang_16
Historic F5 Account
Feb 16, 2006

http redirect determined by TCP latency

Hi,

 

 

The following is a iRule tried to perform HTTP redirect and determined by TCP Latency. But the RTT retrieved and logged by iRule, always is zero.

 

 

A default page will redirect client browser connect to both VS through two ISP link, then the irule is used to determine which ISP link's RTT is the best to client, then http redirect to the webserver (web server is not connected to BIGIP).

 

 

Best Regards

 

Billy

 

 

 

when HTTP_REQUEST {

 

the IP address of the router for each link

 

set gz_router "10.200.200.1"

 

set ph_router "10.200.201.1"

 

 

this gets us the client's RTT through each link

 

set gz_rtt [ROUTE::rtt [IP::client_addr] $gz_router]

 

set ph_rtt [ROUTE::rtt [IP::client_addr] $ph_router]

 

 

array set speeds {0 $gz_rtt 1 $ph_rtt}

 

 

find lowest RTT

 

set lowest [expr $gz_rtt + 1]

 

for { set i 0 } { $i < 2 } { incr i } {

 

if { $speeds($i) < $lowest } {

 

set lowest $i

 

}

 

}

 

 

0 maps to GZ, 1 maps to PH

 

redirect the user based on the site which had the lower RTT

 

switch { $lowest } {

 

0 { HTTP::redirect "http://www1.abc.com/" }

 

1 { HTTP::redirect "http://www2.abc.com/" }

 

}

 

}
No RepliesBe the first to reply