From 36e39d72c7b5cec23aa987193aa525e2286d9423 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 3 Aug 2011 09:44:38 +0100 Subject: [PATCH] WIP DNS notes --- NOTES.ip-over-dns | 70 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/NOTES.ip-over-dns b/NOTES.ip-over-dns index c706b55..ea4c0f4 100644 --- a/NOTES.ip-over-dns +++ b/NOTES.ip-over-dns @@ -10,3 +10,73 @@ Encoding: - client splits packet into appropriate fragments - makes A queries for + + + +We use CNAME queries. The request/response Q and R are bit-encoded +into the labels of the query domain and answer section domains, +respectively. + +The server maintains a local cache of questions we have been asked and +answers we gave. Neither side ever retries packets; so any responses +from our server's cache are due to resolvers between the client and +the server. + + +Requests by client: + + Create Association + Q client-init-nonce + 4 bits Length of client-message-nonce in bits, + 0 meaning 16; default is 8 + remaining Unfragmented response message data bytes + + R 5 bits Length of associd in bits + 0 meaning 32; default is 8 + associd + queue-len-info + remaining=payload + + Request Down + Q associd + client-message-nonce + + R queue-len-info + remaining=payload + + Submit Up + Q associd + client-message-nonce + payload + + R queue-len-info + remaining Unfragmented response message data bytes + +queue-len-info := + 4 bits Double-logarithmic server queue length + # ciel(log_2( Number of bytes of queued message data )) + # except that if no queued message data, value is 0 + +payload := + [ If there is actually any data to send: + 1 bit Only fragment ? + [ If not only fragment: + 1 bit Final fragment ? + 12 bits Fragment offset + [ In packets from server: + 8 bits netlink-packet-sequence-number + # In payloads from client, the client-message-nonce + # is used for reassembly. + ] + ] + remaining Data Bytes + ] + +associd := n bits as specified in Create Association response + +client-init-nonce := 64 bits Random number +client-message-nonce := some bits Sequence number, starts at random value + # Ie if we start having more than 255 queries outstanding, we're + # going to start losing things. With our default TTL of 1s and + # a compliant DNS server, that might limit us to 255 packets/sec. + # With noncompliant DNS servers it might reduce available bandwidth. -- 2.30.2