Changeset b17790 for doc


Ignore:
Timestamp:
12/29/09 21:00:57 (2 years ago)
Author:
J. A. Bezemer <J.A.Bezemer@…>
Branches:
master
Children:
aa818c
Parents:
1a26a9
git-author:
J. A. Bezemer <J.A.Bezemer@…> (12/29/09 21:00:57)
git-committer:
Erik Ekman <erik@…> (02/04/12 20:34:04)
Message:

Applied patch from #88, thanks a lot!

File:
1 moved

Legend:

Unmodified
Added
Removed
  • doc/proto_00000502.txt

    r05e99c rb17790  
    1 Detailed specification of protocol in version 00000501 
     1Detailed specification of protocol in version 00000502 
    22====================================================== 
    33 
     
    771. DNS protocol 
    88====================================================== 
     9 
     10Quick alphabetical index / register: 
     11        0-9     Data packet 
     12        A-F     Data packet 
     13        I       IP address 
     14        L       Login 
     15        N       Downstream fragsize     (NS.topdomain A-type reply) 
     16        O       Options 
     17        P       Ping 
     18        R       Downstream fragsize probe 
     19        S       Switch upstream codec 
     20        V       Version 
     21        W                               (WWW.topdomain A-type reply) 
     22        Y       Downstream codec check 
     23        Z       Upstream codec check 
     24 
    925 
    1026CMC = 2 byte Cache Miss Counter, increased every time it is used 
     
    3955        First byte i or I 
    4056        5 bits coded as Base32 char, meaning userid 
    41         CMC 
     57        CMC as 3 Base32 chars 
    4258Server replies 
    4359        BADIP if bad userid, or 
    4460        I and then 4 bytes network order external IP address of iodined server 
    4561 
    46 Case check: 
     62Upstream codec check / bounce: 
    4763Client sends:  
    4864        First byte z or Z 
    4965        Lots of data that should not be decoded 
    5066Server replies: 
    51         The requested domain copied raw 
     67        The requested domain copied raw, in the lowest-grade downstream codec 
     68        available for the request type. 
     69 
     70Downstream codec check: 
     71Client sends: 
     72        First byte y or Y 
     73        1 char, meaning downstream codec to use 
     74        5 bits coded as Base32 char, meaning check variant 
     75        CMC as 3 Base32 chars 
     76        Possibly extra data, depending on check variant 
     77Server sends: 
     78        Data encoded with requested downstream codec; data content depending 
     79        on check variant number. 
     80        BADCODEC if requested downstream codec not available. 
     81        BADLEN if check variant is not available, or problem with extra data. 
     82 
     83        Downstream codec chars are same as in 'O' Option request, below. 
     84 
     85        Check variants: 
     86        1: Send encoded DOWNCODECCHECK1 string as defined in encoding.h 
     87 
     88        (Other variants reserved; possibly variant that sends a decoded-encoded 
     89        copy of Base32-encoded extra data in the request) 
    5290 
    5391Switch codec: 
     
    5593        First byte s or S 
    5694        5 bits coded as Base32 char, meaning userid 
    57         5 bits coded as Base32 char, with value 5 or 6, representing number of raw 
    58         bits per encoded byte 
    59         CMC 
     95        5 bits coded as Base32 char, representing number of raw bits per 
     96        encoded byte: 
     97                5: Base32   (a-z0-5) 
     98                6: Base64   (a-zA-Z0-9+-) 
     99                26: Base64u (a-zA-Z0-9_-) 
     100                7: Base128  (a-zA-Z0-9\274-\375) 
     101        CMC as 3 Base32 chars 
    60102Server sends: 
    61103        Name of codec if accepted. After this all upstream data packets must  
    62104        be encoded with the new codec. 
    63         BADCODEC if not accepted. Client must then revert to Base32 
     105        BADCODEC if not accepted. Client must then revert to previous codec 
    64106        BADLEN if length of query is too short 
    65107 
     
    69111        5 bits coded as Base32 char, meaning userid 
    70112        1 char, meaning option 
     113        CMC as 3 Base32 chars 
    71114Server sends: 
    72115        Full name of option if accepted. After this, option immediately takes 
     
    78121        t or T: Downstream encoding Base32, for TXT/CNAME/A/MX (default) 
    79122        s or S: Downstream encoding Base64, for TXT/CNAME/A/MX 
     123        u or U: Downstream encoding Base64u, for TXT/CNAME/A/MX 
     124        v or V: Downstream encoding Base128, for TXT/CNAME/A/MX 
    80125        r or R: Downstream encoding Raw, for TXT/NULL (default for NULL) 
    81126        If codec unsupported for request type, server will use Base32; note 
     
    97142        Then follows a long random query which contents does not matter 
    98143Server sends: 
    99         Requested number of bytes as a response. The first two bytes contains 
    100         the requested length. Rest of message can be any data. 
     144        Requested number of bytes as a response. The first two bytes contain 
     145        the requested length. The third byte is 107 (0x6B). The fourth byte 
     146        is a random value, and each following byte is incremented with 107. 
     147        This is checked by the client to determine corruption. 
    101148        BADFRAG if requested length not accepted. 
    102149 
     
    115162Data: 
    116163Upstream data header: 
    117          3210 432 10 43 210 4321 0 
    118         +----+---+--+--+---+----+-+ 
    119         |UUUU|SSS|FF|FF|DDD|GGGG|L| 
    120         +----+---+--+--+---+----+-+ 
     164         3210 432 10 43 210 4321 0 43210 
     165        +----+---+--+--+---+----+-+-----+ 
     166        |UUUU|SSS|FF|FF|DDD|GGGG|L|UDCMC| 
     167        +----+---+--+--+---+----+-+-----+ 
    121168 
    122169Downstream data header: 
     
    133180GGGG = Downstream fragment number 
    134181C = Compression enabled for downstream packet 
    135  
    136 Upstream data packet starts with 1 byte ASCII hex coded user byte, then 3 bytes  
    137 Base32 encoded header, then comes the payload data, encoded with chosen codec. 
     182UDCMC = Upstream Data CMC, 36 steps a-z0-9, case-insensitive 
     183 
     184Upstream data packet starts with 1 byte ASCII hex coded user byte; then 3 bytes  
     185Base32 encoded header; then 1 char data-CMC; then comes the payload data, 
     186encoded with the chosen upstream codec. 
    138187 
    139188Downstream data starts with 2 byte header. Then payload data, which may be 
     
    148197        t or T: Base32   encoded before chop, decoded after un-chop 
    149198        s or S: Base64   encoded before chop, decoded after un-chop 
     199        u or U: Base64u  encoded before chop, decoded after un-chop 
     200        v or V: Base128  encoded before chop, decoded after un-chop 
    150201        r or R: Raw      no encoding, only DNS-chop 
    151 CNAME/A/MX: 
     202SRV/MX/CNAME/A: 
    152203        h or H: Hostname encoded with Base32 
    153204        i or I: Hostname encoded with Base64 
     205        j or J: Hostname encoded with Base64u 
     206        k or K: Hostname encoded with Base128 
     207SRV and MX may reply with multiple hostnames, each encoded separately. Each 
     208has a 10-multiple priority, and encoding/decoding is done in strictly 
     209increasing priority sequence 10, 20, 30, etc. without gaps. Note that some DNS 
     210relays will shuffle the answer records in the response. 
    154211 
    155212Ping: 
     
    163220        CMC 
    164221 
    165 The server response to Ping and Data packets is a DNS NULL type response: 
    166 If server has nothing to send, data length is 0 bytes. 
    167 If server has something to send, it will send a downstream data packet,  
    168 prefixed with 2 bytes header as shown above. 
     222The server response to Ping and Data packets is a DNS NULL/TXT/.. type response, 
     223always starting with the 2 bytes downstream data header as shown above. 
     224If server has nothing to send, no data is added after the header. 
     225If server has something to send, it will add the downstream data packet 
     226(or some fragment of it) after the header. 
    169227  
    170228  
Note: See TracChangeset for help on using the changeset viewer.