doing replay protection before learning remote host
[anytun.git] / papers / draft-gsenger-secure-anycast-tunneling-protocol-02.xml
blob78f3414d8d4341e9a5f4c3af7ad4090cad6c9da4
1 <?xml version='1.0'?>
2     <!DOCTYPE rfc SYSTEM 'rfcXXXX.dtd' [
3     
4     <!ENTITY rfc1546 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.1546.xml'>
5     <!ENTITY rfc3711 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.3711.xml'>
6     <!ENTITY rfc3068 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.3068.xml'>
7     <!ENTITY rfc2784 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2784.xml'>
8     <!ENTITY rfc2401 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2401.xml'>
9     <!ENTITY rfc2119 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml'>
10     <!ENTITY rfc2003 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2003.xml'>
12 <?rfc toc='yes'?>
13     <rfc ipr='full3978' docName='draft-gsenger-secure-anycast-tunneling-protocol-02'>
14     <front>
15         <title>secure anycast tunneling protocol (SATP)</title>
17         <author initials='O.G.' surname='Gsenger'
18                 fullname='Othmar Gsenger'>
19             <organization></organization>
21             <address>
22                 <postal>
23                     <street>Puerstingerstr 32</street>
24                     <city>Saalfelden</city>
25                     <code>5760</code>
26                     <country>AT</country>
27                 </postal>
29                 <phone></phone>
30                 <email>satp@gsenger.com</email>
31                 <uri>http://www.gsenger.com/satp/</uri>
32             </address>
33         </author>
35         <date month='May' year='2008' />
37         <area>General</area>
38         <workgroup></workgroup>
39         <keyword>satp</keyword>
40         <keyword>Internet-Draft</keyword>
41         <keyword>secure anycast tunneling protocol</keyword>
42         <keyword>anycast</keyword>
43         <keyword>tunnel</keyword>
44         <keyword>secure</keyword>
45         <keyword>protocol</keyword>
46         <abstract>
47             <t>The secure anycast tunneling protocol (SATP) defines a protocol used for communication between any combination of unicast and anycast tunnel endpoints. It allows tunneling of every ETHER TYPE protocol (ethernet, ip ...). SATP directly includes cryptography and message authentication based on the methods used by the <xref target="RFC3711">Secure Real-time Transport Protocol(SRTP)</xref>. It can be used as an encrypted alternative to <xref target="RFC2003">IP Encapsulation within IP</xref> and <xref target="RFC2784">Generic Routing Encapsulation (GRE)</xref>. Both anycast receivers and senders are supported.
48             </t>
49         </abstract>
50     </front>
51     <middle>
52     <section title='Introduction'>
53         <t>SATP is a mixture of a generic encapsulation protocol like <xref target="RFC2784">GRE</xref> and a secure tunneling protocol as <xref target="RFC2401">IPsec</xref> in tunnel mode.  It can be used to build redundant virtual private network (VPN) connections.  It supports peer-to-peer tunnels, where tunnel endpoints can be any combination of unicast, multicast or anycast hosts, so it defines a <xref target="RFC1546">Host Anycast Service</xref>. Encryption is done per packet, so the protocol is robust against packet loss and routing changes.
54                                 To reduce header overhead, encryption techniques of <xref target="RFC3711">SRTP</xref> are being used. 
55                                 </t>
56       <section title='Notational Conventions'>
57         <t>The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in  <xref target="RFC2119">RFC2119</xref>.</t>
58        </section>
59     </section> 
60     <section title="Motivation and usage scenarios">
61        <t>This section gives an overview of possible usage scenarios. Please note that the protocols used in the figures are only examples and that SATP itself does not care about either transport protocols or encapsulated protocols. Routing is not done by SATP and each implemetation MAY choose it's own way of doing this task (e.g. using functions provided by the operating system). SATP is used only to encapsulate and encrypt data.</t>
62        <section title="Usage scenarions">
63     
64             <section title='Tunneling from unicast hosts over anycast routers to other unicast hosts'>
65               <figure anchor="tunnel_mode">
66                  <preamble>An example of SATP used to tunnel in a unicast client - anycast server model</preamble>
67                  <artwork>
68                     --------- router ----------- 
69                    /                            \ 
70     unicast ------+---------- router ------------+------ unicast
71     host           \                            /        host
72                     --------- router -----------  
74   unicast  | encrypted     |  anycast  | encrypted     |  unicast
75   tunnel   | communication |  tunnel   | communication |  tunnel  
76   endpoint | using SATP    |  endpoint | using SATP    |  endpoint 
77                  </artwork>
78        </figure>
79               <t>In this scenario the payload is encapsuleted into a SATP packet by a unicast host and gets transmitted to one of the anycast routers. After transmisson the packet gets decapsulated by the router. This router makes a routing descision based on the underlying protocol and transmits a new SATP package to one or more unicast hosts depending on this decision.</t> 
80             </section>
82             <section title='Tunneling from unicast hosts to anycast networks'>
83               <figure anchor="open_tunnel_mode">
84                  <preamble>An example of SATP used to encrypt data between a unicast host and anycast networks</preamble>
85                  <artwork>
86                        -------Router -+---- DNS Server
87                       /                \ 
88                      /                  --- 6to4 Router
89                     /
90     unicast -------+----------Router --+--- DNS Server
91     host            \                   \  
92                      \                   --- 6to4 Router
93                       \
94                        -------Router -+---- DNS Server
95                                        \
96                                         --- 6to4 Router
98   unicast  | encrypted     |  anycast  | plaintext
99   tunnel   | communication |  tunnel   | anycast
100   endpoint | using SATP    |  endpoint | services
102                  </artwork>
103                </figure>
104             <t>When the unicast hosts wants to transmit data to one of the anycast DNS servers, it encapsulates the data and sends a SATP packet to the anycast address of the routers. The packet arrives at one of the routers, gets decapsulated and is then forwarded to the DNS server. This method can be used to tunnel between clients and networks providing anycast services. It can also be used the other way to virtually locate a unicast service within anycasted networks.</t>
105             </section>
106       <section title='Redundant tunnel connection of 2 networks'>
107               <figure anchor="connect_networks">
108                  <preamble>An example of SATP used to connect 2 networks</preamble>
109                  <artwork>
110               Router -----------   ---------------Router
111             /                   \ /                     \
112     Network - Router ------------x                       Network
113        A    \                   / \                     /   B
114               Router -----------   ---------------Router
116             | packets       |  packets  |  packets      |
117  plaintext  | get           |  take a   |  get          | plaintext
118  packets    | de/encrypted  |  random   |  de/encrypted | packets
119             |de/encapsulated|   path    |de/encapsulated|              
121                  </artwork>
122        </figure>
124                <t>Network A has multiple routers which act as gateway/tunnel endpoints to another network B. This way a redundant encrypted tunnel connection between the two networks is built up. All tunnel endpoints of network A share the same anycast address and all tunnel endpoints of network B share another anycast address. When a packet from network A is transmitted to network B, it first arrives on one of network A's border routers. Which router is used is determined by network A's internal routing. This router encapsulates the package and sends it to the anycast address of network B's routers. After arrival the SATP packet gets decapsulated and routed to its destination within network B.</t>
125       </section>
126     </section>
127         <section title="Encapsulation">
128       <t>SATP does not depend on the lower layer protocol. This section only gives an example of how packets could look like.
129       </t>
130       <figure anchor="transport_udp">
131         <preamble>Examples of SATP used with different lower layer and payload protocols</preamble>
132           <artwork>
133     +------+-----+-------------------------------+
134     |      |     |      +----------------+-----+ |
135     | IPv6 | UDP | SATP | Ethernet 802.3 | ... | |
136     |      |     |      +----------------+-----+ |
137     +------+-----+-------------------------------+
139 Tunneling of Ethernet over UDP/IPv6
141     +------+-----+---------------------------+
142     |      |     |      +------+-----+-----+ |
143     | IPv4 | UDP | SATP | IPv6 | UDP | RTP | |
144     |      |     |      +------+-----+-----+ |
145     +------+-----+---------------------------+
147 Tunneling of IPv6 over UDP/IPv4 with RTP payload
149     +------+-------------------------------+
150     |      |      +----------------+-----+ |
151     | IPv6 | SATP | Ethernet 802.3 | ... | |
152     |      |      +----------------+-----+ |
153     +------+-------------------------------+
155 Tunneling of Ethernet over IPv6
157     +------+---------------------------+
158     |      |      +------+-----+-----+ |
159     | IPv4 | SATP | IPv6 | UDP | RTP | |
160     |      |      +------+-----+-----+ |
161     +------+---------------------------+
163 Tunneling of IPv6 over IPv4 with RTP payload
164                  </artwork>
165        </figure>
166           </section>
167         </section>
168   <section title="Using SATP on top of IP">
169          <section title="Fragmentation">
170          <t>
171            The only way of fully supporting fragmentation would be to synchronise fragments between all anycast servers. This is considered to be too much overhead, so there are two non-perfect solutions for these problems. Either fragmentation HAS TO be disabled or if not all fragments arrive at the same server the IP datagramm HAS TO be discarded. As routing changes are not expected to occur very frequently, the encapsulated protocol can do a retransmission and all fragments will arrive at the new server. 
172          </t><t>If the payload type is IP and the IP headers' Don't Fragment (DF) bit is set, then the DF bit of the outer IP header HAS TO be set as well.</t>
173          </section>
174          <section title="ICMP messages">
175            <t>ICMP messages MUST be relayed according to <xref target="RFC2003">rfc2003 section 4</xref>. This is needed for path MTU detection.</t>
176          </section>
177      </section>
178      <section title="Protocol specification">
179        <section title="Header format">
180             <figure anchor="prot_header_table">
181                <preamble>Protocol Format</preamble>
182                  <artwork>
183       0                   1                   2                   3
184       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
185      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
186      |                         sequence number                       | |
187      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
188      |           sender ID           |              MUX              | |
189    +#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+ |
190    | |         payload type          |                               | |
191    | +-------------------------------+                               | |
192    | |              ....        payload        ...                   | |
193    | |                               +-------------------------------+ |
194    | |                               | padding (OPT) | pad count(OPT)| |
195    +#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+#+-+
196    | ~                          MKI (OPTIONAL)                       ~ |
197    | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
198    | :                 authentication tag (RECOMMENDED)              : |
199    | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
200    |                                                                   |
201    +- Encrypted Portion                       Authenticated Portion ---+
202 </artwork>
203 </figure>
204 <t></t>
205        </section>
206        <section title="sequence number">
207        <t>The sequence number is a 32 bit unsigned integer in network byte order. It starts with a random value and is increased by 1 for every sent packet. After the maximum value it starts over from 0. This overrun causes the ROC to be increased.</t>
208        </section>
209        <section title="sender ID">
210        <t>The sender ID is a 16 bit unsigned integer. It HAS TO be unique for every sender sharing the same anycast address.</t>
211        </section>
212        <section title="MUX">
213        <t>The MUX (multiplex) field is a 16 bit unsigned integer. It is used to distinguish multiple tunnel connections.</t>
214        </section>
215        <section title="payload type">
216          <t>The payload type field defines the payload protocol. ETHER TYPE protocol numbers are used. <eref target="http://www.iana.org/assignments/ethernet-numbers">See IANA assigned ethernet numbers</eref> . The values 0000-05DC are reserverd and MUST NOT be used. 
217         <figure anchor="prot_type_table">
218                <preamble>Some examples for protocol numbers</preamble>
219                  <artwork>
221 0000 Reserved
222 .... Reserved
223 05DC Reserved
224 0800 Internet IP (IPv4)
225 6558 transparent ethernet bridging
226 86DD IPv6
227 </artwork>
228 </figure>
229 </t>
230              </section>
231        <section title="payload">
232        <t>A packet of type payload type (e.g. an IP packet).</t>
233        </section>
234        <section title="padding (OPTIONAL)">
235        <t>Padding of max 255 octets.
236 None of the pre-defined encryption transforms uses any padding; for
237    these, the plaintext and encrypted payload sizes match exactly. Transforms are based on transforms of the SRTP protocol and therefore might use the RTP padding format, so a RTP-like padding is supported. If the padding count field is present, the padding count field MUST be set to the padding length.</t>
238        </section>
239        <section title="padding count (OPTIONAL)">
240        <t>The number of octets of the padding field. This field is optional. Its presence is signaled by the key management and not by this protocol. If this field isn't present, the padding field MUST NOT be present as well.</t>
241        </section>
242         <section title="MKI (OPTIONAL)">
243         <t>The MKI (Master Key Identifier) is OPTIONAL and of configurable length. See <xref target="RFC3711">SRTP Section 3.1</xref> for details.</t>
244         </section>
245         <section title="authentication tag (RECOMMENDED)">
246         <t>The authentication tag is RECOMMENDED and of configurable length. It contains a cryptographic checksum of the sender ID, sequence number and the encrypted portion, but not of the MKI. On transmitter side encryption HAS TO be done before calculating the authentication tag. A receiver HAS TO calculate the authentication tag before decrypting the encrypted portion.</t>
247         </section>
248     <section title="Encryption">
249      <t>Encryption is done in the same way as for <xref target="RFC3711">SRTP</xref>. This section will only discuss some small changes that HAVE TO be made. Please read  <xref target="RFC3711">SRTP RFC3711 section 3-9</xref> for details. </t><t>The least significant bits of SSRC are replaced by the sender ID and the most significant bits are replaced by the MUX. For the SRTP SEQ the 16 least significant bits of the SATP sequence number are used and the 16 most significant bits of the sequence number replace the 16 least significant bits of the SRTP ROC.</t>
250    <figure anchor="srtp_vs_satp">
251       <preamble>Difference between SRTP and SATP</preamble>
252       <artwork>
253       0                   1                   2                   3
254       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
255      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
256      |                     SATP    sequence number                   |
257      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
258                                      =
259      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
260      |  SRTP ROC least significant   |           SRTP SEQ            |
261      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
264       0                   1                   2                   3
265       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
266      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
267      |           SATP  MUX           |       SATP sender ID          |
268      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
269                                      =
270      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
271      |                           SRTP SSRC                           |
272      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
273       </artwork>
274     </figure>
275     </section>
276   </section>
277     <section title="Security Considerations">
278      <t>As SATP uses the same encryption techniques as <xref target="RFC3711">SRTP</xref>, it shares the same security issues. This section will only discuss some small changes. Please read  <xref target="RFC3711">SRTP RFC3711 section 9</xref> for details.</t>
279       <section title="Replay protection">
280       <t>Replay protection is done by a replay list. Every anycast receiver has its own replay list, which SHOULDN'T be syncronised because of massive overhead. This leads to an additional possible attack. An attacker is able to replay a captured packet once to every anycast receiver. This attack is considered be very unlikely because multiple attack hosts in different locations are needed to reach seperate anycast receivers and the number of replays is limited to count of receivers - 1. Such replays might also happen because of routing problems, so a payload protocol HAS TO be robust against a small number of duplicated packages. The window size and position HAS TO be syncronised between multiple anycast receivers to limit this attack.</t>
281       </section>
282     </section>
283     <section title="IANA Considerations">
284       <t>The protocol is intended to be used on top of IP or on top of UDP (to be compatible with NAT routers), so UDP and IP protocol numbers have to be assiged by IANA.</t>
285     </section>
286     </middle>
287     <back>
288       <references title="Normative References">
289         &rfc3711;
290         &rfc2119;
291         &rfc2003;
292       </references>
293       <references title="Informational References">
294         &rfc2784; 
295         &rfc2401;
296         &rfc1546;
297       </references>
298     </back>
299     </rfc>