forked from otroan/MAP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
draft-mdt-softwire-mapping-address-and-port.xml
894 lines (724 loc) · 34.2 KB
/
draft-mdt-softwire-mapping-address-and-port.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
<?xml version="1.0" encoding="US-ASCII"?>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!ENTITY rfc2119 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY rfc3633 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3633.xml">
<!ENTITY rfc3056 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3056.xml">
<!ENTITY rfc1933 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.1933.xml">
<!ENTITY rfc5969 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5969.xml">
<!ENTITY rfc2529 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2529.xml">
<!ENTITY rfc5214 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5214.xml">
<!ENTITY rfc4380 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4380.xml">
<!ENTITY rfc2766 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2766.xml">
<!ENTITY rfc6052 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6052.xml">
<!ENTITY rfc6146 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6146.xml">
<!ENTITY rfc6147 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6147.xml">
<!ENTITY rfc6333 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6333.xml">
<!ENTITY rfc6346 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6346.xml">
<!ENTITY rfc6269 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6269.xml">
<!ENTITY rfc6250 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6250.xml">
<!ENTITY rfc2663 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2663.xml">
<!ENTITY I-D.mdt-softwire-map-dhcp-option SYSTEM 'http://xml.resource.org/public/rfc/bibxml3/reference.I-D.mdt-softwire-map-dhcp-option.xml'>
<!ENTITY I-D.ietf-softwire-stateless-4v6-motivation SYSTEM 'http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-softwire-stateless-4v6-motivation.xml'>
<!ENTITY I-D.ietf-tsvwg-iana-ports SYSTEM 'http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-tsvwg-iana-ports.xml'>
]>
<?rfc toc="yes" ?>
<?rfc tocompact="yes" ?>
<?rfc compact="yes" ?>
<?rfc subcompact="no" ?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes" ?>
<?rfc comments="yes" ?>
<?rfc inline="yes" ?>
<rfc category="std" docName="draft-mdt-softwire-mapping-address-and-port-03"
ipr="trust200902">
<front>
<title abbrev="MAP">Mapping of Address and Port (MAP)</title>
<author fullname="Ole Troan" initials="O" surname="Troan">
<organization abbrev="">cisco</organization>
<address>
<postal>
<street></street>
<city>Oslo</city>
<country>Norway</country>
</postal>
<email>[email protected]</email>
</address>
</author>
<author fullname="Satoru Matsushima" initials="S" surname="Matsushima">
<organization abbrev="">SoftBank Telecom</organization>
<address>
<postal>
<street>1-9-1 Higashi-Shinbashi, Munato-ku</street>
<city>Tokyo</city>
<country>Japan</country>
</postal>
<email>[email protected]</email>
</address>
</author>
<author fullname="Tetsuya Murakami" initials="T" surname="Murakami">
<organization abbrev="">IP Infusion</organization>
<address>
<postal>
<street>1188 East Arques Avenue</street>
<city>Sunnyvale</city>
<country>USA</country>
</postal>
<email>[email protected]</email>
</address>
</author>
<author fullname="Xing Li" initials="X" surname="Li">
<organization abbrev="">CERNET Center/Tsinghua University</organization>
<address>
<postal>
<street>Room 225, Main Building, Tsinghua University</street>
<city>Beijing 100084</city>
<country>CN</country>
</postal>
<email>[email protected]</email>
</address>
</author>
<author fullname="Congxiao Bao" initials="C" surname="Bao">
<organization abbrev="">CERNET Center/Tsinghua University</organization>
<address>
<postal>
<street>Room 225, Main Building, Tsinghua University</street>
<city>Beijing 100084</city>
<country>CN</country>
</postal>
<email>[email protected]</email>
</address>
</author>
<date year="2012" />
<area>Internet</area>
<workgroup>Network Working Group</workgroup>
<!-- SECTION 0: Abstract -->
<abstract>
<t>This document describes a generic mechanism for mapping
between IPv4 addresses and IPv6 addresses and transport layer
ports.</t>
</abstract>
</front>
<middle>
<!-- SECTION 1: Introduction -->
<section title="Introduction">
<t>The mechanism of mapping IPv4 addresses in IPv6 addresses has
been described in numerous mechanisms dating back to 1996 <xref
target="RFC1933"></xref>. The Automatic tunneling mechanism
described in RFC1933, assigned a globally unique IPv6 address to
a host by combining the host's IPv4 address with a well-known
IPv6 prefix. Given an IPv6 packet with a destination address
with an embedded IPv4 address, a node could automatically tunnel
this packet by extracting the IPv4 tunnel end-point address from
the IPv6 destination address.</t>
<t>There are numerous variations of this idea, described in
6over4 <xref target="RFC2529"></xref>, 6to4 <xref
target="RFC3056"></xref>, ISATAP <xref target="RFC5214"></xref>,
and 6rd <xref target="RFC5969"></xref>. The differences between
these are the use of well-known IPv6 prefixes, or Service
Provider assigned IPv6 prefixes, and the position of the
embedded IPv4 bits in the IPv6 address. Teredo <xref
target="RFC4380"></xref> added a twist to this to achieve NAT
traversal by also encoding transport layer ports into the IPv6
address. 6rd, to achieve more efficient encoding, allowed for
only the suffix of an IPv4 address to be embedded, with the IPv4
prefix being deduced from other provisioning mechanisms.</t>
<t>NAT-PT <xref target="RFC2766"></xref>(deprecated) combined
with a DNS ALG used address mapping to put NAT state, namely the
IPv6 to IPv4 binding encoded in an IPv6 address. This
characteristic has been inherited by NAT64 <xref
target="RFC6146"></xref> and DNS64 <xref
target="RFC6147"></xref> which rely on an address format defined
in <xref target="RFC6052"></xref>. <xref
target="RFC6052"></xref> specifies the algorithmic translation
of an IPv6 address to IPv4 address. In particular, <xref
target="RFC6052"></xref> specifies the address format to build
IPv4-converted and IPv4-translatable IPv6 addresses. RFC6052
discusses the transport of the port-set information in an
IPv4-embedded IPv6 address but the conclusion was the following
(excerpt from [RFC6052]):</t>
<t>"There have been proposals to complement stateless
translation with a port range feature. Instead of mapping an
IPv4 address to exactly one IPv6 prefix, the options would allow
several IPv6 nodes to share an IPv4 address, with each node
managing a different set of ports. If a port-set extension is
needed, it could be defined later, using bits currently reserved
as null in the suffix."</t>
<t>The commonalities of all these IPv6 over IPv4 mechanisms are:
<list style="symbols">
<t>Automatically provisions an IPv6 address for a host or an
IPv6 prefix for a site</t>
<t>Algorithmic or implicit address resolution for tunneling or
encapsulation. Given an IPv6 destination address, an IPv4
tunnel endpoint address can be calculated. Likewise for
translation, an IPv4 address can be calculated from an IPv6
destination address and vice versa.</t>
<t>Embedding of an IPv4 address or part thereof and optionally
transport layer ports into an IPv6 address.</t>
</list></t>
<t>In phases of IPv4 to IPv6 migration, IPv6 only networks will
be common, while there will still be a need for residual IPv4
deployment. This document describes a more generic mapping of
IPv4 to IPv6 that can be used both for encapsulation (IPv4 over
IPv6) and for translation between the two protocols.</t>
<t>Just as the IPv6 over IPv4 mechanisms referred to above, the
residual IPv4 over IPv6 mechanisms must be capable of:</t>
<t><list style="symbols">
<t>Provisioning an IPv4 prefix, an IPv4 address or a shared IPv4
address.</t>
<t>Algorithmically map between an IPv4 prefix, IPv4 address or
a shared IPv4 address and an IPv6 address.</t>
</list></t>
<t>The unified mapping scheme described here supports
translation mode, encapsulation mode, in both mesh and hub and
spoke topologies.</t>
<t>This document describes delivery of IPv4 unicast service
across an IPv6 infrastructure. IPv4 multicast is not considered
further in this document.</t>
<t>The A+P (Address and Port) architecture of sharing an IPv4
address by distributing the port space is described in <xref
target="RFC6346"></xref>. Specifically section 4 of <xref
target="RFC6346"/> covers stateless mapping. The corresponding
stateful solution DS-lite is described in <xref
target="RFC6333"></xref>. The motivation for work is described
in <xref
target="I-D.ietf-softwire-stateless-4v6-motivation"></xref>.</t>
<t>A companion document defines a DHCPv6 option for provisioning
of MAP <xref
target="I-D.mdt-softwire-map-dhcp-option"></xref>. Deployment
considerations are described in
[I-D.mdt-softwire-map-deployment].</t>
</section>
<!-- SECTION 2: REQUIREMENTS LANGUAGE -->
<section anchor="conventions" title="Conventions">
<t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in RFC 2119 <xref
target="RFC2119"></xref>.</t>
</section>
<!-- conventions -->
<section title="Terminology">
<t><list hangIndent="22" style="hanging">
<t hangText="MAP domain:">A set of MAP CEs and BRs connected
to the same virtual link. A service provider may deploy a
single MAP domain, or may utilize multiple MAP domains.</t>
<t hangText="MAP Rule">A set of parameters describing the
mapping between an IPv4 prefix, IPv4 address or shared IPv4
address and an IPv6 prefix or address. Each MAP node in the
domain has the same set of rules.</t>
<t hangText="MAP node">A device that implements MAP.</t>
<t hangText="MAP Border Relay (BR):">A MAP enabled router
managed by the service provider at the edge of a MAP domain.
A Border Relay router has at least an IPv6-enabled interface
and an IPv4 interface connected to the native IPv4 network. A
MAP BR may also be referred to simply as a "BR" within the
context of MAP.</t>
<t hangText="MAP Customer Edge (CE):">A device functioning as
a Customer Edge router in a MAP deployment. A typical MAP CE
adopting MAP rules will serve a residential site with one WAN
side interface, and one or more LAN side interfaces. A MAP CE
may also be referred to simply as a "CE" within the context of
MAP.</t>
<t hangText="Port-set:">Each node has a separate part of the
transport layer port space; denoted as a port-set.</t>
<t hangText="Port-set ID (PSID):">Algorithmically identifies a
set of ports exclusively assigned to the CE.</t>
<t hangText="Shared IPv4 address:">An IPv4 address that is
shared among multiple CEs. Only ports that belong to the
assigned port-set can be used for communication. Also known as
a Port-Restricted IPv4 address.</t>
<t hangText="End-user IPv6 prefix:">The IPv6 prefix assigned
to an End-user CE by other means than MAP
itself. E.g. provisioned using DHCPv6 PD <xref
target="RFC3633"/> or configured manually. It is unique for
each CE.</t>
<t hangText="MAP IPv6 address:">The IPv6 address used to reach
the MAP function of a CE from other CE's and from BR's.</t>
<t hangText="Rule IPv6 prefix:">An IPv6 prefix assigned by
a Service Provider for a mapping rule.</t>
<t hangText="Rule IPv4 prefix:">An IPv4 prefix assigned by a
Service Provider for a mapping rule.</t>
<t hangText="IPv4 Embedded Address (EA) bits:">The IPv4
EA-bits in the IPv6 address identify an IPv4 prefix/address
(or part thereof) or a shared IPv4 address (or part thereof)
and a port-set identifier.</t>
<t hangText="MRT:">MAP Rule table. Address and Port aware
datastructure, supporting longest match lookups. The MRT is
used by the MAP forwarding function.</t>
</list></t>
</section>
<!-- SECTION 3: DESCRIPTION -->
<section title="Architecture">
<t>A full IPv4 address or IPv4 prefix can be used like today,
e.g. for identifying an interface or as a DHCP pool. A shared
IPv4 address on the other hand, MUST NOT be used to identify an
interface. While it is theoretically possible to make host
stacks and applications port-aware, that is considered a too
drastic change to the IP model <xref target="RFC6250"/>.</t>
<t>The MAP architecture described here, restricts the use of the
shared IPv4 address to only be used as the global address
(outside) of the NAPT <xref target="RFC2663"/> running on the
CE. The NAPT MUST in turn be connected to a MAP aware forwarding
function, that does encapsulation/decapsulation or translation
to IPv6.</t>
<t>For packets outbound from the private IPv4 network, the CE
NAPT MUST translate transport identifiers (e.g. TCP and UDP port
numbers) so that they fall within the assigned CE's
port-range.</t>
<t>The forwarding function uses the MRT to make forwarding
decisions. The table consist of the mapping rules. An entry in
the table consists of an IPv4 prefix and PSID. The normal best
matching prefix algorithm is used. With a maximum key length of
48 (32 + 16). E.g. with a sharing ratio of 64 (6 bit PSID
length) a host route for this CE would be a /38 (32 + 6).</t>
</section>
<section title="Mapping Rules">
<t>A MAP node is provisioned with one or more mapping rules.</t>
<t>Mapping rules are used differently depending on their
function. Every MAP node must be provisioned with a Basic
mapping rule. This is used by the node to configure itself with
an IPv4 address, IPv4 prefix or shared IPv4 address from an
End-user IPv6 prefix. This same basic rule can also be used for
forwarding, where an IPv4 destination address and optionally a
destination port is mapped into an IPv6 address or
prefix. Additional mapping rules can be specified to allow for
e.g. multiple different IPv4 subnets to exist within the
domain. Additional mapping rules are recognized by having a Rule
IPv6 prefix different from the base End-user IPv6 prefix.</t>
<t>Traffic outside of the domain (IPv4 address not matching
(using longest matching prefix) any Rule IPv4 prefix in the
Rules database) will be forward using the Default mapping
rule. The Default mapping rule maps outside destinations to the
BR's IPv6 address or prefix.</t>
<t>There are three types of mapping rules:
<list style="numbers">
<t>Basic Mapping Rule - used for IPv4 prefix, address or port
set assignment. There can only be one Basic Mapping Rule per
End-user IPv6 prefix. The Basic Mapping Rule is used to
configure the MAP IPv6 address or prefix.
<list style="symbols">
<t>Rule IPv6 prefix (including prefix length)</t>
<t>Rule IPv4 prefix (including prefix length)</t>
<t>Rule EA-bits length (in bits)</t>
<t>Rule Port Parameters (optional)</t>
</list></t>
<t>Forwarding Mapping Rule - used for forwarding. The Basic
Mapping Rule is also a Forwarding Mapping Rule. Each
Forwarding Mapping Rule will result in an entry in the MRT for
the Rule IPv4 prefix.
<list style="symbols">
<t>Rule IPv6 prefix (including prefix length)</t>
<t>Rule IPv4 prefix (including prefix length)</t>
<t>Rule EA-bits length (in bits)</t>
<t>Rule Port Parameters (optional)</t>
</list></t>
<t>Default Mapping Rule - used for destinations outside the
MAP domain. A 0.0.0.0/0 entry is installed in the MRT for this
rule.
<list style="symbols">
<t>Rule IPv6 prefix (including prefix length)</t>
<t>Rule BR IPv4 address</t>
</list></t>
</list></t>
<t>A MAP node finds its Basic Mapping Rule by doing a longest
match between the End-user IPv6 prefix and the Rule IPv6 prefix
in the Mapping Rule database. The rule is then used for IPv4
prefix, address or shared address assignment.</t>
<t>A MAP IPv6 address (or prefix) is formed from the BMR Rule
IPv6 prefix. This address MUST be assigned to an interface of
the MAP node and is used to terminate all MAP traffic being sent
or received to the node.</t>
<t>Port-aware IPv4 entries in the MRT are installed for all the
Forwarding Mapping Rules and an IPv4 default route for the
Default Mapping Rule.</t>
<t>In hub and spoke mode, all traffic MUST be forwarded using
the Default Mapping Rule.</t>
<section title="Port mapping algorithm">
<t>Different Port-Set Identifiers (PSID) MUST have
non-overlapping port-sets. The two extreme cases are: (1) the
port numbers are not contiguous for each PSID, but uniformly
distributed across the port range (0-65535); (2) the port
numbers are contiguous in a single range for each PSID. The
port mapping algorithm proposed here is called the Generalized
Modulus Algorithm (GMA) and supports both these cases.</t>
<t>For a given sharing ratio (R) and the maximum number of
contiguous ports (M), the GMA algorithm is defined as:</t>
<t><list style="numbers">
<t>The port number (P) of a given PSID (K) is composed of:
<figure><artwork>
P = R * M * j + M * K + i
</artwork></figure>
Where:<list style="symbols">
<t>PSID: K = 0 to R - 1</t>
<t>Port range index: j = (4096 / M) / R to ((65536 / M) / R) - 1, if the
port numbers (0 - 4095) are excluded.</t>
<t>Contiguous Port index: i = 0 to M - 1</t>
</list></t>
<t>The PSID (K) of a given port number (P) is determined by:
<figure><artwork>
K = (floor(P/M)) % R
</artwork></figure>
Where:<list style="symbols">
<t>% is the modulus operator</t>
<t>floor(arg) is a function that returns the largest integer
not greater than arg.</t>
</list></t>
</list></t>
<section title="Bit Representation of the Algorithm">
<t>Given a sharing ratio (R=2^k), the maximum number of
contiguous ports (M=2^m), for any PSID (K) and available
ports (P) can be represented as:</t>
<t><figure align="left" title="Bit representation" anchor="bitrepresentation-fig">
<preamble></preamble>
<artwork align="left"><![CDATA[
0 8 15
+---------------+----------+------+-------------------+
| P |
----------------+-----------------+-------------------+
| A (j) | PSID (K) | M (i) |
+---------------+----------+------+-------------------+
|<----a bits--->|<-----k bits---->|<------m bits----->|
]]></artwork></figure></t>
<t>Where j and i are the same indexes defined in the port
mapping algorithm.</t>
<t>For any port number, the PSID can be obtained by bit mask
operation.</t>
<t>For a > 0, j MUST be larger than 0. This ensures that the
algorithm excludes the system ports (<xref
target="I-D.ietf-tsvwg-iana-ports"/>). For a = 0, j MAY be 0
to allow for the provisioning of the system ports.</t>
</section>
<section title="GMA examples">
<t><figure align="left" title="Example 1: with offset = 4 (a = 4)">
<preamble>For example, for R = 1024, PSID offset: a = 4 and
PSID length: k = 10 bits</preamble>
<artwork align="left">
Port-set-1 Port-set-2
PSID=0 | 4096, 4097, 4098, 4099, | 8192, 8193, 8194, 8195, | ...
PSID=1 | 4100, 4101, 4102, 4103, | 8196, 8197, 8198, 8199, | ...
PSID=2 | 4104, 4105, 4106, 4107, | 8200, 8201, 8202, 8203, | ...
PSID=3 | 4108, 4109, 4110, 4111, | 8204, 8205, 8206, 8207, | ...
...
PSID=1023| 8188, 8189, 8190, 8191, | 12284, 12285, 12286, 12287,| ...
</artwork></figure></t>
<t><figure align="left" title="Example 2: with offset = 0 (a = 0)">
<preamble>For example, for R = 64, a = 0 (PSID offset = 0
and PSID length = 6 bits):</preamble>
<artwork align="left">
Port-set
PSID=0 | [ 0 - 1023]
PSID=1 | [1024 - 2047]
PSID=2 | [2048 - 3071]
PSID=3 | [3072 - 4095]
...
PSID=63 | [64512 - 65535]
</artwork></figure></t>
</section>
<section title="GMA Provisioning Considerations">
<t>The number of offset bits (a) and excluded ports are
optionally provisioned via the "Rule Port Mapping
Parameters" in the Basic Mapping Rule.</t>
<t>The defaults are:
<list style="symbols">
<t>Excluded ports : 0-4095</t>
<t>Offset bits (a) : 4</t>
</list></t>
<t>To simplify the GMA port mapping algorithm the defaults
are chosen so that the PSID field starts on a nibble
boundary and the excluded port range (0-1023) is extended to
0-4095.</t>
</section>
</section>
<section title="Basic mapping rule (BMR)">
<t><figure align="center" title="IPv6 address format"
anchor="addressallocation-fig">
<preamble></preamble>
<artwork align="center"><![CDATA[
| n bits | o bits | m bits | 128-n-o-m bits |
+--------------------+-----------+---------+------------+----------+
| Rule IPv6 prefix | EA bits |subnet ID| interface ID |
+--------------------+-----------+---------+-----------------------+
|<--- End-user IPv6 prefix --->|
]]></artwork>
</figure></t>
<t>The Embedded Address bits (EA bits) are unique per end user
within a Rule IPv6 prefix. The Rule IPv6 prefix is the part of
the End-user IPv6 prefix that is common among all CEs using
the same Basic Mapping Rule within the MAP domain. The EA bits
encode the CE specific IPv4 address and port information. The
EA bits can contain a full or part of an IPv4 prefix or
address, and in the shared IPv4 address case contains a
Port-Set Identifier (PSID).</t>
<t>The MAP IPv6 address is created by concatenating the
End-user IPv6 prefix with the MAP subnet-id and the
interface-id as specified in <xref target="interface-id"/>.</t>
<t>The MAP subnet ID is defined to be the first subnet (all
bits set to zero). A MAP node MUST reserve the first IPv6
prefix in a End-user IPv6 prefix for the purpose of MAP.</t>
<t><figure align="center" anchor="addressallocation2-fig" title="Shared IPv4 address">
<preamble>Shared IPv4 address:</preamble>
<artwork align="center"><![CDATA[
| r bits | p bits | | q bits |
+-------------+---------------------+ +------------+
| Rule IPv4 | IPv4 Address suffix | |Port-Set ID |
+-------------+---------------------+ +------------+
| 32 bits |
]]></artwork>
</figure></t>
<t><figure align="center" anchor="addressallocation3-fig" title="Complete IPv4 address">
<preamble>Complete IPv4 address:</preamble>
<artwork align="center"><![CDATA[
| r bits | p bits |
+-------------+---------------------+
| Rule IPv4 | IPv4 Address suffix |
+-------------+---------------------+
| 32 bits |
]]></artwork>
</figure></t>
<t><figure align="center" anchor="addressallocation4-fig" title="IPv4 prefix">
<preamble>IPv4 prefix:</preamble>
<artwork align="center"><![CDATA[
| r bits | p bits |
+-------------+---------------------+
| Rule IPv4 | IPv4 Address suffix |
+-------------+---------------------+
| < 32 bits |
]]></artwork>
</figure></t>
<t>The length of r MAY be zero, in which case the complete
IPv4 address or prefix is encoded in the EA bits. If only a
part of the IPv4 address/prefix is encoded in the EA bits, the
Rule IPv4 prefix is provisioned to the CE by other means
(e.g. a DHCPv6 option). To create a complete IPv4 address (or
prefix), the IPv4 address suffix (p) from the EA bits, are
concatenated with the Rule IPv4 prefix (r bits).</t>
<t>The offset of the EA bits field in the IPv6 address is
equal to the BMR Rule IPv6 prefix length. The length of the EA
bits field (o) is given by the BMR Rule EA-bits length. The
sum of the Rule IPv6 Prefix length and the Rule EA-bits length
MUST be less or equal than the End-user IPv6 prefix length.</t>
<t>If o + r < 32 (length of the IPv4 address in bits), then
an IPv4 prefix is assigned.</t>
<t>If o + r is equal to 32, then a full IPv4 address is
to be assigned. The address is created by concatenating the
Rule IPv4 prefix and the EA-bits.</t>
<t>If o + r is > 32, then a shared IPv4 address is to be
assigned. The number of IPv4 address suffix bits (p) in the EA
bits is given by 32 - r bits. The PSID bits are used to create
a port-set. The length of the PSID bit field within EA bits
is: o - p.</t>
<t>In the following examples, only the suffix (last 8 bits) of
the IPv4 address is embedded in the EA bits (r = 24), while
the IPv4 prefix (first 24 bits) is given in the BMR Rule IPv4
prefix.</t>
<t><figure>
<preamble>Example:</preamble>
<artwork align="left"><![CDATA[
Given:
End-user IPv6 prefix: 2001:db8:0012:3400::/56
Basic Mapping Rule: {2001:db8:0000::/40 (Rule IPv6 prefix),
192.0.2.0/24 (Rule IPv4 prefix),
16 (Rule EA-bits length)}
Sharing ratio: 256 (16 - (32 - 24) = 8. 2^8 = 256)
PSID offset: 4
We get IPv4 address and port-set:
EA bits offset: 40
IPv4 suffix bits (p): Length of IPv4 address (32) -
IPv4 prefix length (24) = 8
IPv4 address: 192.0.2.18
PSID start: 40 + p = 40 + 8 = 48
PSID length: o - p = 16 (56 - 40) - 8 = 8
PSID: 0x34
Port-set-1: 4928, 4929, 4930, 4931, 4932, 4933, 4934, 4935,
4936, 4937, 4938, 4939, 4940, 4941, 4942, 4943
Port-set-2: 9024, 9025, 9026, 9027, 9028, 9029, 9030, 9031,
9032, 9033, 9034, 9035, 9036, 9037, 9038, 9039
...
Port-set-15: 62272, 62273, 62274, 62275,
62276, 62277, 62278, 62279,
62280, 62281, 62282, 62283,
62284, 62285, 62286, 62287,
]]></artwork>
</figure>
</t>
</section>
<section title="Forwarding mapping rule (FMR)">
<t>On adding an FMR rule, an IPv4 route is installed in the AP
RIB for the Rule IPv4 prefix.</t>
<t>On forwarding an IPv4 packet, a best matching prefix lookup
is done in the IPv4 routing table and the correct FMR is
chosen.</t>
<t>
<figure align="left" anchor="aplusptoipv6-fig" title="Deriving of MAP IPv6 address">
<preamble></preamble>
<artwork align="left"><![CDATA[
| 32 bits | | 16 bits |
+--------------------------+ +-------------------+
| IPv4 destination address | | IPv4 dest port |
+--------------------------+ +-------------------+
: : ___/ :
| p bits | / q bits :
+----------+ +------------+
|IPv4 sufx| |Port-Set ID |
+----------+ +------------+
\ / ____/ ________/
\ : __/ _____/
\ : / /
| n bits | o bits | m bits | 128-n-o-m bits |
+--------------------+-----------+---------+------------+----------+
| Rule IPv6 prefix | EA bits |subnet ID| interface ID |
+--------------------+-----------+---------+-----------------------+
|<--- End-user IPv6 prefix --->|
]]></artwork>
</figure>
</t>
<t><figure>
<preamble>Example:</preamble>
<artwork align="left"><![CDATA[
Given:
IPv4 destination address: 192.0.2.18
IPv4 destination port: 9030
Forwarding Mapping Rule: {2001:db8:0000::/40 (Rule IPv6 prefix),
192.0.2.0/24 (Rule IPv4 prefix),
16 (Rule EA-bits length)}
PSID offset: 4
We get IPv6 address:
IPv4 suffix bits (p): 32 - 24 = 8 (18 (0x12))
PSID length: 8
PSID: 0x34 (9030 (0x2346))
EA bits: 0x1234
MAP IPv6 address: 2001:db8:0012:3400:00c0:0002:1200:3400
]]></artwork>
</figure>
</t>
</section>
<section title="Default mapping rule (DMR)">
<t>The Default Mapping rule is used to reach IPv4 destinations
outside of the MAP domain. Traffic using this rule will be
sent from a CE to a BR.</t>
<t>The Rule IPv4 prefix in the DMR is: 0.0.0.0/0. The Rule
IPv6 prefix is the IPv6 address or prefix of the BR. Which is
used, is dependent on the mode used. For example translation
requires that the IPv4 destination address is encoded in the
BR IPv6 address, so only a prefix is used in the DMR to allow
for a generated interface identifier. For the encapsulation
mode the Rule IPv6 prefix can be the full IPv6 address of the
BR.</t>
<t>There MUST be only one Default Mapping Rule within a MAP domain.</t>
<t><figure title="Example 3: Default Mapping Rule">
<artwork align="left"><![CDATA[
Default Mapping Rule:
{2001:db8:0001:0000:<interface-id>:/128 (Rule IPv6 prefix),
0.0.0.0/0 (Rule IPv4 prefix),
192.0.2.1 (BR IPv4 address)}
]]></artwork>
</figure></t>
<t>In most implementations of a routing table, the next-hop
address must be of the same address family as the prefix. To
satisfy this requirement a BR IPv4 address is included in the
rule. Giving a default route in the IPv4 routing table:</t>
<t><figure>
<artwork align="left"><![CDATA[
0.0.0.0 -> 192.0.2.1, MAP-Interface0
]]></artwork>
</figure></t>
</section>
</section>
<section title="The IPv6 Interface Identifier" anchor="interface-id">
<t>The Interface identifier format is based on the format
specified in section 2.2 of <xref target="RFC6052"/>, with the
added PSID format field.</t>
<t>In an encapsulation solution, an IPv4 address and port is
mapped to an IPv6 address. This is the address of the tunnel end
point of the receiving MAP CE. For traffic outside the MAP
domain, the IPv6 tunnel end point address is the IPv6 address of
the BR. The interface-id used for all MAP nodes in the domain
MUST be deterministic.</t>
<t>When translating, the destination IPv4 address is translated
into a corresponding IPv6 address. In the case of traffic
outside of the MAP domain, it is translated to the BR's IPv6
prefix. For the BR to be able to reverse the translation, the
full destination IPv4 address must be encoded in the IPv6
address. The same thing applies if an IPv4 prefix is encoded in
the IPv6 address, then the reverse translator needs to know the
full destination IPv4 address, which has to be encoded in the
interface-id.</t>
<t>The encoding of the full IPv4 address into the interface
identifier, both for the source and destination IPv6 addresses
have been shown to be useful for troubleshooting.</t>
<t><figure align="left" anchor="interfaceid2-fig" title="">
<preamble></preamble>
<artwork align="left"><![CDATA[
+--+---+---+---+---+---+---+---+---+
|PL| 8 16 24 32 40 48 56 |
+--+---+---+---+---+---+---+---+---+
|64| u | IPv4 address | PSID | 0 |
+--+---+---+---+---+---+---+---+---+
]]></artwork>
</figure>
</t>
<t>In the case of an IPv4 prefix, the IPv4 address field is
right-padded with zeroes up to 32 bits. The PSID field is
left-padded to create a 16 bit field. For an IPv4 prefix or a
complete IPv4 address, the PSID field is zero.</t>
<t>If the End-user IPv6 prefix length is larger than 64, the
most significant parts of the interface identifier is
overwritten by the prefix. For translation mode the End-user IPv6
prefix MUST be 64 or shorter.</t>
</section>
<!-- SECTION 4: IANA Considerations -->
<section title="IANA Considerations">
<t>This specification does not require any IANA actions.</t>
</section>
<!-- SECTION 5: Security Considerations -->
<section title="Security Considerations">
<t>Specific security considerations with the MAP mechanism are
detailed in the encapsulation and translation documents
[I-D.mdt-map-t/I-D.mdt-map-e].</t>
<t><xref target="RFC6269"/> outlines general issues with IPv4 address sharing.</t>
</section>
<!-- SECTION 6: Contributors -->
<section title="Contributors">
<t>Mohamed Boucadair, Gang Chen, Maoke Chen, Wojciech Dec,
Xiaohong Deng, Jouni Korhonen, Tomasz Mrugalski, Jacni Qin,
Chunfa Sun, Qiong Sun, Leaf Yeh.</t>
</section>
<!-- SECTION 7: Acknowledgements -->
<section title="Acknowledgements">
<t>This document is based on the ideas of many. In particular
Remi Despres, who has tirelessly worked on generalized
mechanisms for stateless address mapping.</t>
<t>The authors would like to thank Guillaume Gottard, Dan Wing,
Jan Zorz, Necj Scoberne, Tina Tsou for their thorough review and
comments.</t>
</section>
</middle>
<back>
<!-- SECTION 8.1: Normative References -->
<references title="Normative References">
&rfc2119;
&rfc6346;
&I-D.mdt-softwire-map-dhcp-option;
</references>
<!-- SECTION 8.2: Informative References -->
<references title="Informative References">
&I-D.ietf-softwire-stateless-4v6-motivation;
&I-D.ietf-tsvwg-iana-ports;
&rfc6333;
&rfc6052;
&rfc1933;
&rfc5969;
&rfc3056;
&rfc2529;
&rfc5214;
&rfc4380;
&rfc2766;
&rfc6146;
&rfc6147;
&rfc3633;
&rfc6269;
&rfc6250;
&rfc2663;
</references>
</back>
</rfc>