Forum Discussion

Nikhil_Bagga_10's avatar
Nikhil_Bagga_10
Icon for Nimbostratus rankNimbostratus
Sep 29, 2006

Monitoring TCP Client Closed connection

Hi, Brand new to irules. Basically we want the BigIP to monitor the client connections. This is for the FIX protocol (basically TCP) For now all i want is that if a client closes the connection then i want to log the destination port that that client was conencting to. Next step i want to be able to get the FIX SenderCompID to be logged as well. Any help will be greatly appriciated. I know i need to start with:

 

when CLIENT_CLOSED {}, but is this supported in 4.5?
  • Ok.. so i found out that client_closed is not supported in 4.5. Is there a way i can do that in 4.5? Can someone help me get the correct "IF" statement?

     

     

    if (*******????*******) {

     

    log "client on port" server_port + " has closed the connection"

     

    use pool POOL1

     

    }

     

    else {

     

    use pool POOL1

     

    }

     

     

    thanks, Nikhil
  • Martin_Machacek's avatar
    Martin_Machacek
    Historic F5 Account
    Nikhil,

     

     

    BIG-IP v4 unfortunately does not have the capability to hook actions to events in iRules the same way as v9. In v4 rules are evaluated only when receiving data from the client and only until loadbalancing decision is made (i.e. pool member is selected). So, there is no way how to trigger an action after client closes connection. You may be able to parse the information out of the client data using the tcp_content variable (please refer to the BIG-IP Reference Guide for details). This however switches the connection to so called late-binding mode, which means that connection to the server (pool member) is not established until the rule evaluation terminates. BIG-IP has to buffer all client content received in the meantime. If the client expects certain response from the server before sending the piece of information you are looking for, this won't work because BIG-IP does not send anything to the client (at application layer) in the late-binding phase. Also BIG-IP can buffer only 16KB of data or 64 packets whichever comes first (the packet count does not include the initial TCP handshake).

     

     

    iRules in BIG-IP v9 are much more flexible.