Forum Discussion
hoolio
Cirrostratus
Sep 21, 2009Effect of 'drop/discard' in HTTP_RESPONSE event?
Hi,
I'm wondering what drop/discard actually do when called from HTTP_RESPONSE. I don't have an easy way to test the customer's exact scenario, so I'm hoping someone here can tell me what it *should* do.
Ideally, I'd like to just not send that specific HTTP response back to the client, but leave the server side TCP connection available for further OneConnect use.
If I check a status code in HTTP_RESPONSE, see it's one I don't like, and call 'drop' or 'discard', does it just prevent the current payload from being sent to the client?
Does it affect any further data that the server might send for that response or in subsequent responses to other HTTP requests?
Does it trigger a FIN or RST being sent on the serverside connection? Does this behavior change if OneConnect is enabled on the VIP?
As long as I'm asking about 'drop/discard', would 'reject' behave differently in terms of the serverside TCP connection being left open?
Thanks,
Aaron
13 Replies
- hoolio
Cirrostratus
Hi Colin,
Thanks for that. Please do let me know when you have a chance.
Thanks,
Aaron - Yepher_100160
Nimbostratus
When you use "drop" in "when HTTP_RESPONSE" the HTTP source clients connection is reset. - Yepher_100160
Nimbostratus
I hope someone can answer this question. I have looked through the IRules command and am a bit stumped.
In the HTTP_RESPONSE I want to close the connection to the server but leave the F5->Client socket/HTTP alone as if "HTTP_RESPONSE" event was never fired. I want to do this based on some header value from the server.
It appears that drop and discard does not solve the problem. Both of these commands close the clients socket immediately.
Here is an example use case:
http://yepher.com/sequencePNG.jsp?data=[settings]%0AshowRungNumber%3Dyes%0A%0A[title]%0ALeave%20Open%20Use%20Case%0A%0A[actors]%0AClientA%0A|%0AF5%0AWebServer%0A%0A[sequences]%0AHTTP%20Request%2C%20ClientA%2C%20F5%0AHTTP%20Request%2C%20F5%2C%20WebServer%0AHTTP%20Response%20%28x-leave-open%3A%20true%29%2C%20WebServer%2C%20F5%0ATCP%20Close%20Connection%2C%20F5%2C%20WebServer%0ANo%20HTTP%20Response%20Back%20to%20ClientA%2C%20F5%2C%20F5%0A%0A%0A&name=image.png
Once I figure out how to do this I wan to be able to push data over the F5-Client TCP connection from another server at some point in the future. I believe OneConnect won't be useful for this use case.
Another way to think about this is I want to send HTTP Chunked responses from multiple servers for a single HTTP_REQUEST/HTTP_RESPONSE.
Any help would be greatly appreciated.
-- Yepher - Colin_Walker_12Historic F5 AccountThis sounds like exactly what OneConnect is for. Why do you think it won't be helpful?
Colin - Yepher_100160
Nimbostratus
Collin,
Thank you for the quick response. I could be misunderstanding how OneConnect works. It is my understanding that OneConnect is for reducing the number of tcp setups to a backend server. In my case i want the HTTP Request to land on one server and a response to happen from a different server which would be a different socket on the backend to the initial socket on the front end. Is this how OneConnect works?
The first server will make an http respone to the f5 but it won't be delivered to the client. The response will be sent from seever B.
I will do more reading with regard to one connect.
Are you able to point me to a specific one connect commands that might help in this scenario. - spark_86682Historic F5 AccountIn the HTTP_RESPONSE I want to close the connection to the server but leave the F5->Client socket/HTTP alone as if "HTTP_RESPONSE" event was never fired. I want to do this based on some header value from the server. It appears that drop and discard does not solve the problem. Both of these commands close the clients socket immediately. Here is an example use case: http://yepher.com/sequencePNG.jsp?data=[settings]%0AshowRungNumber%3Dyes%0A%0A[title]%0ALeave%20Open%20Use%20Case%0A%0A[actors]%0AClientA%0A|%0AF5%0AWebServer%0A%0A[sequences]%0AHTTP%20Request%2C%20ClientA%2C%20F5%0AHTTP%20Request%2C%20F5%2C%20WebServer%0AHTTP%20Response%20%28x-leave-open%3A%20true%29%2C%20WebServer%2C%20F5%0ATCP%20Close%20Connection%2C%20F5%2C%20WebServer%0ANo%20HTTP%20Response%20Back%20to%20ClientA%2C%20F5%2C%20F5%0A%0A%0A&name=image.png Once I figure out how to do this I wan to be able to push data over the F5-Client TCP connection from another server at some point in the future. This isn't going to be a trivial iRule. I don't know exactly what it will look like, but HTTP::retry is likely to be your best path to success here. You can certainly suppress the initial server response to the client while collecting it in a variable, and then call HTTP::retry and prepend the original server's response to the second server's response (rinse and repeat as necessary). I'd start there. Good luck!
- Yepher_100160
Nimbostratus
Spark,
Thanks for the tip on http retry. Initially it looks promising.
One problem I think I will have is the transmitting servers cannot respond to http requests directly. That is to say I want to transmitting server to just send the data (as an HTTP Response) once it is done processing some command that was stuck in a queue by the first server that received the HTTP request.
-- Yepher - Yepher_100160
Nimbostratus
Spark,
Thanks for the suggestion. I had a look at HTTP::retry and it seems it is just for forwarding the request to another HTTP server.
But in my case I want to:
1. send an HTTP response to the F5 which will be intercepted in "when HTTP_RESPONSE {}" code block.
2. have the F5 eat that HTTP Response but not close the clients TCP connection or send any data to the client yet. (until step 4).
3. Have another server send the HTTP Response at some point in the future after some processing has been completed.
4. F5 returns the HTTP Response to the client as if it is an HTTP Response from the first server.
My constraints are:
I am unable to forward the HTTP Request to the server that will actually know what data needs to be transmitted back to the client.
The transmitting server can send the HTTP data as TCP, HTTP, UDP or whatever make the F5 IRule easier to write.
-- Yepher - spark_86682Historic F5 AccountBy default, HTTP::retry may just resend the original request, but you can supply a different one for it to send instead. However, if you cannot send any HTTP request at all to your second server (meaning, the server that is going to supply the response which causes a response to be sent to the client), then I don't see any way for you to accomplish this. In such a case, what are you sending to that server? I mean, you're not expecting that server to initiate the TCP connection, right?
- Yepher_100160
Nimbostratus
Actually yes, I would like the second server to initiate the TCP connection (or better yet an HTTP Post) back to the F5 and the data it sends is the data to be relayed back to the client.
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