Forum Discussion
jgranieri
Nimbostratus
May 24, 2011irule tcp payload persistence
Here is what is currently working:
I have 2 issues/questions. I cant seem to get logging to work whether I use remote syslog IP and or change local0 ot local7 etc.
2nd question - How do I persistence based on @xxx in below. I was trying to find some examples of persist uie for the string feature but cant seem to find the answer. any help would be appreciated.
Checks TCP Payload 250 bytes and uses a switch to find a match
when CLIENT_DATA {
log local0. "in CLIENT_DATA"
set clientData [TCP::payload 250]
log local0. "Client Data raw: $clientData"
switch -glob $clientData {
"@int3*" {
node 10.35.22.33 9820
log local0. "Entity @int4* being Loadbalanced"
}
"@int4*" { node 10.35.22.32 9820 }
}
TCP::release
}
3 Replies
- hoolio
Cirrostratus
Hi,
I don't have much experience parsing TCP for persistence and load balancing, but let's give it a go. Do you have a CLIENT_ACCEPTED event where you're calling TCP::collect? This is required in order to tell TMM to buffer the TCP payload.
http://devcentral.f5.com/wiki/default.aspx/iRules/tcp__collectwhen CLIENT_ACCEPTED { TCP::collect 250 } when CLIENT_DATA { log local0. "in CLIENT_DATA" set clientData [TCP::payload 250] log local0. "Client Data raw: $clientData" switch -glob $clientData { "@int3*" { node 10.35.22.33 9820 log local0. "Entity @int3* being Loadbalanced" } "@int4*" { node 10.35.22.32 9820 log local0. "Entity @int4* being Loadbalanced" } } TCP::release }
What are you trying to persist on? The current iRule is manually selecting a node based on the @int value. Do you want the client IP to be sent to the corresponding node for multiple TCP packets even if they don't have the same @int value on each connection?
Aaron - jgranieri
Nimbostratus
Thats correct hoolio... do I simply add the persist UIE section after the traffic is LB based on the tcp payload inspection.
I need the same tcp session to persist on the specific node/pool after the tcp payload matches the string
Checks TCP Payload 250 bytes and uses a switch to find a match
when CLIENT_ACCEPTED {
TCP::collect 250
}
when CLIENT_DATA {
log local0. "in CLIENT_DATA"
set clientData [TCP::payload 250]
log local0. "Client Data raw: $clientData"
switch -glob $clientData {
"@int3*" {
node 10.35.22.33 9820
log local0. "Entity @int3* being Loadbalanced"
}
"@int4*" {
node 10.35.22.32 9820
log local0. "Entity @int4* being Loadbalanced"
}
}
TCP::release
} - jgranieri
Nimbostratus
hello sorry for the late response just got back from vacation.
I only call TCP Collect during each new client session, from the first 250 bytes of payload I want to LB and persist each session based upon the @int value they use to login with regardless of their IP.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects
