Forum Discussion
Thank you very much for the reply. It would be good to use oneconnect if possible, but I am not sure how to make that happen yet 😊
The lab setup I tried (please feel free to rubbish this setup and suggest any better alternatives) uses 1 pool per FQDN/HTTP combination. For example if I describe using just two pools for simplicity:
- {www.test.com with Header X = A} maps to Pool A
- {www.test.com with Header X = B} maps to Pool B
I then used a traffic policy to forward traffic to the appropriate pool based on this FQDN/HTTP combination.
Other than name, each pool is 100% the same – same single member (IP & port). The only reason I used different pools was to give different ‘targets’ to load balance to (very welcome to suggestions which only require 1 pool).
I then used an iRule to pick up LB_SELECTED events and assign the appropriate Server SSL profile based on the name of the pool chosen, with the profile actually being attached and used in the subsequent SERVER_CONNECTED event.
This appears to work OK, with a traffic profile along the lines of:
- {www.test.com with Header X = A}
first HTTP request received – create new server connection using server SSL profile A
- {www.test.com with Header X = A}
Any number of subsequent HTTP requests received with same FQDN/HTTP combination –LB_SELECTED doesn’t even trigger, traffic just goes across existing server connection OK
- {www.test.com with Header X = B}
HTTP request received with diff FQDN/HTTP combination – existing server connection closed (TCP FIN) and new connection established to same server but using server SSL profile B
- {www.test.com with Header X = B}
Again connection remains constant while subsequent HTTP requests present with the same FQDN/HTTP combination
- {www.test.com with Header X = A}
Cycle repeats…….
At the TCP level the two server connections (A & B) will be the same, i.e. client addr/port & server add/port will be the same. However the key difference is that each will have used a different server SSL profile, i.e.
Pool A connections use server SSL profile A
Pool B connections use server SSL profile B
Is the oneconnect TCP reuse pool aligned per LTM pool, or is it ‘global’? What is the relationship between TCP and SSL with regard to the idle connections in the reuse pool – i.e. are they purely TCP connections or do they also have active SSL sessions?
I did try enabling oneconnect but results were inconsistent, although usually it just kept all traffic going across the first connection established. I therefore assumed the oneconnect reuse pool was global rather than being a separate reuse pool per LTM pool. I also assume SSL remains established per TCP connection.
If you could help me understand how to amend the setup (happy to scrap what I have and go with something completely different) so as to leverage the power of oneconnect, but while still maintaining the key goal of ensuring the traffic is sent across a pipe which has used the correct server SSL profile it would be very much appreciated 😊
Basically the ideal goal would be traffic switching between two different ‘SSL pipes’ to the same server, similar to that listed above, but with each connection remaining up rather than only one being activated at a time. I know the objective of oneconnect is to keep connections active like that, but I need to understand more about what a oneconnect idle connection actually represents and how the F5 makes a decision on which one to choose – e.g. if it is purely on IP/port info, or if there is some way I can align this to account for the different server SSL profiles used as well.
Thanks again for the update :-)
Regarding the mask - I had left it at default because the VS uses a SNAT pool with a single IP. My understanding is that oneconnect examines the post SNAT source IP, so essentially the mask has no impact for my setup? I did try with /32 just to check but saw no difference.
As for my question on what 'level' the oneconnect reuse pool operates at - looking at the help section in the oneconnect profile page on the F5 GUI it looks like it is at the VS level. I think that will likely cause me a problem for the current setup (not tied to that setup though, happy to change it :-). I use different pools so that an iRule can assign a server SSL profile based on a 1-1 mapping between the pool name and the SSL profile to use.
To me the following is what I _suspect_ is happening:
- Initial traffic sent to pool A and server side connection setup correctly using server SSL profile A
- When HTTP header change happens, the traffic policy instead chooses pool B
- Oneconnect kicks in at this point and sees that the required connection is from SNAT IP to website IP port 443. This is on pool B but that was chosen by the VS with the oneconnect profile, and the mask covers the source IP OK, so this connection is eligible to be switched onto a reused TCP connection.
- At the TCP level i.e. IP/port this new connection request in pool B exactly matches the existing connection from pool A. Also at this point the server SSL profile would match, because I can't assign that in the iRule until a serverside event (please correct me if I have that wrong). This is why I asked if oneconnect takes the likes of SSL into account to differentiate between connections or if it is just on the lower level protocol.
- Oneconnect switches the traffic onto the existing connection, and the SERVER_CONNECTED event never triggers, which is where I would have assigned server SSL profile B
So basically all my traffic is just going over that single connection, and any time that HTTP Header X = B the traffic is actually sent on the 'wrong' pipe.
I can see how oneconnect would work if I could somehow confine it to a pool rather than a VS. Essentially I would then just use it to keep a connection up per pool, and I would know that each connection had been established using the correct SSL profile, so any traffic directed to the pool by the traffic policy would definitely be sent across a 'correct' pipe. Is this possible?