iRule 事件顺序

选择 BIG-IP 虚拟服务器的配置栈——Client-SSL、HTTP、Server-SSL、池——查看常见 iRule 事件从 CLIENT_ACCEPTED 到 CLIENT_CLOSED 的触发顺序,以时间线和列表呈现。全部在你的浏览器中完成。

网络

虚拟服务器配置栈

预设:

在你的浏览器中计算,不向任何地方发送数据。

针对 Standard 虚拟服务器的、F5 已记录行为的模型。它从不连接 BIG-IP。

事件序列

客户端侧服务器端全局
1CLIENT_ACCEPTEDConnection setup · 客户端侧2CLIENTSSL_CLIENTHELLOClient-side TLS · 客户端侧3CLIENTSSL_HANDSHAKEClient-side TLS · 客户端侧4HTTP_REQUESTRequest · 客户端侧5LB_SELECTEDLoad balancing · 全局6SERVER_CONNECTEDServer-side setup · 服务器端7SERVERSSL_HANDSHAKEServer-side TLS · 服务器端8HTTP_REQUEST_SENDSend to server · 服务器端9HTTP_RESPONSEResponse · 客户端侧10SERVER_CLOSEDTeardown · 服务器端11CLIENT_CLOSEDTeardown · 客户端侧

按顺序排列的事件

  1. CLIENT_ACCEPTED客户端侧

    A client connection is established. On a Standard virtual server this is when the TCP three-way handshake completes; on FastL4 it fires on the initial SYN.

  2. CLIENTSSL_CLIENTHELLO客户端侧

    The client's TLS ClientHello has been received, before the handshake is processed. Useful for SNI-based decisions.

  3. CLIENTSSL_HANDSHAKE客户端侧

    The client-side TLS handshake has completed successfully.

  4. HTTP_REQUEST客户端侧

    The system has fully parsed the complete client HTTP request headers.

  5. LB_SELECTED全局

    The system has selected a pool member for the connection.

  6. SERVER_CONNECTED服务器端

    The server-side connection to the selected pool member has been established.

  7. SERVERSSL_HANDSHAKE服务器端

    The server-side TLS handshake has completed successfully.

  8. HTTP_REQUEST_SEND服务器端

    Immediately before the HTTP request is sent to the server-side TCP stack. Runs in the server-side context.

  9. HTTP_RESPONSE客户端侧

    The system has parsed all of the response status and header lines from the server response.

  10. SERVER_CLOSED服务器端

    The server-side connection has been closed.

  11. CLIENT_CLOSED客户端侧

    The client-side connection has been closed.

条件事件

这些仅在特定条件下触发:TCP::collect 或 HTTP::collect、负载均衡失败,或 100 Continue 响应。

  • HTTP_REQUEST_DATAHTTP_REQUEST

    After an HTTP::collect has gathered the specified amount of request payload.

  • LB_FAILEDLB_SELECTED

    Instead of LB_SELECTED, when the system fails to select a pool or member, or the selected resource is unreachable.

  • HTTP_RESPONSE_CONTINUEHTTP_RESPONSE

    Before HTTP_RESPONSE, whenever the server sends a 100 Continue interim response.

  • HTTP_RESPONSE_DATAHTTP_RESPONSE

    After an HTTP::collect has gathered the specified amount of response payload.

  • Within a single event, multiple iRules run by priority (default 500, lowest number first); the priority command overrides that. This ordering is across events, not within one.
  • Availability also depends on provisioning: module events (APM ACCESS_*, ASM/Advanced WAF, bot defense) only fire when that module is provisioned. And CLIENT_DATA, SERVER_DATA, HTTP_REQUEST_DATA, and HTTP_RESPONSE_DATA need an explicit TCP::collect or HTTP::collect first.
API endpointGEThttps://ronutz.com/api/v1/f5-irules-event-orderDocumented, not served. Opens the specification.

参考