Debian Codegraph @

rfc6081.html

raw
1 <pre>Internet Engineering Task Force (IETF) D. Thaler
2 Request for Comments: 6081 Microsoft
3 Updates: <a href="./rfc4380">4380</a> January 2011
4 Category: Standards Track
5 ISSN: 2070-1721
6
7
8 <span class="h1">Teredo Extensions</span>
9
10 Abstract
11
12 This document specifies a set of extensions to the Teredo protocol.
13 These extensions provide additional capabilities to Teredo, including
14 support for more types of Network Address Translations (NATs) and
15 support for more efficient communication.
16
17 Status of This Memo
18
19 This is an Internet Standards Track document.
20
21 This document is a product of the Internet Engineering Task Force
22 (IETF). It represents the consensus of the IETF community. It has
23 received public review and has been approved for publication by the
24 Internet Engineering Steering Group (IESG). Further information on
25 Internet Standards is available in <a href="./rfc5741#section-2">Section&nbsp;2 of RFC 5741</a>.
26
27 Information about the current status of this document, any errata,
28 and how to provide feedback on it may be obtained at
29 <a href="http://www.rfc-editor.org/info/rfc6081">http://www.rfc-editor.org/info/rfc6081</a>.
30
31 Copyright Notice
32
33 Copyright (c) 2011 IETF Trust and the persons identified as the
34 document authors. All rights reserved.
35
36 This document is subject to <a href="https://www.rfc-editor.org/bcp/bcp78">BCP 78</a> and the IETF Trust's Legal
37 Provisions Relating to IETF Documents
38 (<a href="http://trustee.ietf.org/license-info">http://trustee.ietf.org/license-info</a>) in effect on the date of
39 publication of this document. Please review these documents
40 carefully, as they describe your rights and restrictions with respect
41 to this document. Code Components extracted from this document must
42 include Simplified BSD License text as described in Section 4.e of
43 the Trust Legal Provisions and are provided without warranty as
44 described in the Simplified BSD License.
45
46
47
48
49
50
51
52 <span class="grey">Thaler Standards Track [Page 1]</span></pre>
53 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-2" ></span>
54 <span class="grey"><a href="./rfc6081">RFC 6081</a> Teredo Extensions January 2011</span>
55
56
57 Table of Contents
58
59 <a href="#section-1">1</a>. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-3">3</a>
60 <a href="#section-2">2</a>. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-3">3</a>
61 <a href="#section-3">3</a>. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-6">6</a>
62 <a href="#section-3.1">3.1</a>. Symmetric NAT Support Extension . . . . . . . . . . . . . <a href="#page-9">9</a>
63 <a href="#section-3.2">3.2</a>. UPnP-Enabled Symmetric NAT Extension . . . . . . . . . . . <a href="#page-11">11</a>
64 <a href="#section-3.3">3.3</a>. Port-Preserving Symmetric NAT Extension . . . . . . . . . <a href="#page-13">13</a>
65 <a href="#section-3.4">3.4</a>. Sequential Port-Symmetric NAT Extension . . . . . . . . . <a href="#page-14">14</a>
66 <a href="#section-3.5">3.5</a>. Hairpinning Extension . . . . . . . . . . . . . . . . . . <a href="#page-15">15</a>
67 <a href="#section-3.6">3.6</a>. Server Load Reduction Extension . . . . . . . . . . . . . <a href="#page-17">17</a>
68 <a href="#section-4">4</a>. Message Syntax . . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-18">18</a>
69 <a href="#section-4.1">4.1</a>. Trailers . . . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-18">18</a>
70 <a href="#section-4.2">4.2</a>. Nonce Trailer . . . . . . . . . . . . . . . . . . . . . . <a href="#page-19">19</a>
71 <a href="#section-4.3">4.3</a>. Alternate Address Trailer . . . . . . . . . . . . . . . . <a href="#page-19">19</a>
72 <a href="#section-4.4">4.4</a>. Neighbor Discovery Option Trailer . . . . . . . . . . . . <a href="#page-20">20</a>
73 <a href="#section-4.5">4.5</a>. Random Port Trailer . . . . . . . . . . . . . . . . . . . <a href="#page-21">21</a>
74 <a href="#section-5">5</a>. Protocol Details . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-22">22</a>
75 <a href="#section-5.1">5.1</a>. Common Processing . . . . . . . . . . . . . . . . . . . . <a href="#page-22">22</a>
76 <a href="#section-5.1.1">5.1.1</a>. Refresh Interval . . . . . . . . . . . . . . . . . . . <a href="#page-22">22</a>
77 <a href="#section-5.1.2">5.1.2</a>. Trailer Processing . . . . . . . . . . . . . . . . . . <a href="#page-23">23</a>
78 <a href="#section-5.2">5.2</a>. Symmetric NAT Support Extension . . . . . . . . . . . . . <a href="#page-23">23</a>
79 <a href="#section-5.2.1">5.2.1</a>. Abstract Data Model . . . . . . . . . . . . . . . . . <a href="#page-24">24</a>
80 <a href="#section-5.2.2">5.2.2</a>. Timers . . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-24">24</a>
81 <a href="#section-5.2.3">5.2.3</a>. Initialization . . . . . . . . . . . . . . . . . . . . <a href="#page-24">24</a>
82 <a href="#section-5.2.4">5.2.4</a>. Message Processing . . . . . . . . . . . . . . . . . . <a href="#page-24">24</a>
83 <a href="#section-5.3">5.3</a>. UPnP-Enabled Symmetric NAT Extension . . . . . . . . . . . <a href="#page-25">25</a>
84 <a href="#section-5.3.1">5.3.1</a>. Abstract Data Model . . . . . . . . . . . . . . . . . <a href="#page-26">26</a>
85 <a href="#section-5.3.2">5.3.2</a>. Timers . . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-26">26</a>
86 <a href="#section-5.3.3">5.3.3</a>. Initialization . . . . . . . . . . . . . . . . . . . . <a href="#page-27">27</a>
87 <a href="#section-5.3.4">5.3.4</a>. Message Processing . . . . . . . . . . . . . . . . . . <a href="#page-28">28</a>
88 <a href="#section-5.3.5">5.3.5</a>. Shutdown . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-29">29</a>
89 <a href="#section-5.4">5.4</a>. Port-Preserving Symmetric NAT Extension . . . . . . . . . <a href="#page-30">30</a>
90 <a href="#section-5.4.1">5.4.1</a>. Abstract Data Model . . . . . . . . . . . . . . . . . <a href="#page-30">30</a>
91 <a href="#section-5.4.2">5.4.2</a>. Timers . . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-31">31</a>
92 <a href="#section-5.4.3">5.4.3</a>. Initialization . . . . . . . . . . . . . . . . . . . . <a href="#page-32">32</a>
93 <a href="#section-5.4.4">5.4.4</a>. Message Processing . . . . . . . . . . . . . . . . . . <a href="#page-32">32</a>
94 <a href="#section-5.5">5.5</a>. Sequential Port-Symmetric NAT Extension . . . . . . . . . <a href="#page-35">35</a>
95 <a href="#section-5.5.1">5.5.1</a>. Abstract Data Model . . . . . . . . . . . . . . . . . <a href="#page-35">35</a>
96 <a href="#section-5.5.2">5.5.2</a>. Timers . . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-36">36</a>
97 <a href="#section-5.5.3">5.5.3</a>. Initialization . . . . . . . . . . . . . . . . . . . . <a href="#page-37">37</a>
98 <a href="#section-5.5.4">5.5.4</a>. Message Processing . . . . . . . . . . . . . . . . . . <a href="#page-37">37</a>
99 <a href="#section-5.6">5.6</a>. Hairpinning Extension . . . . . . . . . . . . . . . . . . <a href="#page-39">39</a>
100 <a href="#section-5.6.1">5.6.1</a>. Abstract Data Model . . . . . . . . . . . . . . . . . <a href="#page-39">39</a>
101 <a href="#section-5.6.2">5.6.2</a>. Timers . . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-39">39</a>
102 <a href="#section-5.6.3">5.6.3</a>. Initialization . . . . . . . . . . . . . . . . . . . . <a href="#page-39">39</a>
103 <a href="#section-5.6.4">5.6.4</a>. Message Processing . . . . . . . . . . . . . . . . . . <a href="#page-40">40</a>
104
105
106
107
108 <span class="grey">Thaler Standards Track [Page 2]</span></pre>
109 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-3" ></span>
110 <span class="grey"><a href="./rfc6081">RFC 6081</a> Teredo Extensions January 2011</span>
111
112
113 <a href="#section-5.7">5.7</a>. Server Load Reduction Extension . . . . . . . . . . . . . <a href="#page-41">41</a>
114 <a href="#section-5.7.1">5.7.1</a>. Abstract Data Model . . . . . . . . . . . . . . . . . <a href="#page-41">41</a>
115 <a href="#section-5.7.2">5.7.2</a>. Timers . . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-41">41</a>
116 <a href="#section-5.7.3">5.7.3</a>. Initialization . . . . . . . . . . . . . . . . . . . . <a href="#page-42">42</a>
117 <a href="#section-5.7.4">5.7.4</a>. Message Processing . . . . . . . . . . . . . . . . . . <a href="#page-42">42</a>
118 <a href="#section-6">6</a>. Protocol Examples . . . . . . . . . . . . . . . . . . . . . . <a href="#page-42">42</a>
119 <a href="#section-6.1">6.1</a>. Symmetric NAT Support Extension . . . . . . . . . . . . . <a href="#page-42">42</a>
120 <a href="#section-6.2">6.2</a>. UPnP-Enabled Symmetric NAT Extension . . . . . . . . . . . <a href="#page-45">45</a>
121 <a href="#section-6.3">6.3</a>. Port-Preserving Symmetric NAT Extension . . . . . . . . . <a href="#page-47">47</a>
122 <a href="#section-6.4">6.4</a>. Sequential Port-Symmetric NAT Extension . . . . . . . . . <a href="#page-51">51</a>
123 <a href="#section-6.5">6.5</a>. Hairpinning Extension . . . . . . . . . . . . . . . . . . <a href="#page-54">54</a>
124 <a href="#section-6.6">6.6</a>. Server Load Reduction Extension . . . . . . . . . . . . . <a href="#page-57">57</a>
125 <a href="#section-7">7</a>. Security Considerations . . . . . . . . . . . . . . . . . . . <a href="#page-58">58</a>
126 <a href="#section-8">8</a>. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-58">58</a>
127 <a href="#section-9">9</a>. IANA Considerations . . . . . . . . . . . . . . . . . . . . . <a href="#page-58">58</a>
128 <a href="#section-10">10</a>. References . . . . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-58">58</a>
129 <a href="#section-10.1">10.1</a>. Normative References . . . . . . . . . . . . . . . . . . . <a href="#page-58">58</a>
130 <a href="#section-10.2">10.2</a>. Informative References . . . . . . . . . . . . . . . . . . <a href="#page-59">59</a>
131
132 <span class="h2"><a class="selflink" id="section-1" href="#section-1">1</a>. Introduction</span>
133
134 This document specifies extensions to the Teredo protocol, as
135 specified in [<a href="./rfc4380" title="&quot;Teredo: Tunneling IPv6 over UDP through Network Address Translations (NATs)&quot;">RFC4380</a>]. These extensions provide additional
136 capabilities to Teredo, including support for more types of Network
137 Address Translations (NATs) and support for more efficient
138 communication.
139
140 <span class="h2"><a class="selflink" id="section-2" href="#section-2">2</a>. Terminology</span>
141
142 Because this document extends [<a href="./rfc4380" title="&quot;Teredo: Tunneling IPv6 over UDP through Network Address Translations (NATs)&quot;">RFC4380</a>], it uses the following
143 terminology, for consistency with [<a href="./rfc4380" title="&quot;Teredo: Tunneling IPv6 over UDP through Network Address Translations (NATs)&quot;">RFC4380</a>].
144
145 Address-Restricted NAT: A restricted NAT that accepts packets from an
146 external host's IP address X and port Y if the internal host has sent
147 a packet that is destined to IP address X regardless of the
148 destination port. In the terminology of [<a href="./rfc4787" title="&quot;Network Address Translation (NAT) Behavioral Requirements for Unicast UDP&quot;">RFC4787</a>], this is a NAT
149 with Endpoint-Independent Mapping and Address-Dependent Filtering.
150
151 Address-Symmetric NAT: A symmetric NAT that has multiple external IP
152 addresses and that assigns different IP addresses and ports when
153 communicating with different external hosts.
154
155 Cone NAT: A NAT that maps all requests from the same internal IP
156 address and port to the same external IP address and port.
157 Furthermore, any external host can send a packet to the internal host
158 by sending a packet to the mapped external address and port. In the
159 terminology of [<a href="./rfc4787" title="&quot;Network Address Translation (NAT) Behavioral Requirements for Unicast UDP&quot;">RFC4787</a>], this is a NAT with Endpoint-Independent
160 Mapping and Endpoint-Independent Filtering.
161
162
163
164 <span class="grey">Thaler Standards Track [Page 3]</span></pre>
165 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-4" ></span>
166 <span class="grey"><a href="./rfc6081">RFC 6081</a> Teredo Extensions January 2011</span>
167
168
169 Direct Bubble: A Teredo bubble that is sent directly to the IPv4 node
170 whose Teredo address is contained in the Destination field of the
171 IPv6 header, as specified in <a href="./rfc4380#section-2.8">Section&nbsp;2.8 of [RFC4380]</a>. The IPv4
172 Destination Address and UDP Destination Port fields contain a mapped
173 address/port.
174
175 Echo Test: A mechanism to predict the mapped address/port a
176 sequential port-symmetric NAT is using for a client behind it.
177
178 Hairpinning: A feature that is available in some NATs where two or
179 more hosts are positioned behind a NAT and each of those hosts is
180 assigned a specific external (public) address and port by the NAT.
181 Hairpinning support in a NAT allows these hosts to send a packet to
182 the external address and port that is assigned to one of the other
183 hosts, and the NAT automatically routes the packet back to the
184 correct host. The term hairpinning is derived from the behavior of
185 the packet, which arrives on, and is sent out to, the same NAT
186 interface.
187
188 Indirect Bubble: A Teredo bubble that is sent indirectly (via the
189 destination's Teredo server) to another Teredo client, as specified
190 in <a href="./rfc4380#section-5.2.4">Section&nbsp;5.2.4 of [RFC4380]</a>.
191
192 Local Address/Port: The IPv4 address and UDP port from which a Teredo
193 client sends Teredo packets. The local port is referred to as the
194 Teredo service port in [<a href="./rfc4380" title="&quot;Teredo: Tunneling IPv6 over UDP through Network Address Translations (NATs)&quot;">RFC4380</a>]. The local address of a node may or
195 may not be globally routable because the node can be located behind
196 one or more NATs.
197
198 Mapped Address/Port: A global IPv4 address and a UDP port that
199 results from the translation of a node's own local address/port by
200 one or more NATs. The node learns these values through the Teredo
201 protocol as specified in [<a href="./rfc4380" title="&quot;Teredo: Tunneling IPv6 over UDP through Network Address Translations (NATs)&quot;">RFC4380</a>]. For symmetric NATs, the mapped
202 address/port can be different for every peer with which a node tries
203 to communicate.
204
205 Network Address Translation (NAT): The process of converting between
206 IP addresses used within an intranet or other private network and
207 Internet IP addresses.
208
209 Nonce: A time-variant random value used in the connection setup phase
210 to prevent message replay and other types of attacks.
211
212 Peer: A Teredo client with which another Teredo client needs to
213 communicate.
214
215
216
217
218
219
220 <span class="grey">Thaler Standards Track [Page 4]</span></pre>
221 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-5" ></span>
222 <span class="grey"><a href="./rfc6081">RFC 6081</a> Teredo Extensions January 2011</span>
223
224
225 Port-Preserving NAT: A NAT that translates a local address/port to a
226 mapped address/port such that the mapped port has the same value as
227 the local port, as long as that same mapped address/port has not
228 already been used for a different local address/port.
229
230 Port-Restricted NAT: A restricted NAT that accepts packets from an
231 external host's IP address X and port Y only if the internal host has
232 sent a packet destined to IP address X and port Y. In the
233 terminology of [<a href="./rfc4787" title="&quot;Network Address Translation (NAT) Behavioral Requirements for Unicast UDP&quot;">RFC4787</a>], this is a NAT with Endpoint-Independent
234 Mapping and Address and Port-Dependent Filtering.
235
236 Port-Symmetric NAT: A symmetric NAT that has only a single external
237 IP address and hence only assigns different ports when communicating
238 with different external hosts.
239
240 Private Address: An IPv4 address that is not globally routable but is
241 part of the private address space specified in <a href="./rfc1918#section-3">Section&nbsp;3 of
242 [RFC1918]</a>.
243
244 Public Address: An external global address used by a NAT.
245
246 Restricted NAT: A NAT where all requests from the same internal IP
247 address and port are mapped to the same external IP address and port.
248 Unlike the cone NAT, an external host can send packets to an internal
249 host (by sending a packet to the external mapped address and port)
250 only if the internal host has first sent a packet to the external
251 host. There are two kinds of restricted NATs: address-restricted
252 NATs and port-restricted NATs.
253
254 Sequential Port-Symmetric NAT: A port-symmetric NAT that allocates
255 external ports sequentially for every {internal IP address and port,
256 destination IP address and port} tuple. The delta used in the
257 sequential assignment is typically 1 or 2 for most such NATs.
258
259 Symmetric NAT: A NAT where all requests from the same internal IP
260 address and port and to the same destination IP address and port are
261 mapped to the same external IP address and port. Requests from the
262 same internal IP address and port to a different destination IP
263 address and port may be mapped to a different external IP address and
264 port. Furthermore, a symmetric NAT accepts packets received from an
265 external host's IP address X and port Y only if some internal host
266 has sent packets to IP address X and port Y. In the terminology of
267 [<a href="./rfc4787" title="&quot;Network Address Translation (NAT) Behavioral Requirements for Unicast UDP&quot;">RFC4787</a>], this is a NAT with a mapping behavior of either Address-
268 Dependent Mapping or Address- and Port-Dependent Mapping, and a
269 filtering behavior of either Address-Dependent Filtering or Address-
270 and Port-Dependent Filtering.
271
272
273
274
275
276 <span class="grey">Thaler Standards Track [Page 5]</span></pre>
277 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-6" ></span>
278 <span class="grey"><a href="./rfc6081">RFC 6081</a> Teredo Extensions January 2011</span>
279
280
281 Teredo Bubble: A Teredo control message (specified in <a href="./rfc4380#section-2.8">Section&nbsp;2.8 of
282 [RFC4380]</a>) that is used to create a mapping in a NAT. There are two
283 types of Teredo bubbles: direct bubbles and indirect bubbles.
284
285 Teredo Client: A node that has access to the IPv4 Internet and wants
286 to gain access to the IPv6 Internet using the Teredo protocol.
287
288 Teredo IPv6 Address: An IPv6 address of a Teredo client, as specified
289 in <a href="./rfc4380#section-2.14">Section&nbsp;2.14 of [RFC4380]</a>.
290
291 Teredo Secondary Server Address: A secondary IPv4 address of a Teredo
292 server with which a Teredo client is configured, as specified in
293 <a href="./rfc4380#section-5.2">Section&nbsp;5.2 of [RFC4380]</a>.
294
295 Teredo Server: A node that has a globally routable address on the
296 IPv4 Internet, and is used as a helper to provide IPv6 connectivity
297 to Teredo clients.
298
299 Teredo Server Address: A (primary) IPv4 address of a Teredo server
300 with which a Teredo client is configured, as specified in <a href="./rfc4380#section-5.2">Section&nbsp;5.2
301 of [RFC4380]</a>.
302
303 UPnP-enabled NAT: A NAT that has the UPnP device control protocol
304 enabled, as specified in [<a href="#ref-UPNPWANIP" title="&quot;WANIPConnection:1&quot;">UPNPWANIP</a>]. (Note that today, by default,
305 most UPnP-capable NATs have the UPnP device control protocol
306 disabled.)
307
308 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
309 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
310 document are to be interpreted as described in <a href="./rfc2119">RFC 2119</a> [<a href="./rfc2119" title="&quot;Key words for use in RFCs to Indicate Requirement Levels&quot;">RFC2119</a>].
311
312 <span class="h2"><a class="selflink" id="section-3" href="#section-3">3</a>. Overview</span>
313
314 The Teredo protocol (as specified in [<a href="./rfc4380" title="&quot;Teredo: Tunneling IPv6 over UDP through Network Address Translations (NATs)&quot;">RFC4380</a>]) enables nodes located
315 behind one or more IPv4 NATs to obtain IPv6 connectivity by tunneling
316 packets over UDP.
317
318 When a node behind a NAT needs to communicate with a peer (i.e.,
319 another node) that is behind a NAT, there are four sets of IPv4
320 address/port pairs of interest:
321
322 o The node's own IPv4 address/port.
323
324 o The external IPv4 address/port to which the node's NAT translates.
325
326 o The peer's own IPv4 address/port.
327
328 o The external IPv4 address/port to which the peer's NAT translates.
329
330
331
332 <span class="grey">Thaler Standards Track [Page 6]</span></pre>
333 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-7" ></span>
334 <span class="grey"><a href="./rfc6081">RFC 6081</a> Teredo Extensions January 2011</span>
335
336
337 When the node sends a packet to a peer, the node needs to send it
338 from the node's own IPv4 address/port, destined to the peer's
339 external IPv4 address/port. By the time it arrives at the peer
340 (i.e., after passing through both NATs), the peer will see the same
341 packet as coming from the node's external IPv4 address/port, destined
342 to the peer's own IPv4 address/port.
343
344 In this document, the term local address/port refers to a Teredo
345 client's own IPv4 address/port, and mapped address/port refers to the
346 external IPv4 address/port to which its NAT translates the local
347 address/port. That is, the mapped address/port is what the IPv4
348 Internet sees the Teredo client as.
349
350 A Teredo client running on a node communicates with a Teredo server
351 to discover its mapped address/port. The mapped address/port, along
352 with the Teredo server address, is used to generate an IPv6 address
353 known as a Teredo IPv6 address. This allows any peer that gets the
354 node's IPv6 address to easily determine the external IPv4 address/
355 port to which to send IPv6 packets encapsulated in IPv4 UDP messages.
356
357 This document specifies extensions to the Teredo protocol. These
358 Teredo extensions are independent of each other and can be
359 implemented in isolation, except that the UPnP-Symmetric NAT
360 Extension and the Port-Preserving Symmetric NAT Extension both
361 require the Symmetric NAT Support Extension to be implemented. An
362 implementation of this specification can support any combination of
363 the Teredo extensions, subject to the above-mentioned restriction.
364
365 The following matrix outlines the connectivity improvements of some
366 of the extensions outlined in this document.
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388 <span class="grey">Thaler Standards Track [Page 7]</span></pre>
389 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-8" ></span>
390 <span class="grey"><a href="./rfc6081">RFC 6081</a> Teredo Extensions January 2011</span>
391
392
393 Destination NAT
394 | | | | | | Port-| | |
395 | | | | UPnP | UPnP | pres.| Seq. | |
396 | | Addr.| Port | Port | Port | Port-| Port-| Port-| Addr
397 Source NAT| Cone | rest.| rest.| rest.| symm.| symm.| symm.| symm.| symm
398 ----------+------+------+------+------+------+------+------+------+-----
399 Cone | Yes | Yes | Yes | Yes | SNS | SNS | SNS | SNS | SNS
400 ----------+------+------+------+------+------+------+------+------+-----
401 Address | Yes | Yes | Yes | Yes | SNS | SNS | SNS | SNS | No
402 restricted| | | | | | | | |
403 ----------+------+------+------+------+------+------+------+------+-----
404 Port | Yes | Yes | Yes | Yes | No | SNS+ | SNS+ | No | No
405 restricted| | | | | | PP | SS | |
406 ----------+------+------+------+------+------+------+------+------+-----
407 UPnP Port-| Yes | Yes | Yes | Yes | SNS+ | No | No | No | No
408 restricted| | | | | UPnP | | | |
409 ----------+------+------+------+------+------+------+------+------+-----
410 UPnP Port | SNS | SNS | No | SNS+ | SNS+ | No | No | No | No
411 symmetric | | | | UPnP | UPnP | | | |
412 ----------+------+------+------+------+------+------+------+------+-----
413 Port- | | | SNS | | | SNS | SNS | |
414 preserving| SNS | SNS | + | No | No | + | + | No | No
415 Port- | | | PP | | | PP | SS | |
416 symmetric | | | | | | | | |
417 ----------+------+------+------+------+------+------+------+------+-----
418 Sequential| | | SNS | | | | | |
419 Port- | SNS | SNS | + | No | No | No | No | No | No
420 symmetric | | | SS | | | | | |
421 ----------+------+------+------+------+------+------+------+------+-----
422 Port- | SNS | SNS | No | No | No | No | No | No | No
423 symmetric | | | | | | | | |
424 ----------+------+------+------+------+------+------+------+------+-----
425 Address- | SNS | No | No | No | No | No | No | No | No
426 symmetric | | | | | | | | |
427 ----------+------+------+------+------+------+------+------+------+-----
428
429 Yes = Supported by [<a href="./rfc4380" title="&quot;Teredo: Tunneling IPv6 over UDP through Network Address Translations (NATs)&quot;">RFC4380</a>].
430
431 SNS = Supported with the Symmetric NAT Support Extension.
432
433 SNS+UPnP = Supported with the Symmetric NAT Support Extension and UPnP
434 Symmetric NAT Extension.
435
436 SNS+PP = Supported with the Symmetric NAT Support Extension and Port-
437 Preserving Symmetric NAT Extension.
438
439 SNS+SS = Supported with the Symmetric NAT Support Extension and
440 Sequential Port-Symmetric NAT Extension.
441
442
443
444 <span class="grey">Thaler Standards Track [Page 8]</span></pre>
445 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-9" ></span>
446 <span class="grey"><a href="./rfc6081">RFC 6081</a> Teredo Extensions January 2011</span>
447
448
449 No = No connectivity.
450
451 Figure 1: Matrix of Connectivity Improvements for Teredo Extensions
452
453 Note that as with [<a href="./rfc4380" title="&quot;Teredo: Tunneling IPv6 over UDP through Network Address Translations (NATs)&quot;">RFC4380</a>], if the qualification process is not
454 successful, Teredo will not be configured with an IPv6 address, and
455 connectivity will function as if Teredo were not present. Similarly,
456 for any combination of NAT types that are not supported by Teredo and
457 the extensions defined herein, the connectivity tests between a
458 client and a peer will fail within a finite period of time, allowing
459 the client to handle this case as with any other type of unreachable
460 destination address (e.g., by trying another address of the
461 destination such as a native IPv4 address).
462
463 <span class="h3"><a class="selflink" id="section-3.1" href="#section-3.1">3.1</a>. Symmetric NAT Support Extension</span>
464
465 The qualification procedure (as specified in <a href="./rfc4380#section-5.2.1">Section&nbsp;5.2.1 of
466 [RFC4380]</a>) is a process that allows a Teredo client to determine the
467 type of NAT that it is behind, in addition to its mapped address/port
468 as seen by its Teredo server. However, <a href="./rfc4380#section-5.2.1">Section&nbsp;5.2.1 of [RFC4380]</a>
469 suggests that if the client learns it is behind a symmetric NAT, the
470 Teredo client should go into an "offline state" where it is not able
471 to use Teredo. The primary reason for doing so is that it is not
472 easy for Teredo clients to connect to each other if either or both of
473 them are positioned behind a symmetric NAT. Because of the way a
474 symmetric NAT works, a peer sees a different mapped address/port in
475 the IPv4/UDP headers of packets coming from a Teredo client than the
476 node's Teredo server sees (and hence appears in the node's Teredo
477 IPv6 address). Consequently, a symmetric NAT does not allow incoming
478 packets from a peer that are addressed to the mapped address/port
479 embedded in the node's Teredo IPv6 address. Thus, the incoming
480 packets are dropped and communication with Teredo clients behind
481 symmetric NATs is not established.
482
483 With the Symmetric NAT Support Extension, Teredo clients begin to use
484 Teredo even after they detect that they are positioned behind a
485 symmetric NAT.
486
487 Consider the topology shown in Figure 2. Teredo Client B uses Teredo
488 Server 2 to learn that its mapped address/port is 192.0.2.10:8192,
489 and constructs a Teredo IPv6 address, as specified in <a href="./rfc4380#section-4">Section&nbsp;4 of
490 [RFC4380]</a>. Hence, c633:6476 is the hexadecimal value of the address
491 of Teredo Server 2 (198.51.100.118), the mapped port is exclusive-
492 OR'ed with 0xffff to form dfff, and the Mapped Address is exclusive-
493 OR'ed with 0xffffffff to form 3fff:fdf5.
494
495
496
497
498
499
500 <span class="grey">Thaler Standards Track [Page 9]</span></pre>
501 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-10" ></span>
502 <span class="grey"><a href="./rfc6081">RFC 6081</a> Teredo Extensions January 2011</span>
503
504
505 Teredo Client A uses Teredo Server 1 to learn that its mapped
506 address/port is 192.0.2.1:4096 and, with this extension, constructs a
507 Teredo IPv6 address (as specified in <a href="./rfc4380#section-4">Section&nbsp;4 of [RFC4380]</a>) even
508 though it learns that it is behind a symmetric NAT. Hence, cb00:7178
509 is the hexadecimal value of the address of Teredo Server 1
510 (203.0.113.120), the mapped port is exclusive-OR'ed with 0xffff to
511 form efff, and the Mapped Address is exclusive-OR'ed with 0xffffffff
512 to form 3fff:fdfe.
513
514 The Symmetric NAT Support Extension enables a Teredo client
515 positioned behind a symmetric NAT to communicate with Teredo peers
516 positioned behind a cone or address-restricted NATs as follows,
517 depending on what side initiates the communication.
518
519 --------------------------------------------
520 / \
521 &lt; IPv6 Internet &gt;
522 \ /
523 -|----------------------------------------|-
524 | |
525 +----------+ +----------+
526 | Teredo | | Teredo |
527 | Server 1 | | Server 2 |
528 +----------+ +----------+
529 203.0.113.120| 198.51.100.118|
530 -|----------------------------------------|-
531 / \
532 &lt; IPv4 Internet &gt;
533 \ /
534 -|----------------------------------------|-
535 192.0.2.1| 192.0.2.10|
536 UDP port 4096| UDP port 8192|
537 +---------+ +----------+
538 |Symmetric| |Other type|
539 | NAT | | of NAT |
540 +---------+ +----------+
541 | |
542 +-----------------+ +-----------------+
543 | Teredo client A | | Teredo client B |
544 +-----------------+ +-----------------+
545 2001:0:cb00:7178:0:efff:3fff:fdfe 2001:0:c633:6476:0:dfff:3fff:fdf5
546 Teredo Address Teredo Address
547
548 Figure 2: Symmetric NAT Example
549
550 In the first case, assume that a Teredo Client B (B) positioned
551 behind a cone or address-restricted NATs initiates communication with
552 Teredo Client A (A) positioned behind a symmetric NAT. B sends an
553
554
555
556 <span class="grey">Thaler Standards Track [Page 10]</span></pre>
557 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-11" ></span>
558 <span class="grey"><a href="./rfc6081">RFC 6081</a> Teredo Extensions January 2011</span>
559
560
561 indirect bubble via A's server (Teredo Server 1) to A, and A responds
562 with a direct bubble. This direct bubble reaches B, because it is
563 positioned behind a cone or address-restricted NAT. However, the
564 mapped address/port in the IPv4/UDP headers of the direct bubble are
565 different from the mapped address/port embedded in A's Teredo IPv6
566 address. B therefore remembers the mapped address/port of the direct
567 bubble and uses them for future communication with A, and thus
568 communication is established.
569
570 In the second case, assume that A, positioned behind a symmetric NAT,
571 initiates communication with B, positioned behind a cone or address-
572 restricted NAT. A sends an indirect bubble to B via B's server
573 (Teredo Server 2), and B responds with a direct bubble. This direct
574 bubble is dropped by A's symmetric NAT because the direct bubble is
575 addressed to the mapped address/port embedded in A's Teredo IPv6
576 address. However, communication can be established by having B
577 respond with an indirect bubble via A's server (Teredo Server 1).
578 Now the scenario is similar to the first case and communication will
579 be established.
580
581 <span class="h3"><a class="selflink" id="section-3.2" href="#section-3.2">3.2</a>. UPnP-Enabled Symmetric NAT Extension</span>
582
583 The UPnP-enabled Symmetric NAT Extension is dependent on the
584 Symmetric NAT Support Extension. Only if Teredo clients have been
585 enabled to acquire a Teredo IPv6 address in spite of being behind a
586 symmetric NAT will this extension help in traversing UPnP-enabled
587 Symmetric NATs.
588
589 The Symmetric NAT Support Extension enables communication between
590 Teredo clients behind symmetric NATs with Teredo clients behind cone
591 NATs or address-restricted NATs. However, clients behind symmetric
592 NATs can still not communicate with clients behind port-restricted
593 NATs or symmetric NATs.
594
595 Referring again to Figure 2 (see <a href="#section-3.1">Section 3.1</a>), assume that Teredo
596 Client A is positioned behind a symmetric NAT and initiates
597 communication with Client B, which is positioned behind a port-
598 restricted NAT. Client A sends a direct bubble and an indirect
599 bubble to Client B via Client B's server (Teredo Server 2). As per
600 the characteristics of the symmetric NAT, the IPv4 source of the
601 direct bubble contains a different mapped address and/or port than
602 the one embedded in the Teredo server. This direct bubble is dropped
603 because Client B's NAT does not have state to let it pass through,
604 and Client B does not learn the mapped address/port used in the IPv4/
605 UDP headers. In response to the indirect bubble from Client A,
606 Client B sends a direct bubble destined to the mapped address/port
607 embedded in Client A's Teredo IPv6 address. This direct bubble is
608 dropped because Client A's NAT does not have state to accept packets
609
610
611
612 <span class="grey">Thaler Standards Track [Page 11]</span></pre>
613 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-12" ></span>
614 <span class="grey"><a href="./rfc6081">RFC 6081</a> Teredo Extensions January 2011</span>
615
616
617 destined to that mapped address/port. The direct bubble does,
618 however, cause Client B's NAT to set up outgoing state for the mapped
619 address/port embedded in Client A's Teredo IPv6 address.
620
621 As described in <a href="#section-3.1">Section 3.1</a>, Client B also sends an indirect bubble
622 that elicits a direct bubble from Client A. Unlike the case in
623 <a href="#section-3.1">Section 3.1</a>, however, the direct bubble from Client A is dropped as
624 Client B's NAT does not have state for the mapped address/port that
625 Client A's NAT uses. Note that Client B's NAT is port-restricted and
626 hence requires both the mapped address and port to be the same as in
627 its outgoing state, whereas in <a href="#section-3.1">Section 3.1</a>, Client A's NAT was a cone
628 or address-restricted NAT which only required the mapped address (but
629 not port) to be the same. Thus, communication between Client A and
630 Client B fails. If Client B were behind a symmetric NAT, the problem
631 is further complicated by Client B's NAT using a different outgoing
632 mapped address/port than the one embedded in Client B's Teredo IPv6
633 address.
634
635 If a Teredo client is separated from the global Internet by a single
636 UPnP-enabled symmetric or port-restricted NAT, it can communicate
637 with other Teredo clients that are positioned behind a single UPnP-
638 enabled symmetric or port-restricted NAT as follows.
639
640 Teredo clients, before communicating with the Teredo server during
641 the qualification procedure, use UPnP to reserve a translation from a
642 local address/port to a mapped-address/port. Therefore, during the
643 qualification procedure, the Teredo server reflects back the reserved
644 mapped address/port, which then is included in the Teredo IPv6
645 address. The mapping created by UPnP allows the NAT to forward
646 packets destined for the mapped address/port to the local address/
647 port, independent of the source of the packets. It typically does
648 not, however, cause packets sourced from the local address/port to be
649 translated to have the mapped address/port as the external source and
650 hence continues to function as a symmetric NAT in this respect.
651
652 Thus, a Teredo client, positioned behind a UPnP-enabled symmetric
653 NAT, can receive a direct bubble sent by any Teredo peer. The Teredo
654 client compares the peer's mapped address/port as seen in the IPv4/
655 UDP headers with the mapped address/port in the peer's Teredo IPv6
656 address. If the two mappings are different, the packet was sent by
657 another Teredo client positioned behind a symmetric NAT. The
658 Symmetric NAT Support Extension suggested that the Teredo client use
659 the peer's mapped address/port seen in the IPv4/UDP headers for
660 future communication. However, because symmetric NAT-to-symmetric
661 NAT communication would not have been possible anyway, the Teredo
662 client sends back a direct bubble to the mapped port/address embedded
663
664
665
666
667
668 <span class="grey">Thaler Standards Track [Page 12]</span></pre>
669 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-13" ></span>
670 <span class="grey"><a href="./rfc6081">RFC 6081</a> Teredo Extensions January 2011</span>
671
672
673 in the peer's Teredo IPv6 address. If the peer is also situated
674 behind a UPnP-enabled NAT, the direct bubble will make it through and
675 communication will be established.
676
677 Even though communication is established between the two Teredo IPv6
678 addresses, the mappings will be asymmetric in the two directions of
679 data transfer. Specifically, incoming packets will be destined to
680 the reserved mapped address/port that is embedded in the Teredo IPv6
681 address. Outgoing packets will instead appear to come from a
682 different mapped address/port due to the symmetric NAT behavior.
683
684 <span class="h3"><a class="selflink" id="section-3.3" href="#section-3.3">3.3</a>. Port-Preserving Symmetric NAT Extension</span>
685
686 The Port-Preserving Symmetric NAT Extension is dependent on the
687 Symmetric NAT Support Extension (<a href="#section-3.1">Section 3.1</a>). Only if Teredo
688 clients have been enabled to acquire a Teredo IPv6 address in spite
689 of being behind a symmetric NAT will this extension help in
690 traversing port-preserving symmetric NATs.
691
692 The Symmetric NAT Support Extension enables communication between
693 Teredo clients behind symmetric NATs with Teredo clients behind cone
694 NATs or address-restricted NATs. However, clients behind symmetric
695 NATs can still not communicate with clients behind port-restricted or
696 symmetric NATs, as described in <a href="#section-3.2">Section 3.2</a>. Note that the Port-
697 Preserving Symmetric NAT Extension described here is independent of
698 the UPnP-enabled Symmetric NAT Extension, described in <a href="#section-3.2">Section 3.2</a>.
699
700 If a Teredo client is positioned behind a port-preserving symmetric
701 NAT, the client can communicate with other Teredo clients positioned
702 behind a port-restricted NAT or a port-preserving symmetric NAT as
703 follows.
704
705 Teredo clients compare the mapped port learned during the
706 qualification procedure with their local port to determine if they
707 are positioned behind a port-preserving NAT. If both the mapped port
708 and the local port have the same value, the Teredo client is
709 positioned behind a port-preserving NAT. At the end of the
710 qualification procedure, the Teredo client also knows if it is
711 positioned behind a symmetric NAT, as described in <a href="#section-3.1">Section 3.1</a>.
712
713 Teredo clients positioned behind port-preserving symmetric NATs can
714 also listen on randomly chosen local ports. If the randomly chosen
715 local port has not been used by the symmetric NAT as a mapped port in
716 a prior port-mapping, the NAT uses the same port number as the mapped
717 port. Thus, the challenge is to get the first direct bubble sent out
718 from the random port to be destined to a valid destination address
719 and port. When the mapped address/port is embedded in the
720 destination's Teredo IPv6 address, this is easy.
721
722
723
724 <span class="grey">Thaler Standards Track [Page 13]</span></pre>
725 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-14" ></span>
726 <span class="grey"><a href="./rfc6081">RFC 6081</a> Teredo Extensions January 2011</span>
727
728
729 The communication setup is more complicated when the destination
730 Teredo client is also positioned behind a port-preserving symmetric
731 NAT. In such a case, both Teredo clients need to send their first
732 direct bubbles to the correct destination mapped address/port. Thus,
733 the protocol messages, which communicate one Teredo client's random
734 port number to the other Teredo client, must be exchanged indirectly
735 (via Teredo servers). When one Teredo client has access to the other
736 Teredo client's random port number, it can send a direct bubble
737 destined to the mapped address embedded in the destination's Teredo
738 IPv6 address, and the mapped port can be the same as the
739 destination's random port number. If both NATs are port-preserving,
740 port-preserved mappings are created on both NATs and the second
741 direct bubble succeeds in reaching the destination.
742
743 <span class="h3"><a class="selflink" id="section-3.4" href="#section-3.4">3.4</a>. Sequential Port-Symmetric NAT Extension</span>
744
745 The Sequential Port-Symmetric NAT Extension is dependent on the
746 Symmetric NAT Support Extension (<a href="#section-3.1">Section 3.1</a>). This extension helps
747 in traversing a sequential port-symmetric NAT only if Teredo clients
748 are enabled to acquire a Teredo IPv6 address even when behind a
749 symmetric NAT.
750
751 When the Sequential Port-Symmetric NAT Extension is used, if a Teredo
752 client is positioned behind a sequential port-symmetric NAT, the
753 client can communicate with other Teredo clients that are positioned
754 behind a port-restricted NAT as follows.
755
756 During qualification, if the client discovers it is behind a
757 symmetric NAT that is not port-preserving, the client assumes by
758 default that it is behind a sequential port-symmetric NAT. This
759 assumption is proactive for the following reasons:
760
761 o There is no perfect method of discovering whether the client is
762 behind a sequential port-symmetric NAT.
763
764 o These kinds of NATs are notorious for changing their behavior. At
765 times, they could be sequential port-symmetric and at other times
766 not.
767
768 o There is no other solution for symmetric NAT traversal so this is
769 a last resort.
770
771 Teredo clients positioned behind sequential port-symmetric NATs can
772 also listen on a randomly chosen local port when communicating with a
773 peer. To predict the external port being used for a given peer, the
774 client sends three packets:
775
776
777
778
779
780 <span class="grey">Thaler Standards Track [Page 14]</span></pre>
781 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-15" ></span>
782 <span class="grey"><a href="./rfc6081">RFC 6081</a> Teredo Extensions January 2011</span>
783
784
785 o Packet 1 is a router solicitation (as specified in <a href="./rfc4380#section-5.2.1">Section&nbsp;5.2.1
786 of [RFC4380]</a>) sent to the Teredo server address.
787
788 o Packet 2 is a direct bubble sent to the peer.
789
790 o Packet 3 is a router solicitation sent to the secondary Teredo
791 server address.
792
793 As part of the normal Teredo protocol, the Teredo server responds to
794 packets 1 and 3. Based on the information in the responses, the
795 client now knows that Packet 1 was seen as coming from one external
796 port, and Packet 3 was seen as coming from another external port.
797 Assuming the NAT is a sequential port-symmetric NAT, the external
798 port for Packet 2 is estimated (or predicted) to be midway between
799 the external ports for Packets 1 and 3. Note that because other
800 applications might also have been using the NAT between packets 1 and
801 3, the actual port might not be exactly the midpoint.
802
803 The Teredo client then communicates the predicted port to its peer,
804 which sends a direct bubble to the communicated port. If the
805 communicated port is indeed the external port for Packet 2, the
806 direct bubble will reach the Teredo client.
807
808 <span class="h3"><a class="selflink" id="section-3.5" href="#section-3.5">3.5</a>. Hairpinning Extension</span>
809
810 Hairpinning support in a NAT routes packets that are sent from a
811 private (local) address destined to a public (mapped) address of the
812 NAT, back to another private (local) destination address behind the
813 same NAT. If hairpinning support is not available in a NAT, two
814 Teredo clients behind the same NAT are not able to communicate with
815 each other, as specified in <a href="./rfc4380#section-8.3">Section&nbsp;8.3 of [RFC4380]</a>.
816
817 The Hairpinning Extension enables two clients behind the same NAT to
818 talk to each other when the NAT does not support hairpinning. This
819 process is illustrated in the following diagram.
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836 <span class="grey">Thaler Standards Track [Page 15]</span></pre>
837 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-16" ></span>
838 <span class="grey"><a href="./rfc6081">RFC 6081</a> Teredo Extensions January 2011</span>
839
840
841 --------------------------------------------
842 / \
843 &lt; IPv6 Internet &gt;
844 \ /
845 --------------------|-----------------------
846 |
847 +----------+
848 | Teredo |
849 | Server |
850 +----------+
851 203.0.113.120|
852 --------------------|-----------------------
853 / \
854 &lt; IPv4 Internet &gt;
855 \ /
856 --------------------|-----------------------
857 198.51.100.118|
858 NAT +-------+
859 without | NAT |
860 hairpinning | E |
861 support +-------+
862 |
863 +------------------+--------------------+
864 192.168.1.0| 192.168.1.1|
865 UDP port 4095| UDP port 4096|
866 +---------+ +----------+
867 | NAT | | NAT |
868 | F | | G |
869 +---------+ +----------+
870 | |
871 +-----------------+ +-----------------+
872 | Teredo client A | | Teredo client B |
873 +-----------------+ +-----------------+
874 2001:0:cb00:7178:0:f000:39cc:9b89 2001:0:cb00:7178:0:efff:39cc:9b89
875 Teredo Address Teredo Address
876
877 Figure 3: Hairpinning Example
878
879 The Teredo Client A (A) includes, as part of its indirect bubble sent
880 to Teredo Client B (B), its local address/port. B, upon receiving
881 the indirect bubble, tries to establish communication by sending
882 direct bubbles to the mapped address/port of A, and also to the local
883 address/port of B.
884
885 If a Teredo client is part of a multi-NAT hierarchy and the NAT to
886 which the Teredo client is connected supports the UPnP protocol (as
887 specified in [<a href="#ref-UPNPWANIP" title="&quot;WANIPConnection:1&quot;">UPNPWANIP</a>]), the Teredo client can use UPnP to
888 determine the mapped address/port assigned to it by the NAT. This
889
890
891
892 <span class="grey">Thaler Standards Track [Page 16]</span></pre>
893 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-17" ></span>
894 <span class="grey"><a href="./rfc6081">RFC 6081</a> Teredo Extensions January 2011</span>
895
896
897 information can be included along with the local address/port when
898 sending the indirect bubble. The destination Teredo client now tries
899 to establish a connection by sending direct bubbles to the mapped
900 address/port in the Teredo IPv6 address, to the local address/port
901 included in the bubble, and also to the mapped address/port included
902 in the bubble.
903
904 Note that UPnP support is only required if the Teredo clients are
905 behind different NATs in a multi-NAT hierarchy. Without UPnP
906 support, the Hairpinning Extension still allows two hosts behind the
907 same non-hairpinning NAT to communicate using their Teredo IPv6
908 addresses.
909
910 <span class="h3"><a class="selflink" id="section-3.6" href="#section-3.6">3.6</a>. Server Load Reduction Extension</span>
911
912 If communication between a Teredo client and a Teredo peer was
913 successfully established but at a later stage was silent for a while,
914 for efficiency, it is best to refresh the mapping state in the NATs
915 that are positioned between them. To refresh the communication
916 between itself and a Teredo peer, a Teredo client needs to solicit a
917 direct bubble response from the Teredo peer. An indirect bubble is
918 sent to solicit a direct bubble response from a Teredo peer, as
919 specified in <a href="./rfc4380#section-5.2.4">Section&nbsp;5.2.4 of [RFC4380]</a>. However, these indirect
920 bubbles increase the load on the Teredo server.
921
922 The Server Load Reduction Extension allows Teredo clients to send
923 direct bubbles most of the time instead of sending indirect bubbles
924 all of the time in the following way:
925
926 1. When a Teredo client tries to refresh its communication with a
927 Teredo peer, it uses a direct bubble instead of an indirect
928 bubble. However, because direct bubbles do not normally solicit
929 a response, the direct bubble format is extended to be able to
930 solicit a response.
931
932 2. When a Teredo client receives a direct bubble that is soliciting
933 a response, the Teredo client responds with a direct bubble.
934
935 3. If attempts to re-establish communication with the help of direct
936 bubbles fail, the Teredo client starts over the process of
937 establishing communication with the Teredo peer, as specified in
938 <a href="./rfc4380#section-5.2.4">Section&nbsp;5.2.4 of [RFC4380]</a>.
939
940
941
942
943
944
945
946
947
948 <span class="grey">Thaler Standards Track [Page 17]</span></pre>
949 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-18" ></span>
950 <span class="grey"><a href="./rfc6081">RFC 6081</a> Teredo Extensions January 2011</span>
951
952
953 <span class="h2"><a class="selflink" id="section-4" href="#section-4">4</a>. Message Syntax</span>
954
955 All Teredo messages are transported over the User Datagram Protocol
956 (UDP), as specified in <a href="./rfc4380#section-3">Section&nbsp;3 of [RFC4380]</a>.
957
958 In addition, <a href="./rfc4380#section-5.2.3">Section&nbsp;5.2.3 of [RFC4380]</a> states:
959
960 An IPv6 packet is deemed valid if it conforms to [<a href="./rfc2460" title="&quot;Internet Protocol, Version 6 (IPv6) Specification&quot;">RFC2460</a>]: the
961 protocol identifier should indicate an IPv6 packet and the payload
962 length should be consistent with the length of the UDP datagram in
963 which the packet is encapsulated. In addition, the client should
964 check that the IPv6 destination address correspond [sic] to its
965 own Teredo address.
966
967 This document updates the word "consistent" above as follows. The
968 IPv6 payload length is "consistent" with the length of the UDP
969 datagram if the IPv6 packet length (i.e., the Payload Length value in
970 the IPv6 header plus the IPv6 header size) is less than or equal to
971 the UDP payload length (i.e., the Length value in the UDP header
972 minus the UDP header size). This allows the use of trailers after
973 the IPv6 packet, which are defined in the following sections.
974
975 <span class="h3"><a class="selflink" id="section-4.1" href="#section-4.1">4.1</a>. Trailers</span>
976
977 Teredo packets can carry a variable number of type-length-value (TLV)
978 encoded trailers, of the following format (intended to be similar to
979 the use of IPv6 options defined in <a href="./rfc2460#section-4.2">[RFC2460] section&nbsp;4.2</a>):
980
981 1 2 3
982 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
983 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
984 | Type | Length | Value (variable) |
985 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
986
987 Type (1 byte): 8-bit identifier of the type of trailer.
988
989 Length (1 byte): 8-bit unsigned integer. Length of the Value field
990 of this trailer, in octets.
991
992 Value (variable): Trailer-Type-specific data.
993
994 The trailer Type identifiers are internally encoded such that their
995 highest-order two bits specify the action that is to be taken if the
996 host does not recognize the trailer Type:
997
998
999
1000
1001
1002
1003
1004 <span class="grey">Thaler Standards Track [Page 18]</span></pre>
1005 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-19" ></span>
1006 <span class="grey"><a href="./rfc6081">RFC 6081</a> Teredo Extensions January 2011</span>
1007
1008
1009 00, 10, 11 - skip over this trailer and continue processing the
1010 packet.
1011
1012 01 - discard the packet.
1013
1014 <span class="h3"><a class="selflink" id="section-4.2" href="#section-4.2">4.2</a>. Nonce Trailer</span>
1015
1016 The Nonce Trailer is used by the Symmetric NAT Support Extension (and
1017 therefore the UPnP-enabled Symmetric NAT Extension and Port-
1018 Preserving Symmetric NAT Extension also) and the Hairpinning
1019 Extension. The Nonce Trailer can be present in both indirect and
1020 direct bubbles. The nonce in the Nonce Trailer helps authenticate a
1021 Teredo client positioned behind a Symmetric NAT.
1022
1023 1 2 3
1024 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
1025 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1026 | Type | Length | Nonce |
1027 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1028 | ... |
1029 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1030
1031 Type (1 byte): The Trailer Option type. This field MUST be set to
1032 0x01.
1033
1034 Length (1 byte): The length in bytes of the rest of the option. This
1035 field MUST be set to 0x04.
1036
1037 Nonce (4 bytes): The nonce value.
1038
1039 <span class="h3"><a class="selflink" id="section-4.3" href="#section-4.3">4.3</a>. Alternate Address Trailer</span>
1040
1041 The Alternate Address Trailer is used by the Hairpinning Extension.
1042 The Alternate Address Trailer MUST NOT be present in any packets
1043 other than indirect bubbles sent by a Teredo client. The Alternate
1044 Address Trailer provides another Teredo client positioned behind the
1045 same NAT with more address options that it can use to connect.
1046
1047 1 2 3
1048 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
1049 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1050 | Type | Length | Reserved |
1051 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1052 | |
1053 | Alternate Address/Port List (variable) |
1054 | |
1055 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1056
1057
1058
1059
1060 <span class="grey">Thaler Standards Track [Page 19]</span></pre>
1061 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-20" ></span>
1062 <span class="grey"><a href="./rfc6081">RFC 6081</a> Teredo Extensions January 2011</span>
1063
1064
1065 Type (1 byte): The Trailer Option type. This field MUST be set to
1066 0x03.
1067
1068 Length (1 byte): The length in bytes of the rest of the option. The
1069 value of this field MUST be in the range 8 to 26 (i.e., 2 bytes for
1070 the Reserved field, and 6 bytes for each entry in the Alternate
1071 Address/Port List). This allows for a minimum of one address/port
1072 mapping and a maximum of four address/port mappings to be advertised.
1073 It SHOULD be at most 14 as a maximum of two address/port mappings can
1074 be determined by Teredo: one local address/port and one obtained
1075 using UPnP. Because the length of the alternate address/port is 6
1076 bytes, the valid range of values is only 8, 14, 20, and 26.
1077
1078 Reserved (2 bytes): This field MUST be set to 0x0000 and ignored on
1079 receipt.
1080
1081 Alternate Address/Port List (variable): An array of additional
1082 address/port pairs that can be used by other Teredo clients to
1083 communicate with the sender. Each alternate address/port entry MUST
1084 be formatted as follows:
1085
1086 1 2 3
1087 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
1088 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1089 | IPv4 Address |
1090 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1091 | Port |
1092 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1093
1094 IPv4 Address (4 bytes): An IPv4 address in network byte order. This
1095 field MUST contain a valid unicast address.
1096
1097 Port (2 bytes): A port number in network byte order. This field MUST
1098 NOT be zero.
1099
1100 <span class="h3"><a class="selflink" id="section-4.4" href="#section-4.4">4.4</a>. Neighbor Discovery Option Trailer</span>
1101
1102 The Neighbor Discovery Option Trailer is used by the Server Load
1103 Reduction Extension because it allows direct bubbles to encode an
1104 IPv6 Neighbor Solicitation (<a href="./rfc4861#section-4.3">Section&nbsp;4.3 of [RFC4861]</a>), in addition to
1105 an IPv6 Neighbor Advertisement (<a href="./rfc4861#section-4.4">Section&nbsp;4.4 of [RFC4861]</a>). This
1106 allows packets to be sent without having to relay them through a
1107 Teredo server. The Neighbor Discovery Option Trailer allows the
1108 receiver to differentiate between a direct bubble that is soliciting
1109 a response versus a regular direct bubble. This allows Teredo
1110 clients to use direct bubbles to refresh inactive connections instead
1111 of using indirect bubbles.
1112
1113
1114
1115
1116 <span class="grey">Thaler Standards Track [Page 20]</span></pre>
1117 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-21" ></span>
1118 <span class="grey"><a href="./rfc6081">RFC 6081</a> Teredo Extensions January 2011</span>
1119
1120
1121 1 2 3
1122 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
1123 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1124 | Type | Length | DiscoveryType | Reserved |
1125 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1126 | ... |
1127 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1128
1129 Type (1 byte): The Trailer Option type. This field MUST be set to
1130 0x04.
1131
1132 Length (1 byte): The length in bytes of the rest of the option. This
1133 field MUST be set to 0x04.
1134
1135 DiscoveryType (1 byte): This field MUST be set to one of the
1136 following values:
1137
1138 TeredoDiscoverySolicitation (0x00): The receiver is requested to
1139 respond with a direct bubble of DiscoveryType
1140 TeredoDiscoveryAdvertisement.
1141
1142 TeredoDiscoveryAdvertisement (0x01): The direct bubble is in
1143 response to a direct bubble or an indirect bubbles containing
1144 DiscoveryType TeredoDiscoverySolicitation.
1145
1146 Reserved (3 bytes): This field MUST be set to 0x000000 on
1147 transmission and ignored on receipt.
1148
1149 <span class="h3"><a class="selflink" id="section-4.5" href="#section-4.5">4.5</a>. Random Port Trailer</span>
1150
1151 The Random Port Trailer is used by the Port-Preserving Symmetric NAT
1152 Extension in both indirect and direct bubbles.
1153
1154 1 2 3
1155 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
1156 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1157 | Type | Length | Random Port |
1158 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1159
1160 Type (1 byte): The Trailer Option type. This field MUST be set to
1161 0x05.
1162
1163 Length (1 byte): The length in bytes of the rest of the option. This
1164 field MUST be set to 0x02.
1165
1166 Random Port (2 bytes): The external port that the sender predicts
1167 that its NAT has assigned it for communication with the destination.
1168 This field MUST be specified in network byte order.
1169
1170
1171
1172 <span class="grey">Thaler Standards Track [Page 21]</span></pre>
1173 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-22" ></span>
1174 <span class="grey"><a href="./rfc6081">RFC 6081</a> Teredo Extensions January 2011</span>
1175
1176
1177 <span class="h2"><a class="selflink" id="section-5" href="#section-5">5</a>. Protocol Details</span>
1178
1179 <span class="h3"><a class="selflink" id="section-5.1" href="#section-5.1">5.1</a>. Common Processing</span>
1180
1181 The behavior in this section applies to multiple extensions.
1182
1183 Packets equivalent to those sent for a peer the first time a
1184 connection is being established MAY be generated at other
1185 implementation-specific times. (For example, an implementation might
1186 choose to do so when its Neighbor Cache Entry for the peer is in the
1187 PROBE state.)
1188
1189 <span class="h4"><a class="selflink" id="section-5.1.1" href="#section-5.1.1">5.1.1</a>. Refresh Interval</span>
1190
1191 <a href="./rfc4380#section-5.2">Section&nbsp;5.2 of [RFC4380]</a> states:
1192
1193 The client must regularly perform the maintenance procedure in
1194 order to guarantee that the Teredo service port remains usable.
1195 The need to use this procedure or not depends on the delay since
1196 the last interaction with the Teredo server. The refresh
1197 procedure takes as a parameter the "Teredo refresh interval".
1198 This parameter is initially set to 30 seconds; it can be updated
1199 as a result of the optional "interval determination procedure".
1200 The randomized refresh interval is set to a value randomly chosen
1201 between 75% and 100% of the refresh interval.
1202
1203 This requirement can be problematic when the client is behind a NAT
1204 that expires state in less than 30 seconds. The optional interval
1205 determination procedure (<a href="./rfc4380#section-5.2.7">Section&nbsp;5.2.7 of [RFC4380]</a>) also does not
1206 provide for intervals under 30 seconds. Hence, this document refines
1207 the behavior by saying the initial parameter SHOULD be configurable
1208 and the default MUST be 30 seconds. An implementation MAY set the
1209 randomized refresh interval to a value randomly chosen within an
1210 implementation-specific range. Such a range MUST fall within 50% to
1211 150% of the refresh interval.
1212
1213 <a href="./rfc4380#section-5.2.5">Section&nbsp;5.2.5 of [RFC4380]</a> states that:
1214
1215 At regular intervals, the client MUST check the "date and time of
1216 the last interaction with the Teredo server" to ensure that at
1217 least one packet has been received in the last Randomized Teredo
1218 Refresh Interval. If this is not the case, the client SHOULD send
1219 a router solicitation message to the server, as specified in
1220 <a href="#section-5.2.1">Section 5.2.1</a>;
1221
1222
1223
1224
1225
1226
1227
1228 <span class="grey">Thaler Standards Track [Page 22]</span></pre>
1229 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-23" ></span>
1230 <span class="grey"><a href="./rfc6081">RFC 6081</a> Teredo Extensions January 2011</span>
1231
1232
1233 This document refines the behavior as follows. A Teredo client MAY
1234 choose to send additional router solicitation messages to the server
1235 at other implementation-specific times. (For example, an
1236 implementation might choose to do so when its Neighbor Cache Entry
1237 for the router is in the PROBE state.)
1238
1239 <span class="h4"><a class="selflink" id="section-5.1.2" href="#section-5.1.2">5.1.2</a>. Trailer Processing</span>
1240
1241 A Teredo client MUST process the sequence of trailers in the same
1242 order as they appear in the packet. If the Teredo client does not
1243 recognize the trailer Type while processing the trailers in the
1244 Teredo packet, the client MUST discard the packet if the highest-
1245 order bits of the trailer Type contain 01, or else the Teredo client
1246 MUST skip past the trailer. A Teredo client MUST stop processing the
1247 trailers as soon as a malformed trailer appears in the sequence of
1248 trailers in the packet. A trailer is defined as malformed if it has
1249 any of the following properties:
1250
1251 o The length in bytes of the remainder of the UDP datagram is less
1252 than 2 (the size of the Type and Length fields of a trailer).
1253
1254 o The length in bytes of the remainder of the UDP datagram is less
1255 than 2 + the value of the Length field of the trailer.
1256
1257 <span class="h3"><a class="selflink" id="section-5.2" href="#section-5.2">5.2</a>. Symmetric NAT Support Extension</span>
1258
1259 <a href="./rfc4380#section-5.2.1">Section&nbsp;5.2.1 of [RFC4380]</a> advises that no Teredo IPv6 address be
1260 configured if the Teredo client is positioned behind a symmetric NAT.
1261 For Teredo clients positioned behind symmetric NATs, the mapped
1262 address/port used by its NAT when communicating with a Teredo peer is
1263 different from the mapped address/port embedded in the Teredo
1264 client's Teredo IPv6 address. The Symmetric NAT Support Extension
1265 provides a solution to this problem.
1266
1267 In addition, <a href="./rfc4380#section-5.2.9">Section&nbsp;5.2.9 of [RFC4380]</a> specifies a direct IPv6
1268 connectivity test to determine that the mapped address/port in the
1269 Teredo IPv6 address of a peer is not spoofed. It does this through
1270 the use of a nonce in ICMPv6 Echo Request and Response messages
1271 (which are defined in <a href="./rfc4443#section-4">Section&nbsp;4 of [RFC4443]</a>). However, the direct
1272 IPv6 connectivity test is limited only to communication between
1273 Teredo IPv6 addresses and non-Teredo IPv6 addresses. In the
1274 following extension, we introduce the use of a nonce in direct and
1275 indirect bubbles and provide a mechanism to verify that the mapped
1276 address/port are not spoofed.
1277
1278 This extension is optional; an implementation SHOULD support it.
1279
1280
1281
1282
1283
1284 <span class="grey">Thaler Standards Track [Page 23]</span></pre>
1285 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-24" ></span>
1286 <span class="grey"><a href="./rfc6081">RFC 6081</a> Teredo Extensions January 2011</span>
1287
1288
1289 <span class="h4"><a class="selflink" id="section-5.2.1" href="#section-5.2.1">5.2.1</a>. Abstract Data Model</span>
1290
1291 This section describes a conceptual model of possible data
1292 organization that an implementation maintains to participate in this
1293 protocol. The described organization is provided to facilitate the
1294 explanation of how the protocol behaves. This document does not
1295 mandate that implementations adhere to this model as long as their
1296 external behavior is consistent with that described in this document.
1297
1298 In addition to the state specified in <a href="./rfc4380#section-5.2">Section&nbsp;5.2 of [RFC4380]</a>, the
1299 following are also required.
1300
1301 Peer Entry: The following additional state is required on a per-peer
1302 basis:
1303
1304 o Nonce Sent: The value of the nonce sent in the last indirect
1305 bubble sent to the Teredo peer.
1306
1307 o Nonce Received: The value of the nonce received in the last
1308 indirect bubble received from the Teredo peer.
1309
1310 <span class="h4"><a class="selflink" id="section-5.2.2" href="#section-5.2.2">5.2.2</a>. Timers</span>
1311
1312 No timers are necessary other than those in [<a href="./rfc4380" title="&quot;Teredo: Tunneling IPv6 over UDP through Network Address Translations (NATs)&quot;">RFC4380</a>].
1313
1314 <span class="h4"><a class="selflink" id="section-5.2.3" href="#section-5.2.3">5.2.3</a>. Initialization</span>
1315
1316 No initialization is necessary other than that specified in
1317 [<a href="./rfc4380" title="&quot;Teredo: Tunneling IPv6 over UDP through Network Address Translations (NATs)&quot;">RFC4380</a>].
1318
1319 <span class="h4"><a class="selflink" id="section-5.2.4" href="#section-5.2.4">5.2.4</a>. Message Processing</span>
1320
1321 Except as specified in the following sections, the rules for message
1322 processing are as specified in [<a href="./rfc4380" title="&quot;Teredo: Tunneling IPv6 over UDP through Network Address Translations (NATs)&quot;">RFC4380</a>].
1323
1324 <span class="h5"><a class="selflink" id="section-5.2.4.1" href="#section-5.2.4.1">5.2.4.1</a>. Sending an Indirect Bubble</span>
1325
1326 The rules for when indirect bubbles are sent to a Teredo peer are
1327 specified in <a href="./rfc4380#section-5.2.6">Section&nbsp;5.2.6 of [RFC4380]</a>. When a Teredo client sends
1328 an indirect bubble, it MUST generate a random 4-byte value and
1329 include it in the Nonce field of a Nonce Trailer (<a href="#section-4.2">Section 4.2</a>)
1330 appended to the indirect bubble, and also store it in the Nonce Sent
1331 field of its Peer Entry for that Teredo peer.
1332
1333
1334
1335
1336
1337
1338
1339
1340 <span class="grey">Thaler Standards Track [Page 24]</span></pre>
1341 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-25" ></span>
1342 <span class="grey"><a href="./rfc6081">RFC 6081</a> Teredo Extensions January 2011</span>
1343
1344
1345 <span class="h5"><a class="selflink" id="section-5.2.4.2" href="#section-5.2.4.2">5.2.4.2</a>. Sending a Direct Bubble</span>
1346
1347 The rules for when direct bubbles are sent to a Teredo peer are
1348 specified in <a href="./rfc4380#section-5.2.6">Section&nbsp;5.2.6 of [RFC4380]</a>. When a Teredo client sends
1349 a direct bubble to a peer after receiving an indirect bubble with a
1350 Nonce Trailer, it MUST include in the direct bubble a Nonce Trailer
1351 with the same nonce value.
1352
1353 If the Teredo client is about to send a direct bubble before it has
1354 received an indirect bubble from the Teredo peer, the Teredo client
1355 MUST NOT include a Nonce Trailer.
1356
1357 <span class="h5"><a class="selflink" id="section-5.2.4.3" href="#section-5.2.4.3">5.2.4.3</a>. Receiving an Indirect Bubble</span>
1358
1359 The rules for processing an indirect bubble are specified in <a href="./rfc4380#section-5.2.3">Section</a>
1360 <a href="./rfc4380#section-5.2.3">5.2.3 of [RFC4380]</a>. In addition, when a Teredo client receives an
1361 indirect bubble containing a Nonce Trailer, the Teredo client MUST
1362 store the nonce in the Nonce Received field of its Peer Entry for
1363 that Teredo peer. If an indirect bubble is received without a Nonce
1364 Trailer, and the Nonce Received field in the Peer Entry is non-zero,
1365 the Nonce Received field SHOULD be set to zero.
1366
1367 <span class="h5"><a class="selflink" id="section-5.2.4.4" href="#section-5.2.4.4">5.2.4.4</a>. Receiving a Direct Bubble</span>
1368
1369 If the mapped address/port of the direct bubble matches the mapped
1370 address/port embedded in the source Teredo IPv6 address, the direct
1371 bubble MUST be accepted, as specified in <a href="./rfc4380#section-5.2.3">Section&nbsp;5.2.3 of [RFC4380]</a>.
1372
1373 In addition, if the mapped address/port does not match the embedded
1374 address/port but the direct bubble contains a Nonce Trailer with a
1375 nonce that matches the Nonce Sent field of the Teredo peer, the
1376 direct bubble MUST be accepted.
1377
1378 If neither of the above conditions is true, the direct bubble MUST be
1379 dropped.
1380
1381 If the direct bubble is accepted, the Teredo client MUST record the
1382 mapped address/port from which the direct bubble is received in the
1383 mapped address/port fields of the Teredo peer, as specified in
1384 <a href="./rfc4380#section-5.2">Section&nbsp;5.2 of [RFC4380]</a>.
1385
1386 <span class="h3"><a class="selflink" id="section-5.3" href="#section-5.3">5.3</a>. UPnP-Enabled Symmetric NAT Extension</span>
1387
1388 The UPnP-enabled Symmetric NAT Extension is optional; an
1389 implementation SHOULD support it. This extension has the Symmetric
1390 NAT Support Extension (<a href="#section-5.2">Section 5.2</a>) as a dependency. Any node that
1391 implements this extension MUST also implement the Symmetric NAT
1392 Support Extension.
1393
1394
1395
1396 <span class="grey">Thaler Standards Track [Page 25]</span></pre>
1397 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-26" ></span>
1398 <span class="grey"><a href="./rfc6081">RFC 6081</a> Teredo Extensions January 2011</span>
1399
1400
1401 <span class="h4"><a class="selflink" id="section-5.3.1" href="#section-5.3.1">5.3.1</a>. Abstract Data Model</span>
1402
1403 This section describes a conceptual model of possible data
1404 organization that an implementation maintains to participate in this
1405 protocol. The described organization is provided to facilitate the
1406 explanation of how the protocol behaves. This document does not
1407 mandate that implementations adhere to this model as long as their
1408 external behavior is consistent with that described in this document.
1409
1410 This extension extends the abstract data model in <a href="#section-5.2.1">Section 5.2.1</a> by
1411 adding the following additional fields.
1412
1413 UPnP-Enabled NAT flag: This is a Boolean value, set to TRUE if the
1414 NAT positioned in front of the Teredo client is UPnP enabled. The
1415 default value of this flag is FALSE.
1416
1417 UPnP-Mapped Address/Port: The mapped address/port assigned via UPnP
1418 to the Teredo client by the UPnP-enabled NAT behind which the Teredo
1419 client is positioned. Note that this field has a valid value only if
1420 the NAT to which the Teredo client is connected is UPnP enabled.
1421 Also, note that if the Teredo client is positioned behind a single
1422 NAT only (as opposed to a series of nested NATs), this value is the
1423 same as the mapped address/port embedded in its Teredo IPv6 address.
1424
1425 Symmetric NAT flag: This is a Boolean value, set to TRUE if the
1426 Teredo client is positioned behind a symmetric NAT.
1427
1428 Peer Entry: The following state needs to be added on a per-peer
1429 basis:
1430
1431 o Symmetric Peer flag: This is a Boolean value and is TRUE if the
1432 Teredo peer is positioned behind a symmetric NAT.
1433
1434 A Teredo client SHOULD also maintain the following state that is
1435 persisted across reboots:
1436
1437 o Persisted UPnP-Mapped Port: The mapped port assigned via UPnP to
1438 the Teredo client by the UPnP-enabled NAT behind which the Teredo
1439 client is positioned. Note that this value is the same as the
1440 UPnP-Mapped Port value when both are non-zero. The default value
1441 is all zero bytes.
1442
1443 <span class="h4"><a class="selflink" id="section-5.3.2" href="#section-5.3.2">5.3.2</a>. Timers</span>
1444
1445 No timers are necessary other than those in [<a href="./rfc4380" title="&quot;Teredo: Tunneling IPv6 over UDP through Network Address Translations (NATs)&quot;">RFC4380</a>].
1446
1447
1448
1449
1450
1451
1452 <span class="grey">Thaler Standards Track [Page 26]</span></pre>
1453 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-27" ></span>
1454 <span class="grey"><a href="./rfc6081">RFC 6081</a> Teredo Extensions January 2011</span>
1455
1456
1457 <span class="h4"><a class="selflink" id="section-5.3.3" href="#section-5.3.3">5.3.3</a>. Initialization</span>
1458
1459 Prior to beginning the qualification procedure, the Teredo client
1460 MUST first perform the uninitialization procedure specified in
1461 <a href="#section-5.3.5.1">Section 5.3.5.1</a> if the Persisted UPnP-Mapped Port is supported and
1462 non-zero.
1463
1464 The Teredo client MUST then invoke the AddPortMapping function, as
1465 specified in Section 2.4.16 of [<a href="#ref-UPNPWANIP" title="&quot;WANIPConnection:1&quot;">UPNPWANIP</a>], with the following
1466 parameters:
1467
1468 o NewRemoteHost: "" (empty string)
1469
1470 o NewExternalPort: Local Port value
1471
1472 o NewProtocol: UDP
1473
1474 o NewInternalPort: Local Port value
1475
1476 o NewInternalClient: Local Address value
1477
1478 o NewEnabled: TRUE
1479
1480 o NewPortMappingDescription: "TEREDO"
1481
1482 o NewLeaseDuration: 0
1483
1484 The successful completion of the AddPortMapping function indicates
1485 that the NAT has created a port mapping from the external port of the
1486 NAT to the internal port of the Teredo client node. The parameters
1487 are specified so that any external host should be able to send
1488 packets to the Teredo client by sending packets to the mapped
1489 address/port. If the AddPortMapping function fails, the Teredo
1490 client MUST continue without using this extension. Otherwise, it
1491 MUST proceed as follows.
1492
1493 The Teredo client MUST set the UPnP-Mapped Port (and Persisted UPnP-
1494 Mapped Port, if supported) to the Local Port value specified in
1495 AddPortMapping. The Teredo client MUST then call the
1496 GetExternalIPAddress function specified in Section 2.4.18 of
1497 [<a href="#ref-UPNPWANIP" title="&quot;WANIPConnection:1&quot;">UPNPWANIP</a>]. If the GetExternalIPAddress function fails, the Teredo
1498 client SHOULD perform the uninitialization procedure specified in
1499 <a href="#section-5.3.5.1">Section 5.3.5.1</a> and continue without using this extension. If the
1500 GetExternalIPAddress function succeeds, the Teredo client MUST
1501 proceed as follows.
1502
1503
1504
1505
1506
1507
1508 <span class="grey">Thaler Standards Track [Page 27]</span></pre>
1509 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-28" ></span>
1510 <span class="grey"><a href="./rfc6081">RFC 6081</a> Teredo Extensions January 2011</span>
1511
1512
1513 The Teredo client MUST set the UPnP-Mapped Address to the address
1514 returned from the GetExternalIPAddress function, and set the UPnP-
1515 Enabled NAT flag to TRUE.
1516
1517 During the qualification procedure (as specified in <a href="./rfc4380#section-5.2.1">Section&nbsp;5.2.1 of
1518 [RFC4380]</a>) when the Teredo client receives a response from the
1519 secondary Teredo server, the Teredo client MUST compare the mapped
1520 address/port learned from the secondary Teredo server with the mapped
1521 address/port associated with the Teredo server. If either the mapped
1522 address or the mapped port value is different, the Symmetric NAT flag
1523 MUST be set to TRUE.
1524
1525 After the qualification procedure, the mapped address/port learned
1526 from the Teredo server MUST be compared to the UPnP-Mapped Address/
1527 Port. If both are the same, the Teredo client is positioned behind a
1528 single NAT and the UPnP-Mapped Address/Port MUST be zeroed out.
1529
1530 <span class="h4"><a class="selflink" id="section-5.3.4" href="#section-5.3.4">5.3.4</a>. Message Processing</span>
1531
1532 Except as specified in the following sections, the rules for message
1533 processing are as specified in <a href="./rfc4380#section-5.2.3">Section&nbsp;5.2.3 of [RFC4380]</a>.
1534
1535 <span class="h5"><a class="selflink" id="section-5.3.4.1" href="#section-5.3.4.1">5.3.4.1</a>. Receiving a Direct Bubble</span>
1536
1537 Except as indicated below, the rules for handling a direct bubble are
1538 as specified in <a href="#section-5.2.4.4">Section 5.2.4.4</a>.
1539
1540 A Teredo client positioned behind a UPnP-enabled NAT (port-restricted
1541 NAT as well as symmetric NAT) will receive all packets sent to the
1542 mapped address/port embedded in its Teredo IPv6 address. Thus, when
1543 a Teredo client receives a direct bubble, it MUST compare the mapped
1544 address/port from which the packet was received with the mapped
1545 address/port embedded in the Teredo IPv6 address in the source
1546 address field of the IPv6 header. If the two are not the same, it
1547 indicates that the Teredo peer is positioned behind a symmetric NAT,
1548 and it MUST set the Symmetric Peer flag in its Peer Entry.
1549
1550 <span class="h5"><a class="selflink" id="section-5.3.4.2" href="#section-5.3.4.2">5.3.4.2</a>. Sending a Direct Bubble</span>
1551
1552 The rules for sending a direct bubble are specified in <a href="./rfc4380#section-5.2.6">Section&nbsp;5.2.6
1553 of [RFC4380]</a> and <a href="#section-5.2.4.2">Section 5.2.4.2</a> of this document. These rules are
1554 further refined as follows.
1555
1556 If the Teredo client sending the direct bubble meets all of the
1557 following criteria:
1558
1559 o The Symmetric NAT flag is set to TRUE.
1560
1561
1562
1563
1564 <span class="grey">Thaler Standards Track [Page 28]</span></pre>
1565 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-29" ></span>
1566 <span class="grey"><a href="./rfc6081">RFC 6081</a> Teredo Extensions January 2011</span>
1567
1568
1569 o The UPnP-Enabled NAT flag is set to TRUE.
1570
1571 o The UPnP-Mapped Address/Port are set to zero.
1572
1573 o The peer's Symmetric Peer flag is set to TRUE.
1574
1575 then the Teredo client MUST send the direct bubble to the mapped
1576 address/port embedded in the peer's Teredo IPv6 address.
1577
1578 This is because Symmetric-to-Symmetric and Port-Restricted-to-
1579 Symmetric NAT communication between the Teredo client and the peer
1580 would have failed anyway. However, by taking a chance that the peer
1581 might also be positioned behind a UPnP-enabled NAT just like the
1582 Teredo client itself, the Teredo client can try sending the direct
1583 bubble to the mapped address/port in the peer's Teredo IPv6 address.
1584 If the packet does go through, communication is established.
1585
1586 <span class="h5"><a class="selflink" id="section-5.3.4.3" href="#section-5.3.4.3">5.3.4.3</a>. Sending a Data Packet</span>
1587
1588 The rules for sending a data packet are specified in <a href="./rfc4380#section-5.2.4">Section&nbsp;5.2.4 of
1589 [RFC4380]</a>. These rules are further refined as follows.
1590
1591 If the Teredo client sending the data packet meets all of the
1592 following criteria:
1593
1594 o The Symmetric NAT flag is set to TRUE.
1595
1596 o The UPnP-Enabled NAT flag is set to TRUE.
1597
1598 o The UPnP-Mapped Address/Port are set to zero.
1599
1600 o The peer's Symmetric Peer flag is set to TRUE.
1601
1602 then the Teredo client MUST send the data packet to the mapped
1603 address/port embedded in the peer's Teredo IPv6 address.
1604
1605 <span class="h4"><a class="selflink" id="section-5.3.5" href="#section-5.3.5">5.3.5</a>. Shutdown</span>
1606
1607 When Teredo client functionality is being shut down, uninitialization
1608 MUST be performed as specified in <a href="#section-5.3.5.1">Section 5.3.5.1</a>.
1609
1610 <span class="h5"><a class="selflink" id="section-5.3.5.1" href="#section-5.3.5.1">5.3.5.1</a>. Uninitialization</span>
1611
1612 First determine the mapped port as follows. If Persisted UPnP-Mapped
1613 Port is supported, use it as the mapped port. Otherwise, use the
1614 UPnP-Mapped Port.
1615
1616
1617
1618
1619
1620 <span class="grey">Thaler Standards Track [Page 29]</span></pre>
1621 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-30" ></span>
1622 <span class="grey"><a href="./rfc6081">RFC 6081</a> Teredo Extensions January 2011</span>
1623
1624
1625 If the mapped port is non-zero, the Teredo client MUST call the
1626 DeletePortMapping function, as specified in Section 2.4.17 of
1627 [<a href="#ref-UPNPWANIP" title="&quot;WANIPConnection:1&quot;">UPNPWANIP</a>], with the following parameters:
1628
1629 o NewRemoteHost: "" (empty string)
1630
1631 o NewExternalPort: the mapped port
1632
1633 o NewProtocol: UDP
1634
1635 <span class="h3"><a class="selflink" id="section-5.4" href="#section-5.4">5.4</a>. Port-Preserving Symmetric NAT Extension</span>
1636
1637 The Port-Preserving Symmetric NAT Extension is optional; an
1638 implementation SHOULD support it. This extension has the Symmetric
1639 NAT Support Extension (as specified in <a href="#section-5.2">Section 5.2</a>) as a dependency.
1640 Any node that implements this extension MUST also implement the
1641 Symmetric NAT Support Extension.
1642
1643 <span class="h4"><a class="selflink" id="section-5.4.1" href="#section-5.4.1">5.4.1</a>. Abstract Data Model</span>
1644
1645 This section describes a conceptual model of possible data
1646 organization that an implementation maintains to participate in this
1647 protocol. The described organization is provided to facilitate the
1648 explanation of how the protocol behaves. This document does not
1649 mandate that implementations adhere to this model as long as their
1650 external behavior is consistent with that described in this document.
1651
1652 The Port-Preserving Symmetric NAT Extension extends the abstract data
1653 model in <a href="#section-5.2.1">Section 5.2.1</a> by adding the following additional fields.
1654
1655 Port-Preserving NAT flag: This is a Boolean value, set to TRUE if the
1656 Teredo client is positioned behind a port-preserving NAT.
1657
1658 Symmetric NAT flag: This is a Boolean value, set to TRUE if the
1659 Teredo client is positioned behind a symmetric NAT.
1660
1661 Peer Entry: The following fields need to be added on a per-peer
1662 basis:
1663
1664 o Random Port: This field contains the value of the external port
1665 that the Teredo client predicts that its NAT has assigned it for
1666 communication with the peer. Set to zero by default.
1667
1668 o Peer Random Port: This field contains the value of the random port
1669 that the peer is using for communication with this Teredo client.
1670 Set to zero by default.
1671
1672
1673
1674
1675
1676 <span class="grey">Thaler Standards Track [Page 30]</span></pre>
1677 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-31" ></span>
1678 <span class="grey"><a href="./rfc6081">RFC 6081</a> Teredo Extensions January 2011</span>
1679
1680
1681 o Direct Receive on Primary Port: This is a Boolean value, set to
1682 TRUE if a packet is received from the Teredo peer on the primary
1683 local port. Set to FALSE by default.
1684
1685 o Direct Receive on Random Port: This is a Boolean value, set to
1686 TRUE if a packet is received from the Teredo peer on the Random
1687 Port. Set to FALSE by default.
1688
1689 o Connection Refresh Count: This field contains the number of direct
1690 bubbles that have been sent to the peer since the last time data
1691 was sent to the peer.
1692
1693 o Last Data Packet Sent Timestamp: This field contains the timestamp
1694 of the last data packet sent to the peer. This timestamp is
1695 different from the field that stores the data and time of last
1696 transmission to the peer (as specified in <a href="./rfc4380#section-5.2">Section&nbsp;5.2 of
1697 [RFC4380]</a>) because the RFC-defined field is also updated every
1698 time a direct bubble is sent.
1699
1700 <span class="h4"><a class="selflink" id="section-5.4.2" href="#section-5.4.2">5.4.2</a>. Timers</span>
1701
1702 Other than those in [<a href="./rfc4380" title="&quot;Teredo: Tunneling IPv6 over UDP through Network Address Translations (NATs)&quot;">RFC4380</a>], the Port-Preserving Symmetric NAT
1703 Extension requires the following additional timer.
1704
1705 Peer Refresh Timer: A timer to refresh peer connections through the
1706 random port, on which no data has been sent for a while.
1707
1708 <span class="h5"><a class="selflink" id="section-5.4.2.1" href="#section-5.4.2.1">5.4.2.1</a>. Peer Refresh Timer Expiry</span>
1709
1710 When the Peer Refresh Timer expires, the Teredo client MUST go
1711 through its list of peers and for each peer to which the Teredo
1712 client is communicating through the random port, the Teredo client
1713 MUST check the Last Data Packet Sent Timestamp to determine if data
1714 has been sent to the peer in the last 30 seconds, and check the
1715 Connection Refresh Count field to determine if the count has reached
1716 the maximum allowed value of 20. If both checks are FALSE, the
1717 Teredo client MUST send a direct bubble (as specified in
1718 <a href="#section-5.4.4.3">Section 5.4.4.3</a>) to the peer and increment the Connection Refresh
1719 Count. This direct bubble is sent as an attempt to keep the port
1720 mappings on all the intermediate NATs alive while the application/
1721 user may be temporarily inactive. If on the other hand, data has
1722 been sent to the peer in the last 30 seconds, the Connection Refresh
1723 Count MUST be reset to zero.
1724
1725 The Peer Refresh Timer MUST then be rescheduled to expire in 30
1726 seconds.
1727
1728
1729
1730
1731
1732 <span class="grey">Thaler Standards Track [Page 31]</span></pre>
1733 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-32" ></span>
1734 <span class="grey"><a href="./rfc6081">RFC 6081</a> Teredo Extensions January 2011</span>
1735
1736
1737 <span class="h4"><a class="selflink" id="section-5.4.3" href="#section-5.4.3">5.4.3</a>. Initialization</span>
1738
1739 In addition to the behavior specified in [<a href="./rfc4380" title="&quot;Teredo: Tunneling IPv6 over UDP through Network Address Translations (NATs)&quot;">RFC4380</a>], the Port-
1740 Preserving NAT flag and Symmetric NAT flag MUST be set to FALSE when
1741 the Teredo client is started. The Peer Refresh Timer MUST be started
1742 and scheduled to expire in 30 seconds.
1743
1744 During the qualification procedure (as specified in <a href="./rfc4380#section-5.2.1">Section&nbsp;5.2.1 of
1745 [RFC4380]</a>), when the Teredo client receives a response from the
1746 Teredo server address, the Teredo client MUST compare the Port value
1747 in the origin indication, as specified in <a href="./rfc4380#section-5.1.1">Section&nbsp;5.1.1 of [RFC4380]</a>,
1748 with the Local Port value. If both values match, the client MUST set
1749 the Port-Preserving NAT flag to TRUE.
1750
1751 <span class="h4"><a class="selflink" id="section-5.4.4" href="#section-5.4.4">5.4.4</a>. Message Processing</span>
1752
1753 <span class="h5"><a class="selflink" id="section-5.4.4.1" href="#section-5.4.4.1">5.4.4.1</a>. Sending a Data Packet</span>
1754
1755 On receiving a data packet to be transmitted to the Teredo peer (in
1756 addition to the rules specified in <a href="./rfc4380#section-5.2.4">Section&nbsp;5.2.4 of [RFC4380]</a>), the
1757 Teredo client MUST update the Last Data Packet Sent Timestamp when
1758 the packet is actually sent.
1759
1760 <span class="h5"><a class="selflink" id="section-5.4.4.2" href="#section-5.4.4.2">5.4.4.2</a>. Sending an Indirect Bubble</span>
1761
1762 The rules for sending an indirect bubble are as specified in
1763 <a href="#section-5.2.4.1">Section 5.2.4.1</a> of this document and <a href="./rfc4380#section-5.2.6">Section&nbsp;5.2.6 of [RFC4380]</a>. In
1764 addition to those rules, if the Port-Preserving NAT flag is TRUE, the
1765 Teredo client MUST do the following:
1766
1767 o If the Symmetric NAT flag is set, the Teredo peer is not marked as
1768 "trusted" (as specified in <a href="./rfc4380#section-5.2">Section&nbsp;5.2 of [RFC4380]</a>), and the
1769 Random Port is zero, the Teredo client MUST first select a random
1770 port number to use, and then begin listening on that port. Since
1771 the NAT is port-preserving, the Teredo client can predict that the
1772 external port assigned will be equal to the random port chosen,
1773 and hence the Teredo client MUST store the random port chosen in
1774 the Random Port field of the Peer Entry.
1775
1776 o If the Random Port value is non-zero, the Teredo client MUST
1777 append a Random Port Trailer to the indirect bubble.
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788 <span class="grey">Thaler Standards Track [Page 32]</span></pre>
1789 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-33" ></span>
1790 <span class="grey"><a href="./rfc6081">RFC 6081</a> Teredo Extensions January 2011</span>
1791
1792
1793 <span class="h5"><a class="selflink" id="section-5.4.4.3" href="#section-5.4.4.3">5.4.4.3</a>. Sending a Direct Bubble</span>
1794
1795 The rules for when direct bubbles are sent to a Teredo peer are as
1796 specified in <a href="./rfc4380#section-5.2.6">Section&nbsp;5.2.6 of [RFC4380]</a>. In addition,
1797 <a href="#section-5.2.4.2">Section 5.2.4.2</a> defines rules for enabling communication for clients
1798 positioned behind a symmetric NAT. In addition to the rules defined
1799 in both the aforementioned sections, if the Port-Preserving NAT flag
1800 is TRUE, the following rules apply also.
1801
1802 If the Symmetric NAT flag is set, and the Teredo peer is not marked
1803 as "trusted" (as specified in <a href="./rfc4380#section-5.2">Section&nbsp;5.2 of [RFC4380]</a>) the Teredo
1804 client MUST send a direct bubble destined to the mapped address/port
1805 embedded in the Teredo IPv6 address of the Teredo peer. If the peer
1806 Random Port field is non-zero, the Teredo client MUST send another
1807 direct bubble from its own random port, destined to the peer random
1808 port. The IPv4 destination address MUST be the mapped address
1809 embedded in the Teredo IPv6 address. In addition, the Teredo client
1810 MUST include the Random Port Trailer (<a href="#section-4.5">Section 4.5</a>).
1811
1812 <span class="h5"><a class="selflink" id="section-5.4.4.4" href="#section-5.4.4.4">5.4.4.4</a>. Receiving an Indirect Bubble</span>
1813
1814 The rules for processing an indirect bubble are as specified in
1815 <a href="#section-5.2.4.3">Section 5.2.4.3</a> of this document and <a href="./rfc4380#section-5.2.3">Section&nbsp;5.2.3 of [RFC4380]</a>. In
1816 addition to these rules, if the incoming indirect bubble has a Random
1817 Port Trailer, the following additional processing MUST be done.
1818
1819 If the Peer Random Port field of the Peer Entry is zero, the Teredo
1820 client MUST store the port from the Random Port Trailer in the Peer
1821 Random Port field of the Peer Entry.
1822
1823 If the Peer Random Port field is non-zero and if either the Peer
1824 Random Port field and the new advertised port have the same value, or
1825 if active data has been exchanged between the two Teredo clients in
1826 the last 30 seconds (that is, "time of last transmission" or "time of
1827 last reception", as specified in <a href="./rfc4380#section-5.2">Section&nbsp;5.2 of [RFC4380]</a>, is set to
1828 a time that is less than 30 seconds ago), the new advertised port
1829 value MUST be ignored.
1830
1831 If the Peer Random Port field is non-zero and the new advertised port
1832 value is different from the Peer Random Port value, and it has been
1833 more than 30 seconds since the last exchange of data packets between
1834 the two Teredo clients, (that is, "time of last transmission" and
1835 "time of last reception" are set to a time that is more than 30
1836 seconds ago), the Teredo client SHOULD store the new advertised port
1837 value in the Peer Random Port field and, if the Port-Preserving NAT
1838 flag is TRUE, then clear the Random Port field, and stop listening on
1839 the old random port. This allows communication to be re-established
1840 if either side changes the random port that it is using.
1841
1842
1843
1844 <span class="grey">Thaler Standards Track [Page 33]</span></pre>
1845 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-34" ></span>
1846 <span class="grey"><a href="./rfc6081">RFC 6081</a> Teredo Extensions January 2011</span>
1847
1848
1849 <span class="h5"><a class="selflink" id="section-5.4.4.5" href="#section-5.4.4.5">5.4.4.5</a>. Receiving a Direct Bubble</span>
1850
1851 The rules for handling direct bubbles are specified in
1852 <a href="#section-5.2.4.4">Section 5.2.4.4</a> of this document and <a href="./rfc4380#section-5.2.3">Section&nbsp;5.2.3 of [RFC4380]</a>. The
1853 rules for whether to accept a direct bubble are extended as follows,
1854 when the Port-Preserving NAT flag is TRUE:
1855
1856 o If the direct bubble is received on the primary port and the
1857 Teredo peer is not "trusted", the status field of the Teredo
1858 client MUST be changed to "trusted" and the Direct Receive on
1859 Primary Port flag MUST be set to TRUE. The mapped address/port
1860 from which the direct bubble was received MUST be recorded in the
1861 mapped address/port fields of the Teredo peer, as specified in
1862 <a href="./rfc4380#section-5.2">Section&nbsp;5.2 of [RFC4380]</a>. The Teredo client MUST then set the
1863 Random Port field in the Peer Entry to zero and stop listening on
1864 the old random port.
1865
1866 o If the direct bubble is received on the primary port, the Teredo
1867 peer is "trusted", and the Direct Receive on Primary flag is set
1868 to TRUE, the Teredo client MUST compare the mapped address/port of
1869 the direct bubble with the mapped address/port of the Peer Entry.
1870 If both mappings are the same, the direct bubble MUST be accepted.
1871 If the mappings are different and it has been more than 30 seconds
1872 since the last packet exchange with the Teredo peer (that is,
1873 "time of last transmission" and "time of last reception", as
1874 defined in <a href="./rfc4380#section-5.2">Section&nbsp;5.2 of [RFC4380]</a>, are set to a time that is
1875 more than 30 seconds ago), the mapping on the Teredo peer's NAT
1876 has changed and communication needs to be re-established. This
1877 MUST be done by changing the status of the peer to "not-trusted",
1878 setting the Direct Receive on Primary Port flag to FALSE, and
1879 sending an indirect bubble to the Teredo peer via its Teredo
1880 server.
1881
1882 o If the direct bubble is received on the primary port, the Teredo
1883 peer is "trusted", the Direct Receive on Primary Port flag is set
1884 to FALSE, and the Direct Receive on Random Port flag is set to
1885 TRUE, the mapped address/port from which the direct bubble is
1886 received MUST be stored in the mapped address/port fields of the
1887 Peer Entry. The Direct Receive on Primary Port flag MUST be set
1888 to TRUE. The Teredo client MUST then set the Random Port field in
1889 the Peer Entry to zero and stop listening on the old random port.
1890 Finally, the Direct Receive on Random Port flag MUST be set to
1891 FALSE.
1892
1893
1894
1895
1896
1897
1898
1899
1900 <span class="grey">Thaler Standards Track [Page 34]</span></pre>
1901 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-35" ></span>
1902 <span class="grey"><a href="./rfc6081">RFC 6081</a> Teredo Extensions January 2011</span>
1903
1904
1905 o If the direct bubble is received on the random port and the Teredo
1906 peer is not "trusted", the status field of the Teredo client MUST
1907 be changed to "trusted" and the Direct Receive on Random Port flag
1908 MUST be set to TRUE. The mapped address/port from which the
1909 direct bubble was received MUST be recorded in the mapped address/
1910 port fields of the Teredo Peer Entry, as specified in <a href="./rfc4380#section-5.2">Section&nbsp;5.2
1911 of [RFC4380]</a>.
1912
1913 o If the direct bubble is received on the random port, the Teredo
1914 peer is "trusted", and the Direct Receive on Primary Port flag is
1915 FALSE, the Teredo client MUST compare the mapped address/port in
1916 the direct bubble with the mapped address/port in the Peer Entry.
1917 If the two mappings are the same, the direct bubble MUST be
1918 accepted. If the mappings are different, it implies that the NAT
1919 had deleted the mapping and when it reassigned the mapping, a
1920 different external port was chosen. In this instance, the Teredo
1921 client SHOULD set the Random Port field to zero, stop listening on
1922 the old random port, and send an indirect bubble to the Teredo
1923 peer as specified in <a href="#section-5.4.4.2">Section 5.4.4.2</a>.
1924
1925 Note that once the Direct Receive on Primary Port flag is TRUE, the
1926 client will stop listening on the random port and hence a direct
1927 bubble cannot be received on the random port. As a result, this case
1928 is intentionally omitted above.
1929
1930 <span class="h3"><a class="selflink" id="section-5.5" href="#section-5.5">5.5</a>. Sequential Port-Symmetric NAT Extension</span>
1931
1932 The Sequential Port-Symmetric NAT Extension is optional; an
1933 implementation SHOULD support it. This extension has the Symmetric
1934 NAT Support Extension (<a href="#section-5.2">Section 5.2</a>) as a dependency. Any node that
1935 implements this extension MUST also implement the Symmetric NAT
1936 Support Extension, as well as the Port-Preserving NAT Extension
1937 (<a href="#section-5.4">Section 5.4</a>).
1938
1939 <span class="h4"><a class="selflink" id="section-5.5.1" href="#section-5.5.1">5.5.1</a>. Abstract Data Model</span>
1940
1941 This section describes a conceptual model of possible data
1942 organization that an implementation maintains to participate in this
1943 protocol. The described organization is provided to facilitate the
1944 explanation of how the protocol behaves. This document does not
1945 mandate that implementations adhere to this model as long as their
1946 external behavior is consistent with that described in this document.
1947
1948 The Sequential Port-Symmetric NAT Extension extends the abstract data
1949 model in <a href="#section-5.4.1">Section 5.4.1</a> by adding the following additional state.
1950
1951
1952
1953
1954
1955
1956 <span class="grey">Thaler Standards Track [Page 35]</span></pre>
1957 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-36" ></span>
1958 <span class="grey"><a href="./rfc6081">RFC 6081</a> Teredo Extensions January 2011</span>
1959
1960
1961 Peer Entry: The following fields need to be added on a per-peer
1962 basis:
1963
1964 o EchoTestNonce1: The value of the nonce sent as part of the
1965 authentication encapsulation, as specified in <a href="./rfc4380#section-5.1.1">Section&nbsp;5.1.1 of
1966 [RFC4380]</a>, in the router solicitation packet sent to the Teredo
1967 server address as part of the Echo Test.
1968
1969 o EchoTestNonce2: The value of the nonce sent as part of the
1970 authentication encapsulation in the router solicitation packet
1971 sent to the secondary Teredo server address as part of the Echo
1972 Test.
1973
1974 o EchoTestLowerPort: The value of the external port mapping
1975 extracted from the origin indication of the router advertisement
1976 received from the Teredo server address as part of the Echo Test.
1977 A value of 0 indicates that no such router advertisement has been
1978 received.
1979
1980 o EchoTestUpperPort: The value of the external port mapping
1981 extracted from the origin indication of the router advertisement
1982 received from the secondary Teredo server address as part of the
1983 Echo Test. A value of 0 indicates that no such router
1984 advertisement has been received.
1985
1986 o EchoTestRetryCounter: The number of times an Echo Test has been
1987 attempted.
1988
1989 <span class="h4"><a class="selflink" id="section-5.5.2" href="#section-5.5.2">5.5.2</a>. Timers</span>
1990
1991 In addition to the timers specified in <a href="#section-5.4.2">Section 5.4.2</a>, the following
1992 additional timer is required per Peer Entry.
1993
1994 Echo Test Failover Timer: A one-shot timer that runs whenever an Echo
1995 Test is in progress.
1996
1997 <span class="h5"><a class="selflink" id="section-5.5.2.1" href="#section-5.5.2.1">5.5.2.1</a>. Peer Refresh Timer Expiry</span>
1998
1999 The processing of the Peer Refresh Timer Expiry MUST be completed as
2000 specified in <a href="#section-5.4.2.1">Section 5.4.2.1</a>. In addition to those rules, the Teredo
2001 client MUST set the EchoTestLowerPort, EchoTestUpperPort, and
2002 EchoTestRetryCounter to zero.
2003
2004 <span class="h5"><a class="selflink" id="section-5.5.2.2" href="#section-5.5.2.2">5.5.2.2</a>. Echo Test Failover Timer Expiry</span>
2005
2006 If the Echo Test Failover Timer expires, the Teredo client MUST do
2007 the following.
2008
2009
2010
2011
2012 <span class="grey">Thaler Standards Track [Page 36]</span></pre>
2013 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-37" ></span>
2014 <span class="grey"><a href="./rfc6081">RFC 6081</a> Teredo Extensions January 2011</span>
2015
2016
2017 If the value of the EchoTestRetryCounter is two, then the Teredo
2018 client MUST send an indirect bubble as specified in <a href="#section-5.2.4.1">Section 5.2.4.1</a>.
2019
2020 If the value of the EchoTestRetryCounter is one, then the Teredo
2021 client MUST start another Echo Test as specified in
2022 <a href="#section-5.5.4.1.1">Section 5.5.4.1.1</a>.
2023
2024 <span class="h4"><a class="selflink" id="section-5.5.3" href="#section-5.5.3">5.5.3</a>. Initialization</span>
2025
2026 No behavior changes are required beyond what is specified in
2027 <a href="#section-5.4.3">Section 5.4.3</a>.
2028
2029 <span class="h4"><a class="selflink" id="section-5.5.4" href="#section-5.5.4">5.5.4</a>. Message Processing</span>
2030
2031 Except as specified in the following sections, the rules for message
2032 processing are as specified in <a href="#section-5.4.4">Section 5.4.4</a>.
2033
2034 <span class="h5"><a class="selflink" id="section-5.5.4.1" href="#section-5.5.4.1">5.5.4.1</a>. Handling a Request to Send an Indirect Bubble</span>
2035
2036 Whenever [<a href="./rfc4380" title="&quot;Teredo: Tunneling IPv6 over UDP through Network Address Translations (NATs)&quot;">RFC4380</a>] or other extensions specified in this document
2037 specify that an indirect bubble is to be sent, the following actions
2038 apply at that time instead if the Symmetric NAT flag is TRUE and the
2039 Port-Preserving NAT flag is FALSE. Note that any behavior specified
2040 by [<a href="./rfc4380" title="&quot;Teredo: Tunneling IPv6 over UDP through Network Address Translations (NATs)&quot;">RFC4380</a>] or other extensions in this document still applies to
2041 how indirect bubbles are constructed, but such behavior is done at a
2042 later time as specified in <a href="#section-5.5.4.4">Section 5.5.4.4</a>.
2043
2044 If the Symmetric NAT flag is TRUE, and the Port-Preserving NAT flag
2045 is FALSE, and the Teredo peer is not marked as "trusted" (as
2046 specified in <a href="./rfc4380#section-5.2">Section&nbsp;5.2 of [RFC4380]</a>), and the Random Port is zero,
2047 then the Teredo client MUST select a random port number to use, begin
2048 listening on that port, and start an Echo Test as specified below.
2049
2050 <span class="h6"><a class="selflink" id="section-5.5.4.1.1" href="#section-5.5.4.1.1">5.5.4.1.1</a>. Starting an Echo Test</span>
2051
2052 To start an Echo Test, the Teredo client MUST send the following
2053 three packets from this port:
2054
2055 o First, a router solicitation (as specified in <a href="./rfc4380#section-5.2.1">Section&nbsp;5.2.1 of
2056 [RFC4380]</a>) MUST be sent to the Teredo server address. The router
2057 solicitation MUST include an authentication encapsulation with a
2058 randomly generated Nonce field, as specified in <a href="./rfc4380#section-5.1.1">Section&nbsp;5.1.1 of
2059 [RFC4380]</a>. The nonce included in the authentication encapsulation
2060 MUST then be stored in the EchoTestNonce1 field of the Peer Entry.
2061
2062 o Second, a direct bubble MUST be sent to the peer.
2063
2064
2065
2066
2067
2068 <span class="grey">Thaler Standards Track [Page 37]</span></pre>
2069 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-38" ></span>
2070 <span class="grey"><a href="./rfc6081">RFC 6081</a> Teredo Extensions January 2011</span>
2071
2072
2073 o Third, a router solicitation MUST be sent to the secondary Teredo
2074 server address. The router solicitation MUST include an
2075 authentication encapsulation with a randomly generated Nonce
2076 field, as specified in <a href="./rfc4380#section-5.1.1">Section&nbsp;5.1.1 of [RFC4380]</a>. The nonce
2077 included in the authentication encapsulation MUST then be stored
2078 in the EchoTestNonce2 field of the Peer Entry.
2079
2080 The Teredo client MUST then increment the EchoTestRetryCounter and
2081 set the Echo Test Failover Timer to expire in a number of seconds
2082 equal to EchoTestRetryCounter.
2083
2084 <span class="h5"><a class="selflink" id="section-5.5.4.2" href="#section-5.5.4.2">5.5.4.2</a>. Sending an Indirect Bubble</span>
2085
2086 The rules for sending an indirect bubble are as specified in
2087 <a href="#section-5.2.4.1">Section 5.2.4.1</a> of this document and <a href="./rfc4380#section-5.2.6">Section&nbsp;5.2.6 of [RFC4380]</a>. In
2088 addition to those rules, if the Symmetric NAT flag is TRUE, and the
2089 Port-Preserving NAT flag is FALSE, and the Random Port value is non-
2090 zero, then the Teredo client MUST append a Random Port Trailer to the
2091 indirect bubble.
2092
2093 <span class="h5"><a class="selflink" id="section-5.5.4.3" href="#section-5.5.4.3">5.5.4.3</a>. Receiving a Direct Bubble</span>
2094
2095 The processing of the direct bubble MUST be completed as specified in
2096 <a href="#section-5.4.4.5">Section 5.4.4.5</a>, as if the Port-Preserving NAT flag were TRUE. After
2097 the processing is complete, if the Direct Bubble Received on Primary
2098 flag is TRUE, and the Echo Test Failover Timer is running, then the
2099 Echo Test Failover Timer MUST be canceled and EchoTestLowerPort,
2100 EchoTestUpperPort, and EchoTestRetryCounter MUST be set to zero.
2101
2102 <span class="h5"><a class="selflink" id="section-5.5.4.4" href="#section-5.5.4.4">5.5.4.4</a>. Receiving a Router Advertisement</span>
2103
2104 The rules for processing a router advertisement are as specified in
2105 <a href="./rfc4380#section-5.2.1">Section&nbsp;5.2.1 of [RFC4380]</a>. In addition to those rules, if the
2106 router advertisement contains an authentication encapsulation, the
2107 Teredo client MUST look for a Peer Entry whose EchoTestNonce1 or
2108 EchoTestNonce2 field matches the nonce in the authentication
2109 encapsulation. If a Peer Entry is found, the Teredo client MUST do
2110 the following.
2111
2112 If the received nonce is equal to EchoTestNonce1 and
2113 EchoTestLowerPort is zero, then EchoTestLowerPort MUST be set to the
2114 external port mapping extracted from the origin indication of this
2115 router advertisement.
2116
2117 If the received nonce is equal to EchoTestNonce2 and
2118 EchoTestUpperPort is zero, then EchoTestUpperPort MUST be set to the
2119 external port mapping extracted from the origin indication of this
2120 router advertisement.
2121
2122
2123
2124 <span class="grey">Thaler Standards Track [Page 38]</span></pre>
2125 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-39" ></span>
2126 <span class="grey"><a href="./rfc6081">RFC 6081</a> Teredo Extensions January 2011</span>
2127
2128
2129 If the EchoTestUpperPort and EchoTestLowerPort are now both non-zero,
2130 the Teredo client MUST then set the Random Port field of the Peer
2131 Entry to (EchoTestUpperPort + EchoTestUpperPort)/2, rounded down, and
2132 send an indirect bubble as specified in <a href="#section-5.5.4.2">Section 5.5.4.2</a>.
2133
2134 <span class="h3"><a class="selflink" id="section-5.6" href="#section-5.6">5.6</a>. Hairpinning Extension</span>
2135
2136 This extension is optional; an implementation SHOULD support it.
2137
2138 <span class="h4"><a class="selflink" id="section-5.6.1" href="#section-5.6.1">5.6.1</a>. Abstract Data Model</span>
2139
2140 This section describes a conceptual model of possible data
2141 organization that an implementation maintains to participate in this
2142 protocol. The described organization is provided to facilitate the
2143 explanation of how the protocol behaves. This document does not
2144 mandate that implementations adhere to this model as long as their
2145 external behavior is consistent with that described in this document.
2146
2147 In addition to the state specified in <a href="./rfc4380#section-5.2">Section&nbsp;5.2 of [RFC4380]</a>, the
2148 following are also required:
2149
2150 UPnP Mapped Address/Port: The mapped address/port assigned via UPnP
2151 to the Teredo client by the UPnP-enabled NAT behind which the Teredo
2152 client is positioned. This field has a valid value only if the NAT
2153 to which the Teredo client is connected is UPnP enabled. In
2154 addition, if the Teredo client is positioned behind a single NAT only
2155 (as opposed to a series of nested NATs), this value will be the same
2156 as the mapped address/port embedded in its Teredo IPv6 address.
2157
2158 Peer Entry: Per-peer state is extended beyond what is described in
2159 [<a href="./rfc4380" title="&quot;Teredo: Tunneling IPv6 over UDP through Network Address Translations (NATs)&quot;">RFC4380</a>] by including the following:
2160
2161 o Alternate Address/Port list: The list of alternate address/port
2162 pairs advertised by the peer.
2163
2164 <span class="h4"><a class="selflink" id="section-5.6.2" href="#section-5.6.2">5.6.2</a>. Timers</span>
2165
2166 No timers are necessary other than those in [<a href="./rfc4380" title="&quot;Teredo: Tunneling IPv6 over UDP through Network Address Translations (NATs)&quot;">RFC4380</a>].
2167
2168 <span class="h4"><a class="selflink" id="section-5.6.3" href="#section-5.6.3">5.6.3</a>. Initialization</span>
2169
2170 Behavior is as specified in [<a href="./rfc4380" title="&quot;Teredo: Tunneling IPv6 over UDP through Network Address Translations (NATs)&quot;">RFC4380</a>], with the following additions.
2171
2172 Prior to beginning the qualification procedure, the Teredo client
2173 MUST invoke the AddPortMapping function (as specified in <a href="#section-2.4.16">Section</a>
2174 <a href="#section-2.4.16">2.4.16</a> of [<a href="#ref-UPNPWANIP" title="&quot;WANIPConnection:1&quot;">UPNPWANIP</a>]) with the parameters specified in
2175 <a href="#section-5.3.3">Section 5.3.3</a>. If successful, it indicates that the NAT has created
2176 a port mapping from the external port of the NAT to the internal port
2177
2178
2179
2180 <span class="grey">Thaler Standards Track [Page 39]</span></pre>
2181 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-40" ></span>
2182 <span class="grey"><a href="./rfc6081">RFC 6081</a> Teredo Extensions January 2011</span>
2183
2184
2185 of the Teredo client node. If the AddPortMapping function is
2186 successful, the Teredo client MUST store the mapping assigned by the
2187 NAT in its UPnP Mapped Address/Port state.
2188
2189 After the qualification procedure, the mapped address/port learned
2190 from the Teredo server MUST be compared to the UPnP Mapped Address/
2191 Port. If both are the same, the Teredo client is positioned behind a
2192 single NAT and the UPnP Mapped Address/Port MUST be zeroed out.
2193
2194 <span class="h4"><a class="selflink" id="section-5.6.4" href="#section-5.6.4">5.6.4</a>. Message Processing</span>
2195
2196 <span class="h5"><a class="selflink" id="section-5.6.4.1" href="#section-5.6.4.1">5.6.4.1</a>. Sending an Indirect Bubble</span>
2197
2198 The rules for when indirect bubbles are sent to a Teredo peer are as
2199 specified in <a href="./rfc4380#section-5.2.6">Section&nbsp;5.2.6 of [RFC4380]</a>. If communication between a
2200 Teredo client and a Teredo peer has not been established, the Teredo
2201 client MUST include the Alternate Address Trailer in the indirect
2202 bubble. The Alternate Address Trailer MUST include the node's local
2203 address/port in the Alternate Address/Port list. If the UPnP Mapped
2204 Address/Port is non-zero, the Alternate Address Trailer MUST also
2205 include it in the list.
2206
2207 Hairpinning requires "direct IPv6 connectivity tests" (as specified
2208 in <a href="./rfc4380#section-5.2.9">Section&nbsp;5.2.9 of [RFC4380]</a>) to succeed before it can accept
2209 packets from an IPv4 address and port not embedded in the Teredo IPv6
2210 address. Hence, the indirect bubble MUST also include a Nonce
2211 Trailer.
2212
2213 <span class="h5"><a class="selflink" id="section-5.6.4.2" href="#section-5.6.4.2">5.6.4.2</a>. Receiving an Indirect Bubble</span>
2214
2215 The rules for processing indirect bubbles are as specified in <a href="./rfc4380#section-5.2.3">Section</a>
2216 <a href="./rfc4380#section-5.2.3">5.2.3 of [RFC4380]</a>. In addition to those rules, when a Teredo client
2217 receives an indirect bubble with the Alternate Address Trailer, it
2218 SHOULD first verify that the Alternate Address Trailer is correctly
2219 formed (as specified in <a href="#section-4.3">Section 4.3</a>), and drop the bubble if not.
2220 Otherwise, it MUST set the Alternate Address/Port list in its Peer
2221 Entry to the list in the trailer. The Teredo client, besides sending
2222 direct bubbles to the mapped address/port embedded in the Teredo IPv6
2223 address (as specified in <a href="./rfc4380#section-5.2.6">Section&nbsp;5.2.6 of [RFC4380]</a>), MUST also send
2224 a direct bubble to each mapped address/port advertised in the
2225 Alternate Address Trailer.
2226
2227 In each of the direct bubbles, the Teredo client MUST include a Nonce
2228 Trailer with the nonce value received in the indirect bubble.
2229
2230
2231
2232
2233
2234
2235
2236 <span class="grey">Thaler Standards Track [Page 40]</span></pre>
2237 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-41" ></span>
2238 <span class="grey"><a href="./rfc6081">RFC 6081</a> Teredo Extensions January 2011</span>
2239
2240
2241 <span class="h5"><a class="selflink" id="section-5.6.4.3" href="#section-5.6.4.3">5.6.4.3</a>. Receiving a Direct Bubble</span>
2242
2243 If the mapped address/port of the direct bubble matches the mapped
2244 address/port embedded in the source Teredo IPv6 address, the direct
2245 bubble MUST be accepted, as specified in <a href="./rfc4380#section-5.2.3">Section&nbsp;5.2.3 of [RFC4380]</a>.
2246
2247 If the mapped address/port does not match the embedded address/port,
2248 but the direct bubble contains a Nonce Trailer with a nonce that
2249 matches the Nonce Sent field of the Teredo peer, the direct bubble
2250 MUST be accepted.
2251
2252 If neither of the above rules match, the direct bubble MUST be
2253 dropped.
2254
2255 <span class="h3"><a class="selflink" id="section-5.7" href="#section-5.7">5.7</a>. Server Load Reduction Extension</span>
2256
2257 This extension is optional; an implementation SHOULD support it.
2258
2259 <span class="h4"><a class="selflink" id="section-5.7.1" href="#section-5.7.1">5.7.1</a>. Abstract Data Model</span>
2260
2261 This section describes a conceptual model of possible data
2262 organization that an implementation maintains to participate in this
2263 protocol. The described organization is provided to facilitate the
2264 explanation of how the protocol behaves. This document does not
2265 mandate that implementations adhere to this model as long as their
2266 external behavior is consistent with that described in this document.
2267
2268 In addition to the state specified in <a href="./rfc4380#section-5.2">Section&nbsp;5.2 of [RFC4380]</a>, the
2269 following are also required.
2270
2271 Peer Entry: The following state needs to be added on a per-peer
2272 basis:
2273
2274 o Count of Solicitations Transmitted: The number of Solicitation
2275 packets sent.
2276
2277 <span class="h4"><a class="selflink" id="section-5.7.2" href="#section-5.7.2">5.7.2</a>. Timers</span>
2278
2279 Retransmission Timer: A timer used to retransmit Teredo Neighbor
2280 Solicitation packets.
2281
2282 When the retransmission timer expires, the Teredo client MUST
2283 retransmit a direct bubble with a Neighbor Discovery Option Trailer,
2284 and increment the Count of Solicitations Transmitted. If the count
2285 is less than three, it MUST then reset the timer to expire in two
2286 seconds. Otherwise (if the count is now three), it MUST send an
2287
2288
2289
2290
2291
2292 <span class="grey">Thaler Standards Track [Page 41]</span></pre>
2293 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-42" ></span>
2294 <span class="grey"><a href="./rfc6081">RFC 6081</a> Teredo Extensions January 2011</span>
2295
2296
2297 indirect bubble to the Teredo peer to re-establish connectivity as if
2298 no communication between the Teredo client and the Teredo peer had
2299 been established.
2300
2301 <span class="h4"><a class="selflink" id="section-5.7.3" href="#section-5.7.3">5.7.3</a>. Initialization</span>
2302
2303 No initialization is necessary other than that specified in
2304 [<a href="./rfc4380" title="&quot;Teredo: Tunneling IPv6 over UDP through Network Address Translations (NATs)&quot;">RFC4380</a>].
2305
2306 <span class="h4"><a class="selflink" id="section-5.7.4" href="#section-5.7.4">5.7.4</a>. Message Processing</span>
2307
2308 Except as specified below, processing is the same as specified in
2309 [<a href="./rfc4380" title="&quot;Teredo: Tunneling IPv6 over UDP through Network Address Translations (NATs)&quot;">RFC4380</a>].
2310
2311 <span class="h5"><a class="selflink" id="section-5.7.4.1" href="#section-5.7.4.1">5.7.4.1</a>. Sending a Data Packet</span>
2312
2313 Upon receiving a data packet to be transmitted to the Teredo peer,
2314 the Teredo client MUST determine whether data has been exchanged
2315 between the Teredo client and peer in either direction in the last 30
2316 seconds (using the state as specified in <a href="./rfc4380#section-5.2">Section&nbsp;5.2 of [RFC4380]</a>).
2317 If not, the Teredo client MUST send a direct bubble with a Neighbor
2318 Discovery Option Trailer having the DiscoveryType field set to
2319 TeredoDiscoverySolicitation. The Count of Solicitations Transmitted
2320 field MUST be set to 1. The retransmission timer MUST be set to
2321 expire in two seconds.
2322
2323 <span class="h5"><a class="selflink" id="section-5.7.4.2" href="#section-5.7.4.2">5.7.4.2</a>. Receiving a Direct Bubble</span>
2324
2325 The rules for processing direct bubbles are as specified in <a href="./rfc4380#section-5.2.3">Section</a>
2326 <a href="./rfc4380#section-5.2.3">5.2.3 of [RFC4380]</a>. In addition to those rules, upon receiving a
2327 direct bubble containing a Neighbor Discovery Option Trailer with
2328 DiscoveryType field set to TeredoDiscoverySolicitation, the Teredo
2329 client MUST respond with a direct bubble with the Neighbor Discovery
2330 Option Trailer having the DiscoveryType field set to
2331 TeredoDiscoveryAdvertisement.
2332
2333 <span class="h2"><a class="selflink" id="section-6" href="#section-6">6</a>. Protocol Examples</span>
2334
2335 The following sections describe several operations as used in common
2336 scenarios to illustrate the function of Teredo Extensions.
2337
2338 <span class="h3"><a class="selflink" id="section-6.1" href="#section-6.1">6.1</a>. Symmetric NAT Support Extension</span>
2339
2340 The following protocol example illustrates the use of the Symmetric
2341 NAT Support Extension.
2342
2343
2344
2345
2346
2347
2348 <span class="grey">Thaler Standards Track [Page 42]</span></pre>
2349 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-43" ></span>
2350 <span class="grey"><a href="./rfc6081">RFC 6081</a> Teredo Extensions January 2011</span>
2351
2352
2353 In Figure 2 (<a href="#section-3.1">Section 3.1</a>), assume that Teredo Client A, which is
2354 positioned behind a port-symmetric NAT, wants to communicate with
2355 Teredo Client B, which is positioned behind an address-restricted
2356 NAT.
2357
2358 The qualification procedure where the Teredo client determines that
2359 it is positioned behind a symmetric NAT is exactly the same as that
2360 specified in <a href="./rfc4380#section-5.2.1">Section&nbsp;5.2.1 of [RFC4380]</a>. Because of the Symmetric
2361 NAT Extension, Client A continues to configure a Teredo IPv6 address
2362 even after determining that the Teredo client is positioned behind a
2363 symmetric NAT.
2364
2365 Next the following packet exchange helps Teredo Client A (A)
2366 establish communication with Teredo Client B (B).
2367
2368 Teredo Client A's Client B's Teredo
2369 Client Teredo Teredo Client
2370 A NAT Server Server NAT B
2371 | | | | | |
2372 | | | Direct Bubble to B | | |
2373 1 |---------------------------------------------------&gt;| |
2374 | | | | | |
2375 |Indirect Bubble to B via B's Teredo Server| | |
2376 2 |-----------------------------------------&gt;|-----------------&gt;|
2377 | | | | | |
2378 | | | Direct Bubble to A | | |
2379 | |&lt;--------------------------------------------------| 3
2380 | | | | | |
2381 | | |Indirect Bubble to A via A's Teredo Server|
2382 |&lt;-----------------|&lt;-----------------------------------------| 4
2383 | | | | | |
2384 | | | Direct Bubble to B | | |
2385 5 |------------------------------------------------------------&gt;|
2386 | | | | | |
2387 |Indirect Bubble to B via B's Teredo Server| | |
2388 6 |-----------------------------------------&gt;|-----------------&gt;|
2389 | | | | | |
2390 | | | Direct Bubble to A | | |
2391 |&lt;------------------------------------------------------------| 7
2392 | | | | | |
2393
2394 Port-Symmetric NAT to Address-Restricted NAT Packet
2395 Exchange
2396
2397
2398
2399
2400
2401
2402
2403
2404 <span class="grey">Thaler Standards Track [Page 43]</span></pre>
2405 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-44" ></span>
2406 <span class="grey"><a href="./rfc6081">RFC 6081</a> Teredo Extensions January 2011</span>
2407
2408
2409 1. A sends a direct bubble (Packet 1) destined to the mapped
2410 address/port embedded in B's Teredo IPv6 address. The mapped
2411 port in the source field of the packet assigned by Client A's
2412 NAT is different from the mapped port embedded in A's Teredo
2413 IPv6 address. This is characteristic of the port-symmetric NAT
2414 positioned in front of A. The mapped address in the source
2415 field of the packet is the same as the mapped address embedded
2416 in the Teredo IPv6 address of A.
2417
2418 2. The aforementioned direct bubble is dropped by B's NAT because
2419 it has not seen an outgoing packet destined to A's mapped IPv4
2420 address.
2421
2422 3. A sends an indirect bubble (Packet 2) destined to B via Client
2423 B's Teredo server.
2424
2425 4. The above-mentioned indirect bubble is received by B. B then
2426 responds with the following packets. The first packet sent by B
2427 is a direct bubble (Packet 3) destined to the mapped address/
2428 port embedded in A's Teredo IPv6 address.
2429
2430 5. The above-mentioned direct bubble is dropped by A's NAT because
2431 the NAT has not seen any outgoing packet sourced from the mapped
2432 address/port embedded in A's Teredo IPv6 address and destined to
2433 the mapped address/port embedded in B's Teredo IPv6 address.
2434
2435 6. B also sends an indirect bubble (Packet 4) destined to A via A's
2436 Teredo Server.
2437
2438 7. The aforementioned indirect bubble is successfully received by
2439 A. A responds to the indirect bubble with its own direct bubble
2440 (Packet 5). This direct bubble is exactly the same as the first
2441 direct bubble (Packet 1) sent by A.
2442
2443 8. This time around the aforementioned direct bubble is accepted by
2444 B's NAT because the NAT has seen an outgoing packet (Packet 3)
2445 sourced from the mapped address/port embedded in B's Teredo IPv6
2446 address and destined to the mapped address/port embedded in A's
2447 Teredo IPv6 address. It is important to remember that A's NAT
2448 is port-symmetric and therefore varies only the mapped port
2449 while the mapped address remains the same. B's NAT is address-
2450 restricted and cares only about prior communication with the
2451 IPv4 address, not the specific port. At this point,
2452 communication in one direction is now possible (B to A, but not
2453 vice versa).
2454
2455
2456
2457
2458
2459
2460 <span class="grey">Thaler Standards Track [Page 44]</span></pre>
2461 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-45" ></span>
2462 <span class="grey"><a href="./rfc6081">RFC 6081</a> Teredo Extensions January 2011</span>
2463
2464
2465 9. After receiving the direct bubble, B remembers the new mapped
2466 address/port that was in the source fields of the direct bubble
2467 and uses those for future communication with A instead of the
2468 mapped address/port embedded in A's Teredo IPv6 address.
2469
2470 10. A then times out and resends an indirect bubble (Packet 6) and
2471 in response, B sends a direct bubble (Packet 7). This direct
2472 bubble is destined to the new learned mapped address/port and
2473 hence A's NAT permits the direct bubble through. Communication
2474 is now possible in the other direction (client A to B).
2475
2476 <span class="h3"><a class="selflink" id="section-6.2" href="#section-6.2">6.2</a>. UPnP-Enabled Symmetric NAT Extension</span>
2477
2478 The following protocol example illustrates the use of the UPnP-
2479 Enabled Symmetric NAT Extension in addition to the Symmetric NAT
2480 Support Extension.
2481
2482 Assume that Teredo Client A, which is positioned behind a UPnP-
2483 enabled port-symmetric NAT, wants to communicate with Teredo Client
2484 B, which is also positioned behind a UPnP-Enabled port-symmetric NAT.
2485
2486 Before both clients start their qualification procedure, they use
2487 UPnP to reserve port mappings on their respective NATs. The UPnP
2488 operations succeed for both the clients and the clients hence know
2489 that they are positioned behind UPnP-enabled NATs. After the
2490 qualification procedure, both clients have valid Teredo IPv6
2491 addresses because they both support the Symmetric NAT Support
2492 Extension. Also, after the qualification procedure both clients will
2493 compare their mapped address/port determined through UPnP with the
2494 mapped address/port determined through the qualification procedure.
2495 Because both will be the same, the clients will zero out their UPnP
2496 mapped address/port values and conclude that they are each located
2497 behind a single UPnP-enabled NAT.
2498
2499 The following packet exchange shows Teredo client A (A) establishing
2500 communication with Teredo client B (B).
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516 <span class="grey">Thaler Standards Track [Page 45]</span></pre>
2517 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-46" ></span>
2518 <span class="grey"><a href="./rfc6081">RFC 6081</a> Teredo Extensions January 2011</span>
2519
2520
2521 Teredo Client A's Client B's Teredo
2522 Client Teredo Teredo Client
2523 A NAT Server Server NAT B
2524 | | | | | |
2525 | | | Direct Bubble to B | | |
2526 1 |------------------------------------------------------------&gt;|
2527 | | | | | |
2528 |Indirect Bubble to B via B's Teredo Server| | |
2529 2 |-----------------------------------------&gt;|-----------------&gt;|
2530 | | | | | |
2531 | | | Direct Bubble to A | | |
2532 |&lt;------------------------------------------------------------| 3
2533 | | | | | |
2534
2535 UPnP-enabled Symmetric NAT Packet Exchange
2536
2537 1. A sends a direct bubble (Packet 1) to the mapped address/port
2538 embedded in B's Teredo IPv6 address. Because A's NAT is a
2539 symmetric NAT, the UDP source port field in the packet assigned
2540 by A's NAT is different from the mapped port embedded in A's
2541 Teredo IPv6 address, but the IPv4 source address of the packet is
2542 the same as the mapped address embedded in A's Teredo IPv6
2543 address.
2544
2545 2. The above-mentioned direct bubble is received by B because it is
2546 destined for the UPnP mapped address/port of B and hence is let
2547 through by the NAT. At this point, B deduces that A is
2548 positioned behind a symmetric NAT because the mapped address/port
2549 from which the direct bubble is received is different from the
2550 mapped address/port that is embedded in A's Teredo IPv6 address.
2551 Hence, it remembers that the peer is positioned behind a
2552 symmetric NAT so that data packets will be sent to the mapped
2553 address/port embedded in A's Teredo IPv6 address, rather than the
2554 mapped address/port from which the direct bubble was received.
2555 At this point, communication in one direction is now possible (B
2556 to A, but not vice versa).
2557
2558 3. A also sends an indirect bubble (Packet 2) destined to B via B's
2559 Teredo Server.
2560
2561 4. The above indirect bubble is received by B. B then responds with
2562 a direct bubble (Packet 3) destined to the mapped address/port
2563 embedded in A's Teredo IPv6 address, as in step 2.
2564
2565 5. Because A's NAT is also UPnP enabled, the above-mentioned direct
2566 bubble is received by A. A also notices that B is positioned
2567 behind a Symmetric NAT because the mapped address/port from which
2568 the packet is received is different from the mapped address/port
2569
2570
2571
2572 <span class="grey">Thaler Standards Track [Page 46]</span></pre>
2573 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-47" ></span>
2574 <span class="grey"><a href="./rfc6081">RFC 6081</a> Teredo Extensions January 2011</span>
2575
2576
2577 embedded in B's Teredo IPv6 address. Hence, it remembers that
2578 the peer is positioned behind a symmetric NAT so that data
2579 packets will be sent to the mapped address/port embedded in B's
2580 Teredo IPv6 address, rather than the mapped address/port from
2581 which the direct bubble was received. At this point,
2582 communication is now possible in the other direction (A to B).
2583
2584 <span class="h3"><a class="selflink" id="section-6.3" href="#section-6.3">6.3</a>. Port-Preserving Symmetric NAT Extension</span>
2585
2586 The following protocol example illustrates the use of the Port-
2587 Preserving Symmetric NAT Extension.
2588
2589 Assume that Teredo Client A (A), which is positioned behind a port-
2590 preserving symmetric NAT, wants to communicate with Teredo Client B
2591 (B), which is also positioned behind a port-preserving symmetric NAT.
2592
2593 The following packet exchange explains the configuration setup and
2594 communication setup between the two clients.
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628 <span class="grey">Thaler Standards Track [Page 47]</span></pre>
2629 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-48" ></span>
2630 <span class="grey"><a href="./rfc6081">RFC 6081</a> Teredo Extensions January 2011</span>
2631
2632
2633 Teredo Client A's Client B's Teredo
2634 Client Teredo Teredo Client
2635 A NAT Server Server NAT B
2636 | | | | | |
2637 | | | Direct Bubble to B | | |
2638 1 |---------------------------------------------------&gt;| |
2639 | | | | | |
2640 |Indirect Bubble to B via B's Teredo Server| | |
2641 2 |-----------------------------------------&gt;|-----------------&gt;|
2642 | | | | | |
2643 | | | Direct Bubble to A | | |
2644 | |&lt;--------------------------------------------------| 3
2645 | | | | | |
2646 | | | Direct Bubble to A | | |
2647 | |&lt;--------------------------------------------------| 4
2648 | | | | | |
2649 | | |Indirect Bubble to A via A's Teredo Server|
2650 |&lt;-----------------|&lt;-----------------------------------------| 5
2651 | | | | | |
2652 | | | Direct Bubble to B | | |
2653 6 |---------------------------------------------------&gt;| |
2654 | | | | | |
2655 | | | Direct Bubble to B | | |
2656 7 |------------------------------------------------------------&gt;|
2657 | | | | | |
2658 |Indirect Bubble to B via B's Teredo Server| | |
2659 8 |-----------------------------------------&gt;|-----------------&gt;|
2660 | | | | | |
2661 | | | Direct Bubble to A | | |
2662 |&lt;------------------------------------------------------------| 9
2663 | | | | | |
2664
2665 Port-Preserving Symmetric NAT Packet Exchange
2666
2667 1. During the qualification procedure, when the clients receive a
2668 response from the Teredo server, they compare the Port value in
2669 the Origin indication with the Local Port value. If both values
2670 match, the clients set the Port-Preserving NAT flag to TRUE.
2671
2672 2. When the response is received from the secondary Teredo server,
2673 the mapped address/port value in the Origin indication is
2674 compared with the mapped address/port value learned from the
2675 response received from the primary server. If the mappings are
2676 different, the Symmetric NAT flag is set to TRUE.
2677
2678 3. It is assumed that for both Clients A and B, the Port-Preserving
2679 NAT flag and the Symmetric NAT flag are set to TRUE at the end
2680 of the qualification procedure.
2681
2682
2683
2684 <span class="grey">Thaler Standards Track [Page 48]</span></pre>
2685 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-49" ></span>
2686 <span class="grey"><a href="./rfc6081">RFC 6081</a> Teredo Extensions January 2011</span>
2687
2688
2689 4. Before A sends packets to B, A checks to see if it is positioned
2690 behind a port-preserving NAT and a symmetric NAT, which in the
2691 example, it is. A also checks to see if the peer is "trusted",
2692 but it currently is not. Next, A checks if the Random Port is
2693 set to non-zero. Since it is still zero, A allocates a new
2694 random port, begins listening on it, and stores the value in the
2695 Random Port field.
2696
2697 5. A sends a direct bubble (Packet 1) from the primary port to the
2698 mapped address/port embedded in B's Teredo IPv6 address. This
2699 direct bubble does not have a Nonce Trailer or a Random Port
2700 Trailer attached to the end.
2701
2702 6. The aforementioned direct bubble is dropped by B's NAT because
2703 the NAT has not seen an outgoing packet destined to A's mapped
2704 address.
2705
2706 7. A sends an indirect bubble (Packet 2) destined to B via client
2707 B's Teredo server. This indirect bubble contains two trailers:
2708 the Nonce Trailer containing a random nonce, and the Random Port
2709 Trailer containing the random port value from the Peer Entry.
2710 The nonce used in the Nonce Trailer is also stored in the Nonce
2711 Sent field of the Peer Entry.
2712
2713 8. The aforementioned indirect bubble is received by B. B adds the
2714 Teredo peer to its peer list. B saves the nonce value from the
2715 Nonce Trailer in the Nonce Advertised field of the Peer Entry.
2716 B stores the port value from the Random Port Trailer in the Peer
2717 Random Port field in the Peer Entry.
2718
2719 9. B responds by sending the following packets. The first packet
2720 sent by B is a direct bubble (Packet 3) destined to the mapped
2721 address/port embedded in A's Teredo IPv6 address. This packet
2722 is sent from the primary port. It includes the Nonce Trailer
2723 with the nonce from the Nonce Advertised field of the Peer
2724 Entry.
2725
2726 10. The aforementioned direct bubble is dropped by A's NAT because
2727 the NAT has not seen any outgoing packet sourced from the mapped
2728 address/port embedded in A's Teredo IPv6 address and destined to
2729 the mapped address/port embedded in B's Teredo IPv6 address.
2730
2731 11. B then checks if it is positioned behind a port-restricted NAT
2732 or a symmetric NAT. It also checks if the peer has already
2733 advertised a random port. In this case, B is positioned behind
2734 a port-preserving symmetric NAT and the peer has advertised a
2735 random port; hence, it needs to use a random port. It checks if
2736 its Random Port field is set to non-zero. Since it is still
2737
2738
2739
2740 <span class="grey">Thaler Standards Track [Page 49]</span></pre>
2741 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-50" ></span>
2742 <span class="grey"><a href="./rfc6081">RFC 6081</a> Teredo Extensions January 2011</span>
2743
2744
2745 zero, B allocates a new random port, begins listening on it, and
2746 stores it in the Random Port entry of the Peer Entry. B then
2747 sends a direct bubble (Packet 4) destined to the mapped address
2748 embedded in A's Teredo IPv6 address and the port stored in the
2749 Peer Random Port field of the Peer Entry. The direct bubble is
2750 sent from its own random port.
2751
2752 12. The above direct bubble is dropped by A's NAT because the NAT
2753 has not seen any outgoing packet sourced from the mapped address
2754 embedded in A's Teredo IPv6 address and random port advertised
2755 by A.
2756
2757 13. B also sends an indirect bubble (Packet 5) destined to A via A's
2758 Teredo Server. This indirect bubble includes a Nonce Trailer
2759 and a Random Port Trailer. The Nonce Trailer includes a new
2760 randomly generated nonce that is also stored in the Nonce Sent
2761 field of the Peer Entry. The Random Port Trailer includes the
2762 value in the Random Port field of the Peer Entry.
2763
2764 14. The aforementioned indirect bubble is successfully received by
2765 A. A parses the trailers and stores the nonce contained in the
2766 Nonce Trailer in the Nonce Received field of the Peer Entry. A
2767 stores the port advertised in the Random Port Trailer in the
2768 Random Port field of the Peer Entry.
2769
2770 15. A responds with the following packets in response to the
2771 indirect bubble received. The first packet is a direct bubble
2772 (Packet 6) sent from the primary port and is destined to the
2773 mapped address/port embedded in B's Teredo IPv6 address.
2774
2775 16. The aforementioned direct bubble again is dropped by B's NAT
2776 because the NAT has not seen an outgoing packet with the same
2777 4-tuple as the incoming packet.
2778
2779 17. The next packet is also a direct bubble (Packet 7) and this one
2780 is sent from A's random port. The packet is destined to the
2781 mapped address embedded in B's Teredo IPv6 address and the Peer
2782 Random Port stored in the Peer Entry.
2783
2784 18. Because both NATs are port-preserving NATs and the random ports
2785 have not been used for any other mapping, the aforementioned
2786 direct bubble is received by B because B's NAT has seen an
2787 outgoing packet (Packet 4) with the same address/port pairs. B
2788 stores the address/port from which the direct bubble was
2789 received in the mapped address/port fields of the Peer Entry.
2790 It changes the status of the peer to "trusted" and sets the
2791
2792
2793
2794
2795
2796 <span class="grey">Thaler Standards Track [Page 50]</span></pre>
2797 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-51" ></span>
2798 <span class="grey"><a href="./rfc6081">RFC 6081</a> Teredo Extensions January 2011</span>
2799
2800
2801 Direct Receive on Random Port field to TRUE. At this point,
2802 communication in one direction is now possible (B to A, but not
2803 vice versa).
2804
2805 19. Because A still considers B to be "not-trusted", it times out
2806 and retransmits an indirect bubble (Packet 8). This packet
2807 contains a new nonce as part of the Nonce Trailer and also
2808 contains the value of the random port as part of the Random Port
2809 Trailer.
2810
2811 20. B receives the aforementioned indirect bubble. The processing
2812 of this indirect bubble is similar to the processing of Packet
2813 2. Since B received a direct bubble on its random port, it does
2814 not respond with a direct bubble from its primary port.
2815 Instead, it responds with a direct bubble (Packet 9) sent from
2816 its random port, which is similar to Packet 4 mentioned above.
2817
2818 21. A receives the direct bubble sent by B. A stores the mapped
2819 address/port from which the direct bubble was received in mapped
2820 address/port fields in the Peer Entry. A changes the status of
2821 B to "trusted" and sets the Direct Receive on Random Port field
2822 to TRUE. At this point, the communication is now possible in
2823 the other direction (A to B).
2824
2825 <span class="h3"><a class="selflink" id="section-6.4" href="#section-6.4">6.4</a>. Sequential Port-Symmetric NAT Extension</span>
2826
2827 The following protocol example illustrates the use of the Sequential
2828 Port-Symmetric NAT Extension.
2829
2830 Assume that Teredo Client A (A), which is positioned behind a
2831 sequential port-symmetric NAT and implements the Sequential Port-
2832 Symmetric NAT Extension, wants to communicate with Teredo Client B
2833 (B), which is positioned behind a port-restricted NAT that supports
2834 the Port-Preserving Port-Symmetric NAT Extension. The following
2835 packet exchange explains the configuration setup and communication
2836 setup between the two clients.
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852 <span class="grey">Thaler Standards Track [Page 51]</span></pre>
2853 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-52" ></span>
2854 <span class="grey"><a href="./rfc6081">RFC 6081</a> Teredo Extensions January 2011</span>
2855
2856
2857 Teredo A's A's B's
2858 Client Primary Secondary Teredo Client
2859 A NAT Server Server Server NAT B
2860 | | | | | | |
2861 | Direct Bubble to B | | | | |
2862 1 |--------------------------------------------------&gt;| |
2863 | | | | | | |
2864 |Router Solicitation | | | | |
2865 2 |-------------------&gt;| | | | |
2866 | | | | | | |
2867 |Router Advertisement| | | | |
2868 |&lt;-------------------| 3 | | | |
2869 | | | | | | |
2870 4 | Direct Bubble to B | | | | |
2871 |--------------------------------------------------&gt;| |
2872 | | | | | | |
2873 | Router Solicitation | | | |
2874 5 |----------------------------&gt;| | | |
2875 | | | | | | |
2876 | Router Advertisement | | | |
2877 |&lt;----------------------------| 6 | | |
2878 | | | | | | |
2879 | Indirect Bubble to B via B's Teredo Server | | |
2880 7 |-------------------------------------------&gt;|--------------&gt;|
2881 | | | | | | |
2882 | | | | Direct Bubble to A |
2883 | |&lt;-------------------------------------------------| 8
2884 | | | | | | |
2885 | | | | Indirect Bubble to A |
2886 |&lt;-------------------|&lt;--------------------------------------| 9
2887 | | | | | | |
2888 | | | | Direct Bubble to A |
2889 |&lt;-----------------------------------------------------------| 10
2890 | | | | | | |
2891 | Direct Bubble to B | | | |
2892 11 |-----------------------------------------------------------&gt;|
2893
2894 Sequential Port-Symmetric NAT Packet Exchange
2895
2896 1. During the qualification procedure, when Client A receives a
2897 response from the Teredo Server, it compares the Port value in
2898 the Origin indication with the Local Port value. Since they are
2899 different, it concludes that it is not behind a port-preserving
2900 NAT, and so assumes it is behind a sequential port-symmetric NAT.
2901
2902 2. When A wants to communicate with B, A starts by sending a direct
2903 bubble (Packet 1) from its primary port. This occurs because
2904 Client A does not know Client B's NAT type, which could be a cone
2905
2906
2907
2908 <span class="grey">Thaler Standards Track [Page 52]</span></pre>
2909 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-53" ></span>
2910 <span class="grey"><a href="./rfc6081">RFC 6081</a> Teredo Extensions January 2011</span>
2911
2912
2913 or address restricted NAT or UPnP-enabled NAT. Because Client A
2914 is behind a symmetric NAT, the external port used by A's NAT is a
2915 new port. This direct bubble will be dropped by B's NAT since
2916 Client B is behind a port-restricted NAT.
2917
2918 3. Because Client A does not know if B is behind a port restricted
2919 NAT or some other kind of NAT, Client A proactively opens a new
2920 random internal port, say, port 1100.
2921
2922 4. Client A then performs its Echo Test as follows:
2923
2924 A. Client A sends a router solicitation (Packet 2) to its Teredo
2925 Server address from port 1100. The server responds with a
2926 router advertisement (Packet 3).
2927
2928 B. Client A sends a direct bubble (Packet 4) to the peer from
2929 port 1100 destined to the port advertised in Client B's
2930 Teredo address, say, port 2100. This direct bubble is
2931 dropped by Client B's port-restricted NAT.
2932
2933 C. Client A sends a router solicitation (Packet 5) to its
2934 secondary Teredo server address from port 1100. The server
2935 responds with a router advertisement (Packet 6).
2936
2937 D. On receiving the corresponding router advertisements for
2938 Packet 2 and Packet 4, Client A knows that port 1100 maps to,
2939 say, port 1200 for Packet 2 and port 1202 for Packet 4.
2940
2941 E. Client A then calculates its predicted port used for Packet 2
2942 as the average (rounded down) of 1200 and 1202, i.e., 1201.
2943
2944 5. Client A then sends out an indirect bubble (Packet 7). This
2945 indirect bubble contains a random port trailer that contains the
2946 predicted port, port 1201. This indirect bubble makes it to
2947 Client B.
2948
2949 6. Client B sends out the following bubbles in response to the
2950 indirect bubble:
2951
2952 A. The first direct bubble (Packet 8) is destined for the port
2953 mapping embedded in Client A's Teredo Address. (It has been
2954 observed that some NATs display symmetric NAT behavior for
2955 outgoing packets but cone NAT behavior for incoming packets.
2956 The direct bubble described is likely to succeed if Client
2957 A's NAT displays such a behavior.) Since in this example,
2958 A's NAT is a normal sequential port-symmetric NAT, this
2959 packet is dropped.
2960
2961
2962
2963
2964 <span class="grey">Thaler Standards Track [Page 53]</span></pre>
2965 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-54" ></span>
2966 <span class="grey"><a href="./rfc6081">RFC 6081</a> Teredo Extensions January 2011</span>
2967
2968
2969 B. The second packet is an indirect bubble (Packet 9) sent to
2970 Client A without any trailers since Client B is behind a
2971 port-restricted NAT.
2972
2973 C. The next packet will be a direct bubble (Packet 10) sent to
2974 port 1201. This packet will make it in to Client A since
2975 Client A previously sent an outgoing packet (Packet 4) with
2976 the same four tuple. At this point, communication in one
2977 direction is now possible (A to B, but not vice versa).
2978
2979 7. Client A then sends a direct bubble (Packet 11) to Client B when
2980 it receives Packet 10. This time, the bubble makes it through to
2981 B because it previously sent an outgoing packet (Packet 10) with
2982 the same four tuple. At this point, communication is now
2983 possible in the other direction (B to A).
2984
2985 <span class="h3"><a class="selflink" id="section-6.5" href="#section-6.5">6.5</a>. Hairpinning Extension</span>
2986
2987 The following protocol example illustrates the use of the Hairpinning
2988 Extension.
2989
2990 In Figure 3 (<a href="#section-3.5">Section 3.5</a>), Teredo Client A (A) and Teredo Client B
2991 (B) are positioned behind different immediate NATs in a two-layer NAT
2992 topology; that is, the outermost NAT (NAT E) is common to both A and
2993 B but the immediate NATs that they are connected to are different (A
2994 is connected to NAT F while B is connected to NAT G). Further assume
2995 that the immediate NATs that A and B are connected to are UPnP-
2996 enabled (NAT F and NAT G are UPnP-enabled). We assume that NAT E
2997 does not support hairpinning; that is, the NAT does not relay packets
2998 originating from the private address space and destined for the
2999 public address of the NAT, back to the private address of the NAT.
3000
3001 Before starting the qualification procedure, both A and B use UPnP to
3002 reserve port mappings on their respective NATs. They observe that
3003 the UPnP operation succeeds and both clients obtain valid UPnP Mapped
3004 Address/Port values.
3005
3006 Next, both client A and client B implement the qualification
3007 procedure where they determine their mapped address/port values, as
3008 specified in <a href="./rfc4380#section-5.2.1">Section&nbsp;5.2.1 of [RFC4380]</a>.
3009
3010 A and B both compare their UPnP Mapped Address/Port values with the
3011 mapped address/port values obtained through the qualification
3012 procedure. Because both A and B are part of a two-layer NAT
3013 topology, these values will be different. Hence, both A and B
3014 continue to hold on to their UPnP Mapped Address/Port.
3015
3016
3017
3018
3019
3020 <span class="grey">Thaler Standards Track [Page 54]</span></pre>
3021 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-55" ></span>
3022 <span class="grey"><a href="./rfc6081">RFC 6081</a> Teredo Extensions January 2011</span>
3023
3024
3025 The following packet exchange shows client A establishing
3026 communication with client B.
3027
3028 Teredo Teredo Client A's Client B's
3029 Client NAT Client NAT NAT Teredo Teredo
3030 A F B G E Server Server
3031 | | | | | | |
3032 | | Direct Bubble to B | | | |
3033 1 |--------------------------------------&gt;| | |
3034 | | | | | | |
3035 | Indirect Bubble to B via B's Teredo Server |
3036 2 |-----------------------------------------------------------&gt;|
3037 | | |&lt;----------------------------------------|
3038 | | | | | | |
3039 | | | Direct Bubble to A | | |
3040 3 | | |-------------------&gt;| | |
3041 | | | | | | |
3042 | | | Direct | | | |
3043 | | |Bubble to A| | | |
3044 4 | | |----------&gt;| | | |
3045 | | | | | | |
3046 | | | Direct | | | |
3047 | | |Bubble to A| | | |
3048 5 | | |----------&gt;| | | |
3049 |&lt;-----------------------------| | | |
3050 | | | | | | |
3051 | | | Indirect Bubble to A | |
3052 6 | | |----------------------------&gt;| |
3053 |&lt;-----------------------------------------------| |
3054 | | | | | | |
3055 |Direct Bubble to B| | | | |
3056 7 |-----------------&gt;| | | | |
3057 | | | | | | |
3058
3059 Hairpinning-Based Packet Exchange
3060
3061 1. A sends a direct bubble (Packet 1) to the mapped address/port
3062 embedded in B's Teredo IPv6 address.
3063
3064 2. The aforementioned direct bubble is dropped by NAT E, because it
3065 does not support Hairpinning.
3066
3067 3. A sends out an indirect bubble (Packet 2) destined to B via B's
3068 Teredo Server. In this indirect bubble, A includes an Alternate
3069 Address Trailer that includes both the local address/port and
3070 the UPnP mapped address/port.
3071
3072
3073
3074
3075
3076 <span class="grey">Thaler Standards Track [Page 55]</span></pre>
3077 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-56" ></span>
3078 <span class="grey"><a href="./rfc6081">RFC 6081</a> Teredo Extensions January 2011</span>
3079
3080
3081 4. The aforementioned indirect bubble is received by B. After
3082 parsing the Alternate Address Trailer, B has a total of three
3083 addresses to communicate with: two from the Alternate Address
3084 Trailer and one from the mapped address/port embedded in A's
3085 Teredo IPv6 address. B then responds with the following
3086 packets. The first packet sent by B is a direct bubble (Packet
3087 3) destined to the mapped address/port embedded in A's Teredo
3088 IPv6 address.
3089
3090 5. The aforementioned direct bubble will be dropped by the NAT E
3091 because it does not support Hairpinning.
3092
3093 6. Because the local address/port was the first mapping in the
3094 Alternate Address Trailer, the second direct bubble (Packet 4)
3095 sent by B is destined to the local address/port.
3096
3097 7. The aforementioned direct bubble is dropped because A and B are
3098 positioned behind different NATs and hence have their own
3099 private address space. A's local address is not reachable from
3100 B.
3101
3102 8. The next direct bubble (Packet 5) is sent by B destined to A's
3103 UPnP mapped address/port, which is the second mapping in the
3104 Alternate Address Trailer sent by A.
3105
3106 9. The aforementioned direct bubble is received by A because A's
3107 UPnP-mapped address is reachable from B. A stores the source
3108 address from which the direct bubble was received in the mapped
3109 address/port fields of the Peer Entry, as defined in <a href="./rfc4380#section-5.2">Section&nbsp;5.2
3110 of [RFC4380]</a>. Also, the mapped address status field (as
3111 specified in <a href="./rfc4380#section-5.2.3">Section&nbsp;5.2.3 of [RFC4380]</a>) is changed to
3112 "trusted". At this point, communication in one direction (A to
3113 B) is now possible, but not vice versa because B has not yet
3114 marked A as trusted.
3115
3116 10. B also sends an indirect bubble (Packet 6) to A via A's Teredo
3117 server. As part of the indirect bubble, B also includes an
3118 Alternate Address Trailer, which contains the local address/port
3119 and the UPnP mapped address/port of B.
3120
3121 11. The aforementioned indirect bubble is received by A. After
3122 parsing the Alternate Address Trailer, A adds the two addresses
3123 in the Alternate Address Trailer to the Alternate Address List
3124 in the Peer Entry. Because the peer's mapping is "trusted"
3125 (point 9), A responds with only one direct bubble (Packet 7)
3126 that is sent to the mapped address/port stored in the Peer
3127 Entry.
3128
3129
3130
3131
3132 <span class="grey">Thaler Standards Track [Page 56]</span></pre>
3133 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-57" ></span>
3134 <span class="grey"><a href="./rfc6081">RFC 6081</a> Teredo Extensions January 2011</span>
3135
3136
3137 12. The aforementioned direct bubble is received by B. B records
3138 the mapped address/port from which the direct bubble was
3139 received in the mapped address/port field in its Peer Entry, and
3140 changes the status of the mapped address to "trusted". At this
3141 point, communication is now possible in the other direction (B
3142 to A).
3143
3144 <span class="h3"><a class="selflink" id="section-6.6" href="#section-6.6">6.6</a>. Server Load Reduction Extension</span>
3145
3146 The following protocol example illustrates the use of the Server Load
3147 Reduction Extension.
3148
3149 Assume that Teredo Client A (A) has established communication with
3150 Teredo Client B (B). Also, assume that at some later point when no
3151 data packets have been exchanged between both clients for more than
3152 30 seconds, the communication needs to be re-established because A
3153 wants to send a data packet to B.
3154
3155 The following packet exchange helps A re-establish communication with
3156 B.
3157
3158 Teredo Client A's Client B's Teredo
3159 Client Teredo Teredo Client
3160 A NAT Server Server NAT B
3161 | | | | | |
3162 | | | Direct Bubble to B | | |
3163 1 |------------------------------------------------------------&gt;|
3164 | | | | | |
3165 | | | Direct Bubble to A | | |
3166 |&lt;------------------------------------------------------------| 2
3167 | | | | | |
3168
3169 Server Load Reduction Packet Exchange
3170
3171 1. A sends a direct bubble (Packet 1) with the Neighbor Discovery
3172 Option Trailer, with the DiscoveryType field set to
3173 TeredoDiscoverySolicitation.
3174
3175 2. If the mapping on either of the NATs has not expired, the direct
3176 bubble is received by B. B parses the Neighbor Discovery Option
3177 and because the DiscoveryType was set to
3178 TeredoDiscoverySolicitation, B responds with a direct bubble
3179 (Packet 2). B's direct bubble also contains the Neighbor
3180 Discovery Option and the DiscoveryType is set to
3181 TeredoDiscoveryAdvertisement.
3182
3183
3184
3185
3186
3187
3188 <span class="grey">Thaler Standards Track [Page 57]</span></pre>
3189 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-58" ></span>
3190 <span class="grey"><a href="./rfc6081">RFC 6081</a> Teredo Extensions January 2011</span>
3191
3192
3193 3. The aforementioned direct bubble is received by A and at this
3194 point, communication between the Teredo clients is re-
3195 established.
3196
3197 <span class="h2"><a class="selflink" id="section-7" href="#section-7">7</a>. Security Considerations</span>
3198
3199 Security considerations are the same as those specified in <a href="./rfc4380#section-7">Section&nbsp;7
3200 of [RFC4380]</a>.
3201
3202 In addition, the Hairpinning Extension introduces the possibility of
3203 an amplification attack if a malicious user could advertise a large
3204 number of port mappings in the Alternate Address Trailer, resulting
3205 in a large number of direct bubbles sent in response. Because of
3206 this, <a href="#section-4.3">Section 4.3</a> explicitly limits the number of addresses that a
3207 Teredo client will accept.
3208
3209 Because the nonce in the Nonce Trailer is used (as specified in
3210 <a href="#section-5.2.4.4">Section 5.2.4.4</a>) to prevent spoofing of bubbles that would result in
3211 directing traffic to the wrong place, it is important that the nonce
3212 be random so that attackers cannot predict its value. See [<a href="./rfc4086" title="&quot;Randomness Requirements for Security&quot;">RFC4086</a>]
3213 for further discussion of randomness requirements.
3214
3215 <span class="h2"><a class="selflink" id="section-8" href="#section-8">8</a>. Acknowledgements</span>
3216
3217 Thanks to Gurpreet Virdi and Poorna Gaddehosur for technical
3218 contributions to this document, and to the V6OPS WG and Jari Arkko
3219 for their helpful reviews.
3220
3221 <span class="h2"><a class="selflink" id="section-9" href="#section-9">9</a>. IANA Considerations</span>
3222
3223 IANA has created a new trailer Type registry. Requests for new
3224 trailer Type values are made through Specification Required
3225 [<a href="./rfc5226" title="">RFC5226</a>]. Initial values are listed below.
3226
3227 Trailer Type Usage Reference
3228 ------------ --------------------------------- ---------
3229 0x01 Nonce Trailer <a href="./rfc6081">RFC 6081</a>
3230 0x02 Random Port Trailer <a href="./rfc6081">RFC 6081</a>
3231 0x03 Alternate Address Trailer <a href="./rfc6081">RFC 6081</a>
3232 0x04 Neighbor Discovery Option Trailer <a href="./rfc6081">RFC 6081</a>
3233
3234 <span class="h2"><a class="selflink" id="section-10" href="#section-10">10</a>. References</span>
3235
3236 <span class="h3"><a class="selflink" id="section-10.1" href="#section-10.1">10.1</a>. Normative References</span>
3237
3238 [<a id="ref-RFC1918">RFC1918</a>] Rekhter, Y., Moskowitz, R., Karrenberg, D., Groot, G.,
3239 and E. Lear, "Address Allocation for Private Internets",
3240 <a href="https://www.rfc-editor.org/bcp/bcp5">BCP 5</a>, <a href="./rfc1918">RFC 1918</a>, February 1996.
3241
3242
3243
3244 <span class="grey">Thaler Standards Track [Page 58]</span></pre>
3245 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-59" ></span>
3246 <span class="grey"><a href="./rfc6081">RFC 6081</a> Teredo Extensions January 2011</span>
3247
3248
3249 [<a id="ref-RFC2119">RFC2119</a>] Bradner, S., "Key words for use in RFCs to Indicate
3250 Requirement Levels", <a href="https://www.rfc-editor.org/bcp/bcp14">BCP 14</a>, <a href="./rfc2119">RFC 2119</a>, March 1997.
3251
3252 [<a id="ref-RFC2460">RFC2460</a>] Deering, S. and R. Hinden, "Internet Protocol, Version 6
3253 (IPv6) Specification", <a href="./rfc2460">RFC 2460</a>, December 1998.
3254
3255 [<a id="ref-RFC4380">RFC4380</a>] Huitema, C., "Teredo: Tunneling IPv6 over UDP through
3256 Network Address Translations (NATs)", <a href="./rfc4380">RFC 4380</a>,
3257 February 2006.
3258
3259 [<a id="ref-RFC4861">RFC4861</a>] Narten, T., Nordmark, E., Simpson, W., and H. Soliman,
3260 "Neighbor Discovery for IP version 6 (IPv6)", <a href="./rfc4861">RFC 4861</a>,
3261 September 2007.
3262
3263 [<a id="ref-RFC5226">RFC5226</a>] Narten, T. and H. Alvestrand, "Guidelines for Writing an
3264 IANA Considerations Section in RFCs", <a href="https://www.rfc-editor.org/bcp/bcp26">BCP 26</a>, <a href="./rfc5226">RFC 5226</a>,
3265 May 2008.
3266
3267 [<a id="ref-UPNPWANIP">UPNPWANIP</a>] UPnP Forum, "WANIPConnection:1", November 2001,
3268 &lt;<a href="http://www.upnp.org/standardizeddcps/documents/UPnP_IGD_WANIPConnection%201.0.pdf">http://www.upnp.org/standardizeddcps/documents/</a>
3269 <a href="http://www.upnp.org/standardizeddcps/documents/UPnP_IGD_WANIPConnection%201.0.pdf">UPnP_IGD_WANIPConnection%201.0.pdf</a>&gt;.
3270
3271 <span class="h3"><a class="selflink" id="section-10.2" href="#section-10.2">10.2</a>. Informative References</span>
3272
3273 [<a id="ref-RFC4086">RFC4086</a>] Eastlake, D., Schiller, J., and S. Crocker, "Randomness
3274 Requirements for Security", <a href="https://www.rfc-editor.org/bcp/bcp106">BCP 106</a>, <a href="./rfc4086">RFC 4086</a>,
3275 June 2005.
3276
3277 [<a id="ref-RFC4443">RFC4443</a>] Conta, A., Deering, S., and M. Gupta, "Internet Control
3278 Message Protocol (ICMPv6) for the Internet Protocol
3279 Version 6 (IPv6) Specification", <a href="./rfc4443">RFC 4443</a>, March 2006.
3280
3281 [<a id="ref-RFC4787">RFC4787</a>] Audet, F. and C. Jennings, "Network Address Translation
3282 (NAT) Behavioral Requirements for Unicast UDP", <a href="https://www.rfc-editor.org/bcp/bcp127">BCP 127</a>,
3283 <a href="./rfc4787">RFC 4787</a>, January 2007.
3284
3285 Author's Address
3286
3287 Dave Thaler
3288 Microsoft Corporation
3289 One Microsoft Way
3290 Redmond, WA 98052
3291 USA
3292
3293 Phone: +1 425 703 8835
3294 EMail: [email protected]
3295
3296
3297
3298
3299
3300 Thaler Standards Track [Page 59]
3301 </pre>