Forum Discussion

Alan_Sha's avatar
Alan_Sha
Icon for Nimbostratus rankNimbostratus
Jul 20, 2005

Closing the server side connection only

Hello,

 

 

I am writing an iRule which needs to close the connection (TCP) to the target server after the BIG IP box receives the response and sends it back to the client; while at the same time the client and BIG-IP will stay connected. My plan is to call the “drop” command in the SERVER_DATA event to close the server connection (not sure if I am doing the right thing or not). However, I am not sure whether that will actually close the connection on both ends, or cause the response to be discarded before it’s sent back to the client.

 

 

Also, the iRule documentation states that this command must be conditionally associated with an if statement. In my case, I don't see the need for the if statement. Maybe I am missing something?

 

 

Please advise. Thanks!

 

4 Replies

  • drteeth_127330's avatar
    drteeth_127330
    Historic F5 Account
    I don't think the drop command will work as you hope. I suspect that dropping the serverside flow will silently abort the connection, i.e. no reset will be sent to the server. However, I think the clientside flow will be aborted with a reset.

     

     

    In any case, it sounds like you are attempting to do connection splitting. Is this for HTTP or some other TCP-based protocol?
  • Yes, what I am trying to do is connection splitting. The connection is TCP-based. Before we added the BIG-IP box, the client machine used to maintain an always-on connection with the server. After we put the BIG-IP box between the client and the server, we want to keep the always-on connection only between the client and the BIG-IP. The BIG-IP box will act like an agent, which will only connect to the server when it receives a request from the client. It will then disconnect from the server once it recieves the response.

     

     

    My understanding is that we can specify the serverside context when executing the command. But, as you said, the drop command will also abort the client connection. Does that mean the serverside keywords is not going to work as I expected in this case?
  • drteeth_127330's avatar
    drteeth_127330
    Historic F5 Account
    There might be a way to do this, but it's fairly complicated. Have you written a rule to parse the server response? Does the protocol contain the length? Is this a protocol that I might have heard of or is it something proprietary? Any information you can give me would help.
  • Oh, sorry. I should have said that this's the standard TCP socket connection. I haven't written any rule yet since I originally thought that BIG-IP box would forward the response back to the client and my iRule would just need to take care of the closing of the server connection afterward. It sounds like I can't simply redirect the traffic in this case, isn't it?