chiark / gitweb /
WIP dns transport notes
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 6 Aug 2011 13:33:36 +0000 (14:33 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 27 Aug 2011 15:44:05 +0000 (16:44 +0100)
NOTES.ip-over-dns

index ea4c0f43fdd882b29fec90ac3e2ea2a2342dd925..d6aefbc74e8c2b4e5bd923a8d96fae1cdd7641f1 100644 (file)
@@ -15,7 +15,13 @@ Encoding:
 
 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.
+respectively.  
+
+So requests by the client are
+    QCLASS=IN QTYPE=CNAME !RD QNAME=<query-bit-pattern>.<my-domain>
+and responses are
+    !RD !RA AA
+    <qname> 1 IN CNAME <response-bit-pattern>
 
 The server maintains a local cache of questions we have been asked and
 answers we gave.  Neither side ever retries packets; so any responses
@@ -27,13 +33,9 @@ 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
+               remaining       Unfragmented response message data nybbles
 
-       R       5 bits          Length of associd in bits
-                                0 meaning 32; default is 8
-               associd
+       R       associd
                queue-len-info
                remaining=payload
 
@@ -53,9 +55,9 @@ Requests by client:
                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
+               4* bits         Logarithmic server queue length
+       # ciel(log_2( Number of bytes of queued message data + 1 ))
+       #  clamped to maximum value
 
 payload :=
        [ If there is actually any data to send:
@@ -64,7 +66,7 @@ payload :=
                1 bit           Final fragment ?
                12 bits         Fragment offset
            [ In packets from server:
-               8 bits          netlink-packet-sequence-number
+               8* bits         netlink-packet-sequence-number
                # In payloads from client, the client-message-nonce
                #  is used for reassembly.
            ]
@@ -72,11 +74,23 @@ payload :=
                remaining       Data Bytes
        ]
 
-associd :=     n bits          as specified in Create Association response
+associd :=             32* bits        Assigned by server
 
 client-init-nonce :=   64 bits         Random number
-client-message-nonce := some bits      Sequence number, starts at random value
+
+client-message-nonce := 8* 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.
+
+Lengths marked with * are configurable.
+
+
+
+Need to test transparency of:
+  A -> CNAME
+  CNAME
+  PTR
+  TXT
+  TXT with binary data