idnits 2.17.1 draft-ietf-ipv6-ipaddressassign-04.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** Looks like you're using RFC 2026 boilerplate. This must be updated to follow RFC 3978/3979, as updated by RFC 4748. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- == No 'Intended status' indicated for this document; assuming Proposed Standard Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** The document seems to lack an IANA Considerations section. (See Section 2.2 of https://www.ietf.org/id-info/checklist for how to handle the case when there are no actions for IANA.) ** The document seems to lack separate sections for Informative/Normative References. All references will be assumed normative when checking for downward references. ** There is 1 instance of too long lines in the document, the longest one being 15 characters in excess of 72. == There are 1 instance of lines with non-RFC3849-compliant IPv6 addresses in the document. If these are example addresses, they should be changed. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the RFC 3978 Section 5.4 Copyright Line does not match the current year == Line 179 has weird spacing: '...of bits pick ...' -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (August 2002) is 7924 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) ** Downref: Normative reference to an Informational RFC: RFC 1219 (ref. '1') Summary: 5 errors (**), 0 flaws (~~), 4 warnings (==), 3 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Internet M. Blanchet 3 Internet-Draft Viagenie inc. 4 Expires: January 30, 2003 August 2002 6 A Flexible Method for Managing the Assignment of Bits of an IPv6 7 Address Block 8 draft-ietf-ipv6-ipaddressassign-04 10 Status of this Memo 12 This document is an Internet-Draft and is in full conformance with 13 all provisions of Section 10 of RFC2026. 15 Internet-Drafts are working documents of the Internet Engineering 16 Task Force (IETF), its areas, and its working groups. Note that 17 other groups may also distribute working documents as Internet- 18 Drafts. 20 Internet-Drafts are draft documents valid for a maximum of six months 21 and may be updated, replaced, or obsoleted by other documents at any 22 time. It is inappropriate to use Internet-Drafts as reference 23 material or to cite them other than as "work in progress." 25 The list of current Internet-Drafts can be accessed at http:// 26 www.ietf.org/ietf/1id-abstracts.txt. 28 The list of Internet-Draft Shadow Directories can be accessed at 29 http://www.ietf.org/shadow.html. 31 This Internet-Draft will expire on January 30, 2003. 33 Copyright Notice 35 Copyright (C) The Internet Society (2002). All Rights Reserved. 37 Abstract 39 This document proposes a method to manage the assignment of bits of 40 an IPv6 address block or range. When an organisation needs to make 41 an address plan for its subnets or when an ISP needs to make an 42 address plan for its customers, this method enables the organisation 43 to postpone the final decision on the number of bits to partition in 44 the address space they have. It does it by keeping the bits around 45 the borders of the partition to be free as long as possible. This 46 scheme is applicable to any bits addressing scheme using bits with 47 partitions in the space, but its first intended use is for IPv6. It 48 is a generalization of RFC1219 and can be used for IPv6 assignments. 50 Table of Contents 52 1. Rationale . . . . . . . . . . . . . . . . . . . . . . . . . . 3 53 2. Scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 54 3. Description of the Algorithm . . . . . . . . . . . . . . . . . 4 55 3.1 Leftmost . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 56 3.2 Rightmost . . . . . . . . . . . . . . . . . . . . . . . . . . 4 57 3.3 Centermost . . . . . . . . . . . . . . . . . . . . . . . . . . 5 58 4. Example . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 59 5. Implementation . . . . . . . . . . . . . . . . . . . . . . . . 6 60 6. Security Considerations . . . . . . . . . . . . . . . . . . . 8 61 7. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 8 62 References . . . . . . . . . . . . . . . . . . . . . . . . . . 8 63 Author's Address . . . . . . . . . . . . . . . . . . . . . . . 8 64 Full Copyright Statement . . . . . . . . . . . . . . . . . . . 9 66 1. Rationale 68 IPv6 addresses have a flexible structure for address assignments. 69 This enables registries, internet service providers, network 70 designers and others to assign address ranges to organizations and 71 networks based on different criteria, like size of networks, 72 estimated growth rate, etc. Often, the initial assignment doesn't 73 scale well because a small network becomes larger than expected, 74 needing more addresses. But then, the assignment authority cannot 75 allocate contiguous addresses because they were already assigned to 76 another network. 78 RFC1219 [1] describes an allocation scheme for IPv4 where address 79 space is kept unallocated between the leftmost bits of the subnet 80 part and the rightmost bits of the host part of the address. This 81 enables the network designer to change the subnet mask without 82 renumbering, for the central bits not allocated. 84 This work generalizes the previous scheme by extending the algorithm 85 so it can be applied on any part of an IP address, which are assigned 86 by any assignment authority level (registries, ISPs of any level, 87 organizations, ...). It can be used for both IPv4 and IPv6. 89 This document does not provide any recommendation to registries on 90 how to assign address ranges to their customers. 92 2. Scheme 94 We define parts of the IP address as p1, p2 , p3, ... pN in order, 95 so that an IP address is composed of these parts contiguously. 96 Boundaries between each part are based on the prefix assigned by the 97 next level authority. Part p1 is the leftmost part probably assigned 98 to a registry, Part p2 can be allocated to a large internet service 99 provider or to a national registry. Part p3 can be allocated to a 100 large customer or a smaller provider, etc. Each part can be of 101 different length. We define l(pX) the length of part X. 103 +------+------+------+------+------+------+ 104 | p1 | p2 | p3 | p4 | ... | pN | 105 +------+------+------+------+------+------+ 106 <------- ipv6 or ipv4 address ------------> 108 The algorithm for allocating addresses is as follows : a) for the 109 leftmost part (p1), assign addresses using the leftmost bits first b) 110 for the rightmost part (pN), assign addresses using the rightmost 111 bits first c) for all other parts (center parts), predefine an 112 arbitrary boundary (prefix) and then assign addresses using the 113 center bits first of the part being assigned. 115 This algorithm grows assigned bits in such way that it keeps 116 unassigned bits near the boundary of the parts. This means that the 117 prefix between any two parts can be changed forward or backward, 118 later on, up to the assigned bits. 120 3. Description of the Algorithm 122 This section describes the assignment of leftmost bits, rightmost 123 bits and centermost bits. 125 3.1 Leftmost 127 p1 will be assigned in order as follows : 129 Order Assignment 130 1 00000000 131 2 10000000 132 3 01000000 133 4 11000000 134 5 00100000 135 6 10100000 136 7 01100000 137 8 11100000 138 9 00010000 139 ... 141 This is actually a mirror of binary counting. 143 3.2 Rightmost 145 pN (the last part) will be assigned in order as follows : 147 Order Assignment 148 1 00000000 149 2 00000001 150 3 00000010 151 4 00000011 152 5 00000100 153 6 00000101 154 7 00000110 155 8 00000111 156 9 00001000 157 ... 159 3.3 Centermost 161 pX (where 1 < X < N) will be assigned in order as follows : (for 162 example, with a 8 bit predefined length l(pX)=8)) 164 Order Assignment 165 1 00000000 166 2 00001000 167 3 00010000 168 4 00011000 169 5 00000100 170 6 00001100 171 7 00010100 172 8 00011100 173 9 00100000 174 ... 176 The bits are assigned using the following algorithm: 178 1. The first round is to select only the middle bit (and if there is 179 an even number of bits pick the bit following the center) 181 2. Create all combinations using the selected bits that haven't yet 182 been created. 184 3. Start a new round by adding one more bit to the set. In even 185 rounds add the preceding bit to the set. In odd rounds add the 186 subsequent bit to the set. 188 4. Repeat 2 and 3 until there are no more bits to consider. 190 4. Example 192 As an example, a provider P1 has been assigned the 3ffe:0b00/24 193 prefix and wants to assign prefixes to its connected networks. It 194 anticipates in the foreseeable future a maximum of 256 customers 195 consuming 8 bits. One of these customers, named C2, anticipates a 196 maximum of 1024 customer's assignments under it, consuming 10 other 197 bits. 199 The assignment will be as follows, not showing the first 24 leftmost 200 bits (3ffe:0b00/24: 00111111 11111110 00001011): 202 P1 assigns address space to its customers using leftmost bits: 204 10000000 : assigned to C1 205 01000000 : assigned to C2 206 11000000 : assigned to C3 207 00100000 : assigned to C4 208 ... 210 C2 assigns address space to its customers (C2C1, C2C2, ...) using 211 centermost bits: 213 0000010000 : assigned to C2C1 214 0000100000 : assigned to C2C2 215 0000110000 : assigned to C2C3 216 ... 218 Customers of C2 can use centermost bits for maximum flexibility and 219 then the last aggregators (should be a network in a site) will be 220 assigned using rightmost bits. 222 Putting all bits together for C2C3: 223 P1 |C2 |C2C3 224 00111111 11111110 00001011 01000000 00001100 00 225 <-------> <------> 226 growing bits 228 By using this method, P1 will be able to expand the number of 229 customers and the customers will be able to modify their first 230 assumptions about the size of their own customers, until the 231 "reserved" bits are assigned. 233 5. Implementation 235 The following Perl code was written by Jocelyn Picard 236 (Jocelyn.Picard@viagenie.qc.ca) and implements this draft. This code 237 is free and without any warranty. 239 #!/sur/bin/perl -w 240 use strict; 242 #========================================================= 243 # allocation(Last Prefix,Number of bits,Method) 244 # 245 # Last Prefix = last prefix allocated, ex: 3ffe:b00::/48 246 # Number of bits = range we want to allocate 247 # Method = method to use: l,c or r (left,center,right) 248 # 249 # Returns next prefix using selected method 250 # 251 # Note: no validation is made 252 # 253 #------------------------------------------------------- 254 sub allocation { 255 my ($ip,$pl)=split('/',shift); 256 my ($nbits,$method) = @_ ; 257 my ($w,@Abits,$abits); 259 my $i = $ip =~ s/:/:/g; 260 my $repl= ':0' x (9 - $i); 261 $ip =~ s/::/$repl/; 262 $ip =~ s/^:/0:/; 264 foreach $i (split(':',$ip)) { 265 push @Abits, split('',unpack("B16", pack("n", hex($i)))); 266 } 267 my $sp = int($nbits/2); 269 for($i=0;$i<$nbits;$i++) { 270 if ($method eq "c") { 271 $w = ($i % 2) ? $sp - ($i+1)/2: $sp + $i/2; 272 } 273 elsif ($method eq "r") { 274 $w = $nbits -1 - $i; 275 } 276 else { 277 $w = $i ; 278 } 279 $w += $pl - $nbits; 281 if ($Abits[$w] == 0) { 282 $Abits[$w] = 1; 283 last; 284 } 285 else { 286 return 0 if ($i == $nbits-1); 287 $Abits[$w] = 0; 288 } 289 } 290 $abits = join("",@Abits); 291 $ip = ""; 292 for($i=0;$i<8;$i++) { 293 $ip .= sprintf("%lx", unpack("n", pack("B16", substr($abits, $i * 16,16)))) . ":"; 294 } 295 chop $ip; 296 $ip =~ s/(:0){2,}$/::/; 297 return($ip . "/$pl"); 298 } 299 #=============================================================== 300 # 301 #Usage example: allocation of 100 /48 using "centermost" method 302 # 303 my $Prefix = '3ffe:b00::/48'; 304 for(my $i=0;$i<100;$i++) { 305 print $Prefix = allocation($Prefix,16,'c'),"\n"; 306 } 308 6. Security Considerations 310 Address assignment doesn't seem to have any specific security 311 consideration. 313 7. Acknowledgements 315 Thanks to Steve Deering, Bob Hinden, Thomas Narten, Erik Nordmark, 316 Florent Parent and Jocelyn Picard for their very useful comments on 317 this work. 319 References 321 [1] Tsuchiya, P., "On the assignment of subnet numbers", RFC 1219, 322 April 1991. 324 Author's Address 326 Marc Blanchet 327 Viagenie inc. 328 2875 boul. Laurier, bureau 300 329 Sainte-Foy, QC G1V 2M2 330 Canada 332 Phone: +1 418 656 9254 333 EMail: Marc.Blanchet@viagenie.qc.ca 334 URI: http://www.viagenie.qc.ca/ 336 Full Copyright Statement 338 Copyright (C) The Internet Society (2002). All Rights Reserved. 340 This document and translations of it may be copied and furnished to 341 others, and derivative works that comment on or otherwise explain it 342 or assist in its implementation may be prepared, copied, published 343 and distributed, in whole or in part, without restriction of any 344 kind, provided that the above copyright notice and this paragraph are 345 included on all such copies and derivative works. However, this 346 document itself may not be modified in any way, such as by removing 347 the copyright notice or references to the Internet Society or other 348 Internet organizations, except as needed for the purpose of 349 developing Internet standards in which case the procedures for 350 copyrights defined in the Internet Standards process must be 351 followed, or as required to translate it into languages other than 352 English. 354 The limited permissions granted above are perpetual and will not be 355 revoked by the Internet Society or its successors or assigns. 357 This document and the information contained herein is provided on an 358 "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING 359 TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING 360 BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION 361 HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF 362 MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 364 Acknowledgement 366 Funding for the RFC Editor function is currently provided by the 367 Internet Society.