An LLQ is initiated by a client and is completed via a four-way handshake. This handshake provides resilience to packet loss, demonstrates client reachability, and reduces denial-of-service attack opportunities (see
Section 8, "[
Security Considerations]").
LLQ Setup Requests and Responses sent by the client
SHOULD be retransmitted if no acknowledgments are received. The client
SHOULD retry up to two more times (for a total of 3 attempts) before considering the server down or unreachable. The client
MUST wait at least 2 seconds before the first retransmission and 4 seconds between the first and second retransmissions. The client
SHOULD listen for a response for at least 8 seconds after the 3rd attempt before considering the server down or unreachable. Upon determining a server to be down, a client
MAY periodically attempt to re-initiate an LLQ setup at a rate of not more than once per hour.
Servers
MUST NOT retransmit acknowledgments that do not generate responses from the client. Retransmission in setup is client driven, freeing servers from maintaining timers for incomplete LLQ setups. If servers receive duplicate messages from clients (perhaps due to the loss of the server's responses mid-flight), the server
MUST resend its reply (possibly modifying the LLQ-LEASE as described in
Section 5.2.4, "[
ACK + Answers]").
Servers
MUST NOT garbage collect LLQs that fail to complete the four-way handshake until the initially granted LLQ-LEASE has elapsed.
The four phases of the handshake include:
-
-
1) Setup Request
-
client to server, identifies LLQ(s) requested
-
2) Setup Challenge
-
server to client, providesunique identifiers for successful requested LLQs, anderror(s) for unsuccessful requested LLQs.
-
3) Challenge Response
-
client to server, echoes identifier(s), demonstrating client'sreachability and willingness to participate
-
4) ACK + Answers
-
server to client, confirms setup and provides initial answers
A request for an LLQ is formatted like a standard DNS query but with an OPT pseudo-RR containing LLQ metadata in its Additional section. LLQ Setup Requests are identified by the LLQ-SETUP opcode and a zero-valued LLQ-ID.
The request
MAY contain multiple questions to set up multiple LLQs. A Setup Request consisting of multiple questions
MUST contain multiple LLQ OPTIONS, one per question, with the LLQ OPTIONS in the same order as the questions they correspond to (i.e., the first LLQ OPTION corresponds to the first question, the second LLQ OPTION corresponds to the second question, etc.). If requesting multiple LLQs, clients
SHOULD request the same LLQ-LEASE for each LLQ. Requests over UDP
MUST NOT contain multiple questions if doing so would cause the message to exceed a single IP packet.
A client
MUST NOT request multiple identical LLQs (i.e., containing the same qname/type/class) from the same source IP address and port. This requirement is to avoid unnecessary load on servers. In the case of multiple independent client implementations that may run on the same device without knowledge of each other, it is allowable if they by chance send LLQ requests for the same qname/type/class. These independent implementations on the same client will be using different source ports. Likewise, to the server, multiple independent clients behind the same NAT gateway will appear as if they were multiple independent clients using different ports on the same host, and this is also allowable.
The query
MUST NOT be for record type ANY (255), class ANY (255), or class NONE (0).
Field Name |
Field Type |
Description |
OPTION-CODE |
u_int16_t |
LLQ (1) |
OPTION-LENGTH |
u_int16_t |
Length of following fields (18) |
LLQ-VERSION |
u_int16_t |
Version of LLQ protocol implemented by requester (1) |
LLQ-OPCODE |
u_int16_t |
LLQ-SETUP (1) |
LLQ-ERROR |
u_int16_t |
NO-ERROR (0) |
LLQ-ID |
u_int64_t |
0 |
LLQ-LEASE |
u_int32_t |
Desired life of LLQ request |
Table 4: Setup Request LLQ OPTION Format
The Setup Request LLQ OPTION
MUST be repeated once for each additional query in the Question section.
Upon receiving an LLQ Setup Request, a server implementing LLQs will send a Setup Challenge to the requester (client). An LLQ Setup Challenge is a DNS response, with the DNS message ID matching that of the Setup Request, and with all questions contained in the Setup Request present in the Question section of the response. Additionally, the challenge contains a single OPT pseudo-RR with an LLQ OPTION for each LLQ request, indicating the success or failure of each request. The LLQ OPTIONS
MUST be in the same order as the questions they correspond to. Note that in a Setup Request containing multiple questions, some LLQs may succeed while others may fail.
Field Name |
Field Type |
Description |
OPTION-CODE |
u_int16_t |
LLQ (1) |
OPTION-LENGTH |
u_int16_t |
Length of following fields (18) |
LLQ-VERSION |
u_int16_t |
Version of LLQ protocol implemented in server (1) |
LLQ-OPCODE |
u_int16_t |
LLQ-SETUP (1) |
LLQ-ERROR |
u_int16_t |
[As Appropriate] |
LLQ-ID |
u_int64_t |
[As Appropriate] |
LLQ-LEASE |
u_int32_t |
[As Appropriate] |
Table 5: Setup Challenge LLQ OPTION Format
The Setup Challenge LLQ OPTION
MUST be repeated once for each query in the Questions section of the Setup Challenge. Further details for LLQ-ERROR, LLQ-ID and LLQ-LEASE are given below.
LLQ-ERROR:
-
-
NO-ERROR:
-
The LLQ Setup Request was successful.
-
FORMAT-ERR:
-
The LLQ was improperly formatted. Note that if the rest of the DNSmessage is properly formatted, the DNS header error code MUST NOT include a format error code, since to do so would cause ambiguitybetween the case where a client sends a valid LLQ Setup Request to a serverthat does not understand LLQ and the case where a client sends a malformedLLQ Setup Request to a server that does understand LLQ.
-
SERV-FULL:
-
The server cannot grant the LLQ request because it is overloaded or therequest exceeds the server's rate limit (see Section 8, [Security Considerations]). Uponreturning this error, the server MUST include in the LLQ-LEASEfield a time interval, in seconds, after which the client may retry the LLQSetup.
-
STATIC:
-
The data for this name and type is not expected to change frequently, andthe server, therefore, does not support the requested LLQ. The clientMUST honor the resource record TTLs returned andMUST NOT poll sooner than indicated by those TTLs,nor should it retry the LLQ Setup for this name and type.
-
BAD-VERS:
-
The protocol version specified in the client's Setup Request is notsupported bythe server.
-
UNKNOWN-ERR:
-
The LLQ was not granted for some other reason not covered by the precedingerror code values.
-
LLQ-ID:
-
On success, a random number generated by the server that is unique on theserver for therequested name/type/class. The LLQ-ID SHOULD be anunpredictable random number. A possible method of allocating LLQ-IDs withminimal bookkeeping would be to store the time, in seconds since the Epoch, inthe high 32 bits of the field, and a cryptographically generated 32-bit randominteger in the low 32 bits.
-
-
On error, the LLQ-ID is set to 0.
-
LLQ-LEASE:
-
On success, the actual life of the LLQ, in seconds. Value may be greaterthan, less than, or equal to the value requested by the client, as per theserver administrator's policy. The server MAY discard the LLQafter this LLQ-LEASE expires unless the LLQ has been renewed by theclient (see Section 7, "[LLQ Lease-Life Expiration]"). The server MUST NOT generate events (seeSection 6, "[Event Responses]") for expired LLQs.
-
-
On SERV-FULL error, LLQ-LEASE MUST be set to a time interval, in seconds, after which the client may retry the LLQ Setup.
-
-
On other errors, the LLQ-LEASE MUST be set to 0.
Upon issuing a Setup Request, a client listens for a Setup Challenge (
Section 5.2.2) retransmitting the Setup Request as necessary (
Section 5.1). After receiving a successful Setup Challenge, the client
SHOULD send a Challenge Response to the server. This Challenge Response is a DNS request with questions as in the Setup Request and Setup Challenge, and a single OPT pseudo-RR in the Additional section, with the LLQ OPTIONS corresponding to the LLQ OPTIONS contained in the Setup Challenge (i.e., echoing, for each LLQ OPTION, the random LLQ-ID and the granted LLQ-LEASE). If the Challenge Response contains multiple questions, the first question
MUST correspond to the first LLQ OPTION, etc.
If the Setup Request for a particular LLQ fails with a STATIC error, the client
MUST NOT poll the server for that LLQ. The client
SHOULD honor the resource record TTLs contained in the response.
If a Setup Request fails with a SERV-FULL error, the client
MAY retry the LLQ Setup Request (
Section 5.2.1) after the time indicated in the LLQ-LEASE field.
If the Setup Request fails with an error other than STATIC or SERV-FULL, or the server is determined not to support LLQ (i.e., the client receives a DNS response with a nonzero RCODE, or a DNS response containing no LLQ option), the client
MAY poll the server periodically with standard DNS queries, inferring Add and Remove Events (see
Section 6, "Event Responses") by comparing answers to these queries. The client
SHOULD NOT poll more than once every 15 minutes for a given query. The client
MUST NOT poll if it receives a STATIC error code in the acknowledgment.
Upon receiving a correct Challenge Response, a server
MUST return an acknowledgment, completing the LLQ setup, and provide all current answers to the question(s).
To acknowledge a successful Challenge Response, i.e., a Challenge Response in which the LLQ-ID and LLQ-LEASE echoed by the client match the values issued by the server, the server
MUST send a DNS response containing all available answers to the question(s) contained in the original Setup Request, along with all additional resource records appropriate for those answers in the Additional section. The Additional section also contains LLQ OPTIONS formatted as follows:
Field Name |
Field Type |
Description |
OPTION-CODE |
u_int16_t |
LLQ (1) |
OPTION-LENGTH |
u_int16_t |
Length of following fields (18) |
LLQ-VERSION |
u_int16_t |
Version of LLQ protocol implemented in server (1) |
LLQ-OPCODE |
u_int16_t |
LLQ-SETUP (1) |
LLQ-ERROR |
u_int16_t |
NO-ERROR (0) |
LLQ-ID |
u_int64_t |
Originally granted ID, echoed in client's Response |
LLQ-LEASE |
u_int32_t |
Remaining life of LLQ, in seconds |
Table 6: Successful ACK + Answers LLQ OPTION Format
If there is a significant delay in receiving a Challenge Response, or multiple Challenge Responses are issued (possibly because they were lost en route to the client, causing the client to resend the Challenge Response), the server
MAY decrement the LLQ-LEASE by the time elapsed since the Setup Challenge was initially issued.
If the setup is completed over UDP and all initially available answers to the question(s), additional records, and the OPT pseudo-RR do not fit in a single IP packet, some or all additional records (excluding the OPT pseudo-RR)
MUST be omitted. If, after omission of all additional records, the answers still do not fit in a single message, answers
MUST be removed until the message fits in a single IP packet. These answers not delivered in the ACK + Answers
MUST be delivered without undue delay to the client via Add Events (
Section 6, "[
Event Responses]").
The TTLs of resource records contained in answers to successful LLQs
SHOULD be ignored by the client. The client
MAY cache LLQ answers until the client receives a gratuitous announcement (see
Section 6, "[
Event Responses]") indicating that the answer to the LLQ has changed. The client
SHOULD NOT cache answers after the LLQs LLQ-LEASE expires without being refreshed (see
Section 7, "LLQ Lease-Life Expiration"). If an LLQ request fails, the client
SHOULD NOT cache answers for a period longer than the client's polling interval.
Note that resource records intended specifically to be transmitted via LLQs (e.g., DNS-based Service Discovery resource records) may have unusually short TTLs. This is because it is assumed that the records may change frequently, and that a client's cache coherence will be maintained via the LLQ and gratuitous responses. Short TTLs prevent stale information from residing in intermediate DNS recursive resolvers that are not LLQ aware.
TTLs of resource records included in the Additional section of an LLQ response (which do not directly answer the LLQ)
SHOULD be honored by the client.