blob: ce119dc493f8daab284fd5b55ac1f8d66de2f238 [file] [log] [blame]
Christopher Fauletf7e4e7e2016-10-27 22:29:49 +02001 -----------------------------------------------
2 Stream Processing Offload Engine (SPOE)
Christopher Faulet57583e42017-09-04 15:41:09 +02003 Version 1.2
4 ( Last update: 2017-09-22 )
Christopher Fauletf7e4e7e2016-10-27 22:29:49 +02005 -----------------------------------------------
6 Author : Christopher Faulet
7 Contact : cfaulet at haproxy dot com
8
9
10SUMMARY
11--------
12
13 0. Terms
14 1. Introduction
15 2. SPOE configuration
16 2.1. SPOE scope
17 2.2. "spoe-agent" section
18 2.3. "spoe-message" section
Christopher Faulet11610f32017-09-21 10:23:10 +020019 2.4. "spoe-group" section
20 2.5. Example
Christopher Fauletf7e4e7e2016-10-27 22:29:49 +020021 3. SPOP specification
22 3.1. Data types
23 3.2. Frames
24 3.2.1. Frame capabilities
25 3.2.2. Frame types overview
26 3.2.3. Workflow
27 3.2.4. Frame: HAPROXY-HELLO
28 3.2.5. Frame: AGENT-HELLO
29 3.2.6. Frame: NOTIFY
30 3.2.7. Frame: ACK
31 3.2.8. Frame: HAPROXY-DISCONNECT
32 3.2.9. Frame: AGENT-DISCONNECT
33 3.3. Events & messages
34 3.4. Actions
Christopher Fauletd1307ce2017-02-27 21:59:39 +010035 3.5. Errors & timeouts
Christopher Fauletb2dd1e02018-03-22 09:07:41 +010036 4. Logging
Christopher Fauletf7e4e7e2016-10-27 22:29:49 +020037
38
390. Terms
40---------
41
42* SPOE : Stream Processing Offload Engine.
43
44 A SPOE is a filter talking to servers managed ba a SPOA to offload the
45 stream processing. An engine is attached to a proxy. A proxy can have
Christopher Fauletd1307ce2017-02-27 21:59:39 +010046 several engines. Each engine is linked to an agent and only one.
Christopher Fauletf7e4e7e2016-10-27 22:29:49 +020047
48* SPOA : Stream Processing Offload Agent.
49
50 A SPOA is a service that will receive info from a SPOE to offload the
51 stream processing. An agent manages several servers. It uses a backend to
52 reference all of them. By extension, these servers can also be called
53 agents.
54
55* SPOP : Stream Processing Offload Protocol, used by SPOEs to talk to SPOA
56 servers.
57
58 This protocol is used by engines to talk to agents. It is an in-house
59 binary protocol described in this documentation.
60
61
621. Introduction
63----------------
64
65SPOE is a feature introduced in HAProxy 1.7. It makes possible the
66communication with external components to retrieve some info. The idea started
67with the problems caused by most ldap libs not working fine in event-driven
68systems (often at least the connect() is blocking). So, it is hard to properly
69implement Single Sign On solution (SSO) in HAProxy. The SPOE will ease this
70kind of processing, or we hope so.
71
72Now, the aim of SPOE is to allow any kind of offloading on the streams. First
73releases, besides being experimental, won't do lot of things. As we will see,
74there are few handled events and even less actions supported. Actually, for
75now, the SPOE can offload the processing before "tcp-request content",
76"tcp-response content", "http-request" and "http-response" rules. And it only
77supports variables definition. But, in spite of these limited features, we can
78easily imagine to implement SSO solution, ip reputation or ip geolocation
79services.
80
81
822. SPOE configuration
83----------------------
84
85Because SPOE is implemented as a filter, To use it, you must declare a "filter
86spoe" line in a proxy section (frontend/backend/listen) :
87
88 frontend my-front
89 ...
90 filter spoe [engine <name>] config <file>
91 ...
92
93The "config" parameter is mandatory. It specififies the SPOE configuration
94file. The engine name is optional. It can be set to declare the scope to use in
95the SPOE configuration. So it is possible to use the same SPOE configuration
96for several engines. If no name is provided, the SPOE configuration must not
97contain any scope directive.
98
99We use a separate configuration file on purpose. By commenting SPOE filter
100line, you completly disable the feature, including the parsing of sections
101reserved to SPOE. This is also a way to keep the HAProxy configuration clean.
102
103A SPOE configuration file must contains, at least, the SPOA configuration
Christopher Faulet11610f32017-09-21 10:23:10 +0200104("spoe-agent" section) and SPOE messages/groups ("spoe-message" or "spoe-group"
105sections) attached to this agent.
Christopher Fauletf7e4e7e2016-10-27 22:29:49 +0200106
107IMPORTANT : The configuration of a SPOE filter must be located in a dedicated
108file. But the backend used by a SPOA must be declared in HAProxy configuration
109file.
110
1112.1. SPOE scope
112-------------------------
113
114If you specify an engine name on the SPOE filter line, then you need to define
115scope in the SPOE configuration with the same name. You can have several SPOE
116scope in the same file. In each scope, you must define one and only one
117"spoe-agent" section to configure the SPOA linked to your SPOE and several
Christopher Faulet11610f32017-09-21 10:23:10 +0200118"spoe-message" and "spoe-group" sections to describe, respecively, messages and
119group of messages sent to servers mananged by your SPOA.
Christopher Fauletf7e4e7e2016-10-27 22:29:49 +0200120
121A SPOE scope starts with this kind of line :
122
123 [<name>]
124
125where <name> is the same engine name specified on the SPOE filter line. The
126scope ends when the file ends or when another scope is found.
127
128 Example :
129 [my-first-engine]
130 spoe-agent my-agent
131 ...
132 spoe-message msg1
133 ...
134 spoe-message msg2
135 ...
Christopher Fauletb2dd1e02018-03-22 09:07:41 +0100136 spoe-group grp1
Christopher Faulet11610f32017-09-21 10:23:10 +0200137 ...
Christopher Fauletb2dd1e02018-03-22 09:07:41 +0100138 spoe-group grp2
139 ...
Christopher Fauletf7e4e7e2016-10-27 22:29:49 +0200140
141 [my-second-engine]
142 ...
143
144If no engine name is provided on the SPOE filter line, no SPOE scope must be
145found in the SPOE configuration file. All the file is considered to be in the
146same anonymous and implicit scope.
147
Christopher Faulet7ee86672017-09-19 11:08:28 +0200148The engine name must be uniq for a proxy. If no engine name is provided on the
149SPOE filter line, the SPOE agent name is unsed by default.
150
Christopher Fauletf7e4e7e2016-10-27 22:29:49 +02001512.2. "spoe-agent" section
152--------------------------
153
154For each engine, you must define one and only one "spoe-agent" section. In this
155section, you will declare SPOE messages and the backend you will use. You will
156also set timeouts and options to customize your agent's behaviour.
157
158
159spoe-agent <name>
160 Create a new SPOA with the name <name>. It must have one and only one
161 "spoe-agent" definition by SPOE scope.
162
163 Arguments :
164 <name> is the name of the agent section.
165
166 following keywords are supported :
Christopher Faulet11610f32017-09-21 10:23:10 +0200167 - groups
Christopher Faulet48026722016-11-16 15:01:12 +0100168 - maxconnrate
169 - maxerrrate
Christopher Fauletd1307ce2017-02-27 21:59:39 +0100170 - max-frame-size
Christopher Faulete8ade382018-01-25 15:32:22 +0100171 - max-waiting-frames
Christopher Fauletf7e4e7e2016-10-27 22:29:49 +0200172 - messages
Christopher Fauletd1307ce2017-02-27 21:59:39 +0100173 - [no] option async
174 - [no] option pipelining
175 - [no] option send-frag-payload
Christopher Fauletea62c2a2016-11-14 10:54:21 +0100176 - option continue-on-error
Christopher Faulet336d3ef2017-12-22 10:00:55 +0100177 - option force-set-var
Christopher Faulet985532d2016-11-16 15:36:19 +0100178 - option set-on-error
Christopher Faulet36bda1c2018-03-22 09:08:20 +0100179 - option set-process-time
180 - option set-total-time
Christopher Fauletf7e4e7e2016-10-27 22:29:49 +0200181 - option var-prefix
Christopher Faulet336d3ef2017-12-22 10:00:55 +0100182 - register-var-names
Christopher Faulet03a34492016-11-19 16:47:56 +0100183 - timeout hello|idle|processing
Christopher Fauletf7e4e7e2016-10-27 22:29:49 +0200184 - use-backend
185
186
Christopher Faulet11610f32017-09-21 10:23:10 +0200187groups <grp-name> ...
188 Declare the list of SPOE groups that an agent will handle.
189
190 Arguments :
191 <grp-name> is the name of a SPOE group.
192
193 Groups delcared here must be found in the same engine scope, else an error is
194 triggered during the configuration parsing. You can have many "groups" lines.
195
196 See also: "spoe-group" section.
197
198
Christopher Faulet48026722016-11-16 15:01:12 +0100199maxconnrate <number>
200 Set the maximum number of connections per second to <number>. The SPOE will
201 stop to open new connections if the maximum is reached and will wait to
202 acquire an existing one. So it is important to set "timeout hello" to a
203 relatively small value.
204
205
206maxerrrate <number>
207 Set the maximum number of errors per second to <number>. The SPOE will stop
208 its processing if the maximum is reached.
209
210
Christopher Fauletd1307ce2017-02-27 21:59:39 +0100211max-frame-size <number>
212 Set the maximum allowed size for frames exchanged between HAProxy and SPOA.
213 It must be in the range [256, tune.bufsize-4] (4 bytes are reserved for the
214 frame length). By default, it is set to (tune.bufsize-4).
215
Christopher Faulete8ade382018-01-25 15:32:22 +0100216max-waiting-frames <number>
217 Set the maximum number of frames waiting for an acknowledgement on the same
218 connection. This value is only used when the pipelinied or asynchronus
219 exchanges between HAProxy and SPOA are enabled. By default, it is set to 20.
Christopher Fauletd1307ce2017-02-27 21:59:39 +0100220
Christopher Fauletf7e4e7e2016-10-27 22:29:49 +0200221messages <msg-name> ...
222 Declare the list of SPOE messages that an agent will handle.
223
224 Arguments :
225 <msg-name> is the name of a SPOE message.
226
227 Messages declared here must be found in the same engine scope, else an error
228 is triggered during the configuration parsing. You can have many "messages"
229 lines.
230
231 See also: "spoe-message" section.
232
233
Christopher Fauletd1307ce2017-02-27 21:59:39 +0100234option async
235no option async
236 Enable or disable the support of asynchronus exchanges between HAProxy and
237 SPOA. By default, this option is enabled.
238
239
Christopher Fauletea62c2a2016-11-14 10:54:21 +0100240option continue-on-error
241 Do not stop the events processing when an error occurred on a stream.
242
243 By default, for a specific stream, when an abnormal/unexpected error occurs,
244 the SPOE is disabled for all the transaction. So if you have several events
245 configured, such error on an event will disabled all followings. For TCP
246 streams, this will disable the SPOE for the whole session. For HTTP streams,
247 this will disable it for the transaction (request and response).
248
249 When set, this option bypass this behaviour and only the current event will
250 be ignored.
251
Etienne Carriereaec89892017-12-14 09:36:40 +0000252option force-set-var
253 By default, SPOE filter only register already known variables (mainly from
254 parsing of the configuration). If you want that haproxy trusts the agent and
255 registers all variables (ex: can be useful for LUA workload), activate this
256 option.
257
258 Caution : this option opens to a variety of attacks such as a rogue SPOA that
259 asks to register too many variables.
260
Christopher Fauletea62c2a2016-11-14 10:54:21 +0100261
Christopher Fauletd1307ce2017-02-27 21:59:39 +0100262option pipelining
263no option pipelining
264 Enable or disable the support of pipelined exchanges between HAProxy and
265 SPOA. By default, this option is enabled.
266
267
268option send-frag-payload
269no option send-frag-payload
270 Enable or disable the sending of fragmented payload to SPOA. By default, this
271 option is enabled.
272
273
Christopher Faulet985532d2016-11-16 15:36:19 +0100274option set-on-error <var name>
275 Define the variable to set when an error occurred during an event processing.
276
277 Arguments :
278
279 <var name> is the variable name, without the scope. The name may only
280 contain characters 'a-z', 'A-Z', '0-9', '.' and '_'.
281
282 This variable will only be set when an error occurred in the scope of the
283 transaction. As for all other variables define by the SPOE, it will be
284 prefixed. So, if your variable name is "error" and your prefix is
285 "my_spoe_pfx", the variable will be "txn.my_spoe_pfx.error".
286
Christopher Fauletb067b062017-01-04 16:39:11 +0100287 When set, the variable is an integer representing the error reason. For values
288 under 256, it represents an error coming from the engine. Below 256, it
289 reports a SPOP error. In this case, to retrieve the right SPOP status code,
290 you must remove 256 to this value. Here are possible values:
291
292 * 1 a timeout occurred during the event processing.
293
294 * 2 an error was triggered during the ressources allocation.
295
Christopher Fauletd1307ce2017-02-27 21:59:39 +0100296 * 3 the frame payload exceeds the frame size and it cannot be
297 fragmented.
298
299 * 4 the fragmentation of a payload is aborted.
300
Christopher Faulet344c4ab2017-09-22 10:20:13 +0200301 * 5 The frame processing has been interrupted by HAProxy.
302
Christopher Fauletb067b062017-01-04 16:39:11 +0100303 * 255 an unknown error occurred during the event processing.
304
305 * 256+N a SPOP error occurred during the event processing (see section
306 "Errors & timeouts").
307
308 Note that if "option continue-on-error" is set, the variable is not
309 automatically removed between events processing.
Christopher Faulet985532d2016-11-16 15:36:19 +0100310
311 See also: "option continue-on-error", "option var-prefix".
312
Christopher Faulet36bda1c2018-03-22 09:08:20 +0100313
314option set-process-time <var name>
315 Define the variable to set to report the processing time of the last event or
316 group.
317
318 Arguments :
319
320 <var name> is the variable name, without the scope. The name may only
321 contain characters 'a-z', 'A-Z', '0-9', '.' and '_'.
322
323 This variable will be set in the scope of the transaction. As for all other
324 variables define by the SPOE, it will be prefixed. So, if your variable name
325 is "process_time" and your prefix is "my_spoe_pfx", the variable will be
326 "txn.my_spoe_pfx.process_time".
327
328 When set, the variable is an integer representing the delay to process the
329 event or the group, in milliseconds. From the stream point of view, it is the
330 latency added by the SPOE processing for the last handled event or group.
331
332 If several events or groups are processed for the same stream, this value
333 will be overrideen.
334
335 See also: "option set-total-time".
336
337
338option set-total-time <var name>
339 Define the variable to set to report the total processing time SPOE for a
340 stream.
341
342 Arguments :
343
344 <var name> is the variable name, without the scope. The name may only
345 contain characters 'a-z', 'A-Z', '0-9', '.' and '_'.
346
347 This variable will be set in the scope of the transaction. As for all other
348 variables define by the SPOE, it will be prefixed. So, if your variable name
349 is "total_time" and your prefix is "my_spoe_pfx", the variable will be
350 "txn.my_spoe_pfx.total_time".
351
352 When set, the variable is an integer representing the sum of processing times
353 for a stream, in milliseconds. From the stream point of view, it is the
354 latency added by the SPOE processing.
355
356 If several events or groups are processed for the same stream, this value
357 will be updated.
358
359 See also: "option set-process-time".
360
361
Christopher Fauletf7e4e7e2016-10-27 22:29:49 +0200362option var-prefix <prefix>
363 Define the prefix used when variables are set by an agent.
364
365 Arguments :
366
367 <prefix> is the prefix used to limit the scope of variables set by an
368 agent.
369
370 To avoid conflict with other variables defined by HAProxy, all variables
371 names will be prefixed. By default, the "spoe-agent" name is used. This
372 option can be used to customize it.
373
374 The prefix will be added between the variable scope and its name, separated
375 by a '.'. It may only contain characters 'a-z', 'A-Z', '0-9', '.' and '_', as
376 for variables name. In HAProxy configuration, you need to use this prefix as
377 a part of the variables name. For example, if an agent define the variable
378 "myvar" in the "txn" scope, with the prefix "my_spoe_pfx", then you should
379 use "txn.my_spoe_pfx.myvar" name in your HAProxy configuration.
380
Etienne Carriereaec89892017-12-14 09:36:40 +0000381 By default, an agent will never set new variables at runtime: It can only set
382 new value for existing ones. If you want a different behaviour, see
Christopher Faulet336d3ef2017-12-22 10:00:55 +0100383 force-set-var option and register-var-names directive.
Christopher Fauletf7e4e7e2016-10-27 22:29:49 +0200384
Christopher Faulet336d3ef2017-12-22 10:00:55 +0100385register-var-names <var name> ...
386 Register some variable names. By default, an agent will not be allowed to set
387 new variables at runtime. This rule can be totally relaxed by setting the
388 option "force-set-var". If you know all the variables you will need, this
389 directive is a good way to register them without letting an agent doing what
390 it want. This is only required if these variables are not referenced anywhere
391 in the HAProxy configuration or the SPOE one.
392
393 Arguments:
394 <var name> is a variable name without the scope. The name may only
395 contain characters 'a-z', 'A-Z', '0-9', '.' and '_'.
396
397 The prefix will be automatically added during the registration. You can have
398 many "register-var-names" lines.
399
400 See also: "option force-set-var", "option var-prefix".
Christopher Fauletf7e4e7e2016-10-27 22:29:49 +0200401
Christopher Fauletf7e4e7e2016-10-27 22:29:49 +0200402timeout hello <timeout>
403 Set the maximum time to wait for an agent to receive the AGENT-HELLO frame.
Christopher Fauletf7a30922016-11-10 15:04:51 +0100404 It is applied on the stream that handle the connection with the agent.
Christopher Fauletf7e4e7e2016-10-27 22:29:49 +0200405
406 Arguments :
407 <timeout> is the timeout value specified in milliseconds by default, but
408 can be in any other unit if the number is suffixed by the unit,
409 as explained at the top of this document.
410
411 This timeout is an applicative timeout. It differ from "timeout connect"
412 defined on backends.
413
414
415timeout idle <timeout>
Christopher Fauletf7a30922016-11-10 15:04:51 +0100416 Set the maximum time to wait for an agent to close an idle connection. It is
417 applied on the stream that handle the connection with the agent.
418
419 Arguments :
420 <timeout> is the timeout value specified in milliseconds by default, but
421 can be in any other unit if the number is suffixed by the unit,
422 as explained at the top of this document.
423
424
425timeout processing <timeout>
426 Set the maximum time to wait for a stream to process an event, i.e to acquire
427 a stream to talk with an agent, to encode all messages, to send the NOTIFY
428 frame, to receive the corrsponding acknowledgement and to process all
429 actions. It is applied on the stream that handle the client and the server
430 sessions.
Christopher Fauletf7e4e7e2016-10-27 22:29:49 +0200431
432 Arguments :
433 <timeout> is the timeout value specified in milliseconds by default, but
434 can be in any other unit if the number is suffixed by the unit,
435 as explained at the top of this document.
436
437
438use-backend <backend>
439 Specify the backend to use. It must be defined.
440
441 Arguments :
442 <backend> is the name of a valid "backend" section.
443
444
4452.3. "spoe-message" section
446----------------------------
447
448To offload the stream processing, SPOE will send messages with specific
449information at a specific moment in the stream life and will wait for
450corresponding replies to know what to do.
451
452
453spoe-message <name>
454 Create a new SPOE message with the name <name>.
455
456 Arguments :
457 <name> is the name of the SPOE message.
458
459 Here you define a message that can be referenced in a "spoe-agent"
460 section. Following keywords are supported :
Christopher Faulet57583e42017-09-04 15:41:09 +0200461 - acl
Christopher Fauletf7e4e7e2016-10-27 22:29:49 +0200462 - args
463 - event
464
465 See also: "spoe-agent" section.
466
467
Christopher Faulet57583e42017-09-04 15:41:09 +0200468acl <aclname> <criterion> [flags] [operator] <value> ...
Christopher Faulet57583e42017-09-04 15:41:09 +0200469 Declare or complete an access list.
470
471 See section 7 about ACL usage in the HAProxy Configuration Manual.
472
473
Christopher Fauletf7e4e7e2016-10-27 22:29:49 +0200474args [name=]<sample> ...
475 Define arguments passed into the SPOE message.
476
477 Arguments :
478 <sample> is a sample expression.
479
480 When the message is processed, if a sample expression is not available, it is
481 set to NULL. Arguments are processed in their declaration order and added in
482 the message in that order. It is possible to declare named arguements.
483
484 For example:
485 args frontend=fe_id src dst
486
487
Christopher Faulet57583e42017-09-04 15:41:09 +0200488event <name> [ { if | unless } <condition> ]
489 Set the event that triggers sending of the message. It may optionally be
490 followed by an ACL-based condition, in which case it will only be evaluated
491 if the condition is true.
Christopher Fauletf7e4e7e2016-10-27 22:29:49 +0200492
Christopher Faulet57583e42017-09-04 15:41:09 +0200493 ACL-based conditions are executed in the context of the stream that handle
494 the client and the server connections.
495
496 Arguments :
497 <name> is the event name.
498 <condition> is a standard ACL-based condition.
Christopher Fauletf7e4e7e2016-10-27 22:29:49 +0200499
500 Supported events are:
501 - on-client-session
Christopher Faulet1002aac2016-12-09 17:41:54 +0100502 - on-server-session
Christopher Fauletf7e4e7e2016-10-27 22:29:49 +0200503 - on-frontend-tcp-request
504 - on-backend-tcp-request
505 - on-tcp-response
506 - on-frontend-http-request
507 - on-backend-http-request
508 - on-http-response
509
Christopher Faulet57583e42017-09-04 15:41:09 +0200510 See section "Events & Messages" for more details about supported events.
511 See section 7 about ACL usage in the HAProxy Configuration Manual.
Christopher Fauletf7e4e7e2016-10-27 22:29:49 +0200512
Christopher Faulet11610f32017-09-21 10:23:10 +02005132.4. "spoe-group" section
514--------------------------
515
516This section can be used to declare a group of SPOE messages. Unlike messages
517referenced in a "spoe-agent" section, messages inside a group are not sent on a
518specific event. The sending must be triggered by TCP or HTTP rules, from the
519HAProxy configuration.
520
521
522spoe-group <name>
523 Create a new SPOE group with the name <name>.
524
525 Arguments :
526 <name> is the name of the SPOE group.
527
528 Here you define a group of SPOE messages that can be referenced in a
529 "spoe-agent" section. Following keywords are supported :
530 - messages
531
532 See also: "spoe-agent" and "spoe-message" sections.
533
534
535messages <msg-name> ...
536 Declare the list of SPOE messages belonging to the group.
537
538 Arguments :
539 <msg-name> is the name of a SPOE message.
540
541 Messages declared here must be found in the same engine scope, else an error
542 is triggered during the configuration parsing. Furthermore, a message belongs
543 at most to a group. You can have many "messages" lines.
544
545 See also: "spoe-message" section.
546
547
5482.5. Example
Christopher Fauletf7e4e7e2016-10-27 22:29:49 +0200549-------------
550
551Here is a simple but complete example that sends client-ip address to a ip
552reputation service. This service can set the variable "ip_score" which is an
553integer between 0 and 100, indicating its reputation (100 means totally safe
554and 0 a blacklisted IP with no doubt).
555
556 ###
557 ### HAProxy configuration
558 frontend www
559 mode http
560 bind *:80
561
562 filter spoe engine ip-reputation config spoe-ip-reputation.conf
563
564 # Reject connection if the IP reputation is under 20
565 tcp-request content reject if { var(sess.iprep.ip_score) -m int lt 20 }
566
567 default_backend http-servers
568
569 backend http-servers
570 mode http
571 server http A.B.C.D:80
572
573 backend iprep-servers
574 mode tcp
575 balance roundrobin
576
577 timeout connect 5s # greater than hello timeout
578 timeout server 3m # greater than idle timeout
579
580 server iprep1 A1.B1.C1.D1:12345
581 server iprep2 A2.B2.C2.D2:12345
582
583 ####
584 ### spoe-ip-reputation.conf
585 [ip-reputation]
586
587 spoe-agent iprep-agent
588 messages get-ip-reputation
589
590 option var-prefix iprep
591
Christopher Faulet03a34492016-11-19 16:47:56 +0100592 timeout hello 2s
593 timeout idle 2m
594 timeout processing 10ms
Christopher Fauletf7e4e7e2016-10-27 22:29:49 +0200595
596 use-backend iprep-servers
597
598 spoe-message get-ip-reputation
599 args ip=src
Christopher Faulet57583e42017-09-04 15:41:09 +0200600 event on-client-session if ! { src -f /etc/haproxy/whitelist.lst }
Christopher Fauletf7e4e7e2016-10-27 22:29:49 +0200601
602
6033. SPOP specification
604----------------------
605
6063.1. Data types
607----------------
608
609Here is the bytewise representation of typed data:
610
611 TYPED-DATA : <TYPE:4 bits><FLAGS:4 bits><DATA>
612
613Supported types and their representation are:
614
615 TYPE | ID | DESCRIPTION
616 -----------------------------+-----+----------------------------------
617 NULL | 0 | NULL : <0>
618 Boolean | 1 | BOOL : <1+FLAG>
619 32bits signed integer | 2 | INT32 : <2><VALUE:varint>
620 32bits unsigned integer | 3 | UINT32 : <3><VALUE:varint>
621 64bits signed integer | 4 | INT64 : <4><VALUE:varint>
622 32bits unsigned integer | 5 | UNIT64 : <5><VALUE:varint>
623 IPV4 | 6 | IPV4 : <6><STRUCT IN_ADDR:4 bytes>
624 IPV6 | 7 | IPV6 : <7><STRUCT IN_ADDR6:16 bytes>
625 String | 8 | STRING : <8><LENGTH:varint><BYTES>
626 Binary | 9 | BINARY : <9><LENGTH:varint><BYTES>
627 10 -> 15 unused/reserved | - | -
628 -----------------------------+-----+----------------------------------
629
630Variable-length integer (varint) are encoded using Peers encoding:
631
632
633 0 <= X < 240 : 1 byte (7.875 bits) [ XXXX XXXX ]
634 240 <= X < 2288 : 2 bytes (11 bits) [ 1111 XXXX ] [ 0XXX XXXX ]
635 2288 <= X < 264432 : 3 bytes (18 bits) [ 1111 XXXX ] [ 1XXX XXXX ] [ 0XXX XXXX ]
636 264432 <= X < 33818864 : 4 bytes (25 bits) [ 1111 XXXX ] [ 1XXX XXXX ]*2 [ 0XXX XXXX ]
637 33818864 <= X < 4328786160 : 5 bytes (32 bits) [ 1111 XXXX ] [ 1XXX XXXX ]*3 [ 0XXX XXXX ]
638 ...
639
640For booleans, the value (true or false) is the first bit in the FLAGS
641bitfield. if this bit is set to 0, then the boolean is evaluated as false,
642otherwise, the boolean is evaluated as true.
643
6443.2. Frames
645------------
646
647Exchange between HAProxy and agents are made using FRAME packets. All frames
648must be prefixed with their size encoded on 4 bytes in network byte order:
649
650 <FRAME-LENGTH:4 bytes> <FRAME>
651
652A frame always starts with its type, on one byte, followed by metadata
653containing flags, on 4 bytes and a two variable-length integer representing the
654stream identifier and the frame identifier inside the stream:
655
656 FRAME : <FRAME-TYPE:1 byte> <METADATA> <FRAME-PAYLOAD>
657 METADATA : <FLAGS:4 bytes> <STREAM-ID:varint> <FRAME-ID:varint>
658
659Then comes the frame payload. Depending on the frame type, the payload can be
660of three types: a simple key/value list, a list of messages or a list of
661actions.
662
663 FRAME-PAYLOAD : <LIST-OF-MESSAGES> | <LIST-OF-ACTIONS> | <KV-LIST>
664
665 LIST-OF-MESSAGES : [ <MESSAGE-NAME> <NB-ARGS:1 byte> <KV-LIST> ... ]
666 MESSAGE-NAME : <STRING>
667
668 LIST-OF-ACTIONS : [ <ACTION-TYPE:1 byte> <NB-ARGS:1 byte> <ACTION-ARGS> ... ]
669 ACTION-ARGS : [ <TYPED-DATA>... ]
670
671 KV-LIST : [ <KV-NAME> <KV-VALUE> ... ]
672 KV-NAME : <STRING>
673 KV-VALUE : <TYPED-DATA>
674
Christopher Fauletd1307ce2017-02-27 21:59:39 +0100675 FLAGS : 0 1 2-31
676 +---+---+----------+
677 | | A | |
678 | F | B | |
679 | I | O | RESERVED |
680 | N | R | |
681 | | T | |
682 +---+---+----------+
Christopher Fauletf7e4e7e2016-10-27 22:29:49 +0200683
684 FIN: Indicates that this is the final payload fragment. The first fragment
685 may also be the final fragment.
686
Christopher Fauletd1307ce2017-02-27 21:59:39 +0100687 ABORT: Indicates that the processing of the current frame must be
688 cancelled. This bit should be set on frames with a fragmented
689 payload. It can be ignore for frames with an unfragemnted
690 payload. When it is set, the FIN bit must also be set.
691
692
Christopher Fauletf7e4e7e2016-10-27 22:29:49 +0200693Frames cannot exceed a maximum size negociated between HAProxy and agents
694during the HELLO handshake. Most of time, payload will be small enough to send
695it in one frame. But when supported by the peer, it will be possible to
696fragment huge payload on many frames. This ability is announced during the
697HELLO handshake and it can be asynmetric (supported by agents but not by
698HAProxy or the opposite). The following rules apply to fragmentation:
699
700 * An unfragemnted payload consists of a single frame with the FIN bit set.
701
702 * A fragemented payload consists of several frames with the FIN bit clear and
703 terminated by a single frame with the FIN bit set. All these frames must
Christopher Fauletd1307ce2017-02-27 21:59:39 +0100704 share the same STREAM-ID and FRAME-ID. The first frame must set the right
705 FRAME-TYPE (e.g, NOTIFY). The following frames must have an unset type (0).
Christopher Fauletf7e4e7e2016-10-27 22:29:49 +0200706
707Beside the support of fragmented payload by a peer, some payload must not be
708fragmented. See below for details.
709
Christopher Fauletd1307ce2017-02-27 21:59:39 +0100710IMPORTANT : The maximum size supported by peers for a frame must be greater
711than or equal to 256 bytes.
Christopher Fauletf7e4e7e2016-10-27 22:29:49 +0200712
7133.2.1. Frame capabilities
714--------------------------
715
716Here are the list of official capabilities that HAProxy and agents can support:
717
Christopher Fauleta1cda022016-12-21 08:58:06 +0100718 * fragmentation: This is the ability for a peer to support fragmented
719 payload in received frames. This is an asymmectical
720 capability, it only concerns the peer that announces
721 it. This is the responsibility to the other peer to use it
722 or not.
723
724 * pipelining: This is the ability for a peer to decouple NOTIFY and ACK
725 frames. This is a symmectical capability. To be used, it must
726 be supported by HAproxy and agents. Unlike HTTP pipelining, the
727 ACK frames can be send in any order, but always on the same TCP
728 connection used for the corresponding NOTIFY frame.
729
730 * async: This ability is similar to the pipelining, but here any TCP
731 connection established between HAProxy and the agent can be used to
732 send ACK frames. if an agent accepts connections from multiple
733 HAProxy, it can use the "engine-id" value to group TCP
734 connections. See details about HAPROXY-HELLO frame.
Christopher Fauletf7e4e7e2016-10-27 22:29:49 +0200735
736Unsupported or unknown capabilities are silently ignored, when possible.
737
7383.2.2. Frame types overview
739----------------------------
740
741Here are types of frame supported by SPOE. Frames sent by HAProxy come first,
742then frames sent by agents :
743
744 TYPE | ID | DESCRIPTION
745 -----------------------------+-----+-------------------------------------
Christopher Fauletd1307ce2017-02-27 21:59:39 +0100746 UNSET | 0 | Used for all frames but the first when a
747 | | payload is fragmented.
748 -----------------------------+-----+-------------------------------------
Christopher Fauletf7e4e7e2016-10-27 22:29:49 +0200749 HAPROXY-HELLO | 1 | Sent by HAProxy when it opens a
750 | | connection on an agent.
751 | |
752 HAPROXY-DISCONNECT | 2 | Sent by HAProxy when it want to close
753 | | the connection or in reply to an
754 | | AGENT-DISCONNECT frame
755 | |
756 NOTIFY | 3 | Sent by HAProxy to pass information
757 | | to an agent
758 -----------------------------+-----+-------------------------------------
759 AGENT-HELLO | 101 | Reply to a HAPROXY-HELLO frame, when
760 | | the connection is established
761 | |
762 AGENT-DISCONNECT | 102 | Sent by an agent just before closing
763 | | the connection
764 | |
765 ACK | 103 | Sent to acknowledge a NOTIFY frame
766 -----------------------------+-----+-------------------------------------
767
768Unknown frames may be silently skipped.
769
7703.2.3. Workflow
771----------------
772
773 * Successful HELLO handshake:
774
775 HAPROXY AGENT SRV
776 | HAPROXY-HELLO |
Christopher Fauletba7bc162016-11-07 21:07:38 +0100777 | (healthcheck: false) |
Christopher Fauletf7e4e7e2016-10-27 22:29:49 +0200778 | --------------------------> |
779 | |
780 | AGENT-HELLO |
781 | <-------------------------- |
782 | |
783
Christopher Fauletba7bc162016-11-07 21:07:38 +0100784 * Successful HELLO healthcheck:
785
786 HAPROXY AGENT SRV
787 | HAPROXY-HELLO |
788 | (healthcheck: true) |
789 | --------------------------> |
790 | |
791 | AGENT-HELLO + close() |
792 | <-------------------------- |
793 | |
794
Christopher Fauletf7e4e7e2016-10-27 22:29:49 +0200795
796 * Error encountered by agent during the HELLO handshake:
797
798 HAPROXY AGENT SRV
799 | HAPROXY-HELLO |
800 | --------------------------> |
801 | |
802 | DISCONNECT + close() |
803 | <-------------------------- |
804 | |
805
806 * Error encountered by HAProxy during the HELLO handshake:
807
808 HAPROXY AGENT SRV
809 | HAPROXY-HELLO |
810 | --------------------------> |
811 | |
812 | AGENT-HELLO |
813 | <-------------------------- |
814 | |
815 | DISCONNECT |
816 | --------------------------> |
817 | |
818 | DISCONNECT + close() |
819 | <-------------------------- |
820 | |
821
Christopher Fauletd1307ce2017-02-27 21:59:39 +0100822 * Notify / Ack exchange (unfragmented payload):
Christopher Fauletf7e4e7e2016-10-27 22:29:49 +0200823
824 HAPROXY AGENT SRV
825 | NOTIFY |
826 | --------------------------> |
827 | |
828 | ACK |
829 | <-------------------------- |
830 | |
831
Christopher Fauletd1307ce2017-02-27 21:59:39 +0100832 * Notify / Ack exchange (fragmented payload):
833
834 HAPROXY AGENT SRV
835 | NOTIFY (frag 1) |
836 | --------------------------> |
837 | |
838 | UNSET (frag 2) |
839 | --------------------------> |
840 | ... |
841 | UNSET (frag N) |
842 | --------------------------> |
843 | |
844 | ACK |
845 | <-------------------------- |
846 | |
847
848 * Aborted fragmentation of a NOTIFY frame:
849
850 HAPROXY AGENT SRV
851 | ... |
852 | UNSET (frag X) |
853 | --------------------------> |
854 | |
855 | ACK/ABORT |
856 | <-------------------------- |
857 | |
858 | UNSET (frag X+1) |
859 | -----------X |
860 | |
861 | |
862
Christopher Fauletf7e4e7e2016-10-27 22:29:49 +0200863 * Connection closed by haproxy:
864
865 HAPROXY AGENT SRV
866 | DISCONNECT |
867 | --------------------------> |
868 | |
869 | DISCONNECT + close() |
870 | <-------------------------- |
871 | |
872
873 * Connection closed by agent:
874
875 HAPROXY AGENT SRV
876 | DISCONNECT + close() |
877 | <-------------------------- |
878 | |
879
8803.2.4. Frame: HAPROXY-HELLO
881----------------------------
882
883This frame is the first one exchanged between HAProxy and an agent, when the
884connection is established. The payload of this frame is a KV-LIST. It cannot be
885fragmented. STREAM-ID and FRAME-ID are must be set 0.
886
887Following items are mandatory in the KV-LIST:
888
889 * "supported-versions" <STRING>
890
891 Last SPOP major versions supported by HAProxy. It is a comma-separated list
892 of versions, following the format "Major.Minor". Spaces must be ignored, if
893 any. When a major version is announced by HAProxy, it means it also support
894 all previous minor versions.
895
896 Example: "2.0, 1.5" means HAProxy supports SPOP 2.0 and 1.0 to 1.5
897
898 * "max-frame-size" <UINT32>
899
900 This is the maximum size allowed for a frame. The HAPROXY-HELLO frame must
901 be lower or equal to this value.
902
903 * "capabilities" <STRING>
904
905 This a comma-separated list of capabilities supported by HAProxy. Spaces
906 must be ignored, if any.
907
Christopher Fauletba7bc162016-11-07 21:07:38 +0100908Following optional items can be added in the KV-LIST:
909
910 * "healthcheck" <BOOLEAN>
911
912 If this item is set to TRUE, then the HAPROXY-HELLO frame is sent during a
913 SPOE health check. When set to FALSE, this item can be ignored.
914
Christopher Fauleta1cda022016-12-21 08:58:06 +0100915 * "engine-id" <STRING>
916
917 This is a uniq string that identify a SPOE engine.
918
Christopher Fauletf7e4e7e2016-10-27 22:29:49 +0200919To finish the HELLO handshake, the agent must return an AGENT-HELLO frame with
920its supported SPOP version, the lower value between its maximum size allowed
921for a frame and the HAProxy one and capabilities it supports. If an error
922occurs or if an incompatibility is detected with the agent configuration, an
923AGENT-DISCONNECT frame must be returned.
924
9253.2.5. Frame: AGENT-HELLO
926--------------------------
927
928This frame is sent in reply to a HAPROXY-HELLO frame to finish a HELLO
929handshake. As for HAPROXY-HELLO frame, STREAM-ID and FRAME-ID are also set
9300. The payload of this frame is a KV-LIST and it cannot be fragmented.
931
932Following items are mandatory in the KV-LIST:
933
934 * "version" <STRING>
935
936 This is the SPOP version the agent supports. It must follow the format
937 "Major.Minor" and it must be lower or equal than one of major versions
938 announced by HAProxy.
939
940 * "max-frame-size" <UINT32>
941
942 This is the maximum size allowed for a frame. It must be lower or equal to
943 the value in the HAPROXY-HELLO frame. This value will be used for all
944 subsequent frames.
945
946 * "capabilities" <STRING>
947
948 This a comma-separated list of capabilities supported by agent. Spaces must
949 be ignored, if any.
950
951At this time, if everything is ok for HAProxy (supported version and valid
952max-frame-size value), the HELLO handshake is successfully completed. Else,
953HAProxy sends a HAPROXY-DISCONNECT frame with the corresponding error.
954
Christopher Fauletba7bc162016-11-07 21:07:38 +0100955If "healthcheck" item was set to TRUE in the HAPROXY-HELLO frame, the agent can
956safely close the connection without DISCONNECT frame. In all cases, HAProxy
957will close the connexion at the end of the health check.
958
Christopher Fauletf7e4e7e2016-10-27 22:29:49 +02009593.2.6. Frame: NOTIFY
960---------------------
961
962Information are sent to the agents inside NOTIFY frames. These frames are
963attached to a stream, so STREAM-ID and FRAME-ID must be set. The payload of
964NOTIFY frames is a LIST-OF-MESSAGES and, if supported by agents, it can be
965fragmented.
966
967NOTIFY frames must be acknowledge by agents sending an ACK frame, repeating
968right STREAM-ID and FRAME-ID.
969
9703.2.7. Frame: ACK
971------------------
972
973ACK frames must be sent by agents to reply to NOTIFY frames. STREAM-ID and
974FRAME-ID found in a NOTIFY frame must be reuse in the corresponding ACK
975frame. The payload of ACK frames is a LIST-OF-ACTIONS and, if supported by
976HAProxy, it can be fragmented.
977
9783.2.8. Frame: HAPROXY-DISCONNECT
979---------------------------------
980
981If an error occurs, at anytime, from the HAProxy side, a HAPROXY-DISCONNECT
982frame is sent with information describing the error. HAProxy will wait an
983AGENT-DISCONNECT frame in reply. All other frames will be ignored. The agent
984must then close the socket.
985
986The payload of this frame is a KV-LIST. It cannot be fragmented. STREAM-ID and
987FRAME-ID are must be set 0.
988
989Following items are mandatory in the KV-LIST:
990
991 * "status-code" <UINT32>
992
993 This is the code corresponding to the error.
994
995 * "message" <STRING>
996
997 This is a textual message describing the error.
998
999For more information about known errors, see section "Errors & timeouts"
1000
10013.2.9. Frame: AGENT-DISCONNECT
1002-------------------------------
1003
1004If an error occurs, at anytime, from the agent size, a AGENT-DISCONNECT frame
1005is sent, with information desribing the error. such frame is also sent in reply
1006to a HAPROXY-DISCONNECT. The agent must close the socket just after sending
1007this frame.
1008
1009The payload of this frame is a KV-LIST. It cannot be fragmented. STREAM-ID and
1010FRAME-ID are must be set 0.
1011
1012Following items are mandatory in the KV-LIST:
1013
1014 * "status-code" <UINT32>
1015
1016 This is the code corresponding to the error.
1017
1018 * "message" <STRING>
1019
1020 This is a textual message describing the error.
1021
1022For more information about known errors, see section "Errors & timeouts"
1023
10243.3. Events & Messages
1025-----------------------
1026
1027Information about streams are sent in NOTIFY frames. You can specify which kind
1028of information to send by defining "spoe-message" sections in your SPOE
1029configuration file. for each "spoe-message" there will be a message in a NOTIFY
1030frame when the right event is triggered.
1031
1032A NOTIFY frame is sent for an specific event when there is at least one
1033"spoe-message" attached to this event. All messages for an event will be added
1034in the same NOTIFY frame.
1035
1036Here is the list of supported events:
1037
1038 * on-client-session is triggered when a new client session is created.
1039 This event is only available for SPOE filters
1040 declared in a frontend or a listen section.
1041
1042 * on-frontend-tcp-request is triggered just before the evaluation of
1043 "tcp-request content" rules on the frontend side.
1044 This event is only available for SPOE filters
1045 declared in a frontend or a listen section.
1046
1047 * on-backend-tcp-request is triggered just before the evaluation of
1048 "tcp-request content" rules on the backend side.
1049 This event is skipped for SPOE filters declared
1050 in a listen section.
1051
1052 * on-frontend-http-request is triggered just before the evaluation of
1053 "http-request" rules on the frontend side. This
1054 event is only available for SPOE filters declared
1055 in a frontend or a listen section.
1056
1057 * on-backend-http-request is triggered just before the evaluation of
1058 "http-request" rules on the backend side. This
1059 event is skipped for SPOE filters declared in a
1060 listen section.
1061
1062 * on-server-session is triggered when the session with the server is
1063 established.
1064
1065 * on-tcp-response is triggered just before the evaluation of
1066 "tcp-response content" rules.
1067
1068 * on-http-response is triggered just before the evaluation of
1069 "http-response" rules.
1070
1071
1072The stream processing will loop on these events, when triggered, waiting the
1073agent reply.
1074
10753.4. Actions
1076-------------
1077
1078An agent must acknowledge each NOTIFY frame by sending the corresponding ACK
1079frame. Actions can be added in these frames to dynamically take action on the
1080processing of a stream.
1081
1082Here is the list of supported actions:
1083
1084 * set-var set the value for an existing variable. 3 arguments must be
1085 attached to this action: the variable scope (proc, sess, txn,
1086 req or req), the variable name (a string) and its value.
1087
1088 ACTION-SET-VAR : <SET-VAR:1 byte><NB-ARGS:1 byte><VAR-SCOPE:1 byte><VAR-NAME><VAR-VALUE>
1089
1090 SET-VAR : <1>
1091 NB-ARGS : <3>
1092 VAR-SCOPE : <PROCESS> | <SESSION> | <TRANSACTION> | <REQUEST> | <RESPONSE>
1093 VAR-NAME : <STRING>
1094 VAR-VALUE : <TYPED-DATA>
1095
1096 PROCESS : <0>
1097 SESSION : <1>
1098 TRANSACTION : <2>
1099 REQUEST : <3>
Christopher Fauleta1cda022016-12-21 08:58:06 +01001100 RESPONSE : <4>
Christopher Fauletf7e4e7e2016-10-27 22:29:49 +02001101
1102 * unset-var unset the value for an existing variable. 2 arguments must be
1103 attached to this action: the variable scope (proc, sess, txn,
1104 req or req) and the variable name (a string).
1105
Christopher Faulet1002aac2016-12-09 17:41:54 +01001106 ACTION-UNSET-VAR : <UNSET-VAR:1 byte><NB-ARGS:1 byte><VAR-SCOPE:1 byte><VAR-NAME>
Christopher Fauletf7e4e7e2016-10-27 22:29:49 +02001107
Christopher Faulet1002aac2016-12-09 17:41:54 +01001108 UNSET-VAR : <2>
1109 NB-ARGS : <2>
Christopher Fauletf7e4e7e2016-10-27 22:29:49 +02001110 VAR-SCOPE : <PROCESS> | <SESSION> | <TRANSACTION> | <REQUEST> | <RESPONSE>
1111 VAR-NAME : <STRING>
1112
1113 PROCESS : <0>
1114 SESSION : <1>
1115 TRANSACTION : <2>
1116 REQUEST : <3>
Christopher Fauleta1cda022016-12-21 08:58:06 +01001117 RESPONSE : <4>
Christopher Fauletf7e4e7e2016-10-27 22:29:49 +02001118
1119
1120NOTE: Name of the variables will be automatically prefixed by HAProxy to avoid
1121 name clashes with other variables used in HAProxy. Moreover, unknown
1122 variable will be silently ignored.
1123
Christopher Fauletd1307ce2017-02-27 21:59:39 +010011243.5. Errors & timeouts
Christopher Fauletf7e4e7e2016-10-27 22:29:49 +02001125----------------------
1126
1127Here is the list of all known errors:
1128
1129 STATUS CODE | DESCRIPTION
1130 ----------------+--------------------------------------------------------
1131 0 | normal (no error occurred)
1132 1 | I/O error
1133 2 | A timeout occurred
1134 3 | frame is too big
1135 4 | invalid frame received
1136 5 | version value not found
1137 6 | max-frame-size value not found
1138 7 | capabilities value not found
1139 8 | unsupported version
1140 9 | max-frame-size too big or too small
Christopher Fauletd1307ce2017-02-27 21:59:39 +01001141 10 | payload fragmentation is not supported
1142 11 | invalid interlaced frames
1143 12 | frame-id not found (it does not match any referenced frame)
1144 13 | resource allocation error
Christopher Fauletf7e4e7e2016-10-27 22:29:49 +02001145 99 | an unknown error occurrde
1146 ----------------+--------------------------------------------------------
1147
1148An agent can define its own errors using a not yet assigned status code.
1149
Christopher Fauletea62c2a2016-11-14 10:54:21 +01001150IMPORTANT NOTE: By default, for a specific stream, when an abnormal/unexpected
1151 error occurs, the SPOE is disabled for all the transaction. So
1152 if you have several events configured, such error on an event
1153 will disabled all followings. For TCP streams, this will
1154 disable the SPOE for the whole session. For HTTP streams, this
1155 will disable it for the transaction (request and response).
1156 See 'option continue-on-error' to bypass this limitation.
Christopher Fauletf7e4e7e2016-10-27 22:29:49 +02001157
1158To avoid a stream to wait infinitly, you must carefully choose the
1159acknowledgement timeout. In most of cases, it will be quiet low. But it depends
1160on the responsivness of your service.
1161
1162You must also choose idle timeout carefully. Because connection with your
1163service depends on the backend configuration used by the SPOA, it is important
1164to use a lower value for idle timeout than the server timeout. Else the
1165connection will be closed by HAProxy. The same is true for hello timeout. You
1166should choose a lower value than the connect timeout.
1167
Christopher Fauletb2dd1e02018-03-22 09:07:41 +010011684. Logging
1169-----------
1170
1171Activity of an SPOE is logged using HAProxy's logger. The messages are logged
1172in the context of the streams that handle the client and the server
1173connections. A message is emitted for each event or group handled by an
1174SPOE. Depending on the status code, the log level will be different. In the
1175normal case, when no error occurred, the message is logged with the level
1176LOG_NOTICE. Otherwise, the message is logged with the level LOG_WARNING.
1177
1178The messages are logged using the stream's logger and use the following format:
1179
1180 SPOE: [AGENT] <TYPE:NAME> sid=STREAM-ID st=STATUC-CODE reqT/qT/wT/resT/pT
1181
1182 AGENT is the agent name
1183 TYPE is EVENT of GROUP
1184 NAME is the event or the group name
1185 STREAM-ID is an integer, the unique id of the stream
1186 STATUS_CODE is the processing's status code
1187 reqT/qT/wT/resT/pT are the following time events:
1188
1189 * reqT : the encoding time. It includes ACLs processing, if any. For
1190 fragmented frames, it is the sum of all fragments.
1191 * qT : the delay before the request gets out the sending queue. For
1192 fragmented frames, it is the sum of all fragments.
1193 * wT : the delay before the reponse is received. No fragmentation
1194 supported here.
1195 * resT : the delay to process the response. No fragmentation supported
Christopher Faulet36bda1c2018-03-22 09:08:20 +01001196 here.
Christopher Fauletb2dd1e02018-03-22 09:07:41 +01001197 * pT : the delay to process the event or the group. From the stream
Christopher Faulet36bda1c2018-03-22 09:08:20 +01001198 point of view, it is the latency added by the SPOE processing.
1199 It is more or less the sum of values above.
Christopher Fauletb2dd1e02018-03-22 09:07:41 +01001200
1201For all these time events, -1 means the processing was interrupted before the
1202end. So -1 for the queue time means the request was never dequeued. For
1203fragmented frames it is harder to know when the interruption happened.
Christopher Fauletf7e4e7e2016-10-27 22:29:49 +02001204
1205/*
1206 * Local variables:
1207 * fill-column: 79
1208 * End:
1209 */